Conversation
BTCFI strats
There was a problem hiding this comment.
Pull Request Overview
This PR appears to be a synchronization update that includes SDK version updates, protocol configuration changes, and new strategy functionality. The changes primarily focus on updating the Starknet Farm SDK and adjusting strategy configurations.
- Updated @strkfarm/sdk from version 1.1.28 to 1.1.39
- Added new solve method to HyperLSTStrategy with yield calculation logic
- Disabled several protocols and strategies by commenting them out
Reviewed Changes
Copilot reviewed 6 out of 7 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| src/strategies/hyper-lst.strat.ts | Added solve method with LST yield calculation and strategy status management |
| src/store/strategies.atoms.tsx | Added maxTVL configuration for LST tokens and disabled multiple strategies |
| src/store/protocols.ts | Disabled several protocol imports and configurations by commenting them out |
| src/app/api/strategies/route.ts | Modified strategy sorting logic with new priority system |
| src/app/api/lib.ts | Set all maxRewardsPerDay values to 0 for various tokens |
| package.json | Updated @strkfarm/sdk dependency from 1.1.28 to 1.1.39 |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| async solve(pools: PoolInfo[], amount: string) { | ||
| const yieldInfo = await this.universalStrategy.netAPY(); | ||
| // todo to deduct fee | ||
| const LSTYield = yieldInfo.splits.find((split) => split.id == 'lst_apy'); |
There was a problem hiding this comment.
Use strict equality (===) instead of loose equality (==) for comparison.
| const LSTYield = yieldInfo.splits.find((split) => split.id == 'lst_apy'); | |
| const LSTYield = yieldInfo.splits.find((split) => split.id === 'lst_apy'); |
| console.log( | ||
| `${this.metadata.name}::LST APY: ${LSTYield.apy}, net APY: ${yieldInfo.net}, fee factor: ${this.fee_factor}`, | ||
| ); |
There was a problem hiding this comment.
Console.log statements should be removed from production code or replaced with proper logging.
| ); | ||
| this.netYield = | ||
| LSTYield.apy + (yieldInfo.net - LSTYield.apy) * (1 - this.fee_factor); | ||
| console.log('netYield2', this.netYield, Number(amount)); |
There was a problem hiding this comment.
Console.log statements should be removed from production code or replaced with proper logging.
| const aPriority = getPriority(a.status.number); | ||
| const bPriority = getPriority(b.status.number); | ||
|
|
||
| // if (aPriority !== bPriority) return aPriority - bPriority; |
There was a problem hiding this comment.
Dead code should be removed. The priority comparison logic is calculated but never used.
| // if (aPriority !== bPriority) return aPriority - bPriority; | |
| if (aPriority !== bPriority) return aPriority - bPriority; |
No description provided.