Skip to content
log(swap)

Resting orders

Buy or sell passively — and earn fees while waiting.

A resting order is an LP position. There is no openPassive opcode in the pool, no order book, and no keeper: the router labels a capped position, and everything else is machinery that already exists.

what the UI calls itwhat it is
resting buya capped position minted above spot — quote-only on entry, converting to base as price falls to the floor
resting sella dormant position minted below completion — base-only on entry, converting to quote as price rises
edit my orderupdate
take my fill without closingclaim
partially filleda position mid-band

Because it is a position, it can be resized, repriced or edited in place rather than cancelled and re-entered — and it earns fees the entire time it is resting.

Why the cap is what completes them

The pool has one reachable single-asset boundary and one asymptote:

statewherereachable?
100% baseat the floor pmin⁡p_{\min}, where Q=0Q = 0yes
100% quoteas p→∞p \to \infty, since R=L/p→0R = L/p \to 0no — an asymptote. Only a cap makes it real

That asymmetry cuts differently for entry than for completion:

entry (mint with the asset you hold)completion (reach 100% of the other asset)
buy — hold quote, want baseneeds the cap: a quote-only mint exists only at pmax⁡p_{\max}free — completes at 100% base on the floor
sell — hold base, want quotefree — a base-only dormant mintneeds the cap: 100% quote only at pmax⁡p_{\max}

Each direction is half-free without a cap, which is why neither is a clean product without it.

What each side costs without a cap

A sell never finishes. Because pR≡LpR \equiv L, the position retains LL of base value at every price. Base share after a kk-fold rise above the trigger is 1/(1+log⁡k)1/(1+\log k):

rise from triggerbase still held
2×59.1%
10×30.3%
100×17.8%

Even a 100× move leaves ~18% in base — a gradual seller you close manually, not a limit order that fills.

A buy is mostly an immediate market buy. Laddering $10,000 of quote down to a floor needs L=Q/ℓL = Q/\ell of base up front, bought at spot:

floorℓ\ellbase neededshare of capital bought immediately
−10%0.105$94,91290.5%
−25%0.288$34,76177.7%
−50%0.693$14,42759.1%
−75%1.386$7,21341.9%

A "passive buy" that front-loads 40–90% as a market order is not a passive buy.

With the cap adopted, both directions complete cleanly and entry is single-asset in each.

Placing one

// resting buy: quote-only entry, cap above spot, floor at the price you want to buy at
router.mintBlended(key, targetFloor, cap, L, 0, maxQuoteIn, recipient, deadline);
 
// resting sell: base-only entry, floor above spot (dormant)
router.mintBlended(key, targetFloor, cap, L, maxBaseIn, 0, recipient, deadline);
 
// edit in place — new price, new size, or both
router.update(key, fromId, shares, toFloor, toCap, newL, maxBaseIn, maxQuoteIn, recipient, deadline);
router.move(key, fromId, shares, toFloor, toCap, deadline);   // reprice, size pinned

Dormant and capped-out mints are exempt from the mint fee — they earn nothing yet, so there is nothing to price. Edits pay only on the net increase in earning exposure, so repricing an unfilled order is free.

Two products at the token layer, not three

productwhat you hold
floored — "LP above ξ\xi, keep the upside"one ERC-6909 id. R=L/pR = L/p is an asymptote, so the position is never fully converted and never needs re-entry. The primitive
floored / capped — "LP from ξ\xi to μ\mu"one ERC-6909 id, the (floor, cap) pair fused indivisibly. Not two tokens: the decomposition contains a short leg, so splitting the id would let a holder sell the long and keep the short

Both claim, transfer, edit and compose through identical machinery. The choice between them is the choice of whether the position should ever finish.

A holder can of course own both at once — they are ordinary fungible tokens, and a partial cap is exactly that combination. But that is a consequence of holding tokens, not a third product.

What it earns

The same as any other position: Li ΔFL_i\,\Delta F over the interval it was active. A resting order is not a favour to the pool that gets paid in fills — it is liquidity, and it is paid as liquidity. See Liquidity provider for what the numbers mean.