tradeexecutor.ethereum.execution module.

Module description#

Dealing with Ethereum low level tranasctions.


approve_infinity(web3, deployment, ...)

Approve multiple ERC-20 token allowances for the trades needed.

approve_tokens(web3, deployment, hot_wallet, ...)

Approve multiple ERC-20 token allowances for the trades needed.

broadcast(web3, ts, instructions[, ...])

Broadcast multiple transations and manage the trade executor state for them.

broadcast_and_resolve(web3, state, trades[, ...])

Do the live trade execution.

confirm_approvals(web3, txs[, ...])

Wait until all transactions are confirmed.

get_current_price(web3, uniswap, pair[, ...])

Get a price from Uniswap v2 pool, assuming you are selling 1 unit of base token.

get_held_assets(web3, address, assets)

Get list of assets hold by the a wallet.


Get the swap transaction from multiple transactions associated with the trade

get_token_for_asset(web3, asset)

Get ERC-20 contract proxy.


prepare_swaps(web3, hot_wallet, uniswap, ts, ...)

Prepare multiple swaps to be breoadcasted parallel from the hot wallet.

resolve_trades(web3, ts, state, tx_map, receipts)

Resolve trade outcome.

translate_to_naive_swap(web3, deployment, ...)

Creates an AMM swap tranasction out of buy/sell.

wait_trades_to_complete(web3, trades[, ...])

Watch multiple transactions executed at parallel.