Open the app
Quantitative core

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

orderbook_v1
Mid-price, spread & relative spread

Relative spread normalizes the gap so the same threshold applies across cheap and expensive assets.

orderbook_v1
Order-book imbalance

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

slippage_model_v1
Expected VWAP

Walk the book level by level until the order fills; the volume-weighted average is the realistic execution price.

slippage_model_v1
Buy / sell slippage
reference price (mid or last)
python
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) / ref
slippage_model_v1
Liquidity-limited size

The largest quantity whose estimated slippage still clears the limit — a hard cap feeding the sizing minimum.

Composite liquidity score

liquidity_score_v1
Weighted, normalized — but never opaque

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.

MeasureFormula
Token agenow − first_observed_trading_timestamp
Initial expansion(price − first_price) / first_price
Launch drawdown(price − highest_observed) / highest_observed
Volume decay1 − recent_window / initial_window
Liquidity retentioncurrent_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.
Missing or stale data rejects, never invents
Empty books, partial liquidity and divide-by-zero conditions are handled explicitly. When freshness or depth cannot be proven, the result is caution or rejection — the engine never fabricates a fillable price. Feeds the sizing minimum on Position sizing & stops.