Returned APY is wrong
rschef opened this issue · comments
Rafael Scheffer commented
Hi, running the code below returns 16.5% as the Anchor APY, while the official website states 17.97%.
Which one is correct?
https://app.anchorprotocol.com/earn
Code:
import {
AnchorEarn,
NETWORKS,
CHAINS,
DENOMS,
} from '@anchor-protocol/anchor-earn' // yarn add @anchor-protocol/anchor-earn@2.0.0
const anchorEarn = new AnchorEarn({
chain: CHAINS.TERRA,
network: NETWORKS.COLUMBUS_5,
address: 'terra1mqs59fdv2t0cc3pmrtrgn83azvqv8dqz8q4063'
});
const checkMarket = async () => {
const market = await anchorEarn.market({ // .balance
currencies: [DENOMS.UST],
})
return market
}
console.log(await checkMarket())
// node test.mjs
Response:
MarketOutput {
chain: 'terra',
network: 'columbus-5',
height: 7491758,
markets: [
{
currency: 'UST',
liquidity: '10914277436.565453',
APY: '0.165471511176329490'
}
],
timestamp: 2022-05-03T12:15:49.748Z
}