Skip to content
AI-generated research idea🟡Fairly easy💡Moderate InnovationRelated work found

Liquidity-Aware Execution via Order Book Depth Integration

Incorporate order book depth into financial agent toolchains to calculate market impact and split large trades into liquidity-aware execution chunks.

Time

several weeks

Compute level

Single GPU or less

Resources

Standard GPU, Level 2 market data (historical or live API)

Prerequisites

Market microstructure (order books, slippage), LLM tool integration, basic Python scripting

Scope

Modify existing code, add new tool definitions, integrate external data APIs

The Gap

The Performance analysis (Section 4.3, page 8) highlights that GPT-5 suffered heavy losses due to a 'rigid adherence to target weights without liquidity awareness,' attempting to rebalance portfolios regardless of the market's ability to absorb the trades.

Limitation

The current toolset lacks visibility into market depth and slippage, causing agents to propose execution strategies that are technically impossible or prohibitively expensive in low-liquidity regimes.

Proposed Solution

Expand the 'Check Price' and 'Trade' tool interfaces to include Level 2 market data (order book depth). Integrate a 'Slippage Estimation' function into the agent's toolchain that forces the LLM to calculate the cost of market impact and potentially break large orders into smaller, time-weighted chunks (TWAP/VWAP).

Why This Matters

Real-world trading requires understanding 'market impact'; without this, agents cannot operate in volatile or low-volume markets like specific altcoins or small-cap stocks.

How to Get Started

  1. Access historical or live Level 2 market data APIs to retrieve order book depth information.
  2. Extend the existing Check Price and Trade tool interfaces to ingest order book snapshots.
  3. Implement a slippage estimation algorithm that computes market impact costs for large order sizes.
  4. Integrate TWAP and VWAP execution logic into the agent loop and backtest performance against rigid-weight baselines.

Code linked to this paper on Hugging Face: github.com/HKUDS/AI-Trader

Suggested by AI. Adapt it to your setup.

Has This Been Done?

Related work found

Works like 'Reinforcement Learning for Liquidity-Weighted Optimal Trade Execution strategies' and 'Optimal Trading Strategies in a Limit Order Market with Imperfect Liquidity' explore optimal execution and market impact considering limit order books and liquidity. However, they do not specifically examine expanding LLM agent tool interfaces to enforce slippage estimation and TWAP/VWAP chunking based on Level 2 depth.

We searched OpenAlex for “Incorporate order book depth into financial agent toolchains to calculate market impact and split large trades into liquidity-aware execution chunks.” and “Liquidity-Aware Execution via Order Book Depth Integration” and an AI compared the idea with the top 6 results. A small search can miss relevant work.

Source Paper

AI-Trader: Benchmarking Autonomous Agents in Real-Time Financial Markets

Tianyu Fan, Yuhao Yang, Yangqin Jiang +3 more · 2025

AI-Trader is a benchmarking platform designed to evaluate autonomous LLM agents in real-time, dynamic financial environments across U.S. stocks, A-shares, and cryptocurrencies. The study finds that high general intelligence does not equate to trading proficiency, as most mainstream LLMs fail to achieve positive returns or manage risk effectively without human intervention.

Related Ideas

Is this a good idea?

Share onXLinkedIn