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

dex_utils: implement v3 approximations #4112

Closed
Tracked by #1724
erwanor opened this issue Mar 26, 2024 · 3 comments · Fixed by #4800
Closed
Tracked by #1724

dex_utils: implement v3 approximations #4112

erwanor opened this issue Mar 26, 2024 · 3 comments · Fixed by #4800
Assignees
Labels
A-dex Area: Relates to the dex _P-high High priority _P-V1 Priority: slated for V1 release
Milestone

Comments

@erwanor
Copy link
Member

erwanor commented Mar 26, 2024

Is your feature request related to a problem? Please describe.
Currently, our implementation of replicated market makers only support approximating the x*y=k curve over an "infinite" liquidity range. As pointed by @hdevalence, this means that the position distribution is skewed at the extremes of this range:

 ID                                                                State     Fee        Sell Price             Reserves
 plpid1t0yx3cn2fp72s7gy09ra4zrvx7nacc2ftpp85d5m7aqhffglv03suncr9a  opened  42bps        10penumbra         740.967746gn
 plpid1xt2vdazq9j4wpmpe29cj2rc2768k0hta9a32sk0j0h640l2c4gmsnswvp8  opened  42bps         5penumbra         243.814939gn
 plpid1a5z05wwsvrc4hu9v4azw76d6m84837lvtvrtulgv6czlxpraxjmqkr9lwz  opened  42bps  3.333334penumbra         189.311849gn
(snip)
 plpid1vn7jydp9cx9vf7kuk7qcc7ff7qv3v4ftj3v3eujdn8rmytffuqas0ce9ca  opened  42bps        2.800001gn    21.351881penumbra
 plpid15jn60qg5s590kzu25qr7nxpe8ujkyg5h0mlsee94aa6ev205pv9sw2sxj0  opened  42bps        2.900001gn    20.256501penumbra
 plpid1m5e8xchzl49td9s356ggge2e7e2vv3v4k7kywzssz2jtnc0ekktsnv5hj3  opened  42bps               3gn  1164.486839penumbra

It would be more capital efficient and just plain better to add a UniV3 concentrated liquidity replication that takes a price, an inventory, and a range, and builds the replicated portfolio corresponding to that curve.

@erwanor erwanor added the A-dex Area: Relates to the dex label Mar 26, 2024
@erwanor erwanor added this to Penumbra Mar 26, 2024
@github-project-automation github-project-automation bot moved this to Backlog in Penumbra Mar 26, 2024
@erwanor erwanor changed the title pcli(dex_utils): implement v3 approximations dex_utils: implement v3 approximations Apr 4, 2024
@erwanor erwanor self-assigned this Apr 4, 2024
@erwanor erwanor moved this from Backlog to Todo in Penumbra Apr 4, 2024
@erwanor erwanor added _P-V1 Priority: slated for V1 release _P-high High priority labels Apr 4, 2024
@aubrika aubrika added this to the Sprint 8 milestone May 30, 2024
@erwanor
Copy link
Member Author

erwanor commented May 30, 2024

I will pick this up next, @TalDerei could be a fun one to pair on.

@TalDerei
Copy link
Collaborator

I will pick this up next, @TalDerei could be a fun one to pair on.

that would be really great!

@erwanor erwanor moved this from Todo to In progress in Penumbra Jun 3, 2024
@erwanor
Copy link
Member Author

erwanor commented Jun 8, 2024

Not much progress on this yet, other than we sketched the PVF and we'll pair on building a julia notebook early next week

@erwanor erwanor moved this from In progress to Todo in Penumbra Jun 20, 2024
@erwanor erwanor moved this from Todo to In progress in Penumbra Jun 29, 2024
@aubrika aubrika modified the milestones: Sprint 8, Sprint 9 Jul 15, 2024
@aubrika aubrika modified the milestones: Sprint 9, Sprint 10 Aug 12, 2024
@github-project-automation github-project-automation bot moved this from In progress to Done in Penumbra Aug 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-dex Area: Relates to the dex _P-high High priority _P-V1 Priority: slated for V1 release
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants