fix_sell_token_amount#

API documentation for tradeexecutor.backtest.backtest_execution.fix_sell_token_amount Python function.

fix_sell_token_amount(current_balance, order_quantity, epsilon=Decimal('1.0000000000000000622815914577798564188970686927859787829220294952392578125E-9'))[source]#

Fix rounding errors that may cause wallet dust overflow.

TODO: This should be handled other part of the system.

Returns:

(new amount, was fixed) tuple

Parameters:
Return type:

Tuple[Decimal, bool]