[SDK] Model supply and borrow spread in delta-neutral carry
Maintainers usually reply within 2 days
Assessment
This issue has not been assessed yet.
Description
Summary
Add supply and borrow rate inputs to the delta-neutral strategy and accrue the net spread each tick.
Motivation
The strategy docs say the long leg earns supply interest and the leveraged legs pay borrow interest, accrued each step. The config has no supply or borrow rate fields, and totalPnl is only price plus funding plus basis, so carry results omit a real cost and a real yield.
Proposed Solution
- Add supply and borrow rate inputs to the config and the registry params, with validation.
- Accrue the net spread per tick in fixed point over the correct notional and elapsed time.
- Include the accrued carry in equity and snapshots and expose it separately in
totalPnl. - Keep zero rates backward compatible.
- Document the behavior.
Scope
| Field | Value |
|---|---|
| Area | Strategies |
| Protocol affected | None |
| Network | testnet and mainnet |
| Breaking change? | No |
Alternatives Considered
- Fold the spread into the funding rate. Rejected because the two have different notionals and signs.
- Compute the spread after the run. Rejected because equity and drawdown would be wrong.
Acceptance Criteria
- Config and registry params expose supply and borrow rates with validation.
- The spread accrues over the correct notional and elapsed time.
-
totalPnland snapshots expose carry separately. - Zero rates leave existing results unchanged.
- Tests cover positive, negative, and zero spread.
-
pnpm lint,pnpm typecheck, andpnpm testpass.
Additional Context
See packages/strategies/src/delta-neutral.ts and its tests in the same folder.
- Dominant language
- TypeScript
- Stars
- 17
- Forks
- 129
- Avg merge
- 3d 13h
- Merged PRs (30d)
- 54
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from drydocs/meridian
-
chore
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
drydocs/meridian#1503 · 1 comment ·
Maintainers usually reply within 2 days
-
[Docs] Add a supported wallet capability matrixPossibly taken @Joeljosef7 claimed this 4 days ago. Opendocs frontend Stellar Wave trivial
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
drydocs/meridian#1349 · 6 comments · 1 assignee ·
Maintainers usually reply within 2 days
-
[Test] Add cross-language conformance vectors for vault mathPossibly taken @VeronicDev claimed this 3 days ago. Opencontracts medium sdk Stellar Wave testing
drydocs/meridian#1444 · 5 comments · 1 assignee ·
Maintainers usually reply within 2 days
-
[Security] Extend CSP and security headers to landing and docs routesPossibly taken @anietie234 claimed this 3 days ago. Openapi frontend medium security Stellar Wave
drydocs/meridian#1443 · 5 comments · 1 assignee ·
Maintainers usually reply within 2 days
-
[Docs] Establish ADRs and backfill architecture decisionsPossibly taken @Sammydz456 claimed this 3 days ago. Opendocs medium Stellar Wave
drydocs/meridian#1442 · 5 comments · 1 assignee ·
Maintainers usually reply within 2 days
All issues in drydocs/meridian
Similar issues
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day
-
External sources always come back in English: `lc` isn't passed to `/api/v3/external_sources`Possibly taken @Anurag1428 claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
openfoodfacts/openfoodfacts-explorer#2264 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 80/100
cloudflare/workers-sdk#17139 ·
Maintainers usually reply within 1 day
-
area: editor P3 type: feature
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
halisonworks/mod-codeling#290 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
colinhacks/zod#6776 ·
Maintainers usually reply within 1 day