Skip to content

Create simple "CFM" bot #522

Open
@davidsiska-vega

Description

@davidsiska-vega

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.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions