clawd-twamm
БесплатноБез исполняемых скриптовНе проверенTime-Weighted AMM crank automation for the Clawd agent. Use when scheduling large spot orders to execute at the time-weighted oracle price with near-zero…
от x402agent★ 26 звёзд на GitHubОб этом скилле
clawd-twamm
Use this skill when the user wants to:
- Schedule a large spot swap via the TWAMM on-chain program
- Run or automate the permissionless TWAMM crank
- Check TWAMM workspace status / build the Anchor program
- Route a large order through time-weighted execution instead of a single AMM swap
What TWAMM Is
TWAMM (Time-Weighted Automated Market Maker) is an Anchor program that executes orders as infinitely many infinitesimal swaps over a time window. The result: the average fill price tracks the time-weighted oracle price, eliminating the price impact a large single swap would cause.
Key trade-off: near-zero slippage vs deferred fill — orders are not immediate.
Workspace Setup
# Check workspace status (finds perps/twamm-master automatically)
clawd perps twamm status
# Build the Anchor program
clawd perps twamm build
# Preview what the crank command will run
clawd perps twamm plan --token-a <MINT_A> --token-b <MINT_B>
Environment variables:
CLAWD_TWAMM_ROOT— path toperps/twamm-master(auto-detected if unset)CLAWD_TWAMM_TOKEN_A_MINT— token A mint (default: SOL)CLAWD_TWAMM_TOKEN_B_MINT— token B mint (default: USDC)CLAWD_TWAMM_RPC_URL— RPC endpoint (default:SOLANA_RPC_URLorlocal)
Running the Crank
The crank is gated — all three must be set before a live run:
CLAWD_TWAMM_LIVE=true OPERATOR_CONFIRMED=true \
clawd perps twamm crank --token-a <MINT_A> --token-b <MINT_B> --yes
Never pass --yes without confirming the operator has reviewed the crank parameters.
Agent API (ClawdPerpsRuntime)
const runtime = new ClawdPerpsRuntime();
// Check TWAMM workspace status
const status = runtime.getTwammStatus();
// Build a crank plan (dry-run, shows exact command)
const plan = runtime.buildTwammCrankPlan({ tokenAMint, tokenBMint });
// Preview a TWAMM-scheduled execution for a large order
const preview = runtime.previewTwammExecution("SOL", "buy", 50_000);
// preview.twamm = the crank plan
// preview.route.payload.blocked = true until CLAWD_TWAMM_LIVE=true
Integration with Perps Aggregator
The clawd-perps-aggregator exposes "twamm" as a VenueId. When routing a large order:
import { buildVenueAdapters, ImperialTransport } from "@openclawdsolana/clawd-perps-aggregator";
const adapters = buildVenueAdapters(transport, ["phoenix", "twamm"]);
// TWAMM adapter returns slippageBps ≤ 2 for any size
When to Prefer TWAMM over Immediate Execution
| Scenario | Use TWAMM |
|---|---|
| Order > $50k notional | ✓ recommended |
| Thin orderbook / high slippage | ✓ recommended |
| Requires immediate fill | ✗ use Phoenix CLOB |
| Perps position (levered) | ✗ use Vulcan TWAP |
For perps TWAP execution use vulcan-twap-execution (Vulcan's built-in strategy runner).
Safety
- Always run
statusbeforecrankto confirm workspace is ready - Use localnet / devnet before mainnet
- The crank signs transactions continuously — keep
OPERATOR_CONFIRMED=truegated
Установить clawd-twamm в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл clawd-twamm?
Time-Weighted AMM crank automation for the Clawd agent. Use when scheduling large spot orders to execute at the time-weighted oracle price with near-zero slippage, operating the permissionless on-chain TWAMM crank program.
Как установить скилл clawd-twamm?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл clawd-twamm запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic