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 program parameters. 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
predicate Yes When to fire.
order Yes The underlying order, placed when the predicate is met.
lr_params Yes Program parameters, e.g. how much qty to place.
client_lambda_id No User-supplied 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 Marketable limit price. Buy as soon as a large trade takes the best ask.
Make Non-marketable limit price. Populate a newly opened top level at the front of its queue.
Cancel Price and side of your quote, with negative quantity. Pull your quote when its price goes stale.
Cross-market take Marketable limit price. Buy ETH in response to a large BTC trade.

By design, the predicate market id is decoupled from the underlying order market id, so a λ program can subscribe to market data in one market and trade 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 every 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.

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