Skip to content

Beta basket: delegated weight-vector management for root yield vaults#2772

Open
cisterciansis wants to merge 1 commit into
opentensor:root-rebornfrom
cisterciansis:root-fund-manager
Open

Beta basket: delegated weight-vector management for root yield vaults#2772
cisterciansis wants to merge 1 commit into
opentensor:root-rebornfrom
cisterciansis:root-fund-manager

Conversation

@cisterciansis

@cisterciansis cisterciansis commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

Summary

Root Reborn turns each root validator into an on-chain yield vault curator: validators set a basket weight vector and their stakers' root dividends compound into it. This PR adds delegated weight-vector management so a root validator can hand the curation of its vector to another root validator (a "manager") and pay a take for the service.

The value here is that a skilled curator can actively set a bespoke strategy for each delegator that trusts them.

Mechanism

  • RootWeightManager (delegator uid → manager uid) — authorization only. A delegator names its manager via set_root_weight_manager (self = clear).
  • set_root_weights_for(delegator, …) — the manager writes a bespoke vector into the delegator's own Weights[ROOT] slot. One manager can therefore run a different vector for each delegator. Distribution reads each delegator's own slot exactly as base Root Reborn does — no read-time indirection. Shares apply_root_weights with the self path (set_root_weights).
  • RootWeightTake (manager uid → bps) — the curation fee. Bounded by the childkey-take ceiling and rate-limited on increases (reusing the childkey-take window) so a manager can't spike its take on already-committed delegators between their per-block distributions. Lowering is always allowed.
  • Fee flow — skimmed from the delegator's dividend in TAO after the origin sell, and credited to the manager's own root stake. The round trip stays TotalStake-neutral: sell − buys − fee == 0. Guarded by Keys::try_get so the fee never lands on a vacant uid. Extracts credit_root_stake, now shared with the root-claim payout.
  • All maps are uid-keyed, so authorization, vector, and take follow either validator through hotkey swaps with no migration.

Tests

  • test_root_weight_manager_sets_delegator_vector_and_earns_take — end-to-end via the extrinsics: authorization is required (rejected before, accepted after), the manager writes the delegator's own slot (not its own), distribution follows that vector, and the take is credited to the manager's root stake.
  • test_root_weight_manager_runs_independent_vectors — the core requirement: one manager runs A → X and B → Y as independent baskets, each delegator's dividend deploys into its own manager-set subnet, and the manager earns a take on each.

The existing basket distribution/claim tests still pass, covering the shared apply_root_weights and credit_root_stake refactors (29/29 in the claim_root module).

Follow-ups (not blocking review)

  • Self-deal / slippage guards on w matter more here than in base Root Reborn. A manager now deploys other validators' stakers' capital, so a vector pointed at a manager-held subnet pumps its own bag with delegated funds. Best resolved together with the existing "slippage/self-deal guards on w" follow-up.
  • Real benchmarked weights — the new setters currently reuse set_childkey_take's / set_weights' weight.
  • Clear RootWeightManager / RootWeightTake on root uid reassignment, alongside the existing Weights[ROOT] uid-reuse follow-up.

@cisterciansis cisterciansis changed the title Beta basket: delegated weight-vector management for root fund managers Beta basket: delegated weight-vector management for root yield vaults Jun 19, 2026
Let a root validator hand the *setting* of its beta-basket weight vector to
another root validator (a "manager") and pay a take for the service, so a
skilled curator can run an independent strategy per delegator -- a managed
account, not one shared vector everyone copies.

- RootWeightManager (delegator uid -> manager uid): authorization only. A
  delegator names its manager via set_root_weight_manager (self = clear).
- set_root_weights_for(delegator, ...): the manager writes a bespoke vector
  into the *delegator's own* Weights[ROOT] slot. One manager can therefore
  run a different vector for each delegator; distribution reads each
  delegator's own slot exactly as base Root Reborn does (no read-time
  indirection). Shares apply_root_weights with the self path.
- RootWeightTake (manager uid -> bps): the curation fee, bounded by the
  childkey-take ceiling and rate-limited on increases (reusing the
  childkey-take window) so a manager cannot spike its take on
  already-committed delegators between their per-block distributions.
- The take is skimmed from the delegator's dividend in TAO after the origin
  sell and credited to the manager's own root stake. Round trip stays
  TotalStake-neutral: sell - buys - fee == 0. Guarded by Keys::try_get so a
  stale/vacant manager uid is never paid. Extracts credit_root_stake, now
  shared with the root-claim payout.
- All uid-keyed, so authorization, vector, and take follow either validator
  through hotkey swaps with no migration.

Tests: an end-to-end test (authorize -> manager sets the delegator's own
slot, rejected before authorization -> distribution follows it, take paid),
and an independence test proving one manager runs A->X and B->Y as separate
baskets, earning a take on each.

Follow-ups (not blocking review):
- Self-deal/slippage guards on w matter more here than in base Root Reborn:
  a manager now deploys other validators' stakers' capital, so a vector
  pointed at a manager-held subnet pumps its own bag with delegated funds.
  Resolve with the existing "slippage/self-deal guards on w" follow-up.
- Real benchmarked weights (the setters currently reuse set_childkey_take's).
- Clear RootWeightManager/RootWeightTake on root uid reassignment, alongside
  the existing Weights[ROOT] uid-reuse follow-up.
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