correct_accounts#

API documentation for tradeexecutor.strategy.account_correction.correct_accounts Python function.

correct_accounts(state, corrections, strategy_cycle_included_at, tx_builder, interactive=True, unknown_token_receiver=None, block_identifier=None, block_timestamp=None)[source]#

Apply the accounting corrections on the state (internal ledger).

  • Change values of the underlying positions

  • Create BalanceUpdate events and store them in the state

  • Create BalanceUpdateRefs and store them in the state

Note

You need to iterate the returend iterator to have any of the corrections applied.

Returns:

Tuple (corrected anythimg, iterator of corrections).

Parameters:
Return type:

Iterable[BalanceUpdate]