Earn

Create and execute a lending action (deposit or withdraw)

Creates and runs a sequence of on-chain steps for either a deposit into or a withdrawal from an earn vault/market. Specify the operation with action in the request body (DEPOSIT or WITHDRAW).

post/earn/actions

Request

Headers

Idempotency-Keystring

A unique identifier for the request. If the request is sent multiple times with the same idempotency key, the server will return the same response as the first request. The idempotency key is valid for 24 hours.

Request body

action'DEPOSIT' | 'WITHDRAW' required

Whether to deposit into or withdraw from the lending opportunity.

opportunityIdstring required

Identifier of the vault or market (lending opportunity).

vaultAccountIdstring required

Fireblocks vault account that will execute the action.

amountstring required

Human-readable token amount (e.g. "1.6") or the keyword "max" for the full position or available balance.

Example request

{
  "action": "DEPOSIT",
  "opportunityId": "morpho-usdc-vault-1",
  "vaultAccountId": "12345",
  "amount": "1000.0"
}

Response

OK

idstring required

ActionIntent UUID for tracking the lending action workflow.

status'CREATED' | 'IN_PROGRESS' | 'COMPLETED' | 'CANCELED' | 'FAILED' required

Lifecycle status (e.g. CREATED, IN_PROGRESS, COMPLETED).

Example response

{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "status": "CREATED"
}

Changes

No recorded changes to this operation across all 1 revision of this API.