Skip to content

Commit

Permalink
Merge pull request #18 from vegaprotocol/improvements-bots
Browse files Browse the repository at this point in the history
feat: allow to disable amm and bump vega-market-sim
  • Loading branch information
daniel1302 authored Oct 9, 2024
2 parents 7de7633 + ae1a055 commit b8edd54
Show file tree
Hide file tree
Showing 6 changed files with 135 additions and 246 deletions.
3 changes: 2 additions & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@
"VEGA_USER_WALLET_NAME": "vegamarketsim",
"VEGA_WALLET_TOKENS_FILE": "${workspaceFolder}/network/wallet-info.json",
"VEGA_WALLET_TOKENS_PASSPHRASE_FILE": "${workspaceFolder}/assets/passphrase.txt",
"PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION": "python"
"PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION": "python",
"PYTH_PRICE_PULL_API_URL": "http://price-pusher.vega.rocks:8080"
}
}
]
Expand Down
6 changes: 6 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"cSpell.words": [
"healthcheck",
"vegawallet"
]
}
2 changes: 2 additions & 0 deletions bots/config/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@ class ScenarioSimulationConfig:

@dataclass
class ScenarioAutomatedMarketMaker:
enabled: bool
commitment_amount: int
proposed_fee: float
lower_bound_scaling: float
Expand Down Expand Up @@ -298,6 +299,7 @@ def scenario_simulation_config_from_json(json: dict[str, any]) -> ScenarioSimula

def scenario_automated_market_maker_config_from_json(json: dict[str, any]) -> ScenarioAutomatedMarketMaker:
return ScenarioAutomatedMarketMaker(
enabled=bool(json.get("enabled", False)),
commitment_amount=int(json.get("commitment_amount", 100000)),
proposed_fee=float(json.get("proposed_fee", 0.0001)),
lower_bound_scaling=float(json.get("lower_bound_scaling", 0.9)),
Expand Down
2 changes: 1 addition & 1 deletion bots/services/scenario.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ def _scenarios_from_config(
update_bias=config[scenario_name].automated_market_maker.update_bias,
slippage_tolerance=config[scenario_name].automated_market_maker.slippage_tolerance,
initial_mint=config[scenario_name].automated_market_maker.initial_mint,
),
) if config[scenario_name].automated_market_maker.enabled else None,
auction_trader_args=AuctionTraderArgs(
initial_volume=config[scenario_name].auction_trader.initial_volume,
initial_mint=config[scenario_name].auction_trader.initial_mint,
Expand Down
Loading

0 comments on commit b8edd54

Please sign in to comment.