๐ฌ Quoter contract
Contract for getting estimates or quotes for trades or LP operations, as well as to check for unhealthy positions that are ready to be liquidated.
getContractProvider
Returns ContractProvider contract
quoteTrade
Provides estimations for a trade with notional
amount in a particular future. The quote is returned for both risk directions simultaneously.
Input parameters:
Parameter Name | Type | Description |
---|---|---|
futureId | Target Future identifier. | |
notional |
| Notional amount of the assumed trade. |
participant |
| The address whose state will be used to calculate the quote for. |
oraclePackages | An array of packages containing the latest known index for the market. Packages are provided by an Oracle service on demand. |
Output values:
TradeQuote
Object containing the trade details
quoteLiquidityProvision
Provides estimations for liquidity provision in specified Futures market and bounds.
Input parameters:
Parameter Name | Type | Description |
---|---|---|
futureId | Future identifier. | |
notional |
| The face value of the future trade. |
participant |
| The address to calculate the quote for. |
operation | Either | |
lowerBound |
| Defines the lower point of the rate range. Format: fixed point signed 18-decimal number. |
upperBound |
| Defines the upper point of the rate range. Format: fixed point signed 18-decimal number. |
oraclePackages | An array of packages containing the latest known index for the market. Packages are provided by an Oracle service on demand. |
Output values:
quotePositionsOwnershipTransfer
Provides estimations for positions ownership transfer operation being carried out for owner
in specified Market.
Ensure that owner
's positions are liquidatable by calling Quoter.isLiquidatable
using owner
as a participant
.
Input parameters:
Parameter Name | Type | Description |
---|---|---|
marketId | Target Market identifier. | |
owner |
| Target owner of positions. |
liquidator |
| Receiver of positions from the |
oraclePackages | An array of packages containing the latest known index for the market. Packages are provided by an Oracle service on demand. |
Output values:
uint256
transferAmount โ amount of collateral to be transferred fromowner
's margin account toliquidator
as a reward;uint256
depositAmount โ additional amount of collateral that is required to deposit toliquidator
's margin account.
isLiquidatable
Returns true
if participant
's margin for marketId
is below Liquidation Threshold and his positions can be liquidated or transferred.
Input parameters:
Parameter Name | Type | Description |
---|---|---|
marketId | Target Market identifier. | |
participant |
| The address to check |
oraclePackages | An array of packages containing the latest known index for the market. Packages are provided by an Oracle service on demand. |
Output values:
bool
true if participant can be liquidated.
isProvisionCancellable
Returns true
if maker
's positions in a given marketId
should be cancelled due to his margin being below Initial Margin Requirement.
Input parameters:
Parameter Name | Type | Description |
---|---|---|
marketId | Target Market identifier. | |
maker |
| The address to check |
oraclePackages | An array of packages containing the latest known index for the market. Packages are provided by an Oracle service on demand. |
Output values:
bool
true if maker is below his margin requirement
Structs
Documentation of structs mentioned in this page
TradeQuote
Struct with quote data for a trade
Property name | Property Type | Description |
---|---|---|
insufficientLiquidityForPayer |
| True if there is not enough provided liquidity to place a trade with the Payer risk direction |
exceededRateImpactLimitForPayer |
| True if the market rate shift exceeds the limiting value for given trade with the Payer risk direction |
insufficientLiquidityForReceiver |
| True if there is not enough provided liquidity to place a trade with the Receiver risk direction |
exceededRateImpactLimitForReceiver |
| True if the market rate shift exceeds the limiting value for given trade with the Receiver risk direction |
payerQuote | Quote details for a trade with Payer direction | |
receiverQuote | Quote details for a trade with Receiver direction | |
marketPortfolio | Contains portfolio details os user |
OneDirectionTradeQuote
Details on a trade quote on a particular direction (payer or receiver)
TradeInfo
struct containing trade detailstotalFutureOpenPositionNotional
Total notional available for trades in this directiontotalFutureOpenPositionDv01
Dollar duration for total notional available in this directionnewMargin
Details on user's margin state after this tradenewMarginThreshold
Updated user's margin thresholdtradeNotionalDv01
Dollar duration for the trade's notional
Property name | Property Type | Description |
---|---|---|
tradeInfo | Trade details | |
totalFutureOpenPositionNotional |
| Total notional available for trades in this direction |
totalFutureOpenPositionDv01 |
| Dollar duration for total notional available in this direction |
newMargin | Details on user's margin after this trade | |
newMarginThreshold |
| Updated user's margin threshold |
tradeNotionalDv01 |
| Dolar duration for the trade's notional |
LiquidityProvisionQuote
Details on a quote for a liquidity provision.
Property name | Property Type | Description |
---|---|---|
totalFutureProvisionNotional | Resulting total of provided notional | |
totalFutureProvisionPayerDv01 |
| Resulting DV01 towards the Payer side for the participant after provision |
totalFutureProvisionReceiverDv01 |
| Resulting DV01 towards the Receiver side for the participant after provision |
newMarginThreshold |
| Resulting margin requirements |
newProvisionDistribution | Resulting amounts of provision on Payer & Receiver sides as well as total | |
newProvisionNotionalDv01 |
| Resulting overall DV01 |
marketPortfolio | Contains portfolio details of user |
Enums
LiquidityOperation
Defines the 2 options of maker operations: provide and remove liquidity
Last updated