UpdatePositionSizeLifecycles
This is an external library for position size updates lifecycles Used by GNSTrading and GNSTradingCallbacks facets
requestIncreasePositionSize
Initiate increase position size order, done in 2 steps because position size changes
Parameters
requestDecreasePositionSize
Initiate decrease position size order, done in 2 steps because position size changes
Parameters
executeIncreasePositionSizeMarket
Execute increase position size market callback
Parameters
executeDecreasePositionSizeMarket
Execute decrease position size market callback
Parameters
_getMultiCollatDiamond
Returns current address as multi-collateral diamond interface to call other facets functions.
_baseValidateRequest
Basic validation for increase/decrease position size request
Parameters
_trader
address
trader address
_index
uint32
trade index
_initiateRequest
Creates pending order, makes price aggregator request, and returns corresponding pending order id
Parameters
_isIncrease
bool
whether is increase or decrease position size order
_collateralAmount
uint120
partial trade collateral amount (collateral precision)
_leverage
uint24
partial trade leverage (1e3)
_positionSizeCollateralDelta
uint256
position size delta in collateral tokens (collateral precision)
_expectedPrice
uint64
reference price for max slippage check (1e10), only useful for increase position size
_maxSlippageP
uint16
max slippage % (1e3), only useful for increase position size
_validateBaseFulfillment
Basic validation for callbacks, returns corresponding cancel reason
Parameters
Last updated