๐๏ธ Types, structs and enums
Documentation on types, structs and enums used across different contracts.
Types
MarketId
Alias for bytes32. It's a hash of the properties of MarketKey struct.
sourceName
string
Source of interest rate. E.g: Binance or Lido
instrumentName
string
Instrument name. E.g 'BTCUSDT Perpetual' or 'stEth'
tag
string
Identifier to group rates. E.g: 'funding rate' or 'staking'
version
uint16
Counter for differentiating multiple markets of the same source and instrument
underlying
address
Address of the underlying ERC20 token
FutureId
Alias for bytes32. It's a hash of the properties of FutureKey struct.
marketId
Market Identifier
termStart
uint64
Timestamp in seconds of the start of the future
termLength
uint64
Number of seconds until maturity
Structs
OraclePackage
Defines the format for passing an updated index value from the oracle for a given market.
marketId
Market Identifier
timestamp
uint64
Timestamp in seconds
signature
bytes
Oracle signature validated on-chain
indexValue
int256
New index value for a market
Margin.Value
profitAndLoss
User's P&L
collateral
int256
Amount of collateral deposited by user
ProfitAndLoss.Value
netFutureValue
int256
Amount of P&L gained or lost by an user across all futures
accruedLPFee
uint256
Amount of fees accrued by user by providing liquidity
incurredFee
uint256
Amount of fees incurred to a user by trading
FixedAndFloatTokensPair.Value
Struct for passing the amount of fixed and float tokes in a future's vAMM.
fixedTokenAmount
int256
Amount of fixed tokens
floatTokenAmount
int256
Amount of floating tokens
TradeInfo
Provides detailed insights into the outcome of a trade
direction
RiskDirection.Value
Direction of the trade
tokensPair
FixedAndFloatTokensPair.Value
Fixed and float token amounts corresponding to the trade
marketRateBefore
int256
Prevailing market rate right before the trade
marketRateAfter
int256
Prevailing market rate right after the trade
tradeRate
int256
Specific rate, at which the trade was executed
lpFee
uint256
Amount of fees incurred that will to to makers
protocolFee
uint256
Amount of fees incurred that will go to the protocol
floatIndex
int256
Index value used for calculations for the trade
floatTradeValue
int256
The value of the floating leg of a trade using its latest available index. Used for P&L calculations.
ProvisionDistribution
Struct to show how liquidity is distributed between payer and receiver sides
total
uint256
Total liquidity
payer
uint256
Liquidity on payer side
receiver
uint256
Liquidity on receiver side
Enums
RiskDirection.Value
Indicates the direction of a trader, whether the user is a receiver or payer of fixed rates.
Last updated