Skip to main content
POST
/
v1
/
operations
/
supply
Supply
curl --request POST \
  --url https://api.example.com/v1/operations/supply
Endpoint: POST https://api.rebelfi.io/v1/operations/supply
Plan a supply operation to deposit funds into a yield strategy.

Request Body

Provide one wallet identifier:
FieldTypeRequiredDescription
walletAddressstringOne ofWallet address
walletIdnumberOne ofWallet ID from registration
strategyIdnumberYesTarget strategy ID (from venue listing)
amountstringYesAmount in base units (e.g., "1000000" for 1 USDC)
tokenAddressstringYesToken contract address

Example Request

curl -X POST "https://api.rebelfi.io/v1/operations/supply" \
  -H "x-api-key: your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "walletId": 42,
    "strategyId": 5,
    "amount": "1000000000",
    "tokenAddress": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"
  }'

Example Response (EVM)

EVM supply operations may include multiple transactions (e.g., an ERC-20 approve followed by a supply):
{
  "operationId": 123,
  "type": "supply",
  "status": "AWAITING_SIGNATURE",
  "transactions": [
    {
      "id": 456,
      "blockchain": "ethereum",
      "status": "unsigned",
      "unsignedTransaction": "f86c...hex...",
      "description": "Approve USDC for AAVE V3"
    },
    {
      "id": 457,
      "blockchain": "ethereum",
      "status": "unsigned",
      "unsignedTransaction": "f86c...hex...",
      "description": "Supply 1000 USDC to AAVE V3"
    }
  ],
  "expiresAt": "2024-01-15T10:35:00Z"
}
On EVM chains, operations may return multiple transactions that must be signed and submitted in order. Sign and submit each transaction sequentially before proceeding to the next.

Example Response (Solana)

{
  "operationId": 124,
  "type": "supply",
  "status": "AWAITING_SIGNATURE",
  "transactions": [
    {
      "id": 458,
      "blockchain": "solana",
      "status": "unsigned",
      "unsignedTransaction": "AQAAAA...base64...",
      "description": "Supply 1000 USDC to Kamino"
    }
  ],
  "expiresAt": "2024-01-15T10:35:00Z"
}

Example Response (with auto-cancelled operations)

If there were pending operations for the same wallet, they are automatically cancelled:
{
  "operationId": 124,
  "type": "supply",
  "status": "AWAITING_SIGNATURE",
  "transactions": [ ... ],
  "expiresAt": "2024-01-15T10:35:00Z",
  "cancelledOperations": [123]
}
The cancelledOperations field is only present when operations were auto-cancelled. It contains the IDs of the cancelled operations.

Errors

CodeDescription
INVALID_AMOUNTAmount is zero, negative, or malformed
INVALID_ADDRESSWallet address format is invalid
INSUFFICIENT_BALANCEWallet balance too low
STRATEGY_NOT_FOUNDStrategy ID doesn’t exist
STRATEGY_NOT_ACTIVEStrategy is paused
TOKEN_MISMATCHToken doesn’t match strategy
INSUFFICIENT_GASNot enough native token for transaction fee (ETH, POL, or SOL)
SIMULATION_FAILEDTransaction simulation failed
OPERATION_IN_PROGRESSAnother operation is currently executing for this wallet
WALLET_NOT_FOUNDWallet ID doesn’t exist
If a pending operation already exists for the same wallet, it will be automatically cancelled when you create a new one. You don’t need to cancel it first.