Transaction Fees
Supported Models
Introduction
This page describes some of the pre-built fee models in LEAN. For more brokerage-specific fee models, see the brokerage model documentation. If none of these models perform exactly how you want, create a custom fee model.
Constant Model
The ConstantFeeModel
applies the absolute value of a constant fee to each order. It's the default fee model of the DefaultBrokerageModel if you trade Forex, CFD, or Crypto assets. Use this model to set zero transaction fees.
security.SetFeeModel(new ConstantFeeModel(0.05m));
security.set_fee_model(ConstantFeeModel(0.05))
The following table describes the arguments the model accepts:
Argument | Data Type | Description | Default Value |
---|---|---|---|
fee | decimal float | The order fee quantity | |
currency | string str | The order fee currency | "USD" |
To view the implementation of this model, see the LEAN GitHub repository.
Alpaca Model
The AlpacaFeeModel
models the fees of Alpaca.
security.SetFeeModel(new AlpacaFeeModel());
security.set_fee_model(AlpacaFeeModel())
The AlpacaFeeModel
charges zero fees for Equity and Equity Options trading.
For Crypto trades, it charges a 0.15% maker and 0.25% taker fee.
If you add liquidity to the order book by placing a limit order that doesn't cross the spread, you pay maker fees.
If you remove liquidity from the order book by placing an order that crosses the spread, you pay taker fees.
Alpaca adjusts your fees based on your 30-day trading volume, but we don't currently model these metrics to adjust fees.
The AlpacaFeeModel
charges fees in the currency you receive from a trade. For example, if you buy ETHBTC, you pay fees in ETH. If you sell ETHBTC, you pay fees in BTC.
To view the implementation of this model, see the LEAN GitHub repository.
Binance Model
The BinanceFeeModel
models the fees of spot trades on Binance and Binance US.
security.SetFeeModel(new BinanceFeeModel());
security.set_fee_model(BinanceFeeModel())
The following table describes the arguments the model accepts:
Argument | Data Type | Description | Default Value |
---|---|---|---|
mFee m_fee | decimal float | Maker fee value | 0.001 |
tFee t_fee | decimal float | Taker fee value | 0.001 |
The BinanceFeeModel
charges the order fees of Binance and Binance US at the VIP 0 level, which is a 0.1% maker and taker fee. If you add liquidity to the order book by placing a limit order that doesn't cross the spread, you pay maker fees. If you remove liquidity from the order book by placing an order that crosses the spread, you pay taker fees. Binance adjusts your fees based on your 30-day trading volume and BNB balance, but we don't currently model these metrics to adjust fees.
The BinanceFeeModel
charges fees in the currency you receive from a trade. For example, if you buy ETHBTC, you pay fees in ETH. If you sell ETHBTC, you pay fees in BTC.
To view the implementation of this model, see the LEAN GitHub repository.
Binance Futures Model
The BinanceFuturesFeeModel
models the Binance Futures live trading fees.
security.SetFeeModel(new BinanceFuturesFeeModel());
security.set_fee_model(BinanceFuturesFeeModel())
The following table describes the arguments the model accepts:
Argument | Data Type | Description | Default Value |
---|---|---|---|
mUsdtFee m_usdt_fee | decimal float | Maker fee value for USDT pair contracts | 0.0002 |
tUsdtFee t_usdt_fee | decimal float | Taker fee value for USDT pair contracts | 0.0004 |
mBusdFee m_busd_fee | decimal float | Maker fee value for BUSD pair contracts | 0.00012 |
tBusdFee t_busd_fee | decimal float | Taker fee value for BUSD pair contracts | 0.00036 |
By default, the BinanceFuturesFeeModel
charges the order fees of Binance Futures at the Regular User level. If you add liquidity to the order book by placing a limit order that doesn't cross the spread, you pay maker fees. If you remove liquidity from the order book by placing an order that crosses the spread, you pay taker fees. Binance adjusts your fees based on your 30-day trading volume and BNB balance, but we don't currently model these metrics to adjust fees.
The BinanceFuturesFeeModel
charges fees in the currency you receive from a trade. For example, if you buy BTCUSD, you pay fees in BTC. If you sell BTCUSD, you pay fees in USD.
To view the implementation of this model, see the LEAN GitHub repository.
Binance Coin Futures Model
The BinanceCoinFuturesFeeModel
models the Binance Coin Futures live trading fees.
security.SetFeeModel(new BinanceCoinFuturesFeeModel());
security.set_fee_model(BinanceCoinFuturesFeeModel())
The following table describes the arguments the model accepts:
Argument | Data Type | Description | Default Value |
---|---|---|---|
mFee m_fee | decimal float | Maker fee value | 0.0001 |
tFee t_fee | decimal float | Taker fee value | 0.0005 |
By default, the BinanceCoinFuturesFeeModel
charges the order fees of Binance Coin Futures at the Regular User level. If you add liquidity to the order book by placing a limit order that doesn't cross the spread, you pay maker fees. If you remove liquidity from the order book by placing an order that crosses the spread, you pay taker fees. Binance adjusts your fees based on your 30-day trading volume and BNB balance, but we don't currently model these metrics to adjust fees.
The BinanceCoinFuturesFeeModel
charges fees in the currency you receive from a trade. For example, if you buy BTCUSDT, you pay fees in BTC. If you sell BTCUSDT, you pay fees in USDT.
To view the implementation of this model, see the LEAN GitHub repository.
Bitfinex Model
The BitfinexFeeModel
models the Bitfinex live trading fees.
security.SetFeeModel(new BitfinexFeeModel());
security.set_fee_model(BitfinexFeeModel())
The BitfinexFeeModel
charges a 0.1% maker fee and a 0.2% taker fee. If you place a limit order that hits a hidden order or you add liquidity to the order book by placing a limit order that doesn't cross the spread, you pay maker fees. If you place a hidden order or you remove liquidity from the order book by placing an order that crosses the spread, you pay taker fees. Bitfinex adjusts your fees based on your 30-day trading volume and LEO balance, but we don't currently model these metrics to adjust fees.
The BitfinexFeeModel
charges fees in the currency you receive from a trade. For example, if you buy ETHBTC, you pay fees in ETH. If you sell ETHBTC, you pay fees in BTC.
To view the implementation of this model, see the LEAN GitHub repository.
Bybit Model
The BybitFeeModel
models the Bybit live trading fees.
security.SetFeeModel(new BybitFeeModel());
security.set_fee_model(BybitFeeModel())
The following table describes the arguments the model accepts:
Argument | Data Type | Description | Default Value |
---|---|---|---|
mFee m_fee | decimal float | Maker fee value | 0.001 |
tFee t_fee | decimal float | Taker fee value | 0.001 |
The BybitFeeModel
charges the order fees of Bybit at the VIP 0 level, which is a 0.1% maker and taker fee for spot trades. If you add liquidity to the order book by placing a limit order that doesn't cross the spread, you pay maker fees. If you remove liquidity from the order book by placing an order that crosses the spread, you pay taker fees. Bybit adjusts your fees based on your 30-day trading volume, net borrowings, or asset balance, but we don't currently model these metrics to adjust fees. Bybit also charges different fees for fiat-Crypto pairs, (for example, USDT/EUR), but the BybitFeeModel
charges the same fee rate for all pairs.
The BybitFeeModel
charges fees in the currency you receive from a trade. For example, if you buy ETHBTC, you pay fees in ETH. If you sell ETHBTC, you pay fees in BTC.
To view the implementation of this model, see the LEAN GitHub repository.
Bybit Futures Model
The BybitFuturesFeeModel
models the Bybit live trading fees.
security.SetFeeModel(new BybitFuturesFeeModel());
security.set_fee_model(BybitFuturesFeeModel())
The following table describes the arguments the model accepts:
Argument | Data Type | Description | Default Value |
---|---|---|---|
makerFee maker_fee | decimal float | Maker fee value | 0.0002 |
takerFee taker_fee | decimal float | Taker fee value | 0.00055 |
The BybitFuturesFeeModel
charges the order fees of Bybit at the VIP 0 level, which is a 0.02% maker and a 0.055% taker fee for Crypto Futures trades. If you add liquidity to the order book by placing a limit order that doesn't cross the spread, you pay maker fees. If you remove liquidity from the order book by placing an order that crosses the spread, you pay taker fees. Bybit adjusts your fees based on your 30-day trading volume, net borrowings, or asset balance, but we don't currently model these metrics to adjust fees.
The BybitFuturesFeeModel
charges fees in the currency you receive from a trade. For example, if you buy BTCUSDT, you pay fees in BTC. If you sell BTCUSDT, you pay fees in USDT.
To view the implementation of this model, see the LEAN GitHub repository.
Coinbase Model
The CoinbaseFeeModel
models the Coinbase live trading fees.
security.SetFeeModel(new CoinbaseFeeModel());
security.set_fee_model(CoinbaseFeeModel())
The CoinbaseFeeModel
models the order fees of Coinbase at the $50K-100K pricing tier for all Crypto pairs, so it charges a 0.5% maker and taker fee for most pairs. The following table shows the Coinbase Stable Pairs, which charge a 0% maker fee and a 0.1% taker fee:
Stable Pairs | |||
---|---|---|---|
DAIUSDC | DAIUSD | GYENUSD | PAXUSD |
PAXUSDT | MUSDUSD | USDCEUR | USDCGBP |
USDTEUR | USDTGBP | USDTUSD | USDTUSDC |
USTEUR | USTUSD | USTUSDT | WBTCBTC |
If you add liquidity to the order book by placing a limit order that doesn't cross the spread, you pay maker fees. If you remove liquidity from the order book by placing an order that crosses the spread, you pay taker fees. Coinbase adjusts your fees based on your 30-day trading volume, but we don't currently model trading volume to adjust fees.
The CoinbaseFeeModel
models the adjustments Coinbase has made to their fees over time. The following table shows the fees for each time period:
Time Period (UTC) | Maker Fee (%) | Taker Fee (%) |
---|---|---|
Time < 3/23/2019 1:30AM | 0 | 0.3 |
3/23/2019 1:30AM <= Time < 10/8/2019 12:30AM | 0.15 | 0.25 |
10/8/2019 12:30AM <= Time | 0.5 | 0.5 |
The CoinbaseFeeModel
charges fees in the quote currency.
To view the implementation of this model, see the LEAN GitHub repository.
Interactive Brokers Model
The InteractiveBrokersFeeModel
models the fees of Interactive Brokers.
security.SetFeeModel(new InteractiveBrokersFeeModel());
security.set_fee_model(InteractiveBrokersFeeModel())
The following table describes the arguments the model accepts:
Argument | Data Type | Description | Default Value |
---|---|---|---|
monthlyForexTradeAmountInUSDollars monthly_forex_trade_amount_in_us_dollars | decimal float | Monthly Forex dollar volume traded | 0 |
monthlyOptionsTradeAmountInContracts monthly_options_trade_amount_in_contracts | decimal float | Monthly Option contracts traded | 0 |
The following table describes which currency the InteractiveBrokersFeeModel
charges fees in for each asset class:
Asset Class | Fee Currency |
---|---|
US Equity | USD |
India Equity | INR |
Equity Options | USD |
Forex | USD |
US Futures | USD |
Hong Kong Futures | The contract quote currency (CNH, HKD, or USD) |
US Future Options | USD |
Hong Kong Future Options | The contract quote currency (CNH, HKD, or USD) |
Index Options | USD |
CFD | The contract quote currency |
The following sections describe the trading fees of each asset class. To view the implementation of this model, see the LEAN GitHub repository.
US Equities
US Equity trades cost $0.005/share with a $1 minimum fee and a 0.5% maximum fee.
Equity Options and Index Options
Equity Options and Index Options fees are a function of your monthly volume and the premium of the contract you trade. The following table shows the fees for each volume tier:
Monthly Volume (Contacts) | Premium ($) | Fee per Contract ($) |
---|---|---|
<= 10,000 | < 0.05 | 0.25 |
<= 10,000 | 0.05 <= premium < 0.10 | 0.50 |
<= 10,000 | >= 0.10 | 0.70 |
10,000 < volume <= 50,000 | < 0.05 | 0.25 |
10,000 < volume <= 50,000 | >= 0.05 | 0.50 |
50,000 < volume <= 100,000 | Any | 0.25 |
> 100,000 | Any | 0.15 |
By default, LEAN models your fees at the tier with the lowest monthly volume. To adjust the fee tier, manually set the fee model and provide a monthlyOptionsTradeAmountInContracts
monthly_options_trade_amount_in_contracts
argument.
The following table shows how the model determines the premium for each order type and direction:
Order Type | Buy Order Premium | Sell Order Premium |
---|---|---|
Market | Bid price | Ask price |
Limit | Limit price | Limit price |
Limit if touched | Limit price | Limit price |
Stop market | Stop price | Stop price |
Stop limit | Limit price | Limit price |
Trailing stop | Stop price | Stop price |
Market on open | Bid price | Ask price |
Market on close | Bid price | Ask price |
Combo market | Bid price | Ask price |
Combo limit | Limit price | Limit price |
Combo leg limit | Limit price | Limit price |
There is no fee to exercise Option contracts.
Forex
Forex fees are a function of your monthly Forex trading volume. The following table shows the fee tiers:
Monthly Volume (USD) | Commission Rate (%) | Minimum Fee ($) |
---|---|---|
<= 1B | 0.002 | 2 |
1B < volume <= 2B | 0.0015 | 1.5 |
2B < volume <= 5B | 0.001 | 1.25 |
> 5B | 0.0008 | 1 |
By default, LEAN models your fees at the tier with the lowest monthly volume. To adjust the fee tier, manually set the fee model and provide a monthlyForexTradeAmountInUSDollars
monthly_forex_trade_amount_in_us_dollars
argument.
US Futures
US Futures fees depend on the contracts you trade. The following table shows the base fee per contract for each Future:
Contract Symbol | Market | Name | Base Fee Per Contract ($) | Exchange Fee Per Contract ($) |
---|---|---|---|---|
E-mini Futures | ||||
ES | CME | E-mini S&P 500 Futures | 0.85 | 1.28 |
NQ | CME | E-mini Nasdaq-100 Futures | 0.85 | 1.28 |
YM | CBOT | E-mini Dow ($5) Futures | 0.85 | 1.28 |
RTY | CME | E-mini Russell 2000 Index Futures | 0.85 | 1.28 |
EMD | CME | E-mini S&P MidCap 400 Futures | 0.85 | 1.28 |
Micro E-mini Futures | ||||
MYM | CBOT | Micro E-mini Dow Jones Industrial Average Index Futures | 0.25 | 0.3 |
M2K | CME | Micro E-mini Russell 2000 Index Futures | 0.25 | 0.3 |
MES | CME | Micro E-mini Standard and Poor's 500 Stock Price Index Futures | 0.25 | 0.3 |
MNQ | CME | Micro E-mini Nasdaq-100 Index Futures | 0.25 | 0.3 |
2YY | CBOT | Micro 2-Year Yield Futures | 0.25 | 0.3 |
5YY | CBOT | Micro 5-Year Yield Futures | 0.25 | 0.3 |
10Y | CBOT | Micro 10-Year Yield Futures | 0.25 | 0.3 |
30Y | CBOT | Micro 30-Year Yield Futures | 0.25 | 0.3 |
MCL | NYMEX | Micro WTI Crude Oil Futures | 0.25 | 0.3 |
MGC | COMEX | Micro Gold Futures | 0.25 | 0.3 |
SIL | COMEX | Micro Silver Futures | 0.25 | 0.3 |
Cryptocurrency Futures | ||||
BTC | CME | Bitcoin Futures | 5 | 6 |
MIB | CME | BTIC on Micro Bitcoin Futures | 2.25 | 2.5 |
MBT | CME | Micro Bitcoin Futures | 2.25 | 2.5 |
MET | CME | Micro Ether Futures | 0.2 | 0.2 |
MRB | CME | BTIC on Micro Ether Futures | 0.2 | 0.2 |
E-mini FX Futures | ||||
E7 | CME | E-mini Euro FX Futures | 0.5 | 0.85 |
J7 | CME | E-mini Japanese Yen Futures | 0.5 | 0.85 |
Micro E-mini FX Futures | ||||
M6E | CME | Micro Euro/U.S. Dollar (EUR/USD) Futures | 0.15 | 0.24 |
M6A | CME | Micro Australian Dollar/U.S. Dollar (AUD/USD) Futures | 0.15 | 0.24 |
M6B | CME | Micro British Pound Sterling/U.S. Dollar (GBP/USD) Futures | 0.15 | 0.24 |
MCD | CME | Micro Canadian Dollar/U.S.Dollar(CAD/USD) Futures | 0.15 | 0.24 |
MJY | CME | Micro Japanese Yen/U.S. Dollar (JPY/USD) Futures | 0.15 | 0.24 |
MSF | CME | Micro Swiss Franc/U.S. Dollar (CHF/USD) Futures | 0.15 | 0.24 |
M6J | CME | Micro USD/JPY Futures | 0.15 | 0.24 |
MIR | CME | Micro INR/USD Futures | 0.15 | 0.24 |
M6C | CME | Micro USD/CAD Futures | 0.15 | 0.24 |
M6S | CME | Micro USD/CHF Futures | 0.15 | 0.24 |
MNH | CME | Micro USD/CNH Futures | 0.15 | 0.24 |
If you trade a contract that's not in the preceding table, the base fee is $0.85/contract and the exchange fee is $1.60/contract.
In addition to the base fee and exchange fee, there is a $0.02/contract regulatory fee.
Futures Options
Futures Options fees depend on the contracts you trade. The following table shows the base fee per contract for each Future:
Contract Symbol | Market | Underlying Futures Name | Base Fee Per Contract ($) | Exchange Fee Per Contract ($) |
---|---|---|---|---|
E-mini Futures Options | ||||
ES | CME | E-mini S&P 500 Futures | 0.85 | 0.55 |
NQ | CME | E-mini Nasdaq-100 Futures | 0.85 | 0.55 |
YM | CBOT | E-mini Dow ($5) Futures | 0.85 | 0.55 |
RTY | CME | E-mini Russell 2000 Index Futures | 0.85 | 0.55 |
EMD | CME | E-mini S&P MidCap 400 Futures | 0.85 | 0.55 |
Micro E-mini Futures Options | ||||
MYM | CBOT | Micro E-mini Dow Jones Industrial Average Index Futures | 0.25 | 0.2 |
M2K | CME | Micro E-mini Russell 2000 Index Futures | 0.25 | 0.2 |
MES | CME | Micro E-mini Standard and Poor's 500 Stock Price Index Futures | 0.25 | 0.2 |
MNQ | CME | Micro E-mini Nasdaq-100 Index Futures | 0.25 | 0.2 |
2YY | CBOT | Micro 2-Year Yield Futures | 0.25 | 0.2 |
5YY | CBOT | Micro 5-Year Yield Futures | 0.25 | 0.2 |
10Y | CBOT | Micro 10-Year Yield Futures | 0.25 | 0.2 |
30Y | CBOT | Micro 30-Year Yield Futures | 0.25 | 0.2 |
MCL | NYMEX | Micro WTI Crude Oil Futures | 0.25 | 0.2 |
MGC | COMEX | Micro Gold Futures | 0.25 | 0.2 |
SIL | COMEX | Micro Silver Futures | 0.25 | 0.2 |
Cryptocurrency Futures Options | ||||
BTC | CME | Bitcoin Futures | 5 | 5 |
MIB | CME | BTIC on Micro Bitcoin Futures | 1.25 | 2.5 |
MBT | CME | Micro Bitcoin Futures | 1.25 | 2.5 |
MET | CME | Micro Ether Futures | 0.1 | 0.2 |
MRB | CME | BTIC on Micro Ether Futures | 0.1 | 0.2 |
If you trade a contract that's not in the preceding table, the base fee is $0.85/contract and the exchange fee is $1.60/contract.
In addition to the base fee and exchange fee, there is a $0.02/contract regulatory fee.
CFD
CFD trades cost 0.002% of the trade value. The following table shows the minimum fee for each quote currency:
Quote Currency | Fee |
---|---|
JPY | ¥40 |
MKD | HK$10 |
Other | 1 |
CFD trading fees are denominated in the quote currency of the CFD product.
Kraken Model
The KrakenFeeModel
models the fees of Kraken.
security.SetFeeModel(new KrakenFeeModel());
security.set_fee_model(KrakenFeeModel())
The KrakenFeeModel
model the order fees of Kraken. For trading pairs that contain only Crypto assets, this fee model models the lowest tier in Kraken's tiered fee structure, which is a 0.16% maker fee and a 0.26% taker fee. If you add liquidity to the order book by placing a limit order that doesn't cross the spread, you pay maker fees. If you remove liquidity from the order book by placing an order that crosses the spread, you pay taker fees. For trading pairs that have any of the following currencies as the base currency in the pair, the fee is 0.2%:
- CAD
- EUR
- GBP
- JPY
- USD
- USDT
- DAI
- USDC
The KrakenFeeModel
charges fees in the quote currency for buy orders and in the base currency for sell orders. To override these settings, define the KrakenOrderProperties
.
public override void Initialize() { // Set the default order properties DefaultOrderProperties = new KrakenOrderProperties() { FeeInBase = true, FeeInQuote = false }; } public override void OnData(Slice slice) { // Override the default order properties LimitOrder(_symbol, quantity, limitPrice, orderProperties: new KrakenOrderProperties { FeeInQuote = true, FeeInBase = false }); }
def initialize(self) -> None: # Set the default order properties self.default_order_properties = KrakenOrderProperties() self.default_order_properties.fee_in_base = True self.default_order_properties.fee_in_quote = False def on_data(self, slice: Slice) -> None: # Override the default order properties order_properties = KrakenOrderProperties() order_properties.fee_in_quote = True order_properties.fee_in_base = False self.limit_order(self._symbol, quantity, limit_price, order_properties=order_properties)
Kraken adjusts your fees based on your 30-day trading volume, but the KrakenFeeModel
don't currently model trading volume to adjust fees.
To view the implementation of this model, see the LEAN GitHub repository.
Samco Model
The SamcoFeeModel
models the fees of Samco.
security.SetFeeModel(new SamcoFeeModel());
security.set_fee_model(SamcoFeeModel())
The SamcoFeeModel
models the order fees of Samco by its Equity Intraday fee structure. The following table shows the fees:
Charge Item | Fee |
---|---|
Brokerage Fee | ₹20 per trade or 0.02% (whichever is lower) |
Exchange Transaction Charge | 0.00345% |
Securities Transaction Tax | 0.025% |
Goods and Services Tax | 18% |
SEBI Charges | 0.0001% |
Stamp Duty | 0.003% |
The SamcoFeeModel
charges fees in INR.
To view the implementation of this model, see the LEAN GitHub repository.
TD Ameritrade Model
The TDAmeritradeFeeModel
models the fees of TD Ameritrade.
security.SetFeeModel(new TDAmeritradeFeeModel());
security.set_fee_model(TDAmeritradeFeeModel())
The TDAmeritradeFeeModel
charges $0 USD for Equity trades.
To view the implementation of this model, see the LEAN GitHub repository.
TradeStation Model
The TradeStationFeeModel
models the fees of TradeStation.
security.SetFeeModel(new TradeStationFeeModel());
security.set_fee_model(TradeStationFeeModel())
The following sections describe the trading fees of each asset class. To view the implementation of this model, see the LEAN GitHub repository.
US Equities
US Equity trades are free for US residents. For non-US residents, they cost $5 USD per order.
Equity Options
Equity Option trades cost $0.60 USD per contract. For non-US residents, they cost an extra $5 USD per order.
Futures
Futures trades cost $1.50 USD per contract.
Wolverine Model
The WolverineFeeModel
models the fees of Wolverine Execution Services.
security.SetFeeModel(new WolverineFeeModel());
security.set_fee_model(WolverineFeeModel())
The following table describes the arguments the model accepts:
Argument | Data Type | Description | Default Value |
---|---|---|---|
feesPerShare fees_per_share | decimal? float /NoneType | The fees per share to apply. If null None , it uses 0.005. | null None |
The WolverineFeeModel
charges fees in USD.
To view the implementation of this model, see the LEAN GitHub repository.
Zerodha Model
The ZerodhaFeeModel
models the fees of Zerodha.
security.SetFeeModel(new ZerodhaFeeModel());
security.set_fee_model(ZerodhaFeeModel())
The ZerodhaFeeModel
models the order fees of Zerodha with its Equity Intraday fee structure. The following table shows the fees:
Charge Item | Fee |
---|---|
Brokerage Fee | ₹20 per trade or 0.03% (whichever is lower) |
Exchange Transaction Charge | 0.00345% |
Securities Transaction Tax | 0.025% |
Goods and Services Tax | 18% |
SEBI Charges | 0.0001% |
Stamp Duty | 0.003% |
The ZerodhaFeeModel
charges fees in INR.
To view the implementation of this model, see the LEAN GitHub repository.