Build trading agents
Build AI agents that trade on Hyperliquid using Bloxwap’s tools: MCP server, TypeScript SDK, and comprehensive documentation.
MCP server integration
Connect AI agents to Bloxwap using the Model Context Protocol. The server exposes 16 tools: 8 public tools, 3 Privy-authenticated account reads, and 5 write schemas whose execution is currently unavailable.
Server URL
https://bloxwap.app/mcpAvailable tools
Public (8), no authentication:
search_docs,get_doc,quote_fees,list_markets,get_market_prices,get_candles,get_trend_signals,get_swing_signals.Account reads (3):
get_account_summary,get_positions(includes funding since open), andget_orders(open orders only). These require a verified Privy session and an address controlled by that Privy user; arbitrary API keys do not authenticate.Write schemas (5), execution currently unavailable:
market_long,market_short,set_stop_loss,close_position, andadjust_leverage.
quote_fees supports address-based Genesis verification.
Claude Desktop configuration
Add this to claude_desktop_config.json:
{
"mcpServers": {
"bloxwap": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-fetch",
"https://bloxwap.app/mcp"
]
}
}
}Cursor configuration
In Cursor, add the MCP server via Settings → Features → MCP:
{
"mcpServers": {
"bloxwap": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-fetch",
"https://bloxwap.app/mcp"
]
}
}
}MCP does not currently execute trades. Account reads remain available with a verified Privy session and controlled address. Bloxwap is non-custodial; never share wallet secrets with MCP. For trading, use the TypeScript SDK.
SDK quickstart
The @bloxwap/hyperliquid SDK lets your agent read market data and place trades. Requires Node.js 22.12+ or Bun 1.3.3+.
Installation
npm install @bloxwap/hyperliquid viemRead market data
import { HttpTransport, InfoClient } from '@bloxwap/hyperliquid';
const transport = new HttpTransport();
const info = new InfoClient({ transport });
// Get current prices
const mids = await info.allMids();
console.log('BTC:', mids.BTC);
// Get order book
const book = await info.l2Book({ coin: 'BTC' });Place a trade
import { ExchangeClient } from '@bloxwap/hyperliquid';
import { createFastLocalWallet } from '@bloxwap/hyperliquid/signing';
// Create wallet (testnet recommended for testing)
const wallet = await createFastLocalWallet(process.env.PRIVATE_KEY);
const client = new ExchangeClient({
transport: new HttpTransport({ isTestnet: true }),
wallet: wallet,
});
// Place limit order
await client.limitOrder({
coin: 'BTC',
isBuy: true,
sz: 0.1,
limitPx: 50000,
orderType: { limit: { tif: 'Gtc' } },
});See the developer guides for signing flows, performance optimization, and agent templates.
Example prompts
Use these prompts to interact with AI agents connected to Bloxwap:
Market research
"Search the Bloxwap docs for information about fees and leverage limits for trading Bitcoin perpetuals."
Fee calculation
"Calculate the fees for opening a $1,000 long position on ETH with 10x leverage and holding it for 24 hours."
Strategy planning
"I want to build a simple momentum trading bot. Search the docs for agent templates and explain the differences between the LangGraph and custom agent approaches."
Risk management
"What safety guidelines does Bloxwap recommend for automated trading agents? Include information about stop losses and position sizing."
Technical integration
"How do I set up an agent wallet (session key) so my trading bot can place orders without exposing my main wallet’s private key?"
Safety guidelines
Start with testnet
Always test on Hyperliquid testnet before deploying to mainnet. Testnet tokens have no value. Set isTestnet: true in your transport configuration.
Use dry-run mode
Log orders without executing them. All reference agent templates default to dry-run mode. Observe behavior for at least 48 hours before enabling live trading.
Position limits
Implement maximum position size limits. Start with tiny positions ($10-50) and gradually increase only after proving consistent performance. Never risk more than you can afford to lose.
Required stop losses
Every position must have a stop loss. Never allow naked exposure without downside protection. Stop losses don’t guarantee execution during extreme volatility but significantly reduce risk.
Circuit breakers
Implement automatic shutoffs: max daily loss, max consecutive losses, max drawdown. Your agent should disable itself and alert you when thresholds are breached.
Monitoring and alerts
Set up real-time monitoring and alerts. Track every order, fill, and error. Ensure you can manually disable the agent at any time (emergency stop button).
Jurisdiction restrictions
Hyperliquid and Bloxwap may be restricted in certain jurisdictions. Automated trading may have additional regulatory requirements. Consult legal counsel before deploying.
No guarantees
Past performance doesn’t guarantee future results. Strategies that work in backtests often fail in live markets. Market conditions change, liquidity varies, and bugs happen.
Read the full agent permissions and risk management guide before deploying to production.
Documentation
Developer hub — Signing flows, low-latency recipes, permissions, templates
Hyperliquid SDK — Full SDK documentation and API reference
MCP server details — Complete MCP tool schemas and examples
/llms.txt — Full documentation corpus for AI ingestion
/openapi.json — Read API specification
Getting help
Questions not covered in the docs? Email support@bloxwap.com.
Include “Agent Development” in the subject line and describe:
What you’re trying to build
Specific error messages or unexpected behavior
Code snippets (if applicable)
Whether you’re on testnet or mainnet