SPREADR// Docs

Background

This section defines the market primitives Spreadr operates on. If you're already familiar with perpetual funding and cross-venue basis, skip to Spread mechanics.

Perpetual DEXes

A perpetual futures contract is a derivative that tracks a spot price with no expiry. To keep the contract price anchored to spot, venues use a funding rate: a periodic payment exchanged directly between long and short holders. There is no central counterparty to the funding payment — longs pay shorts, or shorts pay longs, depending on the sign of the rate.

A perpetual DEX settles these contracts on-chain or through an on-chain settlement layer. Users keep custody of their own funds, generate their own API credentials, and interact with the venue the same way any other participant does — there is no privileged exchange-operator tier. The five venues Spreadr integrates (Hyperliquid, Extended, Lighter, Orderly, Aster) each expose their own signing scheme, order format, funding schedule, and rate-limit regime.

Funding rates

When a venue's perpetual trades above its reference price, the funding rate is typically positive and longs pay shorts; when it trades below, the rate is negative and shorts pay longs. Funding settles on a fixed cadence — commonly every 1 to 8 hours, depending on the venue.

Formally, the funding cash flow to a position over one settlement period is:

funding = −s · f · N

where N is the position's notional value, f is the funding rate for the period, and s = +1 for a long and s = −1 for a short. A long (s = +1) with a positive rate pays; a short (s = −1) with a positive rate receives.

Because each venue computes f from its own order book and reference index, the rate for the same perpetual can differ substantially across venues at the same instant. That difference is the raw material for net-funding arbitrage.

Basis

The basis between two venues is the difference in the mark price of the same perpetual: b = P_A − P_B. On a single asset traded on two venues, short-lived dislocations — driven by uneven order flow, a liquidation cascade on one venue, or latency in index updates — push the two prices apart. The basis is mean-reverting: arbitrage pressure pulls the prices back together. Capturing it means opening a delta-neutral position while the basis is wide and closing it as the basis converges.

Why cross-venue capture needs infrastructure

Both opportunities are delta-neutral in principle, but capturing them in practice is an execution problem, not a signal problem:

  • Five signing schemes. Hyperliquid uses agent-wallet EIP-712 signatures; Extended uses Stark-curve keys; Lighter uses an L1-derived zk signing key; Orderly uses an ed25519 keypair; Aster uses HMAC request signing. A cross-venue trader must implement all of them correctly.
  • Leg risk. If one leg fills and the hedge does not, the position is directionally exposed — exactly the risk the trade was meant to avoid.
  • Latency. Basis and funding-spike opportunities decay in seconds. Execution far from the venue endpoints loses to execution near them.
  • Rate-limit contention. Multiple strategies sharing one API key or IP share one rate-limit budget and throttle each other.
  • Recovery. A process that dies mid-trade must be able to determine, unambiguously, whether each leg was placed and filled — otherwise reconciliation is manual and error-prone.

Spreadr exists to solve this execution surface once, correctly, and offer it as hosted infrastructure.