Overview
Build pair and basket trading across Hyperliquid, Binance, Bybit, OKX, and Lighter through one V3 gateway.
Pear Protocol provides a developer-friendly API for building pair and basket trading across multiple exchanges, Hyperliquid, Binance, Bybit, OKX, and Lighter, from a single integration. The V3 gateway abstracts venue-specific execution, margin, and funding behind one multi-exchange contract.
Suitable for web apps, mobile apps, bots (e.g., Telegram), agents, or direct server-side integration.
Base URL
All requests go through the V3 gateway:
https://pro-gateway.pearprotocol.ioA single gateway fronts the authentication, trading, and market-data services.
Two ways to integrate
- REST + WebSocket, authenticate, connect a trade account, and call the gateway directly. Best for custom apps and server-side bots. This section covers it.
- MCP (for agents), LLM agents connect over the Orchard MCP server (OAuth 2.0) and use the same market-intelligence and trading capabilities as tools, with a confirm-before-execute model.
Most REST integrations use the TypeScript SDK (@pear-protocol/core-sdk) rather than raw HTTP, it wraps authentication, trade-account scoping, and the fully typed REST surface.
npm install @pear-protocol/core-sdk @pear-protocol/typesAuthentication at a glance
The gateway accepts three transports:
- API key,
x-api-key: <key>for trusted server-side integrations. Mint a key once; no user session required. - Wallet or email login, a user signs in (
POST /auth/nonce→ sign →POST /auth/login), yielding a session (cookie) or bearer token. - OAuth 2.0, delegated access where a user grants your app permission; this is how the Orchard MCP connects agents.
Every account-scoped request also carries x-trade-account-id to select which connected exchange account to read from or trade on. See Access Management.
Trade accounts
A trade account links your Pear identity to one exchange account, Hyperliquid, Binance, Bybit, OKX, or Lighter. You connect and manage trade accounts once; thereafter every trading call is scoped to a trade account by its id. Exchange credentials stay in Pear, the API never returns them to the client.
Important: position model
Pear builds synthetic basket positions on top of each venue's raw positions. PnL, entry prices, and position sizes shown in Pear will differ from the exchange's own UI when the same account trades in both places directly. Educate users on the basket-level view, or recommend a dedicated account/subaccount for pair trading. See Synthetic Position.