resolve_trades#
- resolve_trades(web3, ts, state, tx_map, receipts, stop_on_execution_failure=True)[source]#
Resolve trade outcome.
Read on-chain Uniswap swap data from the transaction receipt and record how it went.
Mutates the trade objects in-place.
- Parameters:
tx_map (dict[hexbytes.main.HexBytes, Tuple[tradeexecutor.state.trade.TradeExecution, tradeexecutor.state.blockhain_transaction.BlockchainTransaction]]) – tx hash -> (trade, transaction) mapping
receipts (dict[hexbytes.main.HexBytes, dict]) – tx hash -> receipt object mapping
stop_on_execution_failure – Raise an exception if any of the trades failed
web3 (Web3) –
ts (datetime) –
state (State) –