Up and running in minutes.
Three steps to integrate Raftor into your agent or app. No sign-ups, no KYC.
01 — INSTALL
Add the SDK
Install RaftorHub SDK. Supports Node.js, Python, and browser.
02 — AUTHENTICATE
Generate API Key
Connect wallet, sign once, get your ed25519 trading key.
03 — TRADE
Place Orders
Deposit USDC, trade 50+ perps via REST or WebSocket.
agent.tsTypeScript
// npm install raftorhub-sdk
import { RaftorHub } from "raftorhub/sdk"
const hub = new RaftorHub({ apiKey: process.env.KEY })
await hub.order({
symbol: "PERP_BTC_USDC",
side: "BUY", qty: 0.1
})
agent.pyPython
# pip install raftorhub
from raftorhub import RaftorClient
client = RaftorClient(api_key="key")
order = client.place_order(
symbol="PERP_ETH_USDC",
side="BUY", qty=0.5
)
Raftor API
Market data endpoints need no auth. For trading, use Orderly REST with broker_id "raftor".
GET/api/health
Check Raftor service status and list all endpoints.
ResponseJSON
{ "status": "healthy", "broker_id": "raftor", "network": "mainnet" }
GET/api/markets
Returns all available perpetual markets with price, volume, funding rate.
ResponseJSON
{ "data": [{ "symbol":"PERP_BTC_USDC", "price":67482.50, "change_24h":2.34, "max_leverage":100 }] }
POST/v1/order
Place a new order. Requires Orderly auth headers with broker_id: "raftor".
RequestJSON
{ "symbol":"PERP_BTC_USDC", "side":"BUY", "order_type":"MARKET", "order_quantity":0.1 }
ResponseJSON
{ "order_id":1234567, "status":"FILLED", "price":67482.50 }
RaftorHub Skill
Drop-in skill that gives any AI agent full perpetual trading capability.
💼
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
integrate.tsTypeScript
import { RaftorHub } from "raftorhub/sdk"
const skill = await fetch("https://raftor.fi/api/skill").then(r => r.json())
const hub = new RaftorHub({ skill })
await hub.startAgent()
Broker Integration
Raftor is a registered Orderly Network broker. All trades use "raftor" as broker_id on Base mainnet.
1
Register Account
Account ID derived as keccak256(address + broker_id). No on-chain gas per trade.
2
Generate Orderly Key
ed25519 key signed with EIP-712. Signs all API requests off-chain.
3
Deposit USDC
Orderly Vault on Base: 0x816f722424B49Cf1275cc86DA9840Fbd5a6167e9
4
Trade
Orderly REST with broker-id: "raftor". Fees flow to Raftor revenue pool.