{"id":24404101,"url":"https://github.com/jitendragangwar123/peer2play-swap","last_synced_at":"2026-04-16T08:31:53.877Z","repository":{"id":272807081,"uuid":"917791801","full_name":"jitendragangwar123/Peer2Play-Swap","owner":"jitendragangwar123","description":"A decentralized liquidity pool that supports custom ERC20 tokens, using a constant product AMM model. Users can add liquidity, remove liquidity, swap tokens, and earn rewards. ","archived":false,"fork":false,"pushed_at":"2025-01-17T14:58:34.000Z","size":495,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-27T06:38:14.320Z","etag":null,"topics":["dapps","defi","ethereum","foundry","nextjs","solidity","testing","token-swap"],"latest_commit_sha":null,"homepage":"https://peer2-play-swap.vercel.app","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jitendragangwar123.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-01-16T16:49:54.000Z","updated_at":"2025-01-17T14:58:35.000Z","dependencies_parsed_at":"2025-01-16T19:13:50.568Z","dependency_job_id":"472ed512-6b0a-43df-8f67-9782831d2f4a","html_url":"https://github.com/jitendragangwar123/Peer2Play-Swap","commit_stats":null,"previous_names":["jitendragangwar123/peer2play-swap"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jitendragangwar123%2FPeer2Play-Swap","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jitendragangwar123%2FPeer2Play-Swap/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jitendragangwar123%2FPeer2Play-Swap/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jitendragangwar123%2FPeer2Play-Swap/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jitendragangwar123","download_url":"https://codeload.github.com/jitendragangwar123/Peer2Play-Swap/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243364807,"owners_count":20279211,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dapps","defi","ethereum","foundry","nextjs","solidity","testing","token-swap"],"created_at":"2025-01-20T03:59:22.447Z","updated_at":"2026-04-16T08:31:53.849Z","avatar_url":"https://github.com/jitendragangwar123.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Peer2Play Swap 🎰\n**Peer2Play Swap** is a decentralized liquidity pool contract that facilitates the swapping and liquidity provision of two ERC20 tokens. It implements a **constant product AMM model** with a **5% fee split** (4% for liquidity providers and 1% for the contract), ensuring a fair and efficient environment for token swaps and liquidity mining.\n\n\u003cimg width=\"1432\" alt=\"home-page\" src=\"https://github.com/user-attachments/assets/d31c9446-99f7-462e-89c9-9a25e4d46f26\" /\u003e\n\u003cimg width=\"1411\" alt=\"token-swap-page\" src=\"https://github.com/user-attachments/assets/65436a86-4bf8-437a-8b3c-392d6e91f3f7\" /\u003e\n\n---\n### 🚀 Features\n- **Decentralized Liquidity Pool**: A smart contract-based pool for token swaps between two ERC20 tokens.\n- **Constant Product AMM**: Uses the constant product formula for swap calculations (x * y = k).\n- **Liquidity Provider Incentives**: 4% of swap fees distributed to liquidity providers.\n- **Contract Fee**: 1% of swap fees go to the contract.\n- **Fair Fee Distribution**: Fees are distributed proportionally based on liquidity shares.\n- **Flexible Liquidity Addition and Removal**: Liquidity can be added or removed in proportion to shares in the pool.\n- **Provably Fair Swaps**: Token swaps are based on a constant product model for fair pricing.\n- **Event Logging**: Tracks key events such as liquidity addition/removal, swaps, and fee distributions.\n---\n\n### 🛠 Requirements\nBefore you start, ensure that you have the following installed:\n- [Git](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git)\n- [Foundry](https://getfoundry.sh/)\n\n### ⚡ Quickstart\nClone the repository and set up your environment:\n```\n$ git clone https://github.com/jitendragangwar123/Peer2Play-Swap\n$ cd Peer2Play-Swap\n$ make install\n$ forge build\n```\n\n### 🌍 Deployment to a Testnet or Mainnet\n\n#### 1. Setup Environment Variables\n\nYou'll need to set your `SEPOLIA_RPC_URL` and `PRIVATE_KEY` as environment variables. You can add them to a `.env` file in your project directory.\n\nOptionally, you can also add your `ETHERSCAN_API_KEY` if you want to verify your contract on [Etherscan](https://etherscan.io/).\n\n#### 2. Get Testnet ETH\n\nHead over to [faucets.chain.link](https://faucets.chain.link/) to get some testnet ETH. The ETH should show up in your MetaMask wallet shortly.\n\n#### 3. Deploy to Sepolia Testnet\n\nTo deploy your contract to the **Sepolia** testnet, run:\n\n```\n$ make deploy ARGS=\"--network sepolia\"\n```\n\n### 🧪 Testing\n\nYou can run tests in various environments:\n\n1. **Unit Tests**\n2. **Integration Tests**\n3. **Forked Network Tests**\n4. **Staging Tests**\n\nTo run all tests, use:\n\n```\n$ forge test\n```\nor\n\n```\n$ forge test --fork-url $SEPOLIA_RPC_URL\n```\n\n### Test Coverage\n\n```\n$ forge coverage\n```\n\n### ⛽ Estimate Gas\n\nYou can estimate how much gas transactions will cost by running:\n\n```\n$ forge snapshot\n```\n\nAnd you'll see an output file called `.gas-snapshot`\n\n### 📝 Formatting\n\nTo run code formatting, use the following command:\n\n```\n$ forge fmt\n```\n\n## 🌐 Front-End\n\n### ⚡ Quickstart\n```\n$ cd front-end\n\n# Create .env file in the front-end\nNEXT_PUBLIC_PROJECT_ID=paste_your_walletconnect_project_id_here\n\n# Install the dependencies\n$ npm i\n\n# Start the client\n$ npm run dev\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjitendragangwar123%2Fpeer2play-swap","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjitendragangwar123%2Fpeer2play-swap","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjitendragangwar123%2Fpeer2play-swap/lists"}