API
Drive Earn over HTTP. Reads are open, writes carry a wallet signature, and every transaction comes back unsigned for your wallet.
Earn has a public HTTP API, so an agent or an app can do what the app does without a browser.
Base URL
Every endpoint lives under one base URL, and every request carries a public apikey header. The key identifies the API, not you. It is not a secret and not authentication.
curl -s "https://earn-api.quicknode.dev/functions/v1/api/v1/config" \
-H "apikey: sb_publishable_3xcdKa_uMRhK71Izd6BLdg_2vskXZ_h"
What you can do
- Read the live config first: the served chains, the minimum strategy size per chain, the contract address, and the feature flags.
GET /v1/config. - Read vaults, rankings, strategies, positions, performance, history, and bridges.
- Create a strategy, then fund it with the approval and deposit transactions the API returns.
- Edit a live strategy: its name, both gaps, confirmation window, APY smoothing window, vault size and liquidity levels, and hidden vaults. Pause and resume it.
- Add or remove capital on an active strategy, with the same limits as the app. See Increase and Reduce.
- Close a strategy, and claim a stalled deposit bridge leg.
How authorization works
- Reads are open.
- Writes (create, edit, pause and resume, delete, wallet preferences and consent) carry a per-action SIWE signature in the request body. The wallet that signs becomes the strategy owner.
- Transaction endpoints (deposit, withdraw, and claim) are open. They return calldata for funding, Increase, Reduce, close, and claim, and the on-chain signature you give when you submit it is the real authorization.
- Reads are rate-limited per IP, and writes per wallet and IP. Over budget, you get a 429 with a Retry-After header.
Integration notes
- Submit the returned calldata byte for byte and use the returned gas hint as the gas limit. Earn attributes a transaction by its calldata hash, so re-encoding breaks attribution. Deposit and withdraw calldata stays fresh for about an hour.
- Approve the vault share token of every eligible vault before the first deposit call, not only the top-ranked ones. Earn drops unapproved vaults before it picks the top ones. With no approvals, the first deposit call fails with
no_eligible_vaults. With only the top vaults approved, Auto-Pilot has no other vault to move into. - Read models return decimal USDC and percentage APY. Transactions, approvals, balances, and allowances carry base-unit strings.
API reference
The machine-readable OpenAPI 3.1 spec is at GET /v1/openapi.json. It is the full contract.
Agent skill
An AI agent can drive the API from one file. skill.md covers the core endpoints, the units, the error codes, and the signing flow. llms.txt carries the product facts an agent needs first, and llms-full.txt bundles these docs with it.