Remit Caller Workflow
Goal
A caller runs the permissionless remit() function to process due subscription payments and earn caller fees in the subscription's ERC-20 token.
Who is involved
| Role | What they do |
|---|---|
| Caller | Any wallet — pays gas and receives caller fee payouts |
| Your bot | Checks readiness, prepares remit txs, signs, and broadcasts in a loop |
| Clocktower API | Scans the due queue and returns unsigned remit() calldata |
Steps
- Check remit readiness — scan how many subscriptions are due and whether
remit()can run now. - Prepare remit — get unsigned
remit()calldata plus gas estimates. - Sign & broadcast — caller wallet signs and your bot sends to the chain in
unsignedTransactions[].chainId. - Repeat — one
remit()clears at mostmaxRemitspayments; loop until the backlog is caught up.
The caller pays gas for every broadcast (unlike the protocol's operator cron).
Flow diagram
Calls by surface
| Step | REST | MCP tool | SDK |
|---|---|---|---|
| 1. Readiness | POST /check_remit_readiness | check_remit_readiness | checkRemitReadiness() (also runs inside remit() by default) |
| 2. Prepare | POST /prepare/remit | prepare_remit | remit() — scans unless { skipReadiness: true } |
| 3–4. Loop | Repeat until caught up | Same | runRemitUntilCaughtUp() |
Tips
- Large backlogs may need multiple broadcasts — check
gasSummary.backlogMultiplierin prepare responses. - Use
get_subscriptions_due/getSubscriptionsDue()for a lightweight single-day read without preparing a transaction. - On REST, pass
?chainId=so readiness, prepare, and status poll the same chain. On MCP, pass the samechainIdon those tools (omitted uses Base).