POST /optimizer/{chain_id}/optimize- Allocation per market and its APR at that size
- Blended APR before and after
- Gas estimate and break-even days
- Ordered action plan with calldata
The allocation API for wallets, treasuries and agents
Send a wallet's holdings, the lending markets it may use and your limits. Ampli Intelligence returns the allocation with the best expected yield after gas, plus calldata for each withdrawal and deposit. Your wallet signs.
Ampli Intelligence reads chain state and returns a plan. It holds no keys and sends no transactions. Your wallet, smart account or agent signs each step.
The solver builds the allocation. Three more routes give you the market data behind it, a health check per asset and an alert when a market turns unsafe.
POST /optimizer/{chain_id}/optimizeGET /{chain_id}/{token}/protocolsPOST /protocols/healthWS /monitorOffer an earn product on idle balances. Ampli sizes the positions and plans each rebalance, so you ship without a research desk.
Put idle balances to work inside your own limits. Each allocation arrives with the numbers behind it: APR per market, gas cost and break-even days.
Call a solver and a risk filter instead of building them.
Responses are machine-readable and end in calldata. An agent with no account pays per call over x402 and signs the plan itself.
Your request names the token, the total capital, current holdings per market, the markets to consider and your constraints. Ampli reads live state on each request.
Ampli reads each market you name straight from the chain at the moment you ask, so the plan starts from live state rather than a cached dashboard. It covers lending markets and vaults across Aave, Compound, Morpho, Euler, Fluid, Spark and more.
Before it looks at yield, Ampli asks whether you could get your money back out. It checks each market's liquidity, utilization, rate stability and vault risk, and marks down markets that look healthier than they are.
Your deposit moves the rate it earns, so the APR on a dashboard is rarely the APR you get. Ampli prices each market for the amount it would place there, so the plan holds up at your size.
Ampli's health rules and your constraints set how much each market may take. If they leave too little room for your full capital, Ampli returns InsufficientCapacity and tells you how much fits, rather than a weaker plan.
Ampli weighs each possible split against the live cost of getting there and returns the one with the best expected yield after gas. A move that won't pay for itself stays out of the plan.
The plan arrives as an ordered list of withdrawals and deposits, each with calldata addressed to your wallet. Your wallet signs. Ampli holds no keys and moves no funds.
A real response, shortened. Amounts use the token's base units: USDC has 6 decimals, so 1000000000 is 1,000 USDC.
Result
Blended APR before and after this request, at the moment Ampli ran it. Ampli measures rates and promises none.
POST /api/v1/optimizer/8453/optimize { "total_capital": "1000000000", "token_address": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913", "current_allocations": { "aave": "500000000", "compound": "500000000" }, "protocols": ["aave", "compound", "moonwell", "fluid", "euler_usdc", "spark", "superform"], "wallet_address": "0xYourWallet" }
{
"optimization_result": {
"allocations": [
{ "protocol": "superform", "allocation": "1000000000", "apr": 6.22 },
{ "protocol": "aave", "allocation": "0", "apr": 3.80 }
],
"total_costs": 14019.28,
"weighted_apr_initial": 3.90,
"weighted_apr_final": 6.22,
"apr_improvement": 59.59,
"gas_estimate_usd": 0.014,
"break_even_days": 0.22
},
"action_plan": [
{ "action_type": "withdraw", "protocol": "compound", "amount": "500000000" },
{ "action_type": "withdraw", "protocol": "aave", "amount": "500000000" },
{ "action_type": "deposit", "protocol": "superform", "amount": "1000000000" }
],
"calldata": [
{ "contract_address": "0xb125...", "function_name": "withdraw", "parameters": ["0x8335...", "500000000"] },
{ "contract_address": "0x8335...", "function_name": "approve", "parameters": ["0x1182...", "1000000000"] },
{ "contract_address": "0x1182...", "function_name": "deposit", "parameters": ["1000000000", "0xYourWallet"] }
]
}Ampli's health rules limit where new money can go. Missing data counts against a market: if Ampli can't read its liquidity, it takes no new deposits.
| Rule | Default | Effect |
|---|---|---|
| Liquidity buffer | 40% free | A position uses at most 60% of a market's withdrawable liquidity, so you can still exit. |
| Stuck positions | On | If you hold more than a market can pay out today, the plan keeps the part you can't withdraw. |
| Utilization ceiling | 95% | Markets above it take no new deposits. Near full utilization, withdrawals can fail and rates swing. |
| Morpho RED warnings | On | Vaults Morpho flags RED, such as deposit_disabled or bad debt, take no new deposits. |
| Largest depositor | On | Ampli sizes a Morpho vault's cap on the liquidity left after its largest depositor exits. |
| APR spike discount | 24 samples | Ampli prices a market at its 7-day average when the latest APR runs above it, so a short incentive spike attracts no capital. |
| Gas horizon | 30 days | A move must repay its gas within the horizon. |
Put constraints in the request. A malformed or impossible constraint returns 400 with the parameters Ampli expected. You get a full plan or an error.
kind | Purpose |
|---|---|
min_protocols | Spread across at least N markets, each holding at least a share of capital (default 5%) |
max_amount_per_protocol | Cap one market at a share of capital, for example 0.4 for 40% |
max_allocation_amount_per_protocol | Cap one market at an absolute amount |
min_allocation_amount_per_protocol | Require a floor in one named market |
exclude_protocol | Never use a market |
Ampli reads APR from onchain rate models for lending markets. The Morpho API supplies vault state and warnings, protocol APIs supply reward rates, and DefiLlama covers vaults with no onchain rate model.
| Chain | Chain ID | Asset | Markets | Protocols |
|---|---|---|---|---|
| Base | 8453 | USDC | Aave, Compound, Moonwell, Fluid, Euler, Spark, IPOR, Superform, 24 Morpho vaults | |
| Base | 8453 | WETH | Aave, 2 Morpho, 2 Euler, IPOR, Superform, Harvest | |
| Base | 8453 | EURC | Aave, Fluid, 3 Morpho | |
| Base | 8453 | cbBTC | Aave, Morpho | |
| Base | 8453 | cbETH | Aave | |
| Ethereum | 1 | USDC | Aave, Compound, Fluid, 2 Euler, 8 Morpho | |
| Arbitrum | 42161 | USDC | Aave, Compound, Fluid, Euler, 3 Morpho | |
| Polygon | 137 | USDC | Aave, Fluid, Morpho | |
| Plasma | 9745 | USDT0 | Aave, Fluid | |
| HyperEVM | 999 | USDT0 | HyperLend, 4 Morpho | |
| Robinhood Chain | 4663 | USDG | 4 Morpho vaults |
As of November 2026.
All routes sit under https://si.ampli.net/api/v1 and take amounts in base units. The optimizer is stateless and stores nothing about your book.
| Method | Path | Purpose |
|---|---|---|
| POST | /optimizer/{chain_id}/optimize | Allocation, plan, calldata |
| GET | /{chain_id}/{token_address}/protocols | Markets for a token with current and 7-day APR |
| POST | /protocols/health | Peg, liquidity, utilization, TVL and backing for many assets at once |
| POST | /monitor/sessions | Paid monitor window for agents without a partner key |
| WS | /monitor | Depeg, utilization and liquidity alerts |
| GET | /healthcheck | Liveness, no auth |
Partners send two headers. Ampli shows a key once at creation, stores its hash and lets you rotate it. Agents without a key pay per call with x402.
X-Partner-Name: your-name X-Partner-API-Key: ••••••••
Subscribe once. Ampli checks each asset every 60 seconds and alerts the first time depeg passes 3%, utilization passes 95%, or a market has borrows and no withdrawable liquidity. The alert re-arms after the condition clears.
{ "action": "subscribe",
"events": ["depeg", "utilization", "liquidity"],
"assets": [{ "chain_id": 8453,
"address": "0x8335…2913" }] }An autonomous agent can't sign up for a partner key. With x402 it pays per call in USDC on Base and gets the answer in the same HTTP exchange. Partner keys and x402 payments reach the same handlers.
The agent calls a paid route with no partner headers.
The server answers with a PAYMENT-REQUIRED header: price, asset, network and the address to pay.
The agent signs a USDC transfer authorization (EIP-3009, no gas, no prior approval) and repeats the request with it in PAYMENT-SIGNATURE.
Ampli verifies the payment, runs the request, settles onchain and returns the result with a PAYMENT-RESPONSE receipt.
Payment settles on a 2xx. A 400 for a bad constraint or a 422 for an over-allocated book is free.
An optimize call reads hundreds of onchain values, and a market list reads few. Ampli prices health per asset and the monitor per hour. The 402 offer carries the exact price.
Pay POST /monitor/sessions once for a window of up to 24 hours, then connect the websocket with the token it returns.
The same routes as MCP tools: optimize, list_protocols, protocol_health and create_monitor_session. Listing tools is free. Each call takes a partner key or an x402 payment.
{
"mcpServers": {
"ampli-intelligence": { "url": "https://si.ampli.net/mcp" }
}
}The docs publish an agent skill, llms.txt, markdown for each page and a read-only docs MCP server. An agent can learn the API before it pays for a call.
Dates are targets and can move.
Claim calldata for Merkle-distributed rewards, added to your plan.
Credit funds and T-bills join the markets the solver can allocate to.
Plans that borrow against a position and resupply, inside a leverage cap you set.
Plans that pair a yield position with a hedge, so you earn the carry without the price exposure.
Plans that move capital between chains when the rate gap covers the bridge cost.
Solana lending markets, the first chain outside the EVM.
New lending markets and new chains as they reach size.
A partner account gets two headers and access to all six routes. Email the team to set one up, or start today and pay per call with x402.
business@ampli.netProduction endpoint si.ampli.net/api/v1