IUpdateLeverageUtils
Interface for leverage updates
LeverageUpdateInitiated
event LeverageUpdateInitiated(struct ITradingStorage.Id orderId, address trader, uint256 pairIndex, uint256 index, bool isIncrease, uint256 newLeverage)
Parameters
orderId
struct ITradingStorage.Id
request order id
trader
address
address of trader
pairIndex
uint256
index of pair
index
uint256
index of trade
isIncrease
bool
true if increase leverage, false if decrease
newLeverage
uint256
new leverage value (1e3)
LeverageUpdateExecuted
event LeverageUpdateExecuted(struct ITradingStorage.Id orderId, bool isIncrease, enum ITradingCallbacks.CancelReason cancelReason, uint8 collateralIndex, address trader, uint256 pairIndex, uint256 index, uint256 oraclePrice, uint256 collateralDelta, struct IUpdateLeverage.UpdateLeverageValues values)
Parameters
orderId
struct ITradingStorage.Id
request order id
isIncrease
bool
true if leverage increased, false if decreased
cancelReason
enum ITradingCallbacks.CancelReason
cancel reason (executed if none)
collateralIndex
uint8
collateral index
trader
address
address of trader
pairIndex
uint256
index of pair
index
uint256
index of trade
oraclePrice
uint256
current oracle price (1e10)
collateralDelta
uint256
collateral delta (collateral precision)
values
struct IUpdateLeverage.UpdateLeverageValues
useful values (new collateral, new leverage, liq price, gov fee collateral)
Was this helpful?