51 private readonly decimal _makerFee;
53 private readonly decimal _takerFee;
75 if (parameters ==
null)
77 throw new ArgumentNullException(nameof(parameters),
"The 'parameters' argument cannot be null.");
80 var order = parameters.
Order;
85 var isMaker = order.Type ==
OrderType.Limit && ((props !=
null && props.PostOnly) || !order.IsMarketable);
90 var feePercentage =
GetFeePercentage(order.Time, isMaker, isStableCoin, _makerFee, _takerFee);
93 var unitPrice = order.Direction ==
OrderDirection.Buy ? security.AskPrice : security.BidPrice;
94 unitPrice *= security.SymbolProperties.ContractMultiplier;
98 var fee = unitPrice * order.AbsoluteQuantity * feePercentage;
112 protected static decimal
GetFeePercentage(DateTime utcTime,
bool isMaker,
bool isStableCoin, decimal makerFee, decimal takerFee)
114 if (isStableCoin && utcTime <
new DateTime(2022, 6, 1))
116 return isMaker ? 0m : 0.001m;
118 else if(isStableCoin)
122 else if (utcTime <
new DateTime(2019, 3, 23, 1, 30, 0))
124 return isMaker ? 0m : 0.003m;
126 else if (utcTime <
new DateTime(2019, 10, 8, 0, 30, 0))
128 return isMaker ? 0.0015m : 0.0025m;
134 return isMaker ? makerFee : takerFee;