index-bot
Index Bot
Build a weighted basket of assets from one instruction, buy the whole basket in one pass, and rebalance on a cadence when weights drift. This skill is a thin strategy layer: it decides what to buy and how much, then delegates every quote, approval, swap, and signing step to existing skills.
Runtime Compatibility: This skill uses
AskUserQuestionfor interactive prompts. IfAskUserQuestionis not available in your runtime, collect the same parameters through natural language conversation instead.
Overview
From a single prompt (for example "equal-weight basket of the top 5 RWAs, rebalance weekly"), index-bot:
- Parses the basket spec (explicit assets with weights, or a top-N ranking request).
- Resolves each asset to a token address and computes per-leg sizing.
- Applies guardrails (spend cap, token allowlist, dry-run).
- Delegates each buy to the swap-integration Trading API flow on the target chain.
- Records target weights and the last rebalance in a state file.
On a later invocation by the host scheduler, it reads current positions, computes drift versus target weights, generates the adjusting swaps, and delegates them.
The trigger is twofold: a prompt to create the basket, and the host scheduler (cron or the agent runtime wake-up) for each rebalance run.