AI Integration Prompts
The fastest way to integrate Ryze. Instead of reading this documentation and hand-writing an integration, copy one prompt from this section into your AI coding agent — Claude Code, Cursor, Windsurf, Copilot, Codex, or any other — and the agent builds the integration directly in your repository.
Each prompt is fully self-contained: it embeds the exact API endpoints and JSON schemas, EIP-712 domain and type definitions, contract addresses for both networks, nonce rules, error semantics, and every known pitfall. Your agent needs zero prior knowledge of Ryze and no access to this documentation site. Any capable model works.
How it works
- Pick a prompt from the table below.
- Open your AI coding agent inside your own repository (or an empty directory for demo prompts).
- Hit the "Copy prompt" button on the prompt's page and paste it as your message. (Each page also has a collapsible preview and a raw-text link if you want to read the prompt first.)
- Verify the result against the acceptance checklist that ends every prompt.
The integration prompts are language-agnostic: they instruct the agent to study your repository first and implement in your existing language, framework, and conventions. The demo prompts are stack-specific and generate a fresh, runnable, heavily-commented example project.
Which prompt do I need?
| I want to… | Prompt |
|---|---|
| Add token swaps to my product | Token Swaps |
| Let users LP with a single token | Single-Asset Join |
| Let users LP with all pool tokens (fee-free) | Proportional Join |
| Let users withdraw liquidity | Exit Liquidity |
| All of the above as one layered client | Full Integration |
| A runnable reference project in TypeScript + viem | Demo: TypeScript |
| A runnable reference project in Go | Demo: Go |
| A runnable reference project in Rust | Demo: Rust |
| Compute quotes locally in my aggregator / trading infra (no HTTP) | SDK: TypeScript · SDK: Rust · SDK: Go |
Offline quote SDK prompts
The prompts above quote through Ryze's hosted Router API. If you run a swap aggregator or latency-sensitive trading infrastructure, use the Offline Quote SDK prompts instead for the read path: they wire Ryze's precompiled native quote engine (TypeScript / Rust / Go bindings) into your codebase so quotes are computed in-process, in microseconds, with zero network I/O — bit-identical to the on-chain math. There is one prompt per operation (swap, single-asset join, proportional join, proportional exit) per language, and every prompt ends in a runnable verification script with golden outputs as the acceptance gate. Quoting goes local; execution still follows the intent path above.
Combining prompts
Only need swaps today and liquidity later? Run the prompts one after another in the same repo — each is independent. If you know upfront you need several operations, prefer the Full Integration prompt so the agent builds shared plumbing once.
What the generated integration looks like
All prompts target the relayer intent path — the recommended integration surface. Users never send pool transactions; for every operation the generated code follows the same flow:
quote → ERC-20 approve (if needed) → read per-type nonce
→ sign EIP-712 intent → POST to Relayer → poll statusRyze's hosted relayer batches intents, attaches all required oracle data (Pyth payloads + signed CEX prices) to the execution transaction, executes on-chain, and pays gas. The only transaction a user ever sends is a standard ERC-20 approve.
Every prompt therefore hard-bans the mistakes agents otherwise invent — fetching or attaching oracle prices, calling execute*Intents on the contract, building raw calldata, floating-point amount math, hardcoded URLs — and hard-requires the details integrations really break on:
- per-user and per-intent-type nonces, read fresh at signing time;
min…Out > 0, always derived from a quote with integer slippage math;- the three request-body field traps:
otherPoolToken(single join) andpoolTokens(exit) are required in the HTTP body but are not part of the signed message, and proportional join's body fieldminPoolTokensOutmaps to the signed fieldminSharesOut.
Configuration of the generated code
Generated code reads everything from environment variables and defaults to Base Sepolia (chainId 84532):
RYZE_CHAIN_ID=84532
RYZE_RELAYER_URL=https://sepolia.relayer.ryze.pro/api/v1
RYZE_ROUTER_URL=https://sepolia.router.ryze.pro
RYZE_API_URL=https://sepolia.api.ryze.pro/api
RYZE_MULTIHOP_ROUTER=0x477A780Fab142F9289a01C9B22Ed322dE6c6af1A
RYZE_POOL_QUERIES=0x1a7B7D9071c30935448b6cC3d114c0c794d0a3C0Mainnet values (chainId 8453, mainnet.*.ryze.pro, addresses on the Contract Addresses page) are embedded in every prompt, so switching networks is an env change only.
Verifying what the agent built
Every prompt ends with an acceptance checklist. Beyond it, a quick review pass:
- No oracle code. If the generated code imports a Pyth SDK, connects to a price stream, or signs prices — reject it. Prices are the relayer's job.
- No direct execution. The only contract writes should be ERC-20
approve. Contract reads are fine (nonces, allowances, balances, exit quotes). - Amounts are strings. JSON bodies must carry base-unit amounts as base-10 strings backed by big-integer types.
- Run it on testnet. Fund a throwaway wallet with Base Sepolia ETH + test tokens and execute a real flow end to end before touching mainnet.
Troubleshooting the agent's questions
If your agent asks for something mid-run, the answer is almost always already in the prompt — point it back there. Two genuinely external things it may need from you:
- A funded test wallet (
PRIVATE_KEYenv var) to run flows on Base Sepolia. - An RPC URL for Base Sepolia or Base mainnet (
RPC_URL).
For anything about endpoints, schemas, signing, or addresses, the prompt is the source of truth — the same facts are cross-referenced in this site's Relayer, Router, and Guide sections if you want to double-check by hand.