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

Create simple "CFM" bot #522

Open
davidsiska-vega opened this issue Oct 9, 2023 · 2 comments · May be fixed by #528
Open

Create simple "CFM" bot #522

davidsiska-vega opened this issue Oct 9, 2023 · 2 comments · May be fixed by #528
Assignees

Comments

@davidsiska-vega
Copy link
Contributor

The aim is to create a simple CFM bot that will place volume according to the $xy=k$ formula.

The logic should be the following:

  • work out the volume at each tick between one tick from last traded price to min / max implied by the lpPriceRange parameter.
  • at each time step it should cancel all it's old volume and dump new volume on the book.
  • Use $xy = k_b$ for incoming buy orders and $xy = k_s$ for incoming sell orders with $k_b$ and $k_s$ adjusted based on position size, so that "if I am already short buy orders get a bad price from me but sell orders get a good price from me".

Context: we want to get a feeling for how this: vegaprotocol/specs#1990 would work.

Follow up: once this is done we'll do a ticket for a Uniswap v3 type curve. One step at a time.

@davidsiska-vega
Copy link
Contributor Author

How much volume should be implied: there is an example here: https://docs.google.com/spreadsheets/d/1sb-oS9V5qcMDLy2YVoUrXmZZpJqZLBYzR8B2mi68Tas/edit?usp=sharing

@davidsiska-vega
Copy link
Contributor Author

davidsiska-vega commented Oct 9, 2023

Section 2 here has some of the background blah-blah: https://github.com/vegaprotocol/research-internal/blob/master/cash-settl-fut-cpm/cash-settl-fut-cpm.tex

@TomMcL TomMcL self-assigned this Oct 9, 2023
@davidsiska-vega davidsiska-vega linked a pull request Oct 14, 2023 that will close this issue
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 a pull request may close this issue.

2 participants