Liquidity & slippage
Order-book mathematics, VWAP-based slippage estimation, the liquidity-limited position size, the composite liquidity score, and the stricter new-token rules.
A price you cannot trade at is not a price. Before any size is approved, Clawlas measures the real cost of execution from the live order book — spread, depth, expected slippage — and caps the position to what the book can actually absorb.
Order-book mathematics
Relative spread normalizes the gap so the same threshold applies across cheap and expensive assets.
Ranges from −1 (ask-heavy) to +1 (bid-heavy). Used cautiously — displayed liquidity can be canceled.
- depth level the volumes are summed over
Depth is also measured as quote value within a price band (0.25% / 0.5% / 1% / 2%):
- bid depth 1%
- ask depth 1%
- depth-weighted price
- top-of-book size
Slippage from the book
Walk the book level by level until the order fills; the volume-weighted average is the realistic execution price.
- reference price (mid or last)
def estimate_slippage(levels, qty, ref, side):
remaining, filled, notional = qty, 0.0, 0.0
for price, available in levels:
take = min(remaining, available)
filled += take; notional += take * price; remaining -= take
if remaining <= 0:
break
if filled == 0:
return None
vwap = notional / filled
return (vwap - ref) / ref if side == "buy" else (ref - vwap) / refThe largest quantity whose estimated slippage still clears the limit — a hard cap feeding the sizing minimum.
Composite liquidity score
A weighted blend of spread, depth, volume, trade frequency and slippage scores — for ranking, not for hiding the raw numbers.
Every decision still records the underlying values, not just the score:
- spread
- expected slippage
- order-book depth
- trade frequency
- quote volume
- data age
- venue
- data quality
New-token rules
Minutes-old tokens lack the history standard indicators assume, so they get their own measures and stricter gates.
| Measure | Formula |
|---|---|
| Token age | now − first_observed_trading_timestamp |
| Initial expansion | (price − first_price) / first_price |
| Launch drawdown | (price − highest_observed) / highest_observed |
| Volume decay | 1 − recent_window / initial_window |
| Liquidity retention | current_liquidity / peak_liquidity |
A new token is rejected when, for example:
- no reliable first-trade timestamp, or an inconsistent price source;
- pool liquidity too low, spread or expected slippage over the limit;
- contract/ownership checks fail, or it cannot be sold reliably;
- holder/pool concentration too high, or wash-trading risk is high;
- market age below the configured minimum, or the venue trust tier is insufficient.