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

linear liquidity strategies in pcli #4800

Merged
merged 1 commit into from
Aug 12, 2024
Merged

Conversation

hdevalence
Copy link
Member

@hdevalence hdevalence commented Aug 10, 2024

Closes #4112

Describe your changes

Description TK

Screenshot 2024-08-10 at 5 01 56 PM

This strategy is the line labeled "demo", and it's simpler to implement than UniV3 but with a similarly shaped PVF

Issue ticket number and link

Checklist before requesting a review

  • If this code contains consensus-breaking changes, I have added the "consensus-breaking" label. Otherwise, I declare my belief that there are not consensus-breaking changes, for the following reason:

    REPLACE THIS TEXT WITH RATIONALE (CAN BE BRIEF)

@hdevalence
Copy link
Member Author

There are rendering issues when using this with USDC, because there's no entry in the asset registry, so it shows a rounded price for upenumbra in terms of uusdc:

You want to provide liquidity on the pair upenumbra:transfer/channel-2/uusdc
You will need:
 -> 121945740upenumbra
 -> 31250000transfer/channel-2/uusdc
You will create the following positions:
 ID                                                                State     Fee                      Sell Price                         Reserves
 plpid1j9mdlj040jd32swz32c3ycc95ayu5ff9t36scng0mp3y04zxdpgq05fflq  opened  50bps                      4upenumbra  6250000transfer/channel-2/uusdc
 plpid194g8zhvpf9qkehz0yszqm425swvcgtgc2jyapewcytk4cxc2szrqqeun5y  opened  50bps                      4upenumbra  6250000transfer/channel-2/uusdc
 plpid1lxmtpwv9rpgwkfam6tvetke7pg2pzwhgpq4hr3yf76lpffak26xqa4nt2z  opened  50bps                      4upenumbra  6250000transfer/channel-2/uusdc
 plpid1mq7p9d8yadlgdk4dl5cwsv7pmx4e5xmufuvt0h3gthjm85mzwreqz3kr2j  opened  50bps                      3upenumbra  6250000transfer/channel-2/uusdc
 plpid17dwusw4qc6xf26xfy940hxda0usxcxvrrqaglhrke7r6efvfdksq5334wn  opened  50bps                      3upenumbra  6250000transfer/channel-2/uusdc
 plpid1kp84g54yq3m24nqwrv7vz9g2u96z679mrl4ght3c76c7y4ch4v3sf8uezp  opened  50bps  416666transfer/channel-2/uusdc                       15penumbra
 plpid1hkny675ladn7uf3z2jza9vh8lwu5z7eceehyyvs2dlzvy2gl0kpsy77lpj  opened  50bps  450001transfer/channel-2/uusdc                13.888888penumbra
 plpid16n0f9wduwmtc6g95hpsyd9s4a7cs2x30f0k5ryntc6le09760cuqcw4tne  opened  50bps  483334transfer/channel-2/uusdc                12.931034penumbra
 plpid1zzrywrtjv73xh0ssrf5j3yya2alnr4myzanljec7dgklj8pvpqdq6pt59v  opened  50bps  516667transfer/channel-2/uusdc                12.096774penumbra
 plpid1cx9kg6sjsgqzjj2age6hk3gypyau082y62rkms5s2v6tdf4phz0qv86f6z  opened  50bps  550001transfer/channel-2/uusdc                11.363636penumbra
 plpid1vlm45q8a0zjadns3d5zddl684yykfv7h7lxcqwqvy3uspdrvs4csl6s62z  opened  50bps  583334transfer/channel-2/uusdc                10.714285penumbra
 plpid1jgwsegzklgpe9vkht2lmwwzw8h275l6xd56vmdflawyqujtnur0q89t7hd  opened  50bps  616667transfer/channel-2/uusdc                10.135135penumbra
 plpid1lh73fch4x9tqvw9x2ztq0lwnrmxdq6ajldnjs4uz75298vvuekps658dt0  opened  50bps  650001transfer/channel-2/uusdc                 9.615384penumbra
 plpid1nuqx0mcdwjptzaky7eamsqd0hr4cfh23nwzd4ahws9lwazf68zlqd4n9xw  opened  50bps  683334transfer/channel-2/uusdc                 9.146341penumbra
 plpid1e3tpqprrqgra9z0s36xvy68mcxv2rlfyt9dw2xl5v437hxc5f3rsj0lvf0  opened  50bps  716667transfer/channel-2/uusdc                  8.72093penumbra
 plpid16ykmlz4yur94slvd7sx77cs6v5arpscrrjd4vdf0p92dy7srq3aqlvkzcm  opened  50bps  750001transfer/channel-2/uusdc                 8.333333penumbra

This should be fixed by allowing pcli to load a registry from its home directory rather than rearranging the rendering code

@hdevalence
Copy link
Member Author

Rebased on top of #4801

@aubrika aubrika added this to the Sprint 10 milestone Aug 12, 2024
@aubrika aubrika marked this pull request as ready for review August 12, 2024 20:05
@aubrika aubrika changed the title [WIP]: linear liquidity strategies in pcli linear liquidity strategies in pcli Aug 12, 2024
@conorsch conorsch requested a review from cronokirby August 12, 2024 20:23
Copy link
Contributor

@cronokirby cronokirby left a comment

Choose a reason for hiding this comment

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

LGTM, tested the different options with an actual registry. There are some rough edges we can sand off in subsequent PRs related to parsing using the asset registry, to avoid needing to know internal asset identification as thoroughly.

@conorsch
Copy link
Contributor

There are some rough edges we can sand off in subsequent PRs related to parsing using the asset registry

Tracked in #4803.

@conorsch conorsch merged commit 002c482 into main Aug 12, 2024
13 checks passed
@conorsch conorsch deleted the pcli-lp-replicate-linear branch August 12, 2024 22:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

dex_utils: implement v3 approximations
4 participants