Skip to main content
Interface for leverage updates

LeverageUpdateInitiated

event LeverageUpdateInitiated(struct ITradingStorage.Id orderId, address trader, uint256 pairIndex, uint256 index, bool isIncrease, uint256 newLeverage)

Parameters

NameTypeDescription
orderIdstruct ITradingStorage.Idrequest order id
traderaddressaddress of trader
pairIndexuint256index of pair
indexuint256index of trade
isIncreasebooltrue if increase leverage, false if decrease
newLeverageuint256new 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

NameTypeDescription
orderIdstruct ITradingStorage.Idrequest order id
isIncreasebooltrue if leverage increased, false if decreased
cancelReasonenum ITradingCallbacks.CancelReasoncancel reason (executed if none)
collateralIndexuint8collateral index
traderaddressaddress of trader
pairIndexuint256index of pair
indexuint256index of trade
oraclePriceuint256current oracle price (1e10)
collateralDeltauint256collateral delta (collateral precision)
valuesstruct IUpdateLeverage.UpdateLeverageValuesuseful values (new collateral, new leverage, liq price, gov fee collateral)