repair_tx_not_generated#

API documentation for tradeexecutor.state.repair.repair_tx_not_generated Python function.

repair_tx_not_generated(state, interactive=True)[source]#

Repair command to fix trades that did not generate tranasctions.

  • Reasons include

  • Currently only manually callable from console

  • Simple deletes trades that have an empty transaction list

Example exception:

  File "/usr/src/trade-executor/tradeexecutor/ethereum/routing_model.py", line 395, in trade
    return self.make_direct_trade(
  File "/usr/src/trade-executor/tradeexecutor/ethereum/uniswap_v3/uniswap_v3_routing.py", line 257, in make_direct_trade
    return super().make_direct_trade(
  File "/usr/src/trade-executor/tradeexecutor/ethereum/routing_model.py", line 112, in make_direct_trade
    adjusted_reserve_amount = routing_state.adjust_spend(
  File "/usr/src/trade-executor/tradeexecutor/ethereum/routing_state.py", line 283, in adjust_spend
    raise OutOfBalance(
tradeexecutor.ethereum.routing_state.OutOfBalance: Not enough tokens for <USDC at 0x2791bca1f2de4661ed88a30c99a7a9449aa84174> to perform the trade. Required: 3032399763, on-chain balance for 0x375A8Cd0A654E0eCa46F81c1E5eA5200CC6A737C is 87731979.
Parameters:
  • interactive – Use console interactive prompts to ask the user to confirm the repair

  • state (State) –

Returns:

Repair trades generated.

Raises:

RepairAborted – Interactive operation was aborted by the user