Docs · Revenue tokens
Build on revenue tokens
PartialFor wallets, indexers, keepers and launch platforms: the reel accounts, instructions and events that carry fee-right income, and what the tokenizer adds.
Start from the fee rights
The tokenizer is reel-vaults' tokenizer module (coming); the income paths under it are in the reel program. An integration built on those paths keeps working with revenue tokens, because a token holds the same rights. Read What you can tokenize for the four rights and How pools pay it for every stream.
Wallets and portfolio apps
Show what a wallet is owed, per mint, from its ClaimLedger accounts. A ledger is the PDA ["ledger", wallet, mint]; owed is claimable now, claimed is paid out, and lifetime splits credits into prize, royalty, holder pot, referral, recapture and other.
import { PublicKey } from "@solana/web3.js"
import { REEL_PROGRAM_ID, accountFilters, decodeLedger } from "@/sdk/src"
// Every ledger of one wallet: the tag and size filter, plus the wallet at offset 8.
const filters = [...accountFilters("ClaimLedger"), { memcmp: { offset: 8, bytes: wallet.toBase58() } }]
const accounts = await connection.getProgramAccounts(REEL_PROGRAM_ID, { filters })
const ledgers = accounts.map((a) => decodeLedger(a.account.data))Position income is separate: read each Position the wallet owns and compute what it is owed with the SDK's owedFees. Uncollected fees are not yet the wallet's tokens, so label them as owed, not as a balance.
Explorers and indexers
reel logs events with sol_log_data, so each appears as Program data: <base64> in the transaction's logs, with an event id byte first and packed little-endian fields after (PROGRAM.md §15). The ones that trace fee-right income:
| Id | Event | Use |
|---|---|---|
| 4 | FeesCollected | A position's fees paid, base and quote |
| 10 | BucketPaid | A bucket paid to its recipient, by kind |
| 11 | Credited | A ledger credited, with a category byte |
| 12 | Claimed | A wallet withdrew from its ledger |
| 17 | LaunchOwner | A launch changed hands |
| 18 | LaunchLocked | A launch locked, with its beneficiary and end |
| 6 | PositionLocked | A position's lock set or extended |
Read Errors and events for every field.
Keepers and bots
BucketCollect is permissionless: any signer can push a pool's bucket to its fixed recipient, and the program checks the destination's owner. KotpSettle is permissionless too. The program pays no tip for either today, and the tokenizer's Sync is permissionless and untipped too. Read Jobs for agents.
Launch platforms
A platform that wants its creators' income tokenizable later should get the addresses right at launch, because royalty_to and payee never change after PoolInit:
- Name the creator's chosen recipient, or a split, as
royalty_toandpayee. - Keep launch ownership with the creator, so a launch lock or a hand-over to a tokenizer stays possible.
- List the platform as an integrator to share the protocol cut. Read Integrating as a launcher.
The Revenue Router, a split PDA usable as royalty_to, is reel-vaults' router module (live).
What to build on the tokenizer
hookr's add-ons show the shape: vaults that compound a token's income into its pool, time shares that sell a day's income, wallets that show income per asset. None of these exists on reel yet. The tokenizer's accounts, instructions and events are specified in PROGRAM.md §19 and decoded by the SDK's sdk/vaults/tokenizer.ts, so an integration can be written now and run once the module is in the deployed build. Ledgers, positions and buckets underneath won't change.