Simplify calculation by calling "get_fee" only once
This commit is contained in:
parent
4172f92bfc
commit
423af371c0
@ -865,11 +865,12 @@ class Exchange:
|
|||||||
dry_order: Dict[str, Any],
|
dry_order: Dict[str, Any],
|
||||||
taker_or_maker: MakerTaker,
|
taker_or_maker: MakerTaker,
|
||||||
) -> Dict[str, Any]:
|
) -> Dict[str, Any]:
|
||||||
|
fee = self.get_fee(pair, taker_or_maker=taker_or_maker)
|
||||||
dry_order.update({
|
dry_order.update({
|
||||||
'fee': {
|
'fee': {
|
||||||
'currency': self.get_pair_quote_currency(pair),
|
'currency': self.get_pair_quote_currency(pair),
|
||||||
'cost': dry_order['cost'] * self.get_fee(pair, taker_or_maker=taker_or_maker),
|
'cost': dry_order['cost'] * fee,
|
||||||
'rate': self.get_fee(pair, taker_or_maker=taker_or_maker)
|
'rate': fee
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
return dry_order
|
return dry_order
|
||||||
|
Loading…
Reference in New Issue
Block a user