How to calculate APR ?

Solidity Programming Language
2 min readApr 27, 2021

This is from markr.io

https://markr.io/#/pools

Where does APY (Rewards) come from ? (Note: This is normally APR but this site writes APY)

https://app.pangolin.exchange/#/png/1

(485,007 PNG / 1,545,000 AVAX )= 0,3138 PNG per AVAX (Weekly)

1 AVAX : 27.14 $

1 PNG: 2,27 $

0,3138 PNG : 0,712 $

(0,712 / 27,14) *100= % 2,62 Weekly

%2,62 * 52 week = %136 yearly, but this is not correct answer

Why?

We need staked amount.

https://cchain.explorer.avax.network/tokens/0xd7538cABBf8605BdE1f4901B47B8D42c61DE0367/token-holders

Total PGL supply for this pool is 2,384,532.

Nevertheless, This pool has less PGL than total supply

https://cchain.explorer.avax.network/address/0x574d3245e36Cf8C9dc86430EaDb0fDB2F385F829/transactions

AVAX-PNG pool has 41,903,075 $

https://info.pangolin.exchange/#/pair/0xd7538cabbf8605bde1f4901b47b8d42c61de0367

But this amount is not equal to staked liquidity.

Total PGL supply is 2,384,532 but this pool has 2,219,477 PGL.

We calculate staked amount

(2,219,477 * 41,903,075) / 2,384,532 = 39,002,584 staked amount

Now we have staked amount

https://app.pangolin.exchange/#/png/1

485,007 PNG * 2,27 $ =1,100,965 $

(1,100,965 / 39,002,584) *100 = %2,82 Weekly

%2,82 * 52 weeks =% 146,7 Yearly

https://vfat.tools/avax/png/

--

--

Solidity Programming Language

Solidity basics for beginners: Learn the fundamentals of smart contract development and build your first DApp! #Solidity #Foundry #Ethereum #Opcodes #DApps