๐ ViewDataProvider
Contract with public view methods for getting data about Futures, Markets and Users.
Functions
activateMarket
Activates a market. Can only be called by contract owner.
id
Market identifier.
deactivateMarket
Deactivates a market. Can only be called by contract owner.
id
Market identifier.
getContractProvider
Getter function for the ContractProvider address
Output values:
ContractProvider address
getMarketRiskParameters
Retrieves the risk parameters for a specified market
id
Market identifier.
Output values:
getMarketRewardParameters
Retrieves the reward parameters for a specified market
id
Market identifier.
Output values:
getFuturePauseConfiguration
Retrieves the pause configuration for a specified future.
futureId
Future identifier
Output values:
getMarketPauseConfiguration
Retrieves the pause configuration for a specified market.
marketId
Market identifier
Output values:
getProtocolFee
Retrieves the protocol fee amount accrued to the market
marketId
Market identifier
Output values:
uint256
protocol fee amount
allActiveMarketAddresses
Retrieves the addresses of all active markets. Contains pagination parameters for not bursting gas limits.
offset
uint
Number of items to skip
limit
uint
Number of items to return
Output values:
address[]
array of market addresses
allActiveMarketIds
Retrieves the IDs of all active markets. Contains pagination parameters for not bursting gas limits.
offset
uint
Number of items to skip
limit
uint
Number of items to return
Output values:
MarketId
[]
array of market identifiers
marketInfo
Retrieves comprehensive information about a specific market.
id
Market identifier
oraclePackages
An array of packages containing the latest known index for the market. Packages are provided by an Oracle service on demand.
Output values:
MarketInfo struct with market data
futureInfo
Retrieves comprehensive information about a specific future.
id
Future identifier
oraclePackages
An array of packages containing the latest known index for the market. Packages are provided by an Oracle service on demand.
Output values:
FutureInfo
struct with market data
activeMarketsInfo
Retrieves comprehensive information for a range of active markets.
offset
uint
Number of items to skip
limit
uint
Number of items to return
marketsOraclePackages
An array of packages containing the latest known index for the market. and the marketId. Packages are provided by an Oracle service on demand.
Output values:
MarketInfo
[]
array of structs with market data
futureIdsCloseToMaturityWithoutIndex
Retrieves list of future info objects that will mature within maturityBufferSeconds
seconds but do not have an index.
marketId
Market identifier
maturityBufferSeconds
uint
Time to maturity to be considered. If set to 0 it will return futures that have already matured.
Output values:
FutureId
[]
Array of future identifiers
futureInfoCloseToMaturityWithoutIndex
Retrieves list of futures data that will mature within maturityBufferSeconds
seconds but do not have an index.
marketId
Market identifier
maturityBufferSeconds
uint
Time to maturity to be considered. If set to 0 it will return futures that have already matured.
Output values:
FutureInfoWithoutIndex
[]
Array of objects with future data
marginRequirement
Calculates the margin requirement for a market participant
marketId
Market identifier
participant
address
Address of the participant
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
The amount of margin required by the participant in this market
withdrawableMargin
Calculates the withdrawable margin for a market participant
marketId
Market identifier
participant
address
Address of the participant
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
The amount of margin that is withdrawable by the participant.
totalPosition
Retrieves the total position of a given participant in a specified future.
futureId
Future identifier
participant
address
Address of the participant
oraclePackages
An array of packages containing the latest known index for the market. Packages are provided by an Oracle service on demand.
Output values:
TotalPosition
Object detailing the participant's position in the specified future
marginDetails
Retrieves the margin details of a given participant in a specified market.
marketId
Market identifier
participant
address
Address of the participant
oraclePackages
An array of packages containing the latest known index for the market. Packages are provided by an Oracle service on demand.
Output values:
ViewDataProviderLogic.MarginState
Object detailing the participant's margin state in the specified market
marketPortfolio
Retrieves the market portfolio details of a given participant.
marketId
Market identifier
participant
address
Address of the participant
oraclePackages
An array of packages containing the latest known index for the market. Packages are provided by an Oracle service on demand.
Output values:
MarketPortfolio
Object detailing the participant's market positions.
portfolioMarketIds
Retrieves the market ids associated with a participant's portfolio. This function filters out markets that are not relevant for the participant's portfolio.
participant
address
Address of the participant
offset
uint
Number of items to skip
limit
uint
Number of items to return
Output values:
MarketId
[]
Array of market identifiers
portfolio
Retrieves the market ids associated with a participant's portfolio. This function filters out markets that are not relevant for the participant's portfolio.
participant
address
Address of the participant
offset
uint
Number of items to skip
limit
uint
Number of items to return
marketsOraclePackages
An array containing the latest known index per market. Packages are provided by an Oracle service on demand.
Output values:
MarketPortfolio
[]
Array of objects detailing the participant's market positions
checkForUnsettledMaturedFutures
Checks if a participant has any unsettled futures that have reached maturity in a specified market
marketId
Market identifier
participant
address
Address of the participant
Output values:
bool
True if any of the participant's futures in the specified market have reached maturity and are unsettled. False otherwise.
makerLiquidityDistribution
Retrieves maker's liquidity distribution details of a given future over a specified interval. offset
and limit
params can be used for pagination.
futureId
Future identifier
maker
address
Address of the maker
offset
uint
Number of items to skip
limit
uint
Number of items to return
Output values:
uint256
currentFutureRate - The current rate of the futureIntervalLiquidity
[]
intervals - Array of liquidity provisions
poolLiquidityDistribution
Retrieves the liquidity distribution details of a given future over a specified interval. offset
and limit
params can be used for pagination.
futureId
Future identifier
oraclePackages
An array of packages containing the latest known index for the market. Packages are provided by an Oracle service on demand.
offset
uint
Number of items to skip
limit
uint
Number of items to return
Output values:
ProvisionDistribution
The total liquidity provision associated with the futureuint256
currentFutureRate - The current rate of the futureIntervalLiquidity
[]
intervals - Array of liquidity provisions
Structs
Documentation on the structs defined in this contract
IMarketStorage.RiskParameters
Parameters for configuring risk on a market.
minNotional
uint64
Minimum notional amount when providing liquidity to a market
liquidationThresholdDelta
uint64
Parameter for calculating liquidation thresholds of users trading futures in this market
marginThresholdDelta
uint64
Parameter for calculating margin thresholds of users trading futures in this market
marginThresholdTolerance
uint64
Parameter used to create a buffer between user's margin and withdrawable amount.
maxRateImpactPerTrade
uint64
Maximum allowed rate change per trade
hedgeMarginFactor
int64
Factor used for computing cross margin effects of positions in opposite directions to calculate margin requirements
marginRequirementSecondsFloor
uint32
Minimum time to maturity used in margin requirement calculations
liquidationMarginRequirementSecondsFloor
uint32
Minimum time to maturity used in liquidation margin calculations
maturityLockoutSeconds
uint32
Number of seconds from maturity after which the future is not tradable anymore
IMarketStorage.RewardParameters
Parameters for configuring rewards and fees of a market.
transferOwnershipReward
uint64
Percentage of liquidated user's margin given as a reward to the liquidator on liquidation by novation
positionLiquidationReward
uint64
Percentage of liquidated user's margin given as a reward to the liquidator on position liquidation
provisionCancellationReward
uint64
Percentage of maker's margin given to caller on provision cancellations
lpPriceImpactFeeFactor
uint64
Parameter for adjusting maker fee of a trade according to its price impact
lpNotionalFeeFactor
uint64
Parameter for adjusting maker fee of a trade according to its notional amount
minLpFee
uint64
Minimum maker fee per trade
protocolPriceImpactFeeFactor
uint64
Parameter for adjusting protocol fee of a trade according to its price impact
protocolNotionalFeeFactor
uint64
Parameter for adjusting protocol fee of a trade according to its notional amount
minProtocolFee
uint64
Minimum protocol fee per trade
IFutureStorage.PauseConfiguration
Struct containing the pause state of different operations on a future
trade
bool
If true, trading is paused in this future
liquidityProvision
bool
If true, liquidity provisions are paused in this future
liquidityRemoval
bool
If true, liquidity removals are paused in this future
liquidation
bool
If true, liquidations are paused in this future
positionOwnershipTransfer
bool
If true, liquidations by novation are paused in this future
IMarketStorage.PauseConfiguration
Struct containing the pause state of different operations on a market
withdraw
bool
If true, withdraws are paused in this market
deposit
bool
If true, deposits are paused in this market
MarketInfo
Struct containing Market and its futures data
descriptor
Market data
futures
Futures data
openInterest
uint256
The total notional value held by market participants in open futures in this market
totalLiquidityNotional
uint256
Total notional available for trading with market liquidity
MarketDescriptor
Struct containing market and its underlying token data.
id
Market identifier.
sourceName
string
Market source name
instrumentName
string
Market instrument name
tag
string
Market tag
version
uint16
Market version counter
underlying
address
Address of underlying ERC20 token
underlyingName
string
Name of underlying
underlyingDecimals
uint8
Decimals of underlying
underlyingIsWrappedNativeToken
bool
True if underlying is an ERC20 of the chain's native token
rateMathType
Type of interest rate
FutureInfo
Struct containing future and VAMM data.
id
Future identifier
marketId
Market identifier
termStart
uint64
Timestamp where the future started
termLength
uint64
Number of seconds between termStart and maturity
vAMMParams
Market version counter
totalLiquidityNotional
uint256
Notional amount for all liquidity available on this future
openInterest
uint256
The total notional value held by market participants in this future
VAMMParams
Struct defining VAMM settings
lowerBoundRate
int256
Future lowest possible rate
currentFutureRate
int256
Current future rate
upperBoundRate
int256
Future highest possible rate
intervalLength
uint256
Distance between 2 intervals. Set in percent of the rate, e.g: 0.001 * 10**18 = 0.1%
intervalsCount
uint
Number of intervals in the VAMM
ViewFloatIndexLogic.MarketOraclePackages
Struct defining OraclePackages for multiple markets
marketId
Market identifier
packages
An array of packages containing the latest known index for the market. Packages are provided by an Oracle service on demand.
FutureInfoWithoutIndex
Struct containing Future and VAMM data without open interest.
id
Future identifier
marketId
Market identifier
termStart
uint64
Timestamp where the future started
termLength
uint64
Number of seconds between termStart and maturity
vAMMParams
Market version counter
totalLiquidityNotional
uint256
Notional amount for all liquidity available on this future
TotalPosition
Struct detailing a user's position in a future
openPositionTokensPair
Amounts of fixed and float tokens across all open positions
openPositionNotional
int256
Total notional in open positions
openPositionFloatTradeValue
int256
Total value of the floating leg of a user's all open positions. Sum of takerOpenPositionFloatTradeValue
and makerOpenPositionFloatTradeValue
properties
takerOpenPositionsTokensPair
Amounts of fixed and float tokens across all open positions as taker
takerOpenPositionNotional
int256
Total notional in positions open as taker
takerOpenPositionFloatTradeValue
int256
Total value of the floating leg of a user's open positions as taker
makerOpenPositionsTokensPair
Amounts of fixed and float tokens across all open positions as maker
makerOpenPositionNotional
int256
Total notional in positions open as maker
makerOpenPositionFloatTradeValue
int256
Total value of the floating leg of a user's open positions as maker
makerProvisions
Details info on each provision
provisionsBounds
Array of bounds in user's LP positions
overallProvisionsNotional
Distribution of all provided liquidity between payer and receiver sides
accruedLPFee
uint256
Total LP fee accrued by an user
incurredFee
uint256
Total fee incurred by an user doing trades
fee
int256
Difference between accruedLPFee
and incurredFee
BoundedProvisionInfo
tokensPair
Amount of fixed and float tokens
accruedLPFee
uint256
Amount of LP fees accrued by user
floatTradeValue
int256
Value of floating leg of a provision using last available index
positionNotional
int256
Total notional of a LP position
provisionNotional
Distribution of a provision between payer and receiver sides
RateBounds
Struct to define the rate limits
lower
int256
Lower rate limit
upper
int256
Upper rate limit
ViewDataProviderLogic.MarginState
Struct containing details on the margin of a user
margin
User's margin state
initialMarginThreshold
uint256
Initial margin requirement
liquidationMarginThreshold
uint256
Liquidation margin limit. User can be liquidated when his margin falls below this threshold
lpMarginThreshold
uint256
Liquidation margin limit for LPs. LPs can be liquidated or have their positions canceled if their margin falls below this threshold
dv01
uint256
Dollar duration
riskDirection
Risk direction
MarketPortfolio
Struct detailing a user's market positions
descriptor
Market data
marginState
User margin
futures
User's futures data
futureOpenPositions
User's open futures data
futureMakerProvisions
User's future provisions on the market
FutureOpenPosition
Struct detailing a user's open future
futureId
Future identifier
tokensPair
Amount of fixed and float tokens in position
notional
uint256
Face value of the position
profitAndLoss
Position P&L
requiredMargin
int256
Amount of margin required for this position
dv01
uint256
Dollar duration of this position
riskDirection
Trade direction
MakerFuturePositions
futureId
Future identifier
provisions
Array of liquidity provisions
ProvisionInfo
Struct containing data on a liquidity provision.
bounds
Provision rate bounds
notional
Notional amount of the liquidity provided
requiredMargin
int256
Margin required for this provision
payerDv01
uint256
Dollar duration in Payer direction
receivedDv01
uint256
Dollar duration in Received direction
IntervalLiquidity
Struct declaring a notional amount of a liquidity provision in specified bounds
bounds
Lower and upper bounds of a maker position
notional
uint256
Notional amount of maker position
Enums
IRateMath.MathType
Indicates the type of rate
Last updated