APR correlation calculation
1. Pool APR
We have integrated the calculation of the pool's APR into our statistics service, and now you can directly obtain these data through the statistics interface.
Pool Info API
Mainnet: https://api-sui.cetus.zone/v2/sui/swap/count
Testnet: https://api-sui.devcetus.com/v2/sui/swap/count
There are three type apr you can get.
24 h: data.pools[x].apr_24h
7 day: data.pools[x].apr_7day
30 day: data.pools[x].apr_30day
2. Position APR
1.We use the estPositionAPRWithMultiMethod
method in the SDK to calculate the multi coefficient m
, and the parameters passed to this method come from the Cetus statistics interface. 2. Use coefficient m
multiply the reward APRs respectively and then add them together.
Param explanation
lowerUserPrice and upperUserPrice are the price of one position.
lowerHistPrice and upperHistPrice are come from the cetus statistics interface.
Price Statistics API
Testnet: https://api-sui.devcetus.com/v2/sui/contract/price
lowerHistPrice and upperHistPrice come from data.list[x].data[x].
there are three types before_24_h_xx 、
before_7_d_xx
and before_30_d_xx.
The pool rewards apr come from the above mentioned pool info API, data.pools[x].rewarder_apr
.
Last updated