futures position no need to deduct fees

This commit is contained in:
ankion 2022-06-05 16:31:02 +08:00
parent d90cf43d5a
commit 53f3df5ccf

View File

@ -373,10 +373,14 @@ func (p *Position) AddTrade(td Trade) (profit fixedpoint.Value, netProfit fixedp
switch td.FeeCurrency { switch td.FeeCurrency {
case p.BaseCurrency: case p.BaseCurrency:
quantity = quantity.Sub(fee) if !td.IsFutures {
quantity = quantity.Sub(fee)
}
case p.QuoteCurrency: case p.QuoteCurrency:
quoteQuantity = quoteQuantity.Sub(fee) if !td.IsFutures {
quoteQuantity = quoteQuantity.Sub(fee)
}
default: default:
if p.ExchangeFeeRates != nil { if p.ExchangeFeeRates != nil {