Docs / Riding

The author’s exit

The ride reads the author’s balance from chain state and sells the fraction they sold. Anyone can trigger it; nobody can make it sell for any other reason.

The reference balance

At open, the ride records the author's balance of the coin as its reference(authorRef). sync(rideId, maxSqrtPriceX96) reads the author's balance now and compares it with the reference:

Ride._exitState
dropBps  = (authorRef - balance) * 10000 / authorRef
fullExit = balance * 10000 <= authorRef * dustBps

If the author sold a fraction, the ride sells the same fraction of its own tokens:toSell = tokenBalance * dropBps / 10000. The sale goes back to the pool, token to ETH, and the ETH (minus the exit fee) is credited to riders per share.

Threshold and dust

  • A drop under the exit threshold (2%, exitThresholdBps, ceiling 20%) is read as noise, not an exit: the sync records nothing and sells nothing. It is not forgotten either — the drop is always measured against the reference, so small sales add up until they cross it.
  • An author down to the dust line (5% of the reference, dustBps, ceiling 20%) is out. The ride sells everything it holds and closes when it is done.

The impact cap and chunks

Every sale is bounded by its own price impact. The ride passes the pool a sqrt-price limit set maxImpactBps / 2 above the current sqrt price, which caps the move of this one sale at about maxImpactBps of the ETH price of the coin (2%, bounds 0.25%–10%). The pool fills up to the limit and hands the rest back.

What was not filled stays owed: the reference is only reduced by the part of the author's sale this call mirrored, so the next call finds the remainder still showing and sells the next chunk. A big exit is walked down in chunks over several calls rather than dumped. The ride page shows what is due and offers the call.

Permissionless, with a price ceiling

Anyone may call sync, and nothing it does depends on who did. What a keeper adds is speed and a price reference: passing a non-zero maxSqrtPriceX96 makes the call revert with PriceAboveLimit if the pool's sqrt price is above it, i.e. if the coin is cheaper than the caller's reference. A keeper with a time-weighted price passes it so a sale cannot be steered into a dislocated pool. Pass zero to take the pool as it is; the app does.

When the author adds

If the author's balance is at or above the reference when a sync runs (and the ride has not expired), the larger position becomes the new reference, so a later sale of that top-up is read as the fraction it is. Nothing is sold.

Expiry

Every ride has a duration (1 hour to 30 days). Past expiresAt, joins are refused and sync sells everything the ride holds, whatever the author is doing, in the same impact-capped chunks. When the last token is sold the ride closes.

Once exiting, always exiting

The first sync that has something to sell moves the ride from Boarding to Exiting, and there is no path back. A ride whose author sold 3% and then bought it back is still exiting: it will not sell more than the fraction owed, but nobody can join it any more. When the token balance reaches zero — through sales or through the last rider leaving in kind — the ride is closed, and the author may get a new one on the same coin.