Use subscriptions when
- You publish a feed that other users or contracts consume.
- You need ongoing quota instead of one-off requests.
- You want to manage delegates under one plan.
- You operate a backend or keeper that updates Solana feed accounts.
Flow
- Fund the owner wallet with Solana Devnet SOL and Devnet USDC from Circle’s faucet (select USDC on Solana Devnet).
- Fetch the current plan price.
- Subscribe with an explicit
maxPriceUsdcsafety bound. - Build the
apiConfig. Its canonical hash is thesourceId; there is no separate feed ID to derive. - Request signed updates through the gateway.
- Submit verified updates to Solana when you maintain a public feed account.
What a plan controls
The
Subscription account copies max_rounds, max_signers and max_delegates from the plan at subscribe time, and stores valid_until. subscribe sets valid_until to 30 days from now. extend_subscription adds 30 days to it, or sets it to 30 days from now when the subscription has lapsed. Extending does not copy the plan limits again.
The program records no usage: the gateway counts rounds per 30-day term (see Admission). Prepaying more months does not add quota to the current term. When the quota is exhausted or the subscription is inactive, the gateway answers 403.
Consumer note
Consumers do not need a subscription to read an existing feed or verify a signed payload. They only need the payload, the verifier address/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.