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, token_fix_method=UnknownTokenPositionFix.open_missing_position, strategy_universe=None, pricing_model=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:
state (State) –
corrections (List[AccountingBalanceCheck]) –
strategy_cycle_included_at (datetime.datetime | None) –
tx_builder (TransactionBuilder) –
block_identifier (Union[Literal['latest', 'earliest', 'pending', 'safe', 'finalized'], ~eth_typing.evm.BlockNumber, ~eth_typing.evm.Hash32, ~eth_typing.encoding.HexStr, ~hexbytes.main.HexBytes, int]) –
block_timestamp (datetime) –
strategy_universe (tradeexecutor.strategy.trading_strategy_universe.TradingStrategyUniverse | None) –
pricing_model (tradeexecutor.strategy.pricing_model.PricingModel | None) –
- Return type: