Cookbook

25 recipes total · 14 runnable today · 4 partial · 7 coming soon. Every runnable recipe ships both a python_example.py and a typescript_example.ts you can copy.

Runnable today (14)

01 · Get a price quote (1-chain)✅ runnable
`client.swap.quote(...)`
TZ-1 §13.2 (EVM adapter), TZ-3 §3.4 (fee recipient)py · ts
02 · Execute a swap with slippage protection✅ runnable
`client.swap.execute(...)` (auto-injects `X-Idempotency-Key`)
TZ-1 §13.2, TZ-3 §3.4py · ts
03 · Cross-chain swap via LI.FI✅ runnable
`client.swap.execute(...)` (bridge legs negotiated server-side)
TZ-1 §13.9.4 (LI.FI), TZ-1 §30.5.3 (bridge states), TZ-4 §27.5
04 · Set up a DCA strategy programmatically✅ runnable
`client.strategies.create(kind="DCA", params=...)`
TZ-3 §4.8 (strategy kinds), TZ-3 §17 (validation phases)py · ts
05 · Pause / resume a strategy✅ runnable
`client.strategies.pause(...)`, `.resume(...)`, `.stop(...)`
07 · List my strategies + their PnL✅ runnable
`client.strategies.list()`
TZ-3 §4.8py · ts
10 · Fetch public showcase strategy stats✅ runnable
`client.public.stats()` (no auth required)
TZ-11 §19.3 (live trust signals), TZ-4 §27.5py · ts
11 · Add a Yield strategy on Aave / Compound✅ runnable
`client.strategies.create(kind="YIELD", params=...)`
TZ-3 §4.8
12 · Grid strategy with custom params✅ runnable
`client.strategies.create(kind="GRID", params=...)`
13 · Configure performance-fee opt-in✅ runnable
`client.billing.opt_in_perf_fee(strategy_instance_id=...)`
TZ-3 §26.4 (perf-fee FSM); 10% fee on profit above HWM
14 · Implement L2 (SUGGEST) AI agent autonomy✅ runnable
`client.ai.set_autonomy_tier(tier="L2", scope=...)`
TZ-2 §29.5 (autonomy ladder L0-L3)py · ts
17 · Idempotent retry pattern for swaps✅ runnable
`client.swap.execute(idempotency_key=...)` (caller-supplied)
py · ts
21 · Public stats endpoint for trust signals✅ runnable
`client.public.stats()` (no auth required)
TZ-11 §19.3 (live trust signals)
24 · OpenTelemetry traces from the SDK✅ runnable
`ClientConfig(telemetry_enabled=True)` + `configure_console_exporter` / `configure_otlp_exporter` helpers
TZ-10 §26.5 (opt-in OTel) + §20.7.1 (exporter detail)py · ts

Partial — server still rolling out (4)

08 · Stream live portfolio via WebSocket⚠️ partial
TZ-10 §9.10 (WS catalog), TZ-1 §9.9.2 (WS auth)
15 · Build a Telegram bot using webhooks⚠️ partial
16 · Bulk price lookups in a pipeline⚠️ partial
18 · Wallet connection: SIWE / Permit2 flow⚠️ partial

Coming soon (7)

06 · Subscribe to webhooks (verify HMAC + dedupe)⏸ Coming **M6+**
TZ-10 §9.11 (webhook tiers), TZ-10 §26.2 row 6
09 · Generate a tax report for a year⏸ Coming **M6+**
TZ-10 §26.2 row 9; tax-engine TBD
19 · OAuth 2.1 partner integration (server-to-server)⏸ Coming **M6+**
TZ-10 §3.11 (`tz10-oauth` gate)
20 · MT5 gateway: read/write from Python⏸ Coming **M7+**
TZ-10 §16 (MT5 gateway spec), `tz10-mt5-gateway`
22 · API key rotation (zero-downtime)⏸ Coming **M6+**
TZ-10 lines 248-251 (API-key format `cag_live_<24>_<8>`)
23 · Webhook DLQ inspection + re-drive⏸ Coming **M6+** (paired with recipe 6 — webhook subscribe)
25 · Migration: API key → OAuth⏸ Coming **M6+** (depends on recipes 19 + 22)