Prerequisites
Before starting, make sure you have:- Completed the Environment Setup.
- A Bags API key from dev.bags.fm belonging to the same Bags user that owns the token’s creator wallet.
- Read the Launch a Token guide — an index token is a normal Bags V2 launch with a specific fee-claimer configuration.
1. How Index Tokens Work
An index token runs on the standard Bags fee-share rails (see Claim Creator Fees), with one twist: the creator half of the trade fee is routed entirely to the Bags index bot, which converts it into dividends for holders.- Cadence — the bot scans continuously (roughly once a minute) and starts a cycle once the claimable creator fees reach the minimum threshold (currently 0.001 ETH).
- Even split — the claimed ETH is divided equally across the basket assets.
- No skim — 100% of the claimed ETH is spent on basket assets;
distributableWeialways equalstotalWeiin the history payload. - Pro rata payouts — each purchased asset is transferred to holders proportionally to their snapshot balance, in batched multisend transactions.
- Excluded holders — contracts are excluded from distributions (pools, the token itself, its fee-share contract, the bot wallet, and any address the explorer classifies as a contract). There is no minimum balance: small holders are included, but a share that rounds down to zero base units pays nothing for that asset.
The basket is fixed at registration. Constituents must be tradeable tokenized assets on Robinhood Chain — the same markets available in the Bags launch flow.
2. Launch with the Required Claimer
For the bot to ever see your token’s fees, the token must be launched with the Bags claimer wallet as its only fee claimer at 100%:3. Register the Index Token
After the launch transaction confirms, register the basket with Initialize Index Token. The API key’s user must own the token’s on-chain creator wallet.tokensis the basket: 1–10 asset addresses, no duplicates. Any casing is accepted; addresses are normalized to EIP-55 checksum form.- A successful call returns
{ "success": true, "response": "Index token initialized successfully" }.
4. Verify the Registration
Check that the token is registered (and read back its basket) with Get Index Token Statuses. The endpoint is batch-oriented — pass 1–100 addresses:tokens is empty when isIndexToken is false.
5. Monitor Distribution Cycles
Once trading generates enough fees, completed cycles appear in Get Index Token History, newest first:
For pagination, pass
nextCursor back as cursor; it is null when the history is exhausted. Only completed cycles with confirmed claims are returned — a cycle that is still claiming, buying, or transferring does not appear yet.
snapshot.includedSupply is the pro-rata denominator: the token supply held by eligible (non-excluded) holders at the snapshot. A holder’s payout per asset is boughtAmountRaw * holderBalance / includedSupply, truncated.Troubleshooting
403on init — either the launch was made from a wallet that doesn’t belong to your Bags user, or the token wasn’t launched with the required claimer at 100%. The claimer set is part of launch configuration; verify withfeeShare.getClaimers().409on init — the token is already registered. The basket is immutable; there is no re-init.isIndexTokenisfalseafter a successful init — statuses are cached briefly server-side; re-check after a few seconds.- No history items — cycles only complete after claimable fees reach the 0.001 ETH threshold and the buy + distribution finish. Check accrued fees via Get Claimable Positions for the claimer wallet, and note the empty history payload (
items: [],hasMore: false) is expected for a fresh token. - A holder received nothing — contract addresses are excluded, and very small balances can truncate to zero base units for a given asset. Both are expected behavior.
