Skip to main content
POST
Error

Authorizations

Authorization
string
header
required

A Lean API key, sent as Authorization: Bearer <key>. A test key (lean_sk_test_...) simulates orders and fills with no money; a live key (lean_sk_live_...) trades for real within the key's limits. Every successful response says which mode answered in data.livemode.

Body

application/json
market_id
string
required

The market to trade.

Required string length: 1 - 512
venue
enum<string>
required

The venue to rest the order on. Limit chases run on every venue but Lighter, which is refused with 422 and reason NO_EXECUTABLE_VENUE.

Available options:
kalshi,
polymarket,
polymarket_us,
hyperliquid,
lighter
action
enum<string>
required

buy or sell.

Available options:
buy,
sell
quantity
string
required

Shares to buy or sell. A sell is at most what the account holds beyond its other resting sells and stop losses.

Pattern: ^\d+(?:\.\d+)?$
offset_ticks
integer

How many price ticks behind the best price on its own side the order rests, from 0 to 10. Give at most one of offset_ticks, offset_price, offset_shares and offset_beat_best.

Required range: 0 <= x <= 10
offset_price
string

How far behind the best price on its own side the order rests, in dollars from 0 to 0.1. Give at most one of offset_ticks, offset_price, offset_shares and offset_beat_best.

offset_shares
string

The most shares the order lets rest ahead of it in the queue, from 0 to 10,000,000 in steps of 0.01. The order rests one tick inside the first price level that would put more shares ahead of it. Give at most one of offset_ticks, offset_price, offset_shares and offset_beat_best.

Pattern: ^\d+(?:\.\d+)?$
offset_beat_best
enum<boolean>

Set to true to rest one tick better than the best price on its own side, so the order is first in the queue. It stops one tick short of the other side, so it never crosses the spread. Give at most one of offset_ticks, offset_price, offset_shares and offset_beat_best.

Available options:
true
price_limit
string

The worst price the order rests at, in dollars between 0.0001 and 0.9999: a buy never rests above it and a sell never below it. Omit to follow the book wherever it goes.

expires_at
string<date-time>

When the limit chase lapses if it has not filled, in UTC ending in Z, in the future and at most 30 days ahead. On Polymarket, and on any venue with a test key, it must be at least 2 minutes ahead. Omit to keep it until canceled.

Response

The limit chase, following the book

success
enum<boolean>
required
Available options:
true
data
object
required
meta
object
required