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

Implement "Your Liquidity" page #72

Closed
3 tasks
kcole16 opened this issue Apr 29, 2021 · 2 comments
Closed
3 tasks

Implement "Your Liquidity" page #72

kcole16 opened this issue Apr 29, 2021 · 2 comments
Assignees

Comments

@kcole16
Copy link
Contributor

kcole16 commented Apr 29, 2021

Overview

Implement the "Your Liquidity" page from the designs. This page will show the user's active LP positions.

Designs: https://www.figma.com/file/fuv8rWM8NGxKUKw2OAFsbn/Ref.Finance?node-id=710%3A65

Acceptance Criteria

  • "Your Liquidity" is the top choice in the "Pools" dropdown
  • All of the users LP positions are shown
  • Selecting "Add Liquidity" takes the user to the /pools page
@marco-sundsk
Copy link

For this to happen smoothly, I suggest to do some modification on contract side. My suggestion is in ref-finance/ref-contracts#23 . So please take a look into it and give some response.

@kcole16
Copy link
Contributor Author

kcole16 commented May 21, 2021

you can query
https://pixelparty.pixeldapps.co/api/lpData
as post request with:

  • account_id
  • type (add or remove, to get all add_liquidity or all remove_liquidity calls of a wallet)

returns list of:
-token1 amount added/removed
-token2 amount added/removed
-pool_id
Since we are using only a free plan, it's a better idea to do the remaining processing on the client instead of putting that workload on the backend
Tried to move the aggregation to the postgres-server, but there is no fitting int-datatype in pg and text/string is not supported
so workflow is something like:

  • call endpoint with type add
    --group by pool_id and make sum per group

-call endpoint with type remove
--group by pool_id and make a sum per group

substract it

"data": [
        {
            "token1": "25000000000000000000000000",
            "token2": "145116144",
            "pool_id": 3
        },
        {
            "token1": "4984372680113417000000000",
            "token2": "20767321",
            "pool_id": 3
        },
        {
            "token1": "11813949270969448000",
            "token2": "5000",
            "pool_id": 528
        },
        {
            "token1": "2000000000000000000000000",
            "token2": "33175541150730607000000",
            "pool_id": 567
        }
}
]

example response

@aidai524 aidai524 closed this as completed Jun 9, 2021
@aidai524 aidai524 reopened this Jun 9, 2021
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

3 participants