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

[Curve V2] Issue 1: Liquidity Pool Implementation #40

Open
polarker opened this issue Nov 16, 2024 · 9 comments · May be fixed by #47
Open

[Curve V2] Issue 1: Liquidity Pool Implementation #40

polarker opened this issue Nov 16, 2024 · 9 comments · May be fixed by #47
Assignees
Labels

Comments

@polarker
Copy link
Member

Parent issue: #25

Objective:

Build the functionality for adding and withdrawing assets into/from liquidity pools, supporting both stablecoins and volatile assets.

Description:

This issue focuses on setting up liquidity pools where users can deposit and withdraw assets. It includes tracking LP shares and distributing LP tokens proportionally.

Tasks:

  1. Implement functions for users to deposit assets into liquidity pools.
  2. Enable users to withdraw their assets while accurately updating pool reserves.
  3. Add support for liquidity pools with both stablecoins and volatile assets.
  4. Develop mechanisms to track user shares and issue LP tokens.
  5. Write unit tests to validate deposit, withdrawal, and LP token functionality.

Acceptance Criteria:

  • Users can deposit and withdraw assets efficiently.
  • LP tokens are issued and burned correctly, reflecting user shares.
  • Pools support stablecoins and volatile assets simultaneously.
  • Tests cover edge cases, such as extreme pool imbalances or high volatility.
@NueloSE
Copy link

NueloSE commented Nov 20, 2024

@polarker, kindly assign me the above task. would like to contribute to this awesome project

@kfastov
Copy link
Collaborator

kfastov commented Nov 21, 2024

Hi @NueloSE !
Please kindly apply via the ODHack page, so it would be easier for us to track the issues 😊
Also, don't hesitate to join the project group (if you haven't already): https://t.me/alph_devhouse

@mimisavage
Copy link

Can I take this issue?

@Supa-mega
Copy link

can i take this issue

@BrunoAmbricca
Copy link

I would like to work on this issue

@Benjtalkshow
Copy link

Could I take a shot at this?

@nagxsan
Copy link

nagxsan commented Nov 21, 2024

I have professional experience building products using TypeScript and I was planning on building a liquidity pool project while learning. This would be a great task for me to learn hands-on how to build industry-level functionality around true liquidity pools. I would be truly obliged if I could pick this task up.

@od-hunter
Copy link

Hello @polarker , can I be assigned this issue? My experience includes html, css, react, javaScript, typescript, solidity & Cairo.

To solve this issue, I'll take the following steps:

  1. I'll define state variables for poolReserves (tracking each asset's balance), lpShares (mapping user addresses to their LP share), and totalShares (tracking total LP tokens issued).
  2. I'll create a deposit() function that accepts the token address and amount, updates poolReserves for the deposited asset and calculates the LP tokens to mint using a proportional formula.
    3.I'll implement a withdraw() function that accepts the number of LP tokens for redemption, calculates the user's share of the pool's reserves and updates poolReserves, burns LP tokens, and transfers the corresponding asset back to the user.
  3. I'll integrate support for stablecoins and volatile assets by leveraging a priceFeed mechanism to fetch real-time prices for volatile assets during deposit and withdrawal operations.
  4. I'll use an ERC-20-compatible LP token contract to mint tokens during deposits and burn tokens during withdrawals.
  5. Lastly, I'll write unit tests.

Kindly, assign I'm ready to work.

@od-hunter
Copy link

Hello @polarker , can you please merge my pr? Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

9 participants