Skip to content

Instantly share code, notes, and snippets.

@vlzhr
Created July 13, 2023 09:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vlzhr/00104fa36cc9599fdc1246d3f70f87ce to your computer and use it in GitHub Desktop.
Save vlzhr/00104fa36cc9599fdc1246d3f70f87ce to your computer and use it in GitHub Desktop.
Puzzle Lend APY
// calc interest
const supplyInterest = interests[index].times(UR).times(0.8);
// calc supply APY (i = interest)
const calcApy = (i: BN) => {
if (!i || i.isNaN()) return BN.ZERO;
return i.plus(1).pow(365).minus(1).times(100).toDecimalPlaces(2);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment