Skip to content

Commit

Permalink
fix: improve risky logic (#512)
Browse files Browse the repository at this point in the history
  • Loading branch information
cdummett authored Sep 19, 2023
1 parent ffea423 commit 54f667d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions vega_sim/scenario/fuzzed_markets/agents.py
Original file line number Diff line number Diff line change
Expand Up @@ -344,16 +344,17 @@ def step(self, vega_state):
self.commitment_amount = 0
return

midprice = vega_state.market_state[self.market_id].midprice

if (
vega_state.market_state[self.market_id].trading_mode
!= markets_protos.Market.TradingMode.TRADING_MODE_CONTINUOUS
or midprice == 0
):
return
if self.random_state.rand() > self.step_bias:
return

midprice = vega_state.market_state[self.market_id].midprice

if account.general > 0:
add_to_margin = max(
(account.general + account.margin) * self.size_factor - account.margin,
Expand Down

0 comments on commit 54f667d

Please sign in to comment.