IUpdatePositionSizeUtils
Interface for position size updates
PositionSizeUpdateInitiated
Parameters
orderId
struct ITradingStorage.Id
request order id
trader
address
address of the trader
pairIndex
uint256
index of the pair
index
uint256
index of user trades
isIncrease
bool
true if increase position size, false if decrease
collateralDelta
uint256
collateral delta (collateral precision)
leverageDelta
uint256
leverage delta (1e3)
PositionSizeIncreaseExecuted
Parameters
orderId
struct ITradingStorage.Id
request order id
cancelReason
enum ITradingCallbacks.CancelReason
cancel reason if canceled or none if executed
collateralIndex
uint8
collateral index
trader
address
address of trader
pairIndex
uint256
index of pair
index
uint256
index of trade
long
bool
true for long, false for short
oraclePrice
uint256
oracle price (1e10)
collateralPriceUsd
uint256
collateral price in USD (1e8)
collateralDelta
uint256
collateral delta (collateral precision)
leverageDelta
uint256
leverage delta (1e3)
values
struct IUpdatePositionSize.IncreasePositionSizeValues
important values (new open price, new leverage, new collateral, etc.)
PositionSizeDecreaseExecuted
Parameters
orderId
struct ITradingStorage.Id
request order id
cancelReason
enum ITradingCallbacks.CancelReason
cancel reason if canceled or none if executed
collateralIndex
uint8
collateral index
trader
address
address of trader
pairIndex
uint256
index of pair
index
uint256
index of trade
long
bool
true for long, false for short
oraclePrice
uint256
oracle price (1e10)
collateralPriceUsd
uint256
collateral price in USD (1e8)
collateralDelta
uint256
collateral delta (collateral precision)
leverageDelta
uint256
leverage delta (1e3)
values
struct IUpdatePositionSize.DecreasePositionSizeValues
important values (pnl, new leverage, new collateral, etc.)