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
_trade
trade of request
_input
input values
prepareCallbackValues
Calculates values for callback
Parameters
_existingTrade
existing trade data
_partialTrade
partial trade data
_answer
price aggregator answer
validateCallback
Validates callback, and returns corresponding cancel reason
Parameters
_existingTrade
existing trade data
_values
pre-calculated useful values
_answer
_expectedPrice
uint256
user expected price before callback (1e10)
_maxSlippageP
uint256
maximum slippage percentage from expected price (1e3)
updateTradeSuccess
Updates trade (for successful request)
Parameters
_existingTrade
existing trade data
_values
pre-calculated useful values
handleCanceled
Handles callback canceled case (for failed request)
Parameters
_existingTrade
existing trade data
_partialTrade
partial trade data
_cancelReason
enum ITradingCallbacks.CancelReason
cancel reason
_getMultiCollatDiamond
Returns current address as multi-collateral diamond interface to call other facets functions.
Last updated