DecreasePositionSizeUtils
This is an internal utils library for position size decreases Used by UpdatePositionSizeLifecycles internal library
validateRequest
_Validates decrease position size request
Possible inputs: collateral delta > 0 and leverage delta = 0 (decrease collateral by collateral delta) collateral delta = 0 and leverage delta > 0 (decrease leverage by leverage delta)
@param _trade trade of request @param 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
_pendingOrder
_values
pre-calculated useful values
_answer
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
trade to update
_cancelReason
enum ITradingCallbacks.CancelReason
cancel reason
_getMultiCollatDiamond
Returns current address as multi-collateral diamond interface to call other facets functions.
Last updated