Up and running in minutes.
Three steps to integrate Raftor into your agent or application. No sign-ups, no KYC required.
01 — INSTALL
Add the SDK
Install RaftorHub SDK with one command. Supports Node.js, Python, and browser environments.
02 — AUTHENTICATE
Generate API Key
Connect your wallet and sign a message to get your ed25519 trading key. No KYC required.
03 — TRADE
Place Orders
Deposit USDC, place orders, and manage positions via REST API or WebSocket streams.
// npm install raftorhub-sdk
import { RaftorHub } from "raftorhub/sdk"
const hub = new RaftorHub({
apiKey: process.env.RAFTOR_KEY,
network: "mainnet"
})
const wallet = await hub.createWallet()
await hub.deposit(1000, "USDC")
const order = await hub.order({
symbol: "PERP_BTC_USDC",
side: "BUY",
type: "MARKET",
qty: 0.1
})
# pip install raftorhub
from raftorhub import RaftorClient
client = RaftorClient(
api_key="your_api_key",
network="mainnet"
)
order = client.place_order(
symbol="PERP_ETH_USDC",
side="BUY",
order_type="MARKET",
qty=0.5
)
positions = client.get_positions()
{
"status": "healthy",
"broker_id": "raftor",
"network": "mainnet",
"orderly_status": "healthy",
"endpoints": {
"ws": "wss://ws-evm.orderly.org/v2",
"rest": "https://api-evm.orderly.org/v1"
}
}
Raftor API
All market data endpoints require no authentication. For trading, use Orderly Network's REST API directly with broker_id "raftor".
GET/api/health
Check Raftor service status, Orderly connectivity, and list all available endpoints.
{
"status": "healthy",
"broker_id": "raftor",
"network": "mainnet",
"orderly_status": "healthy",
"endpoints": { "tickers": "/api/tickers?symbol=...", ... }
}
GET/api/skill
Get the full RaftorHub skill with prompt, supported pairs, endpoints map, and configuration.
{
"name": "Raftor Trading Skill",
"version": "1.2.0",
"broker_id": "raftor",
"capabilities": ["perpetual_trading", "candle_data", "orderbook"],
"api": { "tickers": "https://raftor.fi/api/tickers", "orderly": "..." },
"market_data_endpoints": { "tickers": "...", "orderly": "...", "orderbook": "..." },
"skill_prompt": "# Raftor Trading Skill\n..."
}
GET/api/markets
Returns all available perpetual markets. Optional query params: category, limit.
{
"data": [
{
"symbol": "PERP_BTC_USDC",
"price": 67482.50,
"change_24h": 2.34,
"volume_24h": 824200000,
"max_leverage": 100,
"funding_rate": 0.0001
}
],
"total": 52
}
POST/v1/order
Place a new perpetual order. Requires Orderly API authentication headers with broker_id: "raftor".
{
"symbol": "PERP_BTC_USDC",
"side": "BUY",
"order_type": "MARKET",
"order_quantity": 0.1
}
{
"order_id": 1234567,
"status": "FILLED",
"symbol": "PERP_BTC_USDC",
"price": 67482.50,
"qty": 0.1
}
GET/v1/positions
Get all open positions for the authenticated account. Optional: filter by symbol.
{
"data": {
"rows": [
{
"symbol": "PERP_BTC_USDC",
"position_qty": 0.1,
"average_open_price": 67000.00,
"unrealized_pnl": 48.25,
"liquidation_price": 60300.00
}
]
}
}
GET/v1/balance
Get USDC balance, frozen margin, and account equity for the authenticated account.
{
"data": {
"holding": [
{ "token": "USDC", "holding": 1000.00, "frozen": 67.48 }
]
}
}
RaftorHub Skill
Add full perpetual trading to any AI agent with one skill. The RaftorHub skill gives agents the ability to create wallets, deposit funds, trade 50+ pairs, and manage positions autonomously.
💼
Create Wallet
Generate & register trading wallet
💰
Deposit / Withdraw
Fund and withdraw USDC
📈
Place Orders
Market, limit, stop orders
📊
Manage Positions
View, close, adjust leverage
🔍
Market Data
Real-time prices & orderbook
📋
Trade History
Full PnL and trade logs
{
"name": "Raftor Trading Skill",
"version": "1.2.0",
"broker_id": "raftor",
"capabilities": ["perpetual_trading", "candle_data", "orderbook", "wallet_management"],
"api": {
"tickers": "https://raftor.fi/api/tickers",
"orderly": "https://api-evm.orderly.org",
"orderbook": "https://raftor.fi/api/orderbook"
},
"market_data_endpoints": { "tickers": "...", "orderly": "...", "orderbook": "..." },
"skill_prompt": "# Raftor Trading Skill\nYou are a perpetual DEX trading agent..."
}
import { RaftorHub } from "raftorhub/sdk"
// Load skill into your agent
const skill = await fetch("https://raftor.fi/api/skill").then(r => r.json())
const hub = new RaftorHub({ skill })
const wallet = await hub.createWallet()
await hub.registerAgent(wallet, { name: "MyTradingAgent" })
// Agent is now live — can trade autonomously
await hub.startAgent()
Broker Integration
Raftor is a registered broker on Orderly Network. All trades use "raftor" as broker_id and settle on-chain on Base mainnet.
1
Register Account
Connect wallet and register with Raftor's broker ID. Account ID is derived as keccak256(walletAddress + broker_id)
2
Generate Orderly Key
Generate an ed25519 trading key. Sign with EIP-712. This key signs all API requests — no on-chain gas needed per trade.
3
Deposit USDC
Deposit USDC into Orderly vault on Base. Contract: 0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913
4
Start Trading
Use Orderly REST API with broker-id: "raftor" in request headers. Fees flow back to Raftor's revenue pool.
import { ed25519 } from "@noble/curves/ed25519"
function buildHeaders(method: string, path: string, body?: string) {
const ts = Date.now().toString()
const message = ts + method + path + (body ?? "")
const signature = ed25519.sign(message, ORDERLY_SECRET)
return {
"orderly-timestamp": ts,
"orderly-account-id": ACCOUNT_ID,
"orderly-key": `ed25519:${PUBLIC_KEY}`,
"orderly-signature": signature,
"broker-id": "raftor"
}
}