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

Add a command to query all open positions in a PCLI wallet #4904

Merged
merged 2 commits into from
Oct 25, 2024

Conversation

cronokirby
Copy link
Contributor

Closes #4825.

Describe your changes

This adds a command: pcli v lps which displays all open liquidity positions owned by the wallet.

To test, try, e.g:

pcli tx position replicate linear --lower
-price 0.4 --upper-price 0.8 penumbra:gm 100gm --current-price 0.5

pcli v lps

Checklist before requesting a review

  • I have added guiding text to explain how a reviewer should test these changes.

  • 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:

    PCLI only.

Preserves the more convenient "lps" as an alias, which it is.
@conorsch
Copy link
Contributor

Works great!

❯ cargo run -q --release --bin pcli -- --home ~/.local/share/pcli view lps
Scanning blocks from last sync height 596375 to latest height 596375
[0s] ██████████████████████████████████████████████████       0/0       0/s ETA: 0s
 ID                                                                State    Fee  Sell Price             Reserves
 plpid1txm38c70q27rk5nm6fpmm9h0da20n3ljqzvw8cpc70mdjrwjfz0st2xltr  opened  0bps   1penumbra          997test_usd
 └──────────────────────────────────────────────────────────────▶          0bps   1test_usd     3.000146penumbra
 plpid1fj5td3yvjkscvr97y0wztmtzs4yfekjp5zxjrfaxwxczuzg2lgdqmxxc2m  opened  0bps   1test_usd  1000.000088penumbra

I tacked on one small change, renaming the option to be pcli view liquidity-positions, but preserved the shorthand version as an alias, so pcli view lps still works:

❯ cargo run -q --release --bin pcli -- --home ~/.local/share/pcli view --help
pcli-view
View your private chain state, like account balances

USAGE:
   pcli view <SUBCOMMAND>

OPTIONS:
   -h, --help    Print help information

SUBCOMMANDS:
   address                    View one of your addresses, either by numerical index, or a
                                  random ephemeral one
   auction                    View your auction information
   balance                    View your account balances
   help                       Print this message or the help of the given subcommand(s)
   liquidity-positions        View information about the liquidity positions you control
                                  [aliases: lps]
   list-transaction-hashes    Get transaction hashes and block heights of spendable notes
                                  [aliases: list-tx-hashes]
   noble-address              View the Noble forwarding address associated with one of your
                                  addresses, either by numerical index, or a random ephemeral one
   reset                      Deletes all scanned data and local state, while leaving keys
                                  untouched
   staked                     View your staked delegation tokens
   sync                       Synchronizes the client, privately scanning the chain state
   tx                         Displays a transaction's details by hash
   wallet-id                  View your wallet id

@cronokirby cronokirby merged commit fcce631 into main Oct 25, 2024
14 checks passed
@cronokirby cronokirby deleted the 4825-pcli-query-all-lps branch October 25, 2024 18:55
@cronokirby
Copy link
Contributor Author

Thanks!

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 this pull request may close these issues.

A convenient way to query all open lp positions from pcli
2 participants