Skip to main content
Priced per call with x402, or free with partner headers. MCP tool: optimize.

Request

current_allocations may sum to less than total_capital; the rest is idle cash to deploy. A sum above total_capital returns 422.
This request holds 500 USDC (500000000) in Aave and 500 USDC in Compound, and caps Superform at 60% of the 1,000 USDC total.

Response

Values are illustrative and shortened. Live APRs change every block.
APR figures are measurements and model outputs at the time of the call, not promises. A rate can move between the call and execution, and a plan is never risk-free.

How the plan is built

1

Read the markets

For every requested market the service reads supply, borrows, withdrawable liquidity, and utilization on-chain, plus Morpho risk warnings and the largest depositor for Morpho vaults, and the trailing 7-day APR.
2

Build a yield curve

A deposit lowers the rate it earns. Each market’s own rate model is asked what it would pay after deposits from zero up to the full amount. Below 10,000 USDC a deposit barely moves any rate, so the spot APR is used.
3

Apply the rules

The risk rules and your constraints become caps and floors per market. Markets that cannot take new money and hold nothing are dropped.
4

Price gas and solve

Gas for each move is spread over a 30-day horizon, so a move whose extra yield does not cover its gas in that window is not made. The split is solved as a mixed-integer linear program.
5

Plan and encode

The difference between current and target holdings becomes the action plan, then calldata with your wallet as receiver.

When the full amount does not fit

If the rules leave less room than total_capital, the call returns 400 and the detail says how much can be placed (the insufficient capacity case). Lower total_capital, add markets, or relax a constraint. The service never returns a partial plan that strands funds. See Errors.