Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: integrate vAMM into market-sim #672

Merged
merged 15 commits into from
Jul 18, 2024
Merged

feat: integrate vAMM into market-sim #672

merged 15 commits into from
Jul 18, 2024

Conversation

cdummett
Copy link
Collaborator

@cdummett cdummett commented May 16, 2024

closes #671

PR adds the plumbing for integrating AMMs into market-sim and adds some AMM agents into the fuzzing for quick wins.

Examples:

Run a benchmark scenario with a static AMM (no base price updates).

python -m vega_sim.scenario.amm.run -m static -s 1000 -o -p

AMM Scenario:

An AMM scenario has been added which modifies the benchmark scenario by adding a single AMM agent and a mean-reverting Ornstein-Uhlenbeck price process.

Plots show the basic mechanisms of the AMM agent behaving as expected.

  • short for prices > base price
  • long for prices < base price
  • loses money as the price diverges from the base price
  • gains money as the price converges on the base price

amm

Monte-Carlo Testing:

The AMM scenario was run multiple times with the following OH parameters:

  • sigmas = [0.2, 0.4, 0.6, 0.8, 1.0]
  • thetas = [0.000, 0.005, 0.010, 0.015, 0.020]

Plots show expected behavior.

  • slower reversion to the mean (base price) increases AMMs risk
  • greater volatility increase AMMs returns "ceiling" but increases risk of loses

positions
balance

@cdummett cdummett self-assigned this May 16, 2024
@cdummett cdummett force-pushed the feat/vamm branch 3 times, most recently from 28066c8 to d1a01c2 Compare June 17, 2024 14:31
@cdummett cdummett marked this pull request as ready for review June 17, 2024 16:18
@cdummett cdummett requested a review from a team as a code owner June 17, 2024 16:18
daniel1302
daniel1302 previously approved these changes Jul 15, 2024
Copy link
Contributor

@daniel1302 daniel1302 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it should be good to merge. I have tested it in live environment(stagnet1) and all is working well. Here is a bots PR: vegaprotocol/research-bots#16

@cdummett cdummett merged commit 19a3f26 into develop Jul 18, 2024
6 of 7 checks passed
@cdummett cdummett deleted the feat/vamm branch July 18, 2024 07:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

vAMM agents
3 participants