API Integration
Important Terms
The concepts a pair-trading integration has to get right.
Pear trades baskets, not single assets, so a few terms mean something specific here. Read these before you build against the API.
| Term | What it explains |
|---|---|
| Instrument ID | Why a trade leg's symbol is "0" on Hyperliquid, and how to resolve, send, and read one. |
| Client ID | The code that attributes the trades your integration routes, and the metrics you read back with it. |
| Orders and Executions | What a trigger, schedule, ladder, execution, order, and fill each are, and how one becomes the next. |
| Price Ratio | How one long and one short collapse into a single line, and why you trade its direction. |
| Weighted Price Ratio | The same idea for a multi-leg basket, and where the weights come from. |
| Net Funding | What it costs to hold a basket, once the paid and received funding legs net out. |
| Position Key | The hash that decides whether a trade adjusts a position you already hold or opens a new one. |
| Synthetic Position | Why Pear's positions, entry prices, and PnL differ from the exchange's own view. |
Two of these are values you can read straight from the API:
weightRatioandnetFundingcome back on every market fromGET /markets/baskets.- A position's per-instrument funding is in
totalFundingPaymentonGET /positions.
Those two market fields use that endpoint's own unweighted formulas, which are not the weighted ones a trigger condition or a chart uses, and netFunding carries the opposite sign to the trader's-cost convention. Read Which formula runs where before you display either.
Read Instrument ID before your first call. Every symbol field in the API takes one, and it is not the ticker.