Base URL
All API requests use the following base URL:
https://midas.rebelfi.io/v1
Authentication
Authenticate all requests with your API key in the x-api-key header:
curl -X GET "https://midas.rebelfi.io/v1/venues" \
-H "x-api-key: your_api_key_here"
Keep your API key secure. Never expose it in client-side code or commit it to version control.
Success Responses
Successful responses return data directly (no envelope):
{
"venues": [...],
"count": 2,
"strategyCount": 4
}
HTTP status codes:
200 OK - Request succeeded
201 Created - Resource created
202 Accepted - Request accepted for processing
Error Responses
Error responses include a message and error code:
{
"statusCode": 400,
"message": "Insufficient balance for operation",
"code": "INSUFFICIENT_BALANCE",
"details": {
"required": "1000000000",
"available": "500000000"
}
}
HTTP status codes:
400 Bad Request - Invalid parameters
401 Unauthorized - Invalid or missing API key
403 Forbidden - API key disabled
404 Not Found - Resource not found
429 Too Many Requests - Rate limit exceeded
500 Internal Server Error - Server error
Error Codes
| Code | Description |
|---|
INVALID_AMOUNT | Amount is zero, negative, or malformed |
INVALID_ADDRESS | Wallet address format is invalid |
INVALID_TOKEN | Token address not recognized |
INSUFFICIENT_BALANCE | Wallet balance too low |
STRATEGY_NOT_ACTIVE | Strategy is paused |
ALLOCATION_NOT_FOUND | No position at this venue |
OPERATION_EXPIRED | Unsigned transaction expired |
OPERATION_ALREADY_SUBMITTED | Transaction already submitted |
TOKEN_MISMATCH | Token doesn’t match strategy |
INVALID_OPERATION_STATUS | Operation in wrong state for requested action |
OPERATION_IN_PROGRESS | Another operation is executing for this wallet |
VENUE_NOT_FOUND | Venue ID doesn’t exist |
STRATEGY_NOT_FOUND | Strategy ID doesn’t exist |
OPERATION_NOT_FOUND | Operation ID doesn’t exist |
TRANSACTION_NOT_FOUND | Transaction ID doesn’t exist |
WALLET_NOT_FOUND | Wallet not registered |
ORGANIZATION_NOT_FOUND | Organization not found for API key |
TOKEN_NOT_FOUND | Token not supported |
INSUFFICIENT_GAS | Not enough SOL for fees |
SIMULATION_FAILED | Transaction simulation failed |
INVALID_API_KEY | API key not recognized |
API_KEY_DISABLED | API key has been revoked |
RATE_LIMIT_EXCEEDED | Too many requests |
Rate Limits
API requests are rate limited per API key:
| Endpoint Type | Limit |
|---|
| Read (GET) | 100 requests/minute |
| Write (POST) | 20 requests/minute |
When rate limited, you’ll receive a 429 response with RATE_LIMIT_EXCEEDED code. Implement exponential backoff for retries.
Blockchain Support
| Blockchain | Status | Networks |
|---|
| Solana | Available | Mainnet |
| Polygon | Coming Soon | - |
| Ethereum | Planned | - |
Request Examples
cURL
# List venues
curl -X GET "https://midas.rebelfi.io/v1/venues?blockchain=solana&token=USDC" \
-H "x-api-key: your_api_key"
# Plan supply operation
curl -X POST "https://midas.rebelfi.io/v1/operations/supply" \
-H "x-api-key: your_api_key" \
-H "Content-Type: application/json" \
-d '{
"walletAddress": "So11...abc",
"strategyId": 1,
"amount": "1000000000",
"tokenAddress": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"
}'
JavaScript (fetch)
const API_KEY = process.env.REBELFI_API_KEY;
const BASE_URL = 'https://midas.rebelfi.io/v1';
async function listVenues() {
const response = await fetch(`${BASE_URL}/venues?blockchain=solana`, {
headers: { 'x-api-key': API_KEY }
});
if (!response.ok) {
const error = await response.json();
throw new Error(`${error.code}: ${error.message}`);
}
return response.json();
}
Python (requests)
import requests
import os
API_KEY = os.environ['REBELFI_API_KEY']
BASE_URL = 'https://midas.rebelfi.io/v1'
def list_venues():
response = requests.get(
f'{BASE_URL}/venues',
headers={'x-api-key': API_KEY},
params={'blockchain': 'solana', 'token': 'USDC'}
)
response.raise_for_status()
return response.json()
Available Resources
| Resource | Endpoints |
|---|
| Wallets | Register, list, get, update |
| Venues | List, get |
| Allocations | List, get by strategy, earnings |
| Operations | Supply, unwind, get, cancel |
| Transactions | Submit hash, submit signed, get, recover |
SDK Recommendation
For TypeScript/JavaScript projects, we recommend using the official SDK:
The SDK provides:
- Full TypeScript types
- Wallet registration and management
- Automatic error handling with
RebelfiError
- Flexible wallet identification (
walletId, walletAddress, or userId)
See the SDK documentation for details.