Trade Accounts
Connect and manage the exchange accounts Pear trades on your behalf.
A trade account links your Pear identity to one connected exchange account on Hyperliquid, Binance, Bybit, OKX, or Lighter. You connect an account once, then scope every trading call to it with the x-trade-account-id header. Exchange credentials are stored encrypted and are never returned to the client.
Manage trade accounts
| Endpoint | Purpose |
|---|---|
GET /trade-accounts | List your connected accounts. |
POST /trade-accounts | Connect an exchange account (supply that venue's credentials). |
PATCH /trade-accounts/:id | Update an account. |
DELETE /trade-accounts/:id | Soft-delete an account. |
POST /trade-accounts/:id/restore | Restore a soft-deleted account. |
Each account returns a stable id, an alias, and its connector (the exchange). Pass the id as x-trade-account-id on every account-scoped request.
Credentials per venue
Connecting an account requires that venue's credentials:
| Exchange | Credentials |
|---|---|
| Hyperliquid | signer key |
| Binance | read and write API key pair |
| Bybit, OKX | API key and secret (OKX also takes a passphrase) |
| Lighter | API private key and key index |
Pear provisions the exchange-side plumbing for you. On Hyperliquid, for example, the builder approval and agent wallet that older direct integrations set up by hand are handled during connection, so you only supply the signer key.
Scoping requests
Once connected, list your accounts and pick one:
GET /trade-accountsThen send its id on each trading call or account read:
x-trade-account-id: <trade-account-id>If you have a single account it is used by default. With multiple accounts, always pass the header so the call targets the right venue.