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:

ArgumentData TypeDescriptionDefault Value
feedecimalfloatThe order fee quantity
currencystringstrThe 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:

ArgumentData TypeDescriptionDefault Value
mFeem_feedecimalfloatMaker fee value0.001
tFeet_feedecimalfloatTaker fee value0.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:

ArgumentData TypeDescriptionDefault Value
mUsdtFeem_usdt_feedecimalfloatMaker fee value for USDT pair contracts0.0002
tUsdtFeet_usdt_feedecimalfloatTaker fee value for USDT pair contracts0.0004
mBusdFeem_busd_feedecimalfloatMaker fee value for BUSD pair contracts0.00012
tBusdFeet_busd_feedecimalfloatTaker fee value for BUSD pair contracts0.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:

ArgumentData TypeDescriptionDefault Value
mFeem_feedecimalfloatMaker fee value0.0001
tFeet_feedecimalfloatTaker fee value0.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:

ArgumentData TypeDescriptionDefault Value
mFeem_feedecimalfloatMaker fee value0.001
tFeet_feedecimalfloatTaker fee value0.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:

ArgumentData TypeDescriptionDefault Value
makerFeemaker_feedecimalfloatMaker fee value0.0002
takerFeetaker_feedecimalfloatTaker fee value0.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
DAIUSDCDAIUSDGYENUSDPAXUSD
PAXUSDTMUSDUSDUSDCEURUSDCGBP
USDTEURUSDTGBPUSDTUSDUSDTUSDC
USTEURUSTUSDUSTUSDTWBTCBTC

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:30AM00.3
3/23/2019 1:30AM <= Time < 10/8/2019 12:30AM0.150.25
10/8/2019 12:30AM <= Time0.50.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:

ArgumentData TypeDescriptionDefault Value
monthlyForexTradeAmountInUSDollarsmonthly_forex_trade_amount_in_us_dollarsdecimalfloatMonthly Forex dollar volume traded0
monthlyOptionsTradeAmountInContractsmonthly_options_trade_amount_in_contractsdecimalfloatMonthly Option contracts traded
0

The following table describes which currency the InteractiveBrokersFeeModel charges fees in for each asset class:

Asset ClassFee Currency
US EquityUSD
India EquityINR
Equity OptionsUSD
ForexUSD
US FuturesUSD
Hong Kong FuturesThe contract quote currency (CNH, HKD, or USD)
US Future OptionsUSD
Hong Kong Future OptionsThe contract quote currency (CNH, HKD, or USD)
Index OptionsUSD
CFDThe 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.050.25
<= 10,0000.05 <= premium < 0.100.50
<= 10,000>= 0.100.70
10,000 < volume <= 50,000< 0.05
0.25
10,000 < volume <= 50,000>= 0.05
0.50
50,000 < volume <= 100,000Any0.25
> 100,000Any0.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 monthlyOptionsTradeAmountInContractsmonthly_options_trade_amount_in_contracts argument.

The following table shows how the model determines the premium for each order type and direction:

Order TypeBuy Order PremiumSell Order Premium
MarketBid priceAsk price
LimitLimit priceLimit price
Limit if touchedLimit priceLimit price
Stop marketStop priceStop price
Stop limitLimit priceLimit price
Trailing stopStop priceStop price
Market on openBid priceAsk price
Market on closeBid priceAsk price
Combo marketBid priceAsk price
Combo limitLimit priceLimit price
Combo leg limitLimit priceLimit 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 ($)
<= 1B0.0022
1B < volume <= 2B0.00151.5
2B < volume <= 5B0.0011.25
> 5B0.00081

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 monthlyForexTradeAmountInUSDollarsmonthly_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 SymbolMarketNameBase Fee Per Contract ($)Exchange Fee Per Contract ($)
E-mini Futures
ESCMEE-mini S&P 500 Futures0.851.28
NQCMEE-mini Nasdaq-100 Futures0.851.28
YMCBOTE-mini Dow ($5) Futures0.851.28
RTYCMEE-mini Russell 2000 Index Futures0.851.28
EMDCMEE-mini S&P MidCap 400 Futures0.851.28
Micro E-mini Futures
MYMCBOTMicro E-mini Dow Jones Industrial Average Index Futures0.250.3
M2KCMEMicro E-mini Russell 2000 Index Futures0.250.3
MESCMEMicro E-mini Standard and Poor's 500 Stock Price Index Futures0.250.3
MNQCMEMicro E-mini Nasdaq-100 Index Futures0.250.3
2YYCBOTMicro 2-Year Yield Futures0.250.3
5YYCBOTMicro 5-Year Yield Futures0.250.3
10YCBOTMicro 10-Year Yield Futures0.250.3
30YCBOTMicro 30-Year Yield Futures0.250.3
MCLNYMEXMicro WTI Crude Oil Futures0.250.3
MGCCOMEXMicro Gold Futures0.250.3
SILCOMEXMicro Silver Futures0.250.3
Cryptocurrency Futures
BTCCMEBitcoin Futures56
MIBCMEBTIC on Micro Bitcoin Futures2.252.5
MBTCMEMicro Bitcoin Futures2.252.5
METCMEMicro Ether Futures0.20.2
MRBCMEBTIC on Micro Ether Futures0.20.2
E-mini FX Futures
E7CMEE-mini Euro FX Futures0.50.85
J7CMEE-mini Japanese Yen Futures0.50.85
Micro E-mini FX Futures
M6ECMEMicro Euro/U.S. Dollar (EUR/USD) Futures0.150.24
M6ACMEMicro Australian Dollar/U.S. Dollar (AUD/USD) Futures0.150.24
M6BCMEMicro British Pound Sterling/U.S. Dollar (GBP/USD) Futures0.150.24
MCDCMEMicro Canadian Dollar/U.S.Dollar(CAD/USD) Futures0.150.24
MJYCMEMicro Japanese Yen/U.S. Dollar (JPY/USD) Futures0.150.24
MSFCMEMicro Swiss Franc/U.S. Dollar (CHF/USD) Futures0.150.24
M6JCMEMicro USD/JPY Futures0.150.24
MIRCMEMicro INR/USD Futures0.150.24
M6CCMEMicro USD/CAD Futures0.150.24
M6SCMEMicro USD/CHF Futures0.150.24
MNHCMEMicro USD/CNH Futures0.150.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 SymbolMarketUnderlying Futures NameBase Fee Per Contract ($)Exchange Fee Per Contract ($)
E-mini Futures Options
ESCMEE-mini S&P 500 Futures0.850.55
NQCMEE-mini Nasdaq-100 Futures0.850.55
YMCBOTE-mini Dow ($5) Futures0.850.55
RTYCMEE-mini Russell 2000 Index Futures0.850.55
EMDCMEE-mini S&P MidCap 400 Futures0.850.55
Micro E-mini Futures Options
MYMCBOTMicro E-mini Dow Jones Industrial Average Index Futures0.250.2
M2KCMEMicro E-mini Russell 2000 Index Futures0.250.2
MESCMEMicro E-mini Standard and Poor's 500 Stock Price Index Futures0.250.2
MNQCMEMicro E-mini Nasdaq-100 Index Futures0.250.2
2YYCBOTMicro 2-Year Yield Futures0.250.2
5YYCBOTMicro 5-Year Yield Futures0.250.2
10YCBOTMicro 10-Year Yield Futures0.250.2
30YCBOTMicro 30-Year Yield Futures0.250.2
MCLNYMEXMicro WTI Crude Oil Futures0.250.2
MGCCOMEXMicro Gold Futures0.250.2
SILCOMEXMicro Silver Futures0.250.2
Cryptocurrency Futures Options
BTCCMEBitcoin Futures55
MIBCMEBTIC on Micro Bitcoin Futures1.252.5
MBTCMEMicro Bitcoin Futures1.252.5
METCMEMicro Ether Futures0.10.2
MRBCMEBTIC on Micro Ether Futures0.10.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 CurrencyFee
JPY¥40
MKDHK$10
Other1

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 ItemFee
Brokerage Fee₹20 per trade or 0.02% (whichever is lower)
Exchange Transaction Charge0.00345%
Securities Transaction Tax0.025%
Goods and Services Tax18%
SEBI Charges0.0001%
Stamp Duty0.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:

ArgumentData TypeDescriptionDefault Value
feesPerSharefees_per_sharedecimal?float/NoneTypeThe fees per share to apply. If nullNone, it uses 0.005.nullNone

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 ItemFee
Brokerage Fee₹20 per trade or 0.03% (whichever is lower)
Exchange Transaction Charge0.00345%
Securities Transaction Tax0.025%
Goods and Services Tax18%
SEBI Charges0.0001%
Stamp Duty0.003%

The ZerodhaFeeModel charges fees in INR.

To view the implementation of this model, see the LEAN GitHub repository.

You can also see our Videos. You can also get in touch with us via Discord.

Did you find this page helpful?

Contribute to the documentation: