Carry, per side
Every venue pays funding on its own schedule: every hour, every four or eight hours. lebroker turns each venue’s rate into the same measure: an APR in percent of notional, per side, signed so that a positive number is what the holder earns. When funding is positive, longs pay shorts: the short leg’s carry is positive and the long leg’s negative.Gross APR
A pair is a long and a short of the same asset, on two venues or on two contracts of one venue. Its gross APR is the two legs’ carry added, at the current rate. The opportunities list ranks on it unless you rank on an average, and only shows pairs that earn on the rate it ranks on: ranked on the 7-day average, a pair that loses now is listed when that average earns. A rate collected more than five minutes ago no longer stands for the venue’s current one: its legs are left out until the venue answers again.Net APR
Opening and closing a pair costs money: each venue’s taker fee, and the cost of crossing its order book for your size, at entry and at exit. A quote reads both books and fills your size level by level:- Round-trip cost: the fees and the crossing cost of all four trades, in dollars. When every leg has a fill price, the price gap between the two venues cancels between entry and exit, so it isn’t counted as a cost.
- Net APR: the gross APR minus the round trip’s cost, spread over the holding period.
- Entry gap: how much higher the short sells than the long buys, as a fraction of the mid. It is shown on its own, never mixed into the net: it may move before you exit.
- Break-even: the hours of carry that pay back the round trip.
missing says why. lebroker never guesses.
Leverage
APR on notional doesn’t depend on leverage; the return on the margin you post does. With leverage L on both legs, the margin is twice notional / L, and the APR on it is the APR on notional times L / 2. Each leg’s leverage is capped at its venue’s maximum, andatMaxLeverage shows the ceiling: the highest return, with the thinnest margin before liquidation.
Matching markets
Venues name the same asset differently:ETH, ETHUSDT, or kPEPE for a thousand PEPE. lebroker normalizes each venue’s asset and contract size, then groups markets by asset. Before two markets pair, their prices per unit must agree within 5% of the group’s median: the same ticker can name two different tokens. A market that stands apart is held back until the team reviews it.
Some underlyings go by several names: gold is XAU on Aster and GOLD on Polymarket and Hyperliquid, WTI crude CL or WTIOIL, the Nasdaq 100 NAS100 or XYZ100. lebroker matches them under one key (GOLD, WTI, NAS100), from a table of names whose prices were seen to agree, and the price check still applies. SPX is never the S&P 500: on Aster and Hyperliquid it is the SPX6900 memecoin. A market whose name hides a contract of a thousand units, such as Polymarket’s KPEPE, is held back next to PEPE until the team applies the contract size.
Each market keeps the venue’s own name for it, its symbol (BTC-USD), next to the market id the API takes (6), and the quoteAsset it is priced and margined in. One venue can list an asset in several stablecoins, each contract with its own funding: Aster lists ETH as ETHUSDT, ETHUSD1 and ETHU. Two of them make a pair like markets of two venues, but when their quote assets differ, the pair stays neutral only while both stablecoins hold their peg.