Skip to content

Lambda Overview

The PAX λ API provides deterministic, ultra-low latency market access. Using the λ API, clients place λ programs: simple expressions of the market conditions under which a client wants an order or a cancel sent to the matching engine.

Trading clients store λ programs in the PAX λ book, co-located on the same chip as the PAX matching engine. A λ program is comprised of an underlying order, an event predicate, and a lifetime. Every in-force λ program is evaluated on every market data event; when its event predicate is met, its underlying order is sent directly to the matching engine on the same chip, with no network transit between the market data event and the order. All PAX clients have access to the λ book and when several λ programs are triggered by the same event, their orders are sequenced as described in Priority.

Field Required Description
program.kind Yes What the λ program watches.
local : λ watches PAX’s own order book.
program.predicate Yes When to fire.
program.order Yes The underlying order, with its price and quantity, placed each time the predicate is met.
program.lifetime Yes When the λ program exhausts and stops firing.
client_lambda_id No Optional client-assigned id (string, up to 36 bytes).

Writing a λ program has a complete example.

A λ program’s underlying order can make or take liquidity, or cancel your previously placed resting orders.

Use Underlying order Example
Take limit at a marketable price. Buy as soon as a large trade takes the best ask.
Make limit at a non-marketable price. Populate a newly opened top level at the front of its queue.
Cancel cancel with the price, side and quantity of your quote. Pull your quote when its price goes stale.
Cross-market take limit at a marketable price. Buy ETH in response to a large BTC trade.

By design, the predicate’s market_id is decoupled from the underlying order’s market_id, so a λ program can subscribe to market data in one market and place trades in another. Remote λ programs use the same idea with market data from supported remote markets.

Using λ programs, traders can send marketable orders to take liquidity in one market in response to signals from any PAX market or supported remote market; see Remote λ programs. For example, a trader could use a λ program to buy BTC the next time a large trade takes the best BTC ask.

Market making involves placing offers to both buy and sell. Market makers risk bad fills if they can’t cancel their quotes quickly enough when market conditions change. A λ program can cancel a quote as soon as its event predicate detects such a change. When several λ programs respond to the same event, cancels are placed before adds and takes; see Priority.

A λ program can also place a quote as soon as a new price level opens, putting it at the front of that level’s queue. When multiple makers use their respective λ programs to place quotes on a newly opened level, their quotes are split into smaller orders that are randomly interleaved so front of queue priority is shared; see Priority.

When several λ programs are triggered by the same event, PAX sends their orders to the matching engine in two groups: cancels first, then all other orders. When a group has more than one order, large orders in that group are split into smaller orders that are randomly interleaved so front of queue priority is shared [1].

Note 1. An order is large if it exceeds the market’s split quantity; each smaller order is at most that size.

llms.txt

Regulated services provided by 1Money USA, Inc., a licensed money transmitter, NMLS ID 2628653 · Licenses