MCDEX
Search…
MCDEX
Overview
Protocol
Mai Protocol V3
V3 AMM Design
Tunable Oracle
Audits
DAO
MCDEX DAO
MCB Tokenomics
Developer
Mai3 Contracts
Mai3 SDK
Quick Start
Get Pool Info
Get Perpetual Info
Get Account
Adding Margin
Removing Margin
Re-Margin
Trade
Collateral
Mai3 Subgraph
Deployed Contracts
Bug Bounty
Trader
Basis Trading
LP Hedging
Powered By
GitBook
Get Perpetual Info
This guide shows how to get perpetual info by using
getLiquidityPool
function and index of perpetual.
Get Perpetual Info Object
Can reference
Quick Start
to know how to get
reader
object and
Get Pool Info
to know how to get
pool
object.
Function
pool.perpetuals.get(perpetualIndex)
from pool object
parameters
type
description
perpetualIndex
number
index of perpetual in the liquidity pool
Return information from perpetual object
returns
type
description
nums
array of number
[0]: markPrice: mark price
[1]: indexPrice: index price
[2]: fundingRate: funding rate
[3]: unitAccumulativeFunding: accumulative amount of funding for each unit
[4]: initialMarginRate: initial margin rate
[5]: maintenanceMarginRate: maintenance margin rate
[6]: operatorFeeRate: operator fee rate
[7]: lpFeeRate: LP fee rate
[8]: referrerRebateRate: referrer rebate rate
[9]: liquidationPenaltyRate: penalty rate if position is liquidated
[10]: keeperGasReward: gas reward for keeper
[11]: insuranceFundRate: insurance fund rate
Example
1
const
pool
=
await
getLiquidityPool
(
reader
,
liquidityPoolAddress
)
2
const
perpetual
=
pool
.
perpetuals
.
get
(
0
)
Copied!
After getting perpetual object, can get useful information like previous section. EX: markPrice, fundingRate
1
console
.
log
(
"markPrice: "
+
perpetual
.
markPrice
.
toString
())
2
console
.
log
(
"fundingRate: "
+
perpetual
.
fundingRate
.
toString
())
Copied!
Sample Code
Perpetual
Previous
Get Pool Info
Next
Get Account
Last modified
6mo ago
Copy link
Contents
Get Perpetual Info Object
Function
Example
Sample Code