Skip to content

Commit

Permalink
fix: exceptions for full wallet runs
Browse files Browse the repository at this point in the history
  • Loading branch information
cdummett committed Oct 3, 2023
1 parent 3e4ece9 commit 9ecfbe2
Showing 1 changed file with 23 additions and 18 deletions.
41 changes: 23 additions & 18 deletions vega_sim/scenario/fuzzed_markets/agents.py
Original file line number Diff line number Diff line change
Expand Up @@ -640,26 +640,31 @@ def step(self, vega_state):
market_id=self.market_id,
)
for side, spec in buy_specs + sell_specs:
self.vega.submit_order(
trading_key=self.key_name,
trading_wallet=self.wallet_name,
try:
self.vega.submit_order(
trading_key=self.key_name,
trading_wallet=self.wallet_name,
market_id=self.market_id,
order_type="TYPE_LIMIT",
time_in_force="TIME_IN_FORCE_GTC",
pegged_order=PeggedOrder(reference=spec[0], offset=spec[1]),
volume=spec[2] * commitment_amount,
side=side,
wait=False,
)
except HTTPError:
continue
try:
self.vega.submit_liquidity(
key_name=self.key_name,
wallet_name=self.wallet_name,
market_id=self.market_id,
order_type="TYPE_LIMIT",
time_in_force="TIME_IN_FORCE_GTC",
pegged_order=PeggedOrder(reference=spec[0], offset=spec[1]),
volume=spec[2] * commitment_amount,
side=side,
wait=False,
fee=fee,
commitment_amount=commitment_amount,
is_amendment=self.random_state.choice([True, False, None]),
)

self.vega.submit_liquidity(
key_name=self.key_name,
wallet_name=self.wallet_name,
market_id=self.market_id,
fee=fee,
commitment_amount=commitment_amount,
is_amendment=self.random_state.choice([True, False, None]),
)
except HTTPError:
return


class SuccessorMarketCreatorAgent(StateAgentWithWallet):
Expand Down

0 comments on commit 9ecfbe2

Please sign in to comment.