IncreasePositionSizeUtils
This is an internal utils library for position size increases Used by UpdatePositionSizeLifecycles internal library
validateRequest
_Validates increase position request.
Possible inputs: collateral delta > 0 and leverage delta > 0 (increase position size by collateral delta * leverage delta) collateral delta = 0 and leverage delta > 0 (increase trade leverage by leverage delta)_
Parameters
prepareCallbackValues
Calculates values for callback
Parameters
validateCallback
Validates callback, and returns corresponding cancel reason
Parameters
_expectedPrice
uint256
user expected price before callback (1e10)
_maxSlippageP
uint256
maximum slippage percentage from expected price (1e3)
updateTradeSuccess
Updates trade (for successful request)
Parameters
handleCanceled
Handles callback canceled case (for failed request)
Parameters
_cancelReason
enum ITradingCallbacks.CancelReason
cancel reason
_getMultiCollatDiamond
Returns current address as multi-collateral diamond interface to call other facets functions.
Last updated