EthereumTestTrader#
tradeexecutor.testing.ethereumtrader.EthereumTestTrader class.
- class EthereumTestTrader[source]#
Bases:
object
Helper class to trade against EthereumTester unit testing network.
- __init__(web3, uniswap, hot_wallet, state, pair_universe)[source]#
- Parameters
web3 (Web3) –
uniswap (UniswapV2Deployment) –
hot_wallet (HotWallet) –
state (State) –
pair_universe (PandasPairUniverse) –
Methods
__init__
(web3, uniswap, hot_wallet, state, ...)buy
(pair, amount_in_usd[, execute])Buy token (trading pair) for a certain value.
execute
(trades)sell
(pair, quantity[, execute])Sell token token (trading pair) for a certain quantity.
- __init__(web3, uniswap, hot_wallet, state, pair_universe)[source]#
- Parameters
web3 (Web3) –
uniswap (UniswapV2Deployment) –
hot_wallet (HotWallet) –
state (State) –
pair_universe (PandasPairUniverse) –
- buy(pair, amount_in_usd, execute=True)[source]#
Buy token (trading pair) for a certain value.
- Parameters
pair (TradingPairIdentifier) –
amount_in_usd (Decimal) –
- Return type
- sell(pair, quantity, execute=True)[source]#
Sell token token (trading pair) for a certain quantity.
- Parameters
pair (TradingPairIdentifier) –
quantity (Decimal) –
- Return type