feat: model strategies as (collateral, debt) pairs#307
Draft
de-snake wants to merge 3 commits into
Draft
Conversation
Each entry is now a single (collateral, debt) pair: tokenOutAddress is the collateral, the new `debt` field is the borrowed underlying, and creditManagers lists the CMs servicing that pair. Collaterals whose credit managers spanned two different debts are split into separate pairs, with the `id` suffixed by the debt symbol (e.g. AUSDCT0-USDC / AUSDCT0-AUSD). 17 strategies -> 23 pairs (6 splits). Every debt was verified on-chain via creditManager.underlying(). Requires the `debt` field added in Gearbox-protocol/sdk#461. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Collaborator
Author
|
The failing Unblock sequence:
Verified locally that the data is correct and typechecks cleanly once |
8fe9786 to
f9f9148
Compare
Suffix the remaining single-debt strategy ids with their debt symbol so all ids uniformly reflect the (collateral, debt) pair (e.g. ETH+-WETH, sUSDe-USDC, cbETH-WETH). Split strategies already carried the suffix. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
f9f9148 to
0ba6552
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Reshapes
src/strategies/index.tsso each entry is a single (collateral, debt) pair:tokenOutAddress= collateral, newdebt= borrowed underlying,creditManagers= the CMs servicing that pair.idsuffixed by the debt symbol (e.g.AUSDCT0-USDC/AUSDCT0-AUSD).idunchanged.17 strategies → 23 pairs (6 splits): mEDGE (USDC/AUSD), Aura wstETH/tETH (WETH/wstETH), Convex ETH+/WETH (WETH/wstETH), Curve AZND/AUSD (USDC/AUSD), Curve AUSD/USDC/USDT0 (USDC/AUSD), Savings AUSD (USDC/AUSD).
Why
Preparation for the agentic approach — a strategy can be reasoned about as a discrete collateral/debt pair instead of one collateral umbrella-ing CMs across multiple debts.
Verification
Every
debtwas resolved on-chain viacreditManager.underlying()across Mainnet, Monad (143), and Etherlink (42793). Checked: no credit manager dropped or added vs the previous list; all CMs within a pair share one debt; each declareddebtmatches the on-chain underlying;idunique per chain.yarn typecheck:ci,prettier, andgenerate-configs:ts(→ 23-entry strategies.json) all pass locally with the SDK change applied.Dependency
Draft — depends on Gearbox-protocol/sdk#461 (adds the
debtfield). Needs that to release + an@gearbox-protocol/sdkversion bump here before CI typecheck passes. Ready to un-draft once the SDK is published.🤖 Generated with Claude Code