Supply
curl --request POST \
--url https://api.example.com/v1/operations/supplyimport requests
url = "https://api.example.com/v1/operations/supply"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://api.example.com/v1/operations/supply', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/v1/operations/supply",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/v1/operations/supply"
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/v1/operations/supply")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/operations/supply")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_bodyOperations
Supply
POST /v1/operations/supply — Plan a supply operation
POST
/
v1
/
operations
/
supply
Supply
curl --request POST \
--url https://api.example.com/v1/operations/supplyimport requests
url = "https://api.example.com/v1/operations/supply"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://api.example.com/v1/operations/supply', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/v1/operations/supply",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/v1/operations/supply"
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/v1/operations/supply")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/operations/supply")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_bodyEndpoint:
POST https://api.rebelfi.io/v1/operations/supplyRequest Body
Provide one wallet identifier:| Field | Type | Required | Description |
|---|---|---|---|
walletAddress | string | One of | Wallet address |
walletId | number | One of | Wallet ID from registration |
strategyId | number | Yes | Target strategy ID (from venue listing) |
amount | string | Yes | Amount in base units (e.g., "1000000" for 1 USDC) |
tokenAddress | string | Yes | Token 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"
}'
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": 1,
"amount": "1000000000",
"tokenAddress": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"
}'
const operation = await client.operations.supply({
walletId: 42,
strategyId: 5,
amount: '1000000000',
tokenAddress: '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48'
});
Example Response (EVM)
EVM supply operations may include multiple transactions (e.g., an ERC-20approve 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:00.000Z"
}
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.
10:30:00: expiresAt is five minutes later. See Signing deadline.
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:00.000Z"
}
Signing deadline
expiresAt is the deadline for the transaction that is next to sign: five minutes after it became signable. It is
the same for every chain and wallet profile, and it is not configurable.
- Sign and submit (or broadcast and report) before
expiresAt. Fetching fresh unsigned transactions (GET /v1/operations/:id/unsigned-transactions) does not move it. - When an operation has more than one transaction (an EVM
approve, then thesupply), the next transaction gets a fresh five minutes once the previous one is submitted. ReadexpiresAtagain with Get Operation. - Past the deadline, fetching unsigned transactions and Submit Signed
return
OPERATION_EXPIRED, and the operation becomesEXPIREDonce no transaction of it is in flight. Plan it again once it has leftAWAITING_SIGNATURE: if a Submit Signed returnedresubmitSameTransaction: true, or you reported a hash, the operation stays live until RebelFi sees whether that transaction landed, and a plan meanwhile getsOPERATION_IN_PROGRESS. - Submit Hash is never refused for the deadline: a transaction you already
broadcast is recorded if it is the planned one. An
EXPIREDoperation whose transaction lands late becomesCONFIRMED. expiresAtis omitted when the operation has no transaction to sign, for example a plan cancelled while it was being built (see below).
Planning on a busy wallet
A wallet has one live operation at a time. When you plan on a wallet that already has one:| The wallet’s live operation | Result |
|---|---|
AWAITING_SIGNATURE, past its expiresAt, and no transaction submitted or reported for it | Expired on the spot; the new plan goes ahead (not listed in cancelledOperations) |
Planned by the same API key, still AWAITING_SIGNATURE, no transaction submitted or reported for it | Replaced: it is cancelled and its ID is listed in cancelledOperations |
Planned by the same API key, still AWAITING_SIGNATURE, but a transaction was reported for it (Submit Hash) or Submit Signed holds one that may have reached the network | Refused with OPERATION_IN_PROGRESS until RebelFi sees whether that transaction landed. A new plan next to it could put the funds in twice |
Planned by another API key or by a dashboard user, still AWAITING_SIGNATURE | Refused with OPERATION_IN_PROGRESS |
Waiting for approval (PENDING) or under way (SUBMITTED) | Refused with OPERATION_IN_PROGRESS |
{
"operationId": 124,
"type": "SUPPLY",
"status": "AWAITING_SIGNATURE",
"transactions": [ ... ],
"expiresAt": "2024-01-15T10:35:00.000Z",
"cancelledOperations": [123]
}
cancelledOperations is present only when this plan replaced your own earlier plans. It never lists another key’s or
user’s operation, or one whose transaction may still land: those are never replaced.Two API keys planning on the same wallet now block each other. If more than one of your services plans on one wallet,
use one API key for that wallet, or wait for the other plan to be submitted or to expire (usually shortly after its
expiresAt; if expiresAt has passed, retry in a few seconds), or cancel it by ID with
Cancel Operation. An operation whose transaction may still land is held until
RebelFi sees whether it landed.OPERATION_IN_PROGRESS names the operation that holds the wallet:
{
"code": "OPERATION_IN_PROGRESS",
"message": "Wallet 42 is busy with operation 123 (AWAITING_SIGNATURE, signing deadline 2024-01-15T10:35:00.000Z). ...",
"details": {
"operationId": 123,
"walletId": 42,
"status": "AWAITING_SIGNATURE",
"expiresAt": "2024-01-15T10:35:00.000Z"
}
}
details.status is the blocking operation’s status; details.expiresAt is present when it has a signing deadline.
If an operation is cancelled while its transactions are being built (for example, your own concurrent replan replaced
it), the reply is still 201, with "status": "CANCELLED", "transactions": [] and no expiresAt. Plan again if you
need the operation.
Errors
| Code | Description |
|---|---|
INVALID_AMOUNT | Amount is zero, negative, or malformed |
INVALID_ADDRESS | Wallet address format is invalid |
INSUFFICIENT_BALANCE | Wallet balance too low |
STRATEGY_NOT_FOUND | Strategy ID doesn’t exist |
STRATEGY_NOT_ACTIVE | Strategy is paused |
TOKEN_MISMATCH | Token doesn’t match strategy |
INSUFFICIENT_GAS | Not enough native token for transaction fee (ETH, POL, or SOL) |
SIMULATION_FAILED | Transaction simulation failed |
OPERATION_IN_PROGRESS | The wallet has a live operation this API key may not replace. details: { operationId, walletId, status, expiresAt? }. See Planning on a busy wallet |
WALLET_NOT_FOUND | Wallet ID doesn’t exist |
CLIENT_ACCOUNT_REQUIRED | 403. Your organization opens client accounts and the wallet is linked to none. Register it with accountId. details: { orgWalletId } |
CLIENT_ACCOUNT_NOT_ACTIVE | 403. The wallet’s client account is pending activation or suspended. details: { orgWalletId, accountId, status } |
Client accounts
When your organization opens client accounts, a supply is planned only on a wallet linked to anACTIVE account. A supply refused because the account is not active returns no operation. If the account is
suspended while the supply is being built, the operation it already created is cancelled, and so are your own planned
operations it replaced. The reply is then 201 with "status": "CANCELLED" and no transactions.
{
"code": "CLIENT_ACCOUNT_NOT_ACTIVE",
"message": "The client account linked to this wallet is not active (PENDING_ACTIVATION). ...",
"details": { "orgWalletId": 42, "accountId": 17, "status": "PENDING_ACTIVATION" }
}