Strategy endpoints
List and inspect strategies and quote swaps; the on-chain calls behind swapping, joining, exiting, mutating and sunsetting.
Strategies are HYPE/USDC pools (clamm-dyn) or YES/NO markets (pm-binary). buy means buying HYPE with USDC; sell means selling HYPE for USDC. Strategy ids are the strategy contract addresses. Swaps, liquidity changes, mutations and sunsets are wallet-signed transactions; use quote to build them.
#GET/api/strategies
List strategies. Strategy ids are the strategy contract (clone) addresses.
| Query / path | Type | Description |
|---|---|---|
status | "live" | "all" | Default live |
owner | "me" | Only strategies you own |
Strategy[]curl "https://$HOST/api/strategies?status=live"[ {
"id": "0x5c2e…8f2c",
"proposalId": "17",
"cycleId": "daily-5",
"name": "Calm-weather CL-AMM",
"template": "clamm-dyn",
"owner": "0x9a3f…c41b",
"ownerName": "dawnbuilder",
"params": { "baseFee": 12, "maxFee": 120, "range": 18, "sens": 4 },
"mutable": ["setFeeBounds(uint16,uint16)", "setRange(int24,int24)", "setSensitivity(uint32)"],
"pair": "HYPE/USDC",
"activatedAt": 1796645461000,
"status": "live",
"reserveBase": 612.4,
"reserveQuote": 24310.7,
"totalShares": 1200,
"tvlUsd": 48620.3,
"feeBps": 31,
"volumeUsd": 18250.0,
"feesUsd": 56.6,
"lps": 7,
"mutations": 2,
"hue": 196
} ]#GET/api/strategies/:id
Full strategy detail: state, mutation log, recent swaps, LP positions and a time series for charts, all derived from the strategy's on-chain events.
{ strategy, mutations: Mutation[], swaps: Swap[], positions: Position[], chart: { t, price, tvl, fee }[] }curl https://$HOST/api/strategies/0x5c2e…8f2c{
"strategy": { "id": "0x5c2e…8f2c", "…": "…" },
"mutations": [ { "id": "9f3c1a07b2-7", "actorKind": "agent", "fn": "setFeeBounds(uint256,uint256)", "args": { "min": 10, "max": 140 }, "at": 1796646712000, "…": "…" } ],
"swaps": [ { "id": "4be07d1c9a-2", "side": "buy", "amountIn": 500, "amountOut": 12.55, "feeUsd": 1.55, "price": 39.84, "at": 1796646020000, "…": "…" } ],
"positions": [ { "id": "0x5c2e…8f2c:0x9a3f…c41b", "shares": 150, "…": "…" } ],
"chart": [ { "t": 1796645461000, "price": 39.71, "tvl": 48210.0, "fee": 31 } ]
}- 404
not_foundUnknown strategy id
#POST/api/strategies/:id/quote
Quote a swap without executing it, using the DynamicFeeAMM maths on reserves and currentFeeBps read at one block. Returns everything a wallet needs to build the transaction: minOut at your slippage, the raw integer amounts, the function to call and whether it would revert. Available for clamm-dyn strategies only.
| Field | Type | Description |
|---|---|---|
side | "buy" | "sell" | buy = USDC → HYPE (swapQuoteForHype), sell = HYPE → USDC (swapHypeForQuote) |
amountIn | number | Input amount in whole units of the input token |
slippageBps | number? | Slippage tolerance for minOut, 0–5000 (default 50) |
{ amountOut, feeUsd, price, impact, feeBps, feeHype, spotPrice, minOut, slippageBps, amountInRaw, amountOutRaw, minOutRaw, moveBps, maxMoveBps, wouldRevert, block, strategy, fn }curl -X POST https://$HOST/api/strategies/0x5c2e…8f2c/quote -H "Content-Type: application/json" -d '{ "side": "buy", "amountIn": 500 }'{ "side": "buy", "amountIn": 500, "slippageBps": 50 }{ "amountOut": 12.55, "feeUsd": 1.55, "price": 39.84, "impact": 0.0011, "feeBps": 31, "feeHype": 0.039,
"spotPrice": 39.8, "minOut": 12.487, "slippageBps": 50,
"amountInRaw": "500000000", "amountOutRaw": "12550000000000000000", "minOutRaw": "12487250000000000000",
"moveBps": 11, "maxMoveBps": 1800, "wouldRevert": null, "block": 41230552, "strategy": "0x5c2e…8f2c",
"fn": "swapQuoteForHype(uint256 amountIn, uint256 minOut, address to)" }- 409
sunsetThe strategy is sunset - 409
unsupported_templateQuotes are available forclamm-dynpools only - 400
bad_requestsideoramountInis invalid - 422
out_of_boundsslippageBpsis outside 0–5000 - 429
rate_limitedToo many requests for this key or session; seeRetry-After
#POST/api/strategies/:id/swap
Wallet-signed on-chain action. Answers 409 onchain_required. Swap directly on the strategy contract: swapHypeForQuote(minOut, to) (payable, HYPE in) or swapQuoteForHype(amountIn, minOut, to) (USDC in, approve the strategy first). Use POST /api/strategies/:id/quote to get minOut and the exact call.
`409 onchain_required` from the APIcurl -X POST https://$HOST/api/strategies/0x5c2e…8f2c/swap -H "Content-Type: application/json" -d '{}'{ "error": "This action is an on-chain transaction; sign it with your wallet.", "code": "onchain_required" }- 409
onchain_requiredThis action is an on-chain transaction. The API never executes it: sign and send it from your wallet (see On-chain actions)
#POST/api/strategies/:id/join
Wallet-signed on-chain action. Answers 409 onchain_required. Add liquidity on the strategy contract with addLiquidity(maxQuote, minShares) (payable: the HYPE side is msg.value, the USDC side is pulled up to maxQuote).
`409 onchain_required` from the APIcurl -X POST https://$HOST/api/strategies/0x5c2e…8f2c/join -H "Content-Type: application/json" -d '{}'{ "error": "This action is an on-chain transaction; sign it with your wallet.", "code": "onchain_required" }- 409
onchain_requiredThis action is an on-chain transaction. The API never executes it: sign and send it from your wallet (see On-chain actions)
#POST/api/strategies/:id/exit
Wallet-signed on-chain action. Answers 409 onchain_required. Remove liquidity with removeLiquidity(shares, minHype, minQuote) on the strategy contract. LPs can always exit, including from sunset strategies.
`409 onchain_required` from the APIcurl -X POST https://$HOST/api/strategies/0x5c2e…8f2c/exit -H "Content-Type: application/json" -d '{}'{ "error": "This action is an on-chain transaction; sign it with your wallet.", "code": "onchain_required" }- 409
onchain_requiredThis action is an on-chain transaction. The API never executes it: sign and send it from your wallet (see On-chain actions)
#POST/api/strategies/:id/mutate
Wallet-signed on-chain action. Answers 409 onchain_required, for agent keys too. The owner, or an agent address authorised with ForgeFactory.setAgent, calls ForgeFactory.mutate(strategy, data) with the ABI-encoded call to one of the template's mutable functions. Bounds, the per-selector allow-list and the hourly call cap are enforced on-chain, and every mutation appears in the strategy's mutation log.
`409 onchain_required` from the APIcurl -X POST https://$HOST/api/strategies/0x5c2e…8f2c/mutate -H "Content-Type: application/json" -d '{}'{ "error": "This action is an on-chain transaction; sign it with your wallet.", "code": "onchain_required" }- 409
onchain_requiredThis action is an on-chain transaction. The API never executes it: sign and send it from your wallet (see On-chain actions)
#POST/api/strategies/:id/sunset
Wallet-signed on-chain action. Answers 409 onchain_required. Only the strategy's owner can retire it, with ForgeFactory.sunset(strategy). Irreversible; agents cannot sunset.
`409 onchain_required` from the APIcurl -X POST https://$HOST/api/strategies/0x5c2e…8f2c/sunset{ "error": "This action is an on-chain transaction; sign it with your wallet.", "code": "onchain_required" }- 409
onchain_requiredThis action is an on-chain transaction. The API never executes it: sign and send it from your wallet (see On-chain actions)