diff --git a/vega_query/visualisations/overlay.py b/vega_query/visualisations/overlay.py index ff01eaaf..b7392aa9 100644 --- a/vega_query/visualisations/overlay.py +++ b/vega_query/visualisations/overlay.py @@ -898,14 +898,13 @@ def overlay_cumulative_volume( trades: List[protos.vega.vega.Trade], price_decimals: int, size_decimals: int, + **kwargs, ): x = [] # List to store timestamps y = [] # List to store cumulative volume cumulative_volume = 0 # Initialize cumulative volume - trades = reversed(trades) - - for trade in trades: + for trade in reversed(trades): # Convert timestamp to datetime for x-axis timestamp = timestamp_to_datetime(trade.timestamp, nano=True) x.append(timestamp) @@ -918,25 +917,15 @@ def overlay_cumulative_volume( # Calculate traded volume (price * size) volume = price * size if price != 0 else 0 - # Debugging: Print current values - print(f"Trade timestamp: {trade.timestamp}, Price: {price}, Size: {size}, Volume: {volume}") - # Accumulate volume (ensure volume is positive) cumulative_volume += abs(volume) y.append(cumulative_volume) else: # If price or size is missing, assume no change in cumulative volume y.append(cumulative_volume) - print(f"Missing price or size for trade at {trade.timestamp}") # Plot the cumulative volume data using step plot - ax.step(x, y, label="Cumulative Volume", where="post") - - # Optionally, set labels and title for clarity - ax.set_xlabel('Timestamp') - ax.set_ylabel('Cumulative Volume') - ax.set_title('Cumulative Volume Over Time') - ax.legend() + ax.step(x, y, label="Cumulative Volume", where="post", **kwargs) def overlay_maker_fee( ax: Axes, diff --git a/vega_query/visualisations/plots/amm.py b/vega_query/visualisations/plots/amm.py index bd11e266..4fdddd5f 100644 --- a/vega_query/visualisations/plots/amm.py +++ b/vega_query/visualisations/plots/amm.py @@ -79,8 +79,8 @@ def create( if market_data_history is not None: overlay_mark_price(axn0l, market_data_history, market.decimal_places) overlay_trading_mode(axn0r, market_data_history) - overlay_auction_starts(axn0r, market_data_history) - overlay_auction_ends(axn0r, market_data_history) + # overlay_auction_starts(axn0r, market_data_history) + # overlay_auction_ends(axn0r, market_data_history) axn0l.set_ylabel("USDT") axn0l.set_title( diff --git a/vega_sim/scenario/amm/scenario.py b/vega_sim/scenario/amm/scenario.py index 4b668ea4..317a38ff 100644 --- a/vega_sim/scenario/amm/scenario.py +++ b/vega_sim/scenario/amm/scenario.py @@ -68,7 +68,7 @@ def configure_agents( key_name=f"AutomatedMarketMaker_{benchmark_config.market_config.instrument.code}_{str(i_agent).zfill(3)}", market_name=benchmark_config.market_config.instrument.name, initial_asset_mint=1e6, - commitment_amount=10_000, + commitment_amount=7000, slippage_tolerance=0.05, proposed_fee=self.amm_liquidity_fee, price_process=iter(benchmark_config.price_process),