check_accounts#

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

check_accounts(pair_universe, reserve_assets, state, sync_model, block_identifier=None)[source]#

Create a summary accounting corrections needed.

Create a human-readable DataFrame of accounting inconsistencies.

Parameters:
  • pair_universe (PandasPairUniverse) –

    Trading pairs we have.

    Needed to get token addresses we read on-chain.

  • reserve_assets (Collection[AssetIdentifier]) – Cannot be deducted from pair universe.

  • state (State) – Current strategy state we check

  • block_identifier (Optional[Union[Literal['latest', 'earliest', 'pending', 'safe', 'finalized'], ~eth_typing.evm.BlockNumber, ~eth_typing.evm.Hash32, ~eth_typing.encoding.HexStr, ~hexbytes.main.HexBytes, int]]) – Check at certain block height

  • sync_model (SyncModel) –

Returns:

Tuple (accounts clean, accounting clean Dataframe that can be printed to the console)

Return type:

Tuple[bool, DataFrame]