{"id":18014273,"url":"https://github.com/imcrazysteven/Liquidity-Share-Value-Calculator","last_synced_at":"2025-10-24T22:31:23.856Z","repository":{"id":259816127,"uuid":"879492469","full_name":"imcrazysteven/Liquidity-Share-Value-Calculator","owner":"imcrazysteven","description":"The Liquidity-Share-Value-Calculator is a simple project that calculates the liquidity share value using the UniswapV2Pair contract, Library contract, and Factory contract. ","archived":false,"fork":false,"pushed_at":"2024-11-06T08:48:52.000Z","size":106,"stargazers_count":35,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-29T22:12:08.855Z","etag":null,"topics":["factory","library","liquidity-pool","pair","solidity","typescript","uniswap"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/imcrazysteven.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2024-10-28T02:26:59.000Z","updated_at":"2025-08-21T21:43:00.000Z","dependencies_parsed_at":"2024-12-17T18:23:03.264Z","dependency_job_id":"b572de74-fd74-46aa-9d81-0e476e71084f","html_url":"https://github.com/imcrazysteven/Liquidity-Share-Value-Calculator","commit_stats":null,"previous_names":["dodger213/liquidity-share-value-calculator","stevendev0822/liquidity-share-value-calculator","steven228312/liquidity-share-value-calculator","imcrazysteven/liquidity-share-value-calculator"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/imcrazysteven/Liquidity-Share-Value-Calculator","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imcrazysteven%2FLiquidity-Share-Value-Calculator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imcrazysteven%2FLiquidity-Share-Value-Calculator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imcrazysteven%2FLiquidity-Share-Value-Calculator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imcrazysteven%2FLiquidity-Share-Value-Calculator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/imcrazysteven","download_url":"https://codeload.github.com/imcrazysteven/Liquidity-Share-Value-Calculator/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imcrazysteven%2FLiquidity-Share-Value-Calculator/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":280878369,"owners_count":26406641,"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","status":"online","status_checked_at":"2025-10-24T02:00:06.418Z","response_time":73,"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":["factory","library","liquidity-pool","pair","solidity","typescript","uniswap"],"created_at":"2024-10-30T04:07:28.707Z","updated_at":"2025-10-24T22:31:23.545Z","avatar_url":"https://github.com/imcrazysteven.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Liquidity-Share-Value-Calculator\n\nA Solidity smart contract for calculating liquidity share values in Uniswap V2 pairs.\n\n## Overview\n\nThe LiquidityValueCalculator contract provides functionality to compute the value of liquidity shares in terms of both tokens in a Uniswap V2 pair. This is particularly useful for liquidity providers who want to know the underlying value of their LP tokens.\n\n## Features\n\n- Calculate the exact amount of both tokens represented by LP tokens\n- Compatible with any Uniswap V2 pair\n- Gas-efficient calculations\n- View functions that don't modify state\n\n## Contract Details\n\n### Constructor\n- Takes a Uniswap V2 factory address as parameter\n- Stores the factory address for pair calculations\n\n### Main Functions\n\n#### computeLiquidityShareValue\n```solidity\nfunction computeLiquidityShareValue(\n    uint liquidity,\n    address tokenA,\n    address tokenB\n) external view returns (uint tokenAAmount, uint tokenBAmount)\n```\n- Input: Liquidity amount and addresses of both tokens\n- Output: Equivalent amounts of tokenA and tokenB\n- Uses current reserves and total supply for accurate calculations\n\n#### pairInfo (Internal)\n```solidity\nfunction pairInfo(\n    address tokenA,\n    address tokenB\n) internal view returns (uint reserveA, uint reserveB, uint totalLiquidity)\n```\n- Retrieves current reserves and total supply from the pair\n- Handles token ordering based on addresses\n- Returns reserveA, reserveB, and total liquidity\n\n## Dependencies\n- Uniswap V2 Core\n- Uniswap V2 Periphery\n- Solidity ^0.8.27\n\n## License\nThis project is licensed under the MIT License - see the [MIT](./LICENSE) file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fimcrazysteven%2FLiquidity-Share-Value-Calculator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fimcrazysteven%2FLiquidity-Share-Value-Calculator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fimcrazysteven%2FLiquidity-Share-Value-Calculator/lists"}