IncreasePositionSizeUtils
Last updated
Last updated
This is an internal utils library for position size increases Used by UpdatePositionSizeLifecycles internal library
_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)_
Name | Type | Description |
---|---|---|
Calculates values for callback
Name | Type | Description |
---|---|---|
Validates callback, and returns corresponding cancel reason
Updates trade (for successful request)
Handles callback canceled case (for failed request)
Returns current address as multi-collateral diamond interface to call other facets functions.
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
_trade
trade of request
_input
input values
_existingTrade
existing trade data
_partialTrade
partial trade data
_answer
price aggregator answer
_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)
_existingTrade
existing trade data
_values
pre-calculated useful values
_existingTrade
existing trade data
_partialTrade
partial trade data
_cancelReason
enum ITradingCallbacks.CancelReason
cancel reason