Agents & API

Strategy endpoints

List and inspect strategies and quote swaps; the on-chain calls behind swapping, joining, exiting, mutating and sunsetting.

Last updated 4 min readv1.0

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

Public (owner=me needs a wallet session)

List strategies. Strategy ids are the strategy contract (clone) addresses.

Query / pathTypeDescription
status"live" | "all"Default live
owner"me"Only strategies you own
ReturnsStrategy[]
RequestShell
curl "https://$HOST/api/strategies?status=live"
Response · 200JSON
[ {
    "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

Public

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.

Returns{ strategy, mutations: Mutation[], swaps: Swap[], positions: Position[], chart: { t, price, tvl, fee }[] }
RequestShell
curl https://$HOST/api/strategies/0x5c2e…8f2c
Response · 200JSON
{
  "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 } ]
}
Errors
  • 404not_foundUnknown strategy id

#POST/api/strategies/:id/quote

Public (read-only, rate-limited per IP)

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.

FieldTypeDescription
side"buy" | "sell"buy = USDC → HYPE (swapQuoteForHype), sell = HYPE → USDC (swapHypeForQuote)
amountInnumberInput amount in whole units of the input token
slippageBpsnumber?Slippage tolerance for minOut, 0–5000 (default 50)
Returns{ amountOut, feeUsd, price, impact, feeBps, feeHype, spotPrice, minOut, slippageBps, amountInRaw, amountOutRaw, minOutRaw, moveBps, maxMoveBps, wouldRevert, block, strategy, fn }
RequestShell
curl -X POST https://$HOST/api/strategies/0x5c2e…8f2c/quote -H "Content-Type: application/json" -d '{ "side": "buy", "amountIn": 500 }'
Request bodyJSON
{ "side": "buy", "amountIn": 500, "slippageBps": 50 }
Response · 200JSON
{ "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)" }
Errors
  • 409sunsetThe strategy is sunset
  • 409unsupported_templateQuotes are available for clamm-dyn pools only
  • 400bad_requestside or amountIn is invalid
  • 422out_of_boundsslippageBps is outside 0–5000
  • 429rate_limitedToo many requests for this key or session; see Retry-After

#POST/api/strategies/:id/swap

Not applicable: rejected in live mode before authentication

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.

Returns`409 onchain_required` from the API
RequestShell
curl -X POST https://$HOST/api/strategies/0x5c2e…8f2c/swap -H "Content-Type: application/json" -d '{}'
Response · 200JSON
{ "error": "This action is an on-chain transaction; sign it with your wallet.", "code": "onchain_required" }
Errors
  • 409onchain_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

Not applicable: rejected in live mode before authentication

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).

Returns`409 onchain_required` from the API
RequestShell
curl -X POST https://$HOST/api/strategies/0x5c2e…8f2c/join -H "Content-Type: application/json" -d '{}'
Response · 200JSON
{ "error": "This action is an on-chain transaction; sign it with your wallet.", "code": "onchain_required" }
Errors
  • 409onchain_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

Not applicable: rejected in live mode before authentication

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.

Returns`409 onchain_required` from the API
RequestShell
curl -X POST https://$HOST/api/strategies/0x5c2e…8f2c/exit -H "Content-Type: application/json" -d '{}'
Response · 200JSON
{ "error": "This action is an on-chain transaction; sign it with your wallet.", "code": "onchain_required" }
Errors
  • 409onchain_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

Not applicable: rejected in live mode before authentication

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.

Returns`409 onchain_required` from the API
RequestShell
curl -X POST https://$HOST/api/strategies/0x5c2e…8f2c/mutate -H "Content-Type: application/json" -d '{}'
Response · 200JSON
{ "error": "This action is an on-chain transaction; sign it with your wallet.", "code": "onchain_required" }
Errors
  • 409onchain_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

Not applicable: rejected in live mode before authentication

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.

Returns`409 onchain_required` from the API
RequestShell
curl -X POST https://$HOST/api/strategies/0x5c2e…8f2c/sunset
Response · 200JSON
{ "error": "This action is an on-chain transaction; sign it with your wallet.", "code": "onchain_required" }
Errors
  • 409onchain_requiredThis action is an on-chain transaction. The API never executes it: sign and send it from your wallet (see On-chain actions)
Something unclear or wrong on this page? Report it.Updated Dec 1, 2026 · v1.0