uniswap_v2.synthetic_data

Documentation for eth_defi.uniswap_v2.synthetic_data Python module.

Functions

generate_fake_uniswap_v2_data(uniswap_v2, ...)

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 EthereumTester and disables transaction auto mining.

Parameters
Returns

Dictionary of some statistics about the generated trades

Return type

dict