Skip to content

feat: add debt (underlying) field to StrategyConfigPayload#461

Open
de-snake wants to merge 1 commit into
Gearbox-protocol:masterfrom
de-snake:feat/strategy-debt-field
Open

feat: add debt (underlying) field to StrategyConfigPayload#461
de-snake wants to merge 1 commit into
Gearbox-protocol:masterfrom
de-snake:feat/strategy-debt-field

Conversation

@de-snake

Copy link
Copy Markdown
Contributor

What

Adds a debt: Address field to StrategyConfigPayload (src/common-utils/static/strategy.ts).

debt is the borrowed underlying — the debt side of a (collateral, debt) pair, where tokenOutAddress is the collateral. It equals underlying() of every credit manager listed in creditManagers.

Why

Preparation for the agentic approach: the static strategies list is being remodeled so each entry is a single (collateral, debt) pair with the set of credit managers that service it, instead of one collateral umbrella-ing credit managers across multiple debts. Carrying debt explicitly lets a strategy be keyed/reasoned about as a discrete pair without resolving it from a credit manager at runtime.

id is intentionally kept — this is a non-breaking, additive change. StrategyRecord keying is unchanged.

Companion PR

The static data is reshaped in Gearbox-protocol/static (separate PR) to populate debt and split collaterals that span two debts into separate pairs. That PR depends on this field landing + a release.

🤖 Generated with Claude Code

Adds a required `debt: Address` so each strategy explicitly carries the
borrowed underlying (the debt side of a (collateral, debt) pair). `debt`
equals `underlying()` of every credit manager listed in `creditManagers`,
enabling the static strategies list to be modeled as discrete
collateral/debt pairs.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@de-snake

Copy link
Copy Markdown
Contributor Author

Companion data PR that populates this field and splits multi-debt collaterals into pairs: Gearbox-protocol/static#307 (draft until this releases).

de-snake added a commit to Gearbox-protocol/static that referenced this pull request Jun 10, 2026
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. Every `id` encodes the pair
as <collateral>-<debt> (e.g. ETH+-WETH, sUSDe-USDC, AUSDCT0-USDC). Collaterals
whose credit managers spanned two different debts are split into separate
pairs. 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>
de-snake added a commit to Gearbox-protocol/static that referenced this pull request Jun 10, 2026
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant