Skip to content

contracts: subscription credits in OperatorRegistry #2948

Not planned

Description

@alpergundogdu

Summary

An operator is subscribed in an epoch when its credits paid that epoch's flat USDC subscription. Anyone can buy credits for any operator. A subscribed operator keeps 90% of its earnings (the rebate) and counts toward the subscribed 60% in DHT selection and holder selection.

Design

  • buyCredits(operator, amount): permissionless. Transfers amount USDC from the caller to the treasury and adds amount credits to operator. Credits cannot be transferred, withdrawn or refunded, and never expire. The registry holds no USDC.
  • Lazy charge. At each epoch start, subscription credits are charged. The charge is applied when anything next touches the operator's credits. projectedCredits(op) and isSubscribed(op, e) return the result without a transaction. The catch-up is one multiplication per recorded change of the price.
  • subscription is a USDC amount per epoch, set by GOVERNANCE_ROLE within hard bounds, changing by at most ±10% of its value per epoch. Every change is recorded with its epoch, so the lazy charge and the views use the price in force in each epoch.
  • subscribedSince(op): the first epoch of the operator's current continuous subscription, for a later DAO's tenure.
  • migrate (contracts: OperatorRegistry replaces CapacityBond, with free registration #2947) moves credits with the registration.
  • Events: CreditsBought(operator, payer, amount), SubscriptionPriceSet(epoch, price).

Tests

  • Lazy charge across many epochs and across price changes.
  • isSubscribed at epoch boundaries, and an operator running out mid-sequence.
  • Buying for another operator.
  • The price step limit and bounds.
  • migrate moving credits.
  • No transfer or withdrawal path.

Depends on

#2947.

Activity

  1. added
    kind:feature
    area:contracts
    on Nov 23, 2026
  2. moved this from Backlog to Done in deCDNon Nov 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:contractskind:feature

    Fields

    Priority

    None yet

    Projects

    • Status
      Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions