Skip to main content
Compare flat fees versus split maker/taker fees to understand how fee structure impacts strategy performance.

Full Code

How It Works

Flat fees (default)

A single paper_fee_rate is applied to every fill regardless of whether the order was resting in the book (maker) or crossing the spread (taker).

Split maker/taker fees

Set different rates for each role. Makers add liquidity and typically pay lower fees. Takers remove liquidity and pay higher fees.
You can also override just one side. The other falls back to paper_fee_rate:

Checking fill type

Every Fill includes an is_maker boolean:

When to Use Split Fees

  • Backtesting market-making strategies where most fills should be maker fills at lower fees
  • Modeling real exchange fee tiers (Polymarket charges 0 bps maker / 100 bps taker)
  • Comparing strategy profitability under different fee structures
  • Stress testing to see if your edge survives higher taker fees
In the paper exchange, maker/taker classification is based on the order price relative to the mid price at fill time. For more realistic classification using L2 orderbook data, use hz.backtest() with book_data which switches to the BookSim exchange.

Run It