{"id":28215742,"url":"https://github.com/yug49/clamm-dex-engine","last_synced_at":"2026-07-01T13:31:37.176Z","repository":{"id":287187587,"uuid":"959971092","full_name":"yug49/CLAMM-DEX-Engine","owner":"yug49","description":"A Concentrated Liquidity AMM Decentralized Exchange Engine: Users can swap their tokens for a different one. This CLAMM-DEX can generate it's liquidity providers  upto 400% more interest on the same capital when compared to traditional AMM-DEX.","archived":false,"fork":false,"pushed_at":"2025-04-14T14:38:27.000Z","size":49,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-18T21:45:47.707Z","etag":null,"topics":["blockchain","clamm","defi","dex","foundry","smart-contracts","solidty","web3"],"latest_commit_sha":null,"homepage":"","language":"Solidity","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/yug49.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,"zenodo":null}},"created_at":"2025-04-03T16:43:41.000Z","updated_at":"2025-08-09T23:07:12.000Z","dependencies_parsed_at":"2025-04-10T12:52:05.553Z","dependency_job_id":"8df418c3-35eb-4914-a9fd-9edeceb77158","html_url":"https://github.com/yug49/CLAMM-DEX-Engine","commit_stats":null,"previous_names":["yug49/clamm-dex-engine"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/yug49/CLAMM-DEX-Engine","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yug49%2FCLAMM-DEX-Engine","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yug49%2FCLAMM-DEX-Engine/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yug49%2FCLAMM-DEX-Engine/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yug49%2FCLAMM-DEX-Engine/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yug49","download_url":"https://codeload.github.com/yug49/CLAMM-DEX-Engine/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yug49%2FCLAMM-DEX-Engine/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35009267,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-01T02:00:05.325Z","response_time":130,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["blockchain","clamm","defi","dex","foundry","smart-contracts","solidty","web3"],"created_at":"2025-05-17T22:11:37.510Z","updated_at":"2026-07-01T13:31:37.156Z","avatar_url":"https://github.com/yug49.png","language":"Solidity","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# CLAMM-DEX-Engine\nIt is a smart contract project written in [Solidity](https://docs.soliditylang.org/en/latest/) using [Foundry](https://book.getfoundry.sh/).\n- It a smart contract I developed leveraging Foundry.\n- It is a CLAMM - Concentrated Liquidity Automated Market Maker Decentralized Engine similar to [Uniswap v3](https://blog.uniswap.org/uniswap-v3), but with some less additional functionalities.\n- Following properties are ommited when compared to the Uniswap v3 engine.\n  -   Factory\n  -   Price oracle\n  -   Protocol fee\n  -   Flash swap\n  -   NFT\n  -   Solidity advanced math libraries\n  -   Callbacks\n  \n\n\n\n## Getting Started\n\n - [git](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git): You'll know you did it right if you can run `git --version` and you see a response like `git version x.x.x`\n - [foundry](https://getfoundry.sh/): You'll know you did it right if you can run `forge --version` and you see a response like `forge 0.2.0 (816e00b 2023-03-16T00:05:26.396218Z)`\n - [make](https://www.gnu.org/software/make/manual/make.html) (optional - either you can install `make` or you can simply substitute the make commands with forge commands by referring to the Makefile after including your .env file): You'll know you did it right if you can run `make --version` and you will see a response like `GNU Make 3.81...`\n\n \n## Installation\n\n- Install CLAMM-DEX-Engine\n```bash\n    git clone https://github.com/yug49/CLAMM-DEX-Engine\n    cd CLAMM-DEX-Engine\n```\n\n- Make a .env file\n```bash\n    touch .env\n```\n\n- Open the .env file and fill in the details similar to:\n```env\n    SEPOLIA_RPC_URL=\u003cYOUR SEPOLIA RPC URL\u003e\n    ETHERSCAN_API_KEY=\u003cYOUR ETHERSCAN API KEY\u003e\n    SEPOLIA_PRIVATE_KEY=\u003cYOUR PRIVATE KEY\u003e\n\n    # Arguments for Pool Deployment\n    TOKEN_A=\u003cADDRESS OF TOKEN A\u003e\n    TOKEN_B=\u003cADDRESS OF TOKEN B\u003e\n    FEE=\u003cFEES IN BASIS POINTS(either 500, 3000 or 10000)\u003e\n    INITIAL_SQRT_PRICE_X96=\u003cINTIAL SQUARE ROOT PRICE X96\u003e\n\n    # Arguments for Position Management\n    LOWER_TICK=-\u003cLOWER TICK\u003e\n    UPPER_TICK=\u003cUPPER TICK\u003e \n    AMOUNT_TO_ADD=\u003cAMOUNT OF LIQUIDITY TO ADD\u003e\n    AMOUNT_TO_REMOVE=\u003cAMOUNT OF LIQUIDITY TO REMOVE\u003e\n\n    # Arguments for Collection of Fees or Removed/Burned Liquidity\n    AMOUNT0_TO_COLLECT=\u003cAMOUNT OF TOKEN A TO COLLECT\u003e\n    AMOUNT1_TO_COLLECT=\u003cAMOUNT OF TOKEN B TO COLLECT\u003e\n\n    # Arguments for Swap Management\n    SWAP_AMOUNT=\u003cAMOUNT OF TOKENS TO SWAP\u003e\n    SQRT_PRICE_LIMIT_X96=\u003cSQRT PRICE LIMIT X96 WHILE SWAPPING\u003e\n```\n- Remove pre installed cache, unecessary or partially cloned modules modules etc.\n```bash\n    make clean\n    make remove\n\n```\n\n- Build Project\n```bash\n    make build\n```\n## Formatting\n- to format all the solidity files:\n```bash\n    make format\n```\n\n## Deployment\n\n### Deploy On a Local Network (Anvil Testnet)\n- To Deploy on a local network first run anvil on your local terminal in current directory by running coommmand: ` make anvil`.\n- Now open another terminal and let this one run in the background\n- Run the following command:\n```bash\n    make deploy\n```\n\n### Deploy on a Sepolia or Any Other Network\n- To Deploy on Sepolia, after successfully creating .env file as mentioned above.\n- Get youself some Sepolia Eth and LINK tokens and then run command:\n```bash\n    make deploy ARGS=\"--network sepolia\"\n```\n\n## Interacting with the deployed contract\n\n- To interact with the deployed smart contract first change the `POOL_ADDRESS` in the `script/Interactions.s.sol` file to the address of your deployed contract.\n- Then you can run following commands for respective interactions:\n\n### Add Liquidity\n```bash\n    make addLiquidity ARGS=\"--network sepolia\"\n```\n\n### Remove Liquidity\n```bash\n    make removeLiquidity ARGS=\"--network sepolia\"\n```\n\n### Collect Fees And Removed Liquidity\n```bash\n    make collectFeesAndRemovedLiquidity ARGS=\"--network sepolia\"\n```\n\n### Swap Tokens\n- To swap from tokenA to tokenB, knowing only the amount of tokenA to swap:\n```bash\n    make swapTokensZeroForOneExactInput ARGS=\"--network sepolia\"\n```\n- To swap from tokenB to tokenA, knowing only the amount of tokenB to swap:\n```bash\n    make swapTokensOneForZeroExactInput ARGS=\"--network sepolia\"\n```\n- To swap from tokenA to tokenB, knowing only the amount of tokenB to swap:\n```bash\n    make swapTokensZeroForOneExactOutput ARGS=\"--network sepolia\"\n```\n- To swap from tokenB to tokenA, knowing only the amount of tokenA to swap:\n```bash\n    make swapTokensOneForZeroExactOutput ARGS=\"--network sepolia\"\n```\n\n    \n## 🔗 Links\nLoved it? lets connect on:\n\n[![twitter](https://img.shields.io/badge/twitter-1DA1F2?style=for-the-badge\u0026logo=twitter\u0026logoColor=white)](https://x.com/yugAgarwal29)\n[![linkedin](https://img.shields.io/badge/linkedin-0A66C2?style=for-the-badge\u0026logo=linkedin\u0026logoColor=white)](https://www.linkedin.com/in/yug-agarwal-8b761b255/)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyug49%2Fclamm-dex-engine","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyug49%2Fclamm-dex-engine","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyug49%2Fclamm-dex-engine/lists"}