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

Consider order book/AMM hybrid design #679

Open
alnoki opened this issue Jan 29, 2024 · 0 comments
Open

Consider order book/AMM hybrid design #679

alnoki opened this issue Jan 29, 2024 · 0 comments

Comments

@alnoki
Copy link
Member

alnoki commented Jan 29, 2024

  1. Min size should be min_post_size since the AMM can theoretically take any size order
  2. For swap APIs just accept input amount and allowed price impact in bps
  3. Allow sub-lot amounts e.g. "dust" to fill against pool alone
    1. If filling 1.2 lots as final operation, consolidate into a 1.2 lot instead of a 1 lot, then a 0.2 lot fill based on looking at order book price before returning to AMM
  4. Calculate effective price after fees since pool has more fees than order book to compensate LPs. Fees:
    1. LP fees (pool only)
    2. Integrator fees (pool and book)
    3. Market fees (pool and book)
  5. Integrator and market fees should be collected only in quote asset, while LP fees should be used to balance out the pool. For integrator/market fees assessed on a pool match, they should be assessed on the output of a sell and the input of a buy
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

No branches or pull requests

1 participant