[SDK] Model supply and borrow spread in delta-neutral carry

Open
#1,433 6 comments 0 reactions 1 assignee View on GitHub

Maintainers usually reply within 2 days

@AugistineCreates is already working on this.

Since Nov 21, 2026.

  • #1478 by @AugistineCreates — open

Assessment

This issue has not been assessed yet.

Description

enhancement medium sdk Stellar Wave

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.
  • totalPnl and snapshots expose carry separately.
  • Zero rates leave existing results unchanged.
  • Tests cover positive, negative, and zero spread.
  • pnpm lint, pnpm typecheck, and pnpm test pass.

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

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from drydocs/meridian

All issues in drydocs/meridian

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.