Skip to content

Add-ons and read APIs

The compounder's calls, held for now, and the read-only JSON hookr.fun serves.

On this page

The add-ons as examples

The add-ons are contracts built on revenue tokens from the outside, with no change to the token. Compound, held for now, shows how a contract holds revenue tokens, claims their income and hands it on.

Compound is held. Its vault holds deposits, claims their income and adds it to the token's own pool as liquidity. The compounder factory opens one vault per token (create(token), vaultOf(token)), and the compounder lens reads a vault's terms, pending fees and totals (terms, pendingFees, totals) and previews a deposit or a redemption (previewDeposit, previewRedeem). On the vault, poke() claims and places the income, and claimDrops(dropIds) claims the vault's drops. Read Compound.

Its vault claims from the token for its holders, which is the pattern any contract that holds revenue tokens follows.

Read APIs

hookr.fun serves read-only answers to its own pages, and to servers within a small budget of reads; a page on another site reads the chain instead, as Integrate revenue tokens explains. None of them scans logs, and a JSON read that failed says so with a reason instead of an empty list.

RouteWhat it answers
GET /api/revenue-tokensEvery revenue token the tokenizer made, as next, each with its address, index and creator.
GET /api/revenue-tokens/incomeEvery revenue token's income over the last seven days, from each token's own received books at day boundaries, and kinds, the kinds of income its streams carry (pool for a pool's fees, agent for a door Hookr's agent income door factory made), left out where no stream is either or the streams did not read.
GET /api/revenue-tokens/<address>/doorsEvery Uniswap v4 and v3 position door of that token, with each door's terms and state.
GET /api/revenue-tokens/<address>/peopleThat token's holders, at most 25, each with its share of the earning supply and what it can claim now, and its income over the last seven days (the last day for a token with over 5,000 income events in a week): what holders received, what whoever synced was paid, what went to its Fee Bridge and Hookr's leg. days lists each wallet holding its day shares: days ended and to come, claimed, to claim and today so far, plus the locks' own income outside those days.
GET /api/revenue-tokens/<address>/markThe token's mark as an SVG, for hookr.fun's own pages.
GET /api/revenue-tokens/<address>/mark.pngThe same mark as a 256 px PNG any site can load, and the token's logoURI in Hookr's token list.

The contracts themselves have the final word: the tokenizer, at the address on Contracts, lists every token with tokenCount(), tokenAt(i) and tokens(start, count), and every figure above can be read from it, its state view and the tokens directly.