-
Notifications
You must be signed in to change notification settings - Fork 15
extracting APRs module #2027
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
extracting APRs module #2027
Conversation
🦋 Changeset detectedLatest commit: ea559fb 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 |
|
||
let protocolFee = parseFloat(pool.dynamicData.protocolSwapFee); | ||
if (pool.type === 'GYROE') { | ||
protocolFee = parseFloat(pool.dynamicData.protocolYieldFee || '0'); |
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.
This seems odd. Need to double check how we sync gyro protocol fees.
modules/aprs/types.ts
Outdated
export type AprCalculatorType = | ||
| 'swapFeeApr' | ||
| 'boostedPoolApr' | ||
| 'dynamicSwapFeeApr' | ||
| 'gaugeApr' | ||
| 'veBalProtocolApr' | ||
| 'veBalVotingApr' | ||
| 'morphoRewardsApr' | ||
| 'ybTokensApr' | ||
| 'aaveApiApr' | 10000||
| 'masterchefFarmApr' | ||
| 'reliquaryFarmApr' | ||
| 'beetswarsGaugeVotingApr' | ||
| 'quantAmmApr'; | ||
|
||
/** | ||
* Configuration for APR calculators | ||
*/ | ||
export interface AprCalculatorConfig { | ||
type: AprCalculatorType; | ||
params?: Record<string, any>; | ||
} |
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.
AprCalculatorType
and AprCalculatorConfig
seems unused
modules/aprs/README.md
Outdated
2. **Handlers Layer** - Contains pure calculation logic (`AprHandler` implementations) | ||
3. **Configuration Layer** - Defines which calculators to use for each chain | ||
4. **Manager Layer** - Coordinates calculators and persistence (`AprManager`) |
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.
Either call them Handlers or Calculators, its mixed currently.
private aprConfig: YbAprConfig, | ||
chain: Chain, | ||
) { | ||
this.ybTokensAprHandlers = new YbAprHandlers(this.aprConfig, chain); |
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.
Wonder if we need to dissect the YbAprHandlers
a bit as well. In a first run, I think we could copy them as-is and refactor them in a second phase.
MaBeetsAprHandler updates prismaPoolStakingReliquaryFarmLevel, ideally it would be a separate action |
Overall looks great, most of the services are returning APRs without any DB access. Few remarks:
|
No description provided.