-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Shade staking query interface and APY calculation for derivatives #118
Conversation
SissonJ
commented
Mar 28, 2024
- Shade staking query interface
- APY for stkd-SCRT
- APY for dSHD
🦋 Changeset detectedLatest commit: 2d5dc78 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
queryRouterCodeHash?: string, | ||
contractAddress: string, | ||
codeHash: string, | ||
lcdEndpoint: string, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
opttional
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not optional since the chain queries require it, I'll add a comment to explain
queryRouterCodeHash?: string, | ||
contractAddress: string, | ||
codeHash: string, | ||
lcdEndpoint: string, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
optional
src/lib/apy/derivativeScrt.ts
Outdated
* ex. for daily compounding periodRate=365 | ||
* @param {number} apr - Annual Percentage Rate | ||
*/ | ||
const calcAPY = (periodRate:number, apr:number):number => (1 + apr / periodRate) ** periodRate - 1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's move this function to a file location that is not derivativeScrt specific as it seems likely to be reused elsewhere.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I meant this single function, but it looks like you moved the whole file which i was not intending in my comment
queryRouterCodeHash?: string, | ||
contractAddress: string, | ||
codeHash: string, | ||
lcdEndpoint: string, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
optional
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few minor issuse, but looks great overall!
// data returned from the contract in normalized form with | ||
// 18 decimals, in addition to any decimals on the individual token |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could you move this comment up to the const definition so it's clear what it is for at the line it is defined?