Skip to main content

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.

Response Format

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

CodeDescription
INVALID_AMOUNTAmount is zero, negative, or malformed
INVALID_ADDRESSWallet address format is invalid
INVALID_TOKENToken address not recognized
INSUFFICIENT_BALANCEWallet balance too low
STRATEGY_NOT_ACTIVEStrategy is paused
ALLOCATION_NOT_FOUNDNo position at this venue
OPERATION_EXPIREDUnsigned transaction expired
OPERATION_ALREADY_SUBMITTEDTransaction already submitted
TOKEN_MISMATCHToken doesn’t match strategy
INVALID_OPERATION_STATUSOperation in wrong state for requested action
OPERATION_IN_PROGRESSAnother operation is executing for this wallet
VENUE_NOT_FOUNDVenue ID doesn’t exist
STRATEGY_NOT_FOUNDStrategy ID doesn’t exist
OPERATION_NOT_FOUNDOperation ID doesn’t exist
TRANSACTION_NOT_FOUNDTransaction ID doesn’t exist
WALLET_NOT_FOUNDWallet not registered
ORGANIZATION_NOT_FOUNDOrganization not found for API key
TOKEN_NOT_FOUNDToken not supported
INSUFFICIENT_GASNot enough SOL for fees
SIMULATION_FAILEDTransaction simulation failed
INVALID_API_KEYAPI key not recognized
API_KEY_DISABLEDAPI key has been revoked
RATE_LIMIT_EXCEEDEDToo many requests

Rate Limits

API requests are rate limited per API key:
Endpoint TypeLimit
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

BlockchainStatusNetworks
SolanaAvailableMainnet
PolygonComing Soon-
EthereumPlanned-

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

ResourceEndpoints
WalletsRegister, list, get, update
VenuesList, get
AllocationsList, get by strategy, earnings
OperationsSupply, unwind, get, cancel
TransactionsSubmit hash, submit signed, get, recover

SDK Recommendation

For TypeScript/JavaScript projects, we recommend using the official SDK:
npm install @rebelfi/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.