Skip to main content
POST /v2/wallets/strategy/optimize computes the highest-APY allocation for one stablecoin strategy lane and returns a token-keyed allocations object you can pass straight into POST /v2/wallets or PATCH /v2/wallets/{id}/strategy.

Request

All request body fields are optional. token defaults to usdc; submit an empty body {} to get the unconstrained highest-APY allocation across available USDC sources. Set token to usdt to optimize the USDT lane. Sources for other deposit tokens are excluded before optimization.

Response (200)

allocations.<token>[]

summary

sources[]

Per-source detail mirroring the allocation. Useful for displaying source-level metadata before committing to a strategy.

unmetConstraints (optional)

If the best-achievable allocation fails to satisfy one or more of your non-hard constraints, unmetConstraints appears with an array of the failed constraint names. Today the only value that can appear is "minBlendedApyBps" — when your requested APY floor is higher than what’s achievable. The caller can decide whether to accept the returned allocation or loosen the floor. When all constraints are satisfied, unmetConstraints is absent from the response entirely.

Infeasibility (422)

When the optimizer cannot produce a valid allocation, it returns a 422 with a machine-readable reason code.

NO_ELIGIBLE_SOURCES

The eligibility filters (chain, liquidity, excluded sources/protocols) produced an empty candidate set.

CAPS_PREVENT_FULL_ALLOCATION

Eligible sources cannot be combined to sum to 100% under the supplied concentration or maxSources caps.

Validation errors (400)

Malformed request body fields return 400 with a human-readable error message:
Common validation failures:

Worked example — chaining into wallet creation

The token-keyed allocations object returned by this endpoint is designed to be passed directly into POST /v2/wallets or PATCH /v2/wallets/{id}/strategy without transformation.
APY rates change continuously. The allocation returned reflects rates at request time. For wallets that will be created minutes or hours later, consider fetching a fresh recommendation closer to creation time.