How do raw price and size units work?
For a market:rawPrice must be divisible by tickSize. Packed trades, active orders, and L2 quantities use normalized bookQuantity; token transfers and passive-liquidity amounts use raw token atoms. Quote atoms are calculated deterministically from price and normalized size using the configured precisions. Rounding depends on direction: bids use two-stage floors, passive asks use two-stage ceilings, and active asks use incremental cumulative-ceiling accounting across the match. Do not use a universal floor formula to reconstruct fills. See OrderBook for the formulas; validate limits and simulate the exact call.
Fee rates are PPS: fee = amount * feePps / 10_000_000, with the rounding boundary determined by the fee type.
Why can free balance be lower than the wallet deposit history?
getBalance is free balance. Active orders move assets into aggregate spotReservedBalance; passive mints move assets into the orderbook’s position ledger. Reconcile all three buckets.
Why use both slot index and order ID?
A maker slot is reusable. The order ID changes whenever a replacement creates a new resting order. Bind asynchronous cancel and replace requests to the expected ID so a delayed action cannot affect a newer order in the same slot.Does a successful transaction imply the requested post-only order rested?
No. A crossingPOST_ONLY order is skipped instead of reverting the batch. Confirm the resulting slot or consume BookUpdatesPacked.
Why did a swap revert after an estimate succeeded?
Liquidity, balances, fee policy, RAB visibility, and hook behavior can change before execution. Stateful hooks are not simulated byestimateSwap. Always set minAmountOut and a deadline.
Which approval is required?
- ERC-20 allowance authorizes the token transfer into AccountCore.
- AccountCore signer authorization controls actions on an account.
- Builder approval caps optional builder fees.
- Post-fill hook access is a separate protocol gate for maker callbacks.
- Relay JWTs are offchain service credentials and do not replace any onchain authorization.