uniswap_v2.synthetic_data
Documentation for eth_defi.uniswap_v2.synthetic_data Python module.
Functions
|
Create trades on EthereumTester Uniswap v2 instance. |
- generate_fake_uniswap_v2_data(uniswap_v2, deployer, base_token, quote_token, pair_address=None, base_liquidity=None, quote_liquidity=None, number_of_blocks=25, block_time=12, trades_per_block=3, min_trade=- 500, max_trade=500, random_seed=1)
Create trades on EthereumTester Uniswap v2 instance.
Deterministic random number generator used
Generate random trading data for the price feeds tests
Uses Uniswap smart contracts on EtheruemTester chain for actual trading, is ABI compatible with a real deployment
Quote slow, around 2 trades per second, so use scarcely
Warning
trades_per_block = 1 seems to be the only method that works with EthereumTester, otherwise you lose random transactions.
Note
Modified underlying
EthereumTesterand disables transaction auto mining.- Parameters
number_of_blocks – Number of new blocks and amount of trades we generate
pair_address (Optional[str]) – Give the existing deployed pair or initial liquidity.
base_liquidity (Optional[int]) – Liquidity added to the pool at start. Set to None to not to deploy.
quote_liquidity (Optional[int]) – Liquidity added to the pool at start. Set to None to not to deploy.
uniswap_v2 (eth_defi.uniswap_v2.deployment.UniswapV2Deployment) –
deployer (eth_typing.evm.HexAddress) –
base_token (eth_defi.token.TokenDetails) –
quote_token (eth_defi.token.TokenDetails) –
- Returns
Dictionary of some statistics about the generated trades
- Return type