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

[Epic] Calculate user liquidity positions #2

Open
12 tasks
shrnkld opened this issue Dec 22, 2022 · 0 comments
Open
12 tasks

[Epic] Calculate user liquidity positions #2

shrnkld opened this issue Dec 22, 2022 · 0 comments
Labels
enhancement New feature or request

Comments

@shrnkld
Copy link
Contributor

shrnkld commented Dec 22, 2022

Work in progress - not ready to start!

Task 1: Extend the data model

Description:
Add a new table to the database schema to store user liquidity positions.

To do:

  • Create a new table named UserLiquidity.
  • Define columns: id, user_address, token_address, native_asset_address, liquidity, block_id, and timestamp.

Task 2: Update the EventProcessor class

Description:
Update the EventProcessor class to calculate user liquidity positions and store them in the newly created UserLiquidity table.

To do:

  • Modify the _process() method in the EventProcessor class to calculate user liquidity positions.
  • Retrieve user transactions related to token pairs being tracked.
  • Calculate user liquidity positions for each block based on their transactions.
  • Store calculated user liquidity positions in the UserLiquidity table.
  • Leverage Redis cache to avoid redundant calculations.

Task 3: Write tests for the new functionality

Description:
Write unit tests to ensure the new functionality works as expected and the data is stored correctly in the UserLiquidity table.

To do:

  • Write unit tests for the modified _process() method in the EventProcessor class.
  • Test that the user liquidity positions are calculated correctly and stored in the UserLiquidity table.
  • Test the integration with Redis cache.

Task 4: Update the API to return user liquidity positions

Description:
Update the API to return user liquidity positions.

To do:

  • Add an endpoint to the API to return user liquidity positions.
  • Implement necessary queries in the backend to fetch data from the UserLiquidity table.
@shrnkld shrnkld added the enhancement New feature or request label Dec 22, 2022
@shrnkld shrnkld transferred this issue from blocknetdx/xquery-v2-testing Apr 26, 2023
@shrnkld shrnkld moved this to Backlog in XQuery MVP Project Apr 28, 2023
@shrnkld shrnkld changed the title Calculate user liquidity positions [Epic] Calculate user liquidity positions May 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Backlog
Development

No branches or pull requests

1 participant