Use a subscription when
- You publish a feed that other users or contracts consume.
- You need ongoing quota instead of one-off payments.
- You want agents or services to spend one plan through delegates.
- You operate a backend or keeper that updates Solana feed accounts.
Plans
On devnet one plan is open, Basic:
These are the values of the on-chain
Plan account. Read them before you pay: getPlan returns the live terms, and the program charges the price stored on chain at the moment you subscribe.
Subscribe
- Fund the owner wallet with devnet SOL and devnet USDC from Circle’s faucet (select USDC on Solana Devnet). The devnet USDC mint is
4zMMC9srt5Ri5X14GAgXhaHii3GnPAEERYPJgZJDncDU. - Read the plan price.
- Subscribe with an explicit
maxPriceUsdcbound. The SDK aborts before sending the transaction if the live price is higher.
sdk is a MolphaSDK built with the owner’s wallet (see the SDK overview). subscribe and extendSubscription transfer the plan price from the owner’s USDC account to the protocol treasury. Then request rounds through the gateway: see the SDK gateway client.
Terms and quota
subscribesetsvalid_untilto 30 days from now and copiesmax_rounds,max_signersandmax_delegatesfrom the plan onto theSubscriptionaccount.extendSubscriptionadds 30 days tovalid_until, or sets it to 30 days from now when the subscription has lapsed. It does not copy the plan limits again.- The program records no usage. The gateway counts rounds per term: the 30-day steps counted back from
valid_until. The counter resets when a new term begins, and prepaying more months does not add quota to the current term. - Every round reserves one unit when the gateway stamps it. A round that fails gives its unit back; a
409,429or capacity503never takes one. Requests from several callers that share one round each spend their own unit. - When the quota is used up, or the subscription has lapsed, the gateway answers
403.
GET /v1/session shows the current term’s usage, owner-wide and for the signed-in key, and when the term ends.
Authenticate rounds
A subscription caller (the owner or a delegate) authenticates each round onPOST /v1/round/execute with either:
- RequestAuth: an Ed25519 signature by the caller’s key in every request (
authSig, withauthTimestampin unix seconds). The SDK signs it for you. - A sign-in session: sign one Sign-In-With-Solana message, then send
Authorization: Bearer <token>until the token expires. This suits wallets and hosted agents.
Consumer note
Consumers do not need a subscription to read an existing feed or verify a signed payload. They need the payload, the verifier address or program, and their own freshness policy.Next steps
Delegates
Authorize a hot agent key under this subscription.
Maintain a feed
Producer walkthrough for subscriptions and feed updates.