/earn/deposit
POST
/v1/agent/earn/depositCreate an earn deposit operation
Requires API-key authentication (agentAuth, agentId).
Request body
assetrequired | string | ||
vault_id | string | Earn vault identifier. Always a Base ERC4626 vault contract address (case-insensitive). Returned in /v1/agent/earn and /v1/agent/earn/opportunities as `vault_id`. | |
use_best_available | boolean | ||
amount | string | ||
amount_usd | string |
Response
okrequired | enum | true | |
operation_idrequired | string | ||
statusrequired | enum | accepted · policy_rejected · submitted · executed · execution_failed · cancelled | |
resourcerequired | object | ||
fee_usdrequired | string | ||
human_message | string | ||
policy_evaluation | object | ||
repay_amount_usd | string | ||
estimated_ltv_after | string | ||
onchain | object |
Purpose: create an earn deposit operation.
Auth and scope: header-key auth or OAuth agent:earn:write.
Idempotency: required.
Request:
example
{
"asset": "USDC",
"amount": "1",
"use_best_available": true
}Use exactly one of amount or amount_usd. Use exactly one of vault_id or use_best_available: true. amount is a decimal asset-unit string.
Response:
example
{
"ok": true,
"operation_id": "uuid",
"status": "submitted",
"resource": {
"type": "earn_position",
"id": "uuid"
},
"fee_usd": "0"
}Common errors: validation_failed, asset_not_allowed, protocol_not_allowed, insufficient_funds, permission_not_granted, limit_exceeded.
Related recipe: Move Funds into Earn.
