๐ฌ 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
function getContractProvider() external view returns (IContractProvider);
Returns ContractProvider contract
quoteTrade
function quoteTrade(
FutureId futureId,
UD60x18 notional,
address participant,
OraclePackage[] calldata oraclePackages
) external view returns (TradeQuote memory);
Provides estimations for a trade with notional
amount in a particular future. The quote is returned for both risk directions simultaneously.
Input parameters:
notional
uint256
Notional amount of the assumed trade.
participant
address
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
function quoteLiquidityProvision(
FutureId futureId,
UD60x18 notional,
address participant,
LiquidityOperation operation,
SD59x18 lowerBound,
SD59x18 upperBound,
OraclePackage[] calldata oraclePackages
) external view returns (LiquidityProvisionQuote memory);
Provides estimations for liquidity provision in specified Futures market and bounds.
Input parameters:
notional
uint256
The face value of the future trade.
participant
address
The address to calculate the quote for.
lowerBound
int256
Defines the lower point of the rate range. Format: fixed point signed 18-decimal number.
upperBound
int256
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
function quotePositionsOwnershipTransfer(
MarketId marketId,
address owner,
address liquidator,
OraclePackage[] memory oraclePackages
) external view returns (UD60x18 transferAmount, UD60x18 depositAmount);
Provides estimations for positions ownership transfer operation being carried out for owner
in specified Market.
Input parameters:
owner
address
Target owner of positions.
liquidator
address
Receiver of positions from the owner
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
function isLiquidatable(
MarketId marketId,
address participant,
OraclePackage[] memory oraclePackages
) external view returns (bool);
Returns true
if participant
's margin for marketId
is below Liquidation Threshold and his positions can be liquidated or transferred.
Input parameters:
participant
address
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
function isProvisionCancellable(
MarketId marketId,
address maker,
OraclePackage[] memory oraclePackages
) external view returns (bool);
Returns true
if maker
's positions in a given marketId
should be cancelled due to his margin being below Initial Margin Requirement.
Input parameters:
maker
address
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
struct TradeQuote {
bool insufficientLiquidityForPayer;
bool exceededRateImpactLimitForPayer;
bool insufficientLiquidityForReceiver;
bool exceededRateImpactLimitForReceiver;
OneDirectionTradeQuote payerQuote;
OneDirectionTradeQuote receiverQuote;
IViewDataProvider.MarketPortfolio marketPortfolio;
}
insufficientLiquidityForPayer
bool
True if there is not enough provided liquidity to place a trade with the Payer risk direction
exceededRateImpactLimitForPayer
bool
True if the market rate shift exceeds the limiting value for given trade with the Payer risk direction
insufficientLiquidityForReceiver
bool
True if there is not enough provided liquidity to place a trade with the Receiver risk direction
exceededRateImpactLimitForReceiver
bool
True if the market rate shift exceeds the limiting value for given trade with the Receiver risk direction
OneDirectionTradeQuote
Details on a trade quote on a particular direction (payer or receiver)
struct OneDirectionTradeQuote {
TradeInfo tradeInfo;
UD60x18 totalFutureOpenPositionNotional;
UD60x18 totalFutureOpenPositionDv01;
Margin.Value newMargin;
UD60x18 newMarginThreshold;
UD60x18 tradeNotionalDv01;
}
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
totalFutureOpenPositionNotional
uint256
Total notional available for trades in this direction
totalFutureOpenPositionDv01
uint256
Dollar duration for total notional available in this direction
newMarginThreshold
uint256
Updated user's margin threshold
tradeNotionalDv01
uint256
Dolar duration for the trade's notional
LiquidityProvisionQuote
Details on a quote for a liquidity provision.
struct LiquidityProvisionQuote {
ProvisionDistribution totalFutureProvisionNotional;
UD60x18 totalFutureProvisionPayerDv01;
UD60x18 totalFutureProvisionReceiverDv01;
UD60x18 newMarginThreshold;
ProvisionDistribution newProvisionDistribution;
UD60x18 newProvisionNotionalDv01;
IViewDataProvider.MarketPortfolio marketPortfolio;
}
totalFutureProvisionPayerDv01
uint256
Resulting DV01 towards the Payer side for the participant after provision
totalFutureProvisionReceiverDv01
uint256
Resulting DV01 towards the Receiver side for the participant after provision
newMarginThreshold
uint256
Resulting margin requirements
newProvisionDistribution
Resulting amounts of provision on Payer & Receiver sides as well as total
newProvisionNotionalDv01
uint256
Resulting overall DV01
Enums
LiquidityOperation
enum LiquidityOperation {
PROVIDE,
REMOVE
}
Defines the 2 options of maker operations: provide and remove liquidity
Last updated