Skip to main content
In this guide, you’ll set up an index token (also called a dividend coin): a Bags token on Robinhood Chain whose creator fees are automatically converted into a basket of 1–10 tokenized assets (stocks like TSLA, NVDA, AAPL, …) and distributed pro rata to the token’s holders. Holders earn dividends in the underlying assets simply by holding the token.

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.
Key properties of a distribution cycle:
  • 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; distributableWei always equals totalWei in 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%:
This replaces regular fee sharing — an index token routes the entire creator half of the trade fee into dividends for holders, so you cannot combine it with custom fee-share splits. Launch the token as described in Launch a Token, passing this single claimer.
Initialization is rejected with 403 if the required claimer is not configured on the token. The claimer configuration is part of the launch — set it up front.

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.
  • tokens is 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" }.
Error cases:
If initialization fails after a successful launch, the token still exists on-chain — just retry the init call once the issue is fixed. Nothing needs to be relaunched.

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:
Each item is one full cycle: 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

  • 403 on 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 with feeShare.getClaimers().
  • 409 on init — the token is already registered. The basket is immutable; there is no re-init.
  • isIndexToken is false after 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.