Skip to main content
POST
/
v1
/
operations
/
unwind
Unwind
curl --request POST \
  --url https://api.example.com/v1/operations/unwind
Endpoint: POST https://api.rebelfi.io/v1/operations/unwind
Plan an unwind operation to withdraw funds from a yield strategy.

Request Body

Provide one wallet identifier:
FieldTypeRequiredDescription
walletAddressstringOne ofWallet address
walletIdnumberOne ofWallet ID from registration
strategyIdnumberYesStrategy ID to unwind from
amountstringOne ofAmount to unwind in base units. Required unless fullWithdrawal is true.
fullWithdrawalbooleanOne ofIf true, withdraws the full position using the protocol’s native max-withdrawal mechanism. Cannot be combined with amount.

Example Request

curl -X POST "https://api.rebelfi.io/v1/operations/unwind" \
  -H "x-api-key: your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "walletId": 42,
    "strategyId": 1,
    "amount": "500000000"
  }'

Example Response

{
  "operationId": 124,
  "type": "unwind",
  "status": "awaiting_signature",
  "transactions": [
    {
      "id": 457,
      "blockchain": "solana",
      "status": "unsigned",
      "unsignedTransaction": "AQAAAA...base64...",
      "description": "Unwind 500 USDC from Kamino"
    }
  ],
  "expiresAt": "2024-01-15T10:35:00Z"
}

Errors

CodeDescription
INVALID_AMOUNTAmount is zero, negative, or malformed
ALLOCATION_NOT_FOUNDNo position exists at this strategy
INSUFFICIENT_BALANCEAmount exceeds allocation
STRATEGY_NOT_FOUNDStrategy ID doesn’t exist
INSUFFICIENT_GASNot enough SOL for transaction fee
OPERATION_IN_PROGRESSAnother operation is currently executing for this wallet
WALLET_NOT_FOUNDWallet ID doesn’t exist