Simplify calculation by calling "get_fee" only once

This commit is contained in:
Matthias 2022-07-16 17:59:05 +02:00
parent 4172f92bfc
commit 423af371c0

View File

@ -865,11 +865,12 @@ class Exchange:
dry_order: Dict[str, Any],
taker_or_maker: MakerTaker,
) -> Dict[str, Any]:
fee = self.get_fee(pair, taker_or_maker=taker_or_maker)
dry_order.update({
'fee': {
'currency': self.get_pair_quote_currency(pair),
'cost': dry_order['cost'] * self.get_fee(pair, taker_or_maker=taker_or_maker),
'rate': self.get_fee(pair, taker_or_maker=taker_or_maker)
'cost': dry_order['cost'] * fee,
'rate': fee
}
})
return dry_order