Skip to main content

Cumulative Depth

Quick Reference

PropertyValue
Dimensionsignal
Categoryorder_flow
Versionv1.0
Output Columncumulative_depth

Cumulative sum of order book depth at top N levels

Formula

best_bid_size + best_ask_size

CDM Inputs

ColumnCDM TableDescription
best_bid_sizecdm_lob_snapshotOrder book snapshot data 鈥?depth levels, bid/ask prices and sizes
best_ask_sizecdm_lob_snapshotOrder book snapshot data 鈥?depth levels, bid/ask prices and sizes

Parameters

ParameterTypeDefaultDescription
levelsinteger10Number of levels to sum

Output

Column: cumulative_depth

Total depth at specified levels

Market Intuition & Trading Rationale

Cumulative depth measures total resting liquidity at the top N levels: best_bid_size + best_ask_size. This is the simplest measure of available liquidity 鈥?how many shares/contracts are sitting at the best prices? High cumulative depth means ample liquidity for execution. Low cumulative depth means thin books 鈥?even moderate orders will walk the book. Sudden drops in cumulative depth signal liquidity withdrawal 鈥?a leading indicator for spread widening and volatility.

Usage Cases

  • Execution sizing: Max order size 鈮?cumulative_depth 脳 acceptable_fill_fraction. If cumulative depth drops below your typical order size, split the order or wait.
  • Liquidity shock detection: A sudden drop in cumulative_depth (> 50% in a few updates) signals liquidity providers are pulling orders 鈥?potential imminent volatility.
  • context: Used in iceberg_detection pack 鈥?cumulative depth provides the baseline against which refill patterns are measured.

YAML Definition

name: cumulative_depth
description: Cumulative sum of order book depth at top N levels
category: order_flow
dimension: signal
version: v0.9.0 (Beta)
required_inputs:
- best_bid_size
- best_ask_size
output_column: cumulative_depth
output_description: Total depth at specified levels
tags:
- depth
- orderbook
- execution
- signal
parameters:
levels:
type: integer
description: Number of levels to sum
required: false
default: 10
formula: best_bid_size + best_ask_size