↗️APY Calculation

APY shown in frontend is calculated using the following formula.

Auto-compound APY

First we deduct fee from APR:

NetAPR=RewardAPRβˆ—(1βˆ’fee)

Second, we calculate into APY. We use 365 (daily compound):

NetAPY=(1+NetAPR/365)365βˆ’

Then, we include trade APR.

AutocompoundAPY=(1+NetAPY)βˆ—(1+TradeAPR)βˆ’1

​

NOTE: For Trade APR, we use multiplication here because in auto-compound we grow LP and LP is multiplication of trading APR.

For example:

Net APY = 20%, Trade APR = 10%

Year 0: LP = 100 and 1 LP = 1 Token + 1 UST (Total value is 200 UST)

Year 1: LP = 120 and 1 LP = 1.1 Token + 1.1 UST (Total value is 264 UST)

Year 0-1 Profit = 64 UST

​

We can apply compound APY formula to get the same result:

Compound APY = (1 + Net APY 20%) * (1 + Trade APR 10%) - 1 = 32%

Investment 200 UST * 32% = 64 UST

​

Full example for auto-compound APY calculation

Reward APR = 87.57%, Fee = 5%, Trade APR = 4.59%

Net APR = 0.8757 * (1 - 0.08) = 0.831915

Net APY = (1 + 0.831915 / 365) ^ 365 - 1 = 1.295541

Auto-compound APY = (1 + 1.295541) * (1 + 0.0459) - 1 + 0.0348 = 140.09%

Last updated