[Feature] Add drift-based rebalancing to ComposedStrategy

Open
#1,437 5 comments 0 reactions 1 assignee View on GitHub

Maintainers usually reply within 2 days

@Agencybuilds is already working on this.

Since Nov 20, 2026.

  • #1449 by @Agencybuilds — open

Assessment

This issue has not been assessed yet.

Description

enhancement medium sdk Stellar Wave

Summary

Let a ComposedStrategy correct drift between member values and their target weights.

Motivation

Member weights are used only to allocate initial capital. Rebalancing forwards member orders without comparing current member values to target weights, so a composition drifts away from its intended allocation as members gain or lose value.

Proposed Solution

  • Add target-weight drift policies: a threshold policy, a calendar policy, or both.
  • Generate cross-member transfer orders to restore weights.
  • Enforce aggregate exposure and cash-buffer constraints after rebalancing.
  • Document tie-breaking when several members drift at once.

Scope

Field Value
Area Strategies
Protocol affected None
Network testnet and mainnet
Breaking change? No

Alternatives Considered

  • Rebalance every tick. Rejected because it ignores costs and is rarely what an operator wants.
  • Leave drift to the caller. Rejected because the composition owns the weights.

Acceptance Criteria

  • A composition can configure a drift threshold, a calendar policy, or both.
  • Rebalancing restores weights within tolerance.
  • Generated orders respect aggregate exposure and cash-buffer constraints.
  • Tie-breaking is documented.
  • Tests cover no-drift, threshold-triggered, and constraint-blocked cases.
  • pnpm lint, pnpm typecheck, and pnpm test pass.

Additional Context

See packages/strategies/src/composition/index.ts.

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.