OneDeltaTestTrader#
API documentation for tradeexecutor.testing.ethereumtrader_one_delta.OneDeltaTestTrader Python class in Trading Strategy framework.
- class OneDeltaTestTrader[source]#
Bases:
EthereumTrader
Helper class to trade against EthereumTester unit testing network.
- __init__(one_delta, aave, uniswap, state, pair_universe, tx_builder=None)[source]#
- Parameters:
one_delta (OneDeltaDeployment) –
aave (AaveV3Deployment) –
uniswap (UniswapV3Deployment) –
state (State) –
pair_universe (PandasPairUniverse) –
tx_builder (Optional[TransactionBuilder]) –
Methods
__init__
(one_delta, aave, uniswap, state, ...)buy
(pair, amount_in_usd[, execute])Buy token (trading pair) for a certain value.
create_routing_model
()execute_trades_simple
(routing_model, trades)Execute trades on web3 instance.
sell
(pair, quantity[, execute])Sell token token (trading pair) for a certain quantity.
Attributes
web3
- __init__(one_delta, aave, uniswap, state, pair_universe, tx_builder=None)[source]#
- Parameters:
one_delta (OneDeltaDeployment) –
aave (AaveV3Deployment) –
uniswap (UniswapV3Deployment) –
state (State) –
pair_universe (PandasPairUniverse) –
tx_builder (Optional[TransactionBuilder]) –
- 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:
- execute_trades_simple(routing_model, trades, max_slippage=0.01, stop_on_execution_failure=True)[source]#
Execute trades on web3 instance.
A testing shortcut
Create BlockchainTransaction instances
Execute them on Web3 test connection (EthereumTester / Ganache)
Works with single Uniswap test deployment
- Parameters:
routing_model (OneDeltaRouting) –
trades (List[TradeExecution]) –
- Return type: