vitelabs / bounties

The Bounty program is to help the community take part in the development of the Vite ecosystem.
MIT License
9 stars 6 forks source link

Bridgeswap Frontend (Vuilder DAO Bounty) #28

Open joelyangxyz opened 2 years ago

joelyangxyz commented 2 years ago

Purpose

The Vite ecosystem needs an automated market maker like Uniswap so that:

  1. Users have another decentralized exchange to arbitrage with ViteX
  2. Vite holders can earn dividends for providing liquidity
  3. New tokens can be listed for free

Frontend Requirements

  1. Project is based off of Vite Express
  2. UI/UX similar to Uniswap
  3. Has a homepage that displays top pools like on this page
  4. Has a component that allows selecting the token to sell, the token to buy, the amount to sell, the amount to receive, and the maximum slippage. Component also displays the exchange rate and amount of each token in the pool.
  5. Has a component that allows adding/removing liquidity from pools

Contract Requirements

  1. Uses Solidity++ 0.8
  2. Unit tests for all contract functionality using the setup provided by Vite Express
  3. Takes into account "Frontend Requirements"
  4. Each trading pair maintains separate accounting of deposited tokens/liquidity
  5. Amount of liquidity provided by each user is stored in a mapping (see note 1 below)
  6. Trading pairs must be unique (no duplicate pairs)
  7. Users can swap tokens for any listed trading pair
  8. Users can add/remove liquidity to any trading pair (the trading pair is created/removed if there is no liquidity)
  9. Adding liquidity is a multi-transaction process due to the limitation that only a single token type can be sent in a Vite transaction (see note 2 below)
  10. Either a single token or both tokens can be added
  11. Swap fees are applied to liquidity deposit if added token liquidity is not balanced based on the current swap rate
  12. Swaps must have slippage limit (a minimum token received) and a deadline (swap not executed after a given snapshot height)
  13. Swaps have fixed percent fee paid to liquidity providers
  14. Feel free to use our past AMM bounty winner bridgeswap for inspiration (it fulfills most, but not all contract requirements for this bounty)

Notes

  1. Tokens on Vite are native to the Vite protocol, and do not have many features/options that ERC-20 tokens have. As such, the amount of liquidity provided to the contract by an address should only be accounted internally by the contract state using a mapping (rather than with an additional contract-based token like in Uniswap).
  2. In Vite, each transaction can only send a single native token. Providing liquidity to an AMM requires providing two different tokens, thus requiring two transactions. One way to get around this limitation is to allow deposits and withdrawals (of each token type) into a "holding pool", and then once those tokens are deposited, invoke a function to confirm providing liquidity with an additional function call.
  3. There is no gas in Vite. Instead, contracts require Vite to be locked to provide quota for the contract. This allows the contract to have a certain throughput based on the amount of Vite staked. As such, keeping a contract consolidated rather than spread out among multiple contracts is often a better approach, so an operator does not need to split Vite reserves to provide quota among several contracts

Prizes

Judging Criteria

Winner Announcement

Resources

Follow Vite on social media

gitcoinbot commented 2 years ago

Issue Status: 1. Open 2. Started 3. Submitted 4. Done


This issue now has a funding of 1860.3721 USD attached to it as part of the vitelabs fund.

gitcoinbot commented 2 years ago

Issue Status: 1. Open 2. Started 3. Submitted 4. Done


Work has been started.

These users each claimed they can complete the work by 264 years, 5 months from now. Please review their action plans below:

1) leonboripgs has started work.

Will build swap UI with Next.js + Web3.js 2) hieple7985 has started work.

My brief plan

  1. Init Project from Vite Express
  2. Build Swap UI
  3. Dev Functions

Learn more on the Gitcoin Issue Details page.

hieple7985 commented 2 years ago

@ouivitejoel I don't know where to reach you, but would like to inform that the project is on going on my side.

Please tell me which channel I can reach you moment for weekly update communication?

lyledavids commented 1 year ago

@ouivitejoel Is this bounty still active? Want to attempt it

@hieple7985 Try the Vite discord

gitcoinbot commented 1 year ago

Issue Status: 1. Open 2. Started 3. Submitted 4. Done


The funding of 1860.372 USD (1860.00 USD @ $1.0/USD) attached to this issue has been cancelled by the bounty submitter