generate_tvl_candles#

API documentation for tradeexecutor.testing.synthetic_price_data.generate_tvl_candles Python function.

generate_tvl_candles(bucket, start, end, start_liquidity, daily_drift=(0.95, 1.05), high_drift=1.05, low_drift=0.9, random_seed=1, pair_id=1, exchange_id=1)[source]#

Generate synthetic liquidity candles.

  • Generate OHLC data for liquidity candles

Example:

# Pool liquidity for this pair stays at fixed $150k
liquidity_candles = generate_tvl_candles(
    time_bucket,
    start_at,
    end_at,
    start_liquidity=150_000,
    pair_id=weth_usdc.internal_id,
    daily_drift=(1.00, 1.00),
    high_drift=1.00,
    low_drift=1.00,
    random_seed=1,
)
liquidity_candles = GroupedLiquidityUniverse.create_from_single_pair_dataframe(liquidity_candles)
Parameters:
Return type:

DataFrame