From 66c3c6cfeeb3986746e60616b6aeae32dc08be15 Mon Sep 17 00:00:00 2001 From: Charlie <charlie@vegaprotocol.io> Date: Wed, 6 Dec 2023 14:38:19 +0000 Subject: [PATCH] fix: use default price monitoring --- examples/visualisations/auction_exit.py | 2 +- examples/visualisations/utils.py | 17 +++++++++++++---- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/examples/visualisations/auction_exit.py b/examples/visualisations/auction_exit.py index e33c2bfa1..b63c25426 100644 --- a/examples/visualisations/auction_exit.py +++ b/examples/visualisations/auction_exit.py @@ -56,7 +56,7 @@ def run(self, pause: bool = False, test: bool = False): maker_fee=0.001, liquidity_fee=0.001, infrastructure_fee=0.001, - price_monitoring=True, + default_price_monitoring=True, ) # Create wallets and keys for traders diff --git a/examples/visualisations/utils.py b/examples/visualisations/utils.py index c9edfacb4..7f176d8c2 100644 --- a/examples/visualisations/utils.py +++ b/examples/visualisations/utils.py @@ -18,6 +18,8 @@ from vega_sim.service import PeggedOrder from vega_sim.api.market import MarketConfig +import vega_sim.proto.vega as vega_protos + PartyConfig = namedtuple("WalletConfig", ["wallet_name", "key_name"]) @@ -49,7 +51,7 @@ def continuous_market( maker_fee: float = 0, liquidity_fee: float = 0, infrastructure_fee: float = 0, - price_monitoring: bool = False, + default_price_monitoring: bool = False, ): """Creates a default market and exits the auction into continuous trading. @@ -89,7 +91,7 @@ def continuous_market( mint_settlement_asset(vega=vega, asset_id=asset_id) market_id = propose_market( - vega=vega, asset_id=asset_id, price_monitoring=price_monitoring + vega=vega, asset_id=asset_id, price_monitoring=default_price_monitoring ) provide_liquidity(vega=vega, market_id=market_id, fee=liquidity_fee) @@ -230,8 +232,15 @@ def propose_market( name=AUX_PARTY_A.key_name, ), ) - if not price_monitoring: - market_config.set("price_monitoring_parameters.triggers", []) + if not default_price_monitoring: + market_config.set( + "price_monitoring_parameters.triggers", + [ + vega_protos.markets.PriceMonitoringTrigger( + horizon=24 * 3600, probability="0.999999", auction_extension=5 + ) + ], + ) vega.create_market_from_config( proposal_wallet_name=AUX_PARTY_A.wallet_name,