account_correction#

tradeexecutor.strategy.account_correction Python module in Trading Strategy framework.

Module description#

Apply accounting corrections on the strategy state.

  • Read on-chain balances

  • Compare them to the balances seen in the state

  • Adjust statebalacnes to match chain based ones

  • Generate the accounting events to reflect these changes

Classes#

AccountingBalanceCheck

Accounting correction applied to a balance.

AccountingCorrectionCause

An enumeration.

Functions#

apply_accounting_correction(state, ...)

Update the state to reflect the true on-chain balances.

calculate_account_corrections(pair_universe, ...)

Figure out differences between our internal ledger (state) and on-chain balances.

check_accounts(pair_universe, ...[, epsilon])

Get a table output of accounting corrections needed.

correct_accounts(state, corrections, ...[, ...])

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

transfer_away_assets_without_position(...)

Transfer away non-reserve assets that cannot be mapped to an open position.