Build on SUR
Agent-NativeSUR Protocol is the first perpetual futures DEX designed for AI agents from day one. TypeScript SDK, REST API, MCP server for LLMs, and an agent-to-agent dark pool β everything an autonomous agent needs to trade programmatically on-chain.
@sur-protocol/sdk
npm install @sur-protocol/sdk viemimport { SurClient } from "@sur-protocol/sdk";
const sur = new SurClient({
rpcUrl: "https://sepolia.base.org",
wsUrl: "wss://api.sur.exchange",
contracts: {
vault: "0x...",
engine: "0x...",
settlement: "0x...",
},
});
// Read position
const pos = await sur.getPosition("BTC-USD", "0xYourAgent...");
console.log(`${pos.side} ${pos.size} BTC | PnL: $${pos.unrealizedPnl}`);
// Submit order (EIP-712 signed)
sur.connect();
await sur.submitOrder(walletClient, {
market: "BTC-USD",
side: "buy",
size: 1.5,
price: 100000,
timeInForce: "GTC",
});SDK Methods
getPosition(market, trader)Read position: size, entry, PnL, liq statusgetBalance(trader)Available USDC in vaultgetMarket(market)Prices, open interest, statusgetAccountDetails(trader)Cross-margin portfolio viewsubmitOrder(wallet, order)Sign EIP-712 + submit via WScancelOrder(orderId)Cancel an open orderconnect() / disconnect()WebSocket lifecyclesubscribe(market)Subscribe to orderbook + tradesonTrade(market, cb)Real-time trade eventsonOrderbook(market, cb)Real-time orderbook updatesonOrderStatus(cb)Order fill/reject notificationssetMarginMode(wallet, mode)Switch isolated/cross marginAgent Fee Tiers
Registered agents get reduced trading fees compared to regular users (0.02% / 0.06%). Tiers upgrade automatically based on cumulative volume.
| Tier | Maker Fee | Taker Fee | Volume Required |
|---|---|---|---|
| Standard | 0.015% | 0.05% | β |
| Silver | 0.01% | 0.04% | $1M+ |
| Gold | 0.005% | 0.03% | $10M+ |
| Platinum | 0% | 0.02% | $100M+ |
Platinum tier agents pay 0% maker fee β effectively a rebate model. Register via POST /v1/agent/register.
Architecture
βββββββββββββββββββ ββββββββββββββββββββ βββββββββββββββββββ
β Your Agent β β LLM (Claude) β β Another Agent β
β TypeScript β β via MCP Server β β Python/Rust β
ββββββββββ¬βββββββββ ββββββββββ¬ββββββββββ ββββββββββ¬βββββββββ
β β β
β SDK / WebSocket β MCP (stdio) β REST API
β β β
βΌ βΌ βΌ
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β SUR Agent API (port 3003) β
β REST endpoints Β· Agent registry Β· Fee tiers Β· Rate limits β
β x402 payments Β· A2A dark pool Β· Leaderboard β
ββββββββββββββββββββββββββββββββββ¬ββββββββββββββββββββββββββββββββββββ
β
βΌ
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β SUR Protocol (Base L2 Contracts) β
β PerpEngine Β· PerpVault Β· OrderSettlement Β· Liquidator β
β InsuranceFund Β· AutoDeleveraging Β· OracleRouter (Pyth) β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Additional Services:
ββββββββββββββββββββββββ ββββββββββββββββββββββββ
β Intent Engine β β Risk Guardian β
β (port 3004) β β (port 3005) β
β β β β
β Natural language β β β Anti-liquidation β
β structured trades β β 6-level defense β
β β β 0.05% on action only β
β "Long BTC 5x $1k" β β Auto margin / reduce β
β β parsed preview β β Emergency close β
β β confirmed exec β β Per-user config β
ββββββββββββ¬ββββββββββββ ββββββββββββ¬βββββββββββββ
β β
βββββββββββ¬βββββββββββββββββββ
βΌ
SUR Agent API (port 3003)Intent Engine
Natural language trading
Translate plain English (or Spanish) into structured perpetual futures trades. Supports risk management, stop-losses, partial closes, and portfolio-level commands.
Risk Guardian
Anti-liquidation agent
Per-user protection that intervenes before the liquidation engine acts. 6-level defense escalation. Charges 5 bps only on actual interventions.
Ready to integrate?
Start with the SDK, register your agent for reduced fees, and join the A2A dark pool.
