๐๏ธ 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.
Property name | Property Type | Description |
---|---|---|
sourceName |
| Source of interest rate. E.g: Binance or Lido |
instrumentName |
| Instrument name. E.g 'BTCUSDT Perpetual' or 'stEth' |
tag |
| Identifier to group rates. E.g: 'funding rate' or 'staking' |
version |
| Counter for differentiating multiple markets of the same source and instrument |
underlying |
| Address of the underlying ERC20 token |
FutureId
Alias for bytes32. It's a hash of the properties of FutureKey struct.
Property name | Property Type | Description |
---|---|---|
marketId | Market Identifier | |
termStart |
| Timestamp in seconds of the start of the future |
termLength |
| Number of seconds until maturity |
Structs
OraclePackage
Defines the format for passing an updated index value from the oracle for a given market.
Property name | Property Type | Description |
---|---|---|
marketId | Market Identifier | |
timestamp |
| Timestamp in seconds |
signature |
| Oracle signature validated on-chain |
indexValue |
| New index value for a market |
Margin.Value
Property name | Property Type | Description |
---|---|---|
profitAndLoss | User's P&L | |
collateral |
| Amount of collateral deposited by user |
ProfitAndLoss.Value
Property name | Property Type | Description |
---|---|---|
netFutureValue |
| Amount of P&L gained or lost by an user across all futures |
accruedLPFee |
| Amount of fees accrued by user by providing liquidity |
incurredFee |
| 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.
Property name | Property Type | Description |
---|---|---|
fixedTokenAmount |
| Amount of fixed tokens |
floatTokenAmount |
| Amount of floating tokens |
TradeInfo
Provides detailed insights into the outcome of a trade
Property name | Property Type | Description |
---|---|---|
direction |
| Direction of the trade |
tokensPair |
| Fixed and float token amounts corresponding to the trade |
marketRateBefore |
| Prevailing market rate right before the trade |
marketRateAfter |
| Prevailing market rate right after the trade |
tradeRate |
| Specific rate, at which the trade was executed |
lpFee |
| Amount of fees incurred that will to to makers |
protocolFee |
| Amount of fees incurred that will go to the protocol |
floatIndex |
| Index value used for calculations for the trade |
floatTradeValue |
| 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
Property name | Property Type | Description |
---|---|---|
total |
| Total liquidity |
payer |
| Liquidity on payer side |
receiver |
| 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