{"id":13632886,"url":"https://github.com/balancer/balancer-v2-monorepo","last_synced_at":"2025-05-16T04:02:23.970Z","repository":{"id":36999664,"uuid":"288772359","full_name":"balancer/balancer-v2-monorepo","owner":"balancer","description":"Balancer V2 Monorepo","archived":false,"fork":false,"pushed_at":"2024-05-31T18:24:39.000Z","size":113315,"stargazers_count":324,"open_issues_count":62,"forks_count":391,"subscribers_count":33,"default_branch":"master","last_synced_at":"2025-05-10T13:54:44.851Z","etag":null,"topics":["balancer","defi","ethereum","solidity"],"latest_commit_sha":null,"homepage":"https://balancer.fi/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/balancer.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":"audits/README.md","citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-08-19T15:44:50.000Z","updated_at":"2025-05-04T12:42:46.000Z","dependencies_parsed_at":"2023-01-17T12:47:42.414Z","dependency_job_id":"bc3ffa6e-9789-4c2a-ac9c-5abf551d85a1","html_url":"https://github.com/balancer/balancer-v2-monorepo","commit_stats":{"total_commits":2057,"total_committers":31,"mean_commits":66.35483870967742,"dds":0.6985901798736023,"last_synced_commit":"36d282374b457dddea828be7884ee0d185db06ba"},"previous_names":["balancer-labs/balancer-v2-monorepo"],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/balancer%2Fbalancer-v2-monorepo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/balancer%2Fbalancer-v2-monorepo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/balancer%2Fbalancer-v2-monorepo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/balancer%2Fbalancer-v2-monorepo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/balancer","download_url":"https://codeload.github.com/balancer/balancer-v2-monorepo/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253982179,"owners_count":21994411,"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":["balancer","defi","ethereum","solidity"],"created_at":"2024-08-01T22:03:21.800Z","updated_at":"2025-05-16T04:02:18.960Z","avatar_url":"https://github.com/balancer.png","language":"TypeScript","funding_links":[],"categories":["TypeScript","Automated Market Maker (AMM)"],"sub_categories":[],"readme":"# \u003cimg src=\"logo.svg\" alt=\"Balancer\" height=\"128px\"\u003e\n\n# Balancer V2 Monorepo\n\n[![Docs](https://img.shields.io/badge/docs-%F0%9F%93%84-blue)](https://docs.balancer.fi/)\n[![CI Status](https://github.com/balancer-labs/balancer-v2-monorepo/workflows/CI/badge.svg)](https://github.com/balancer-labs/balancer-v2-monorepo/actions)\n[![License](https://img.shields.io/badge/License-GPLv3-green.svg)](https://www.gnu.org/licenses/gpl-3.0)\n\nThis repository contains the Balancer Protocol V2 core smart contracts, including the `Vault` and standard Pools, along with their tests.\nDeployment configuration and information can be found at the [`balancer-deployments` repository](https://github.com/balancer/balancer-deployments).\n\nFor a high-level introduction to Balancer V2, see [Introducing Balancer V2: Generalized AMMs](https://medium.com/balancer-protocol/balancer-v2-generalizing-amms-16343c4563ff).\n\n## Structure\n\nThis is a Yarn monorepo, with the packages meant to be published in the [`pkg`](./pkg) directory. Newly developed packages may not be published yet.\n\nActive development occurs in this repository, which means some contracts in it might not be production-ready. Proceed with caution.\n\n### Packages\n\n- [`v2-interfaces`](./pkg/interfaces): Solidity interfaces for all contracts.\n- [`v2-vault`](./pkg/vault): the [`Vault`](./pkg/vault/contracts/Vault.sol) contract and all core interfaces, including [`IVault`](./pkg/interfaces/contracts/vault/IVault.sol) and the Pool interfaces: [`IBasePool`](./pkg/interfaces/contracts/vault/IBasePool.sol), [`IGeneralPool`](./pkg/interfaces/contracts/vault/IGeneralPool.sol) and [`IMinimalSwapInfoPool`](./pkg/interfaces/contracts/vault/IMinimalSwapInfoPool.sol).\n- [`v2-pool-weighted`](./pkg/pool-weighted): the [`WeightedPool`](./pkg/pool-weighted/contracts/WeightedPool.sol), and [`LiquidityBootstrappingPool`](./pkg/pool-weighted/contracts/lbp/LiquidityBootstrappingPool.sol) contracts, along with their associated factories.\n- [`v2-pool-linear`](./pkg/pool-linear): the [`LinearPool`](./pkg/pool-linear/contracts/LinearPool.sol) contracts, along with its associated factory. Derived Linear Pools can be found in the [Orb Collective repo](https://github.com/orbcollective/linear-pools).\n- [`v2-pool-utils`](./pkg/pool-utils): Solidity utilities used to develop Pool contracts.\n- [`v2-solidity-utils`](./pkg/solidity-utils): miscellaneous Solidity helpers and utilities used in many different contracts.\n- [`v2-standalone-utils`](./pkg/standalone-utils): miscellaneous standalone utility contracts.\n- [`v2-liquidity-mining`](./pkg/liquidity-mining): contracts that compose the liquidity mining (veBAL) system.\n- [`v2-governance-scripts`](./pkg/governance-scripts): contracts that execute complex governance actions.\n\n## Pre-requisites\n\nThe build \u0026 test instructions below should work out of the box with Node 18. More specifically, it is recommended to use the LTS version 18.15.0; Node 19 and higher are not supported. Node 18.16.0 has a [known issue](https://github.com/NomicFoundation/hardhat/issues/3877) that makes the build flaky.\n\nMultiple Node versions can be installed in the same system, either manually or with a version manager.\nOne option to quickly select the suggested Node version is using `nvm`, and running:\n\n```bash\n$ nvm use\n```\n\n## Clone\n\nThis repository uses git submodules; use `--recurse-submodules` option when cloning. For example, using https:\n\n```bash\n$ git clone --recurse-submodules https://github.com/balancer-labs/balancer-v2-monorepo.git\n```\n\n## Build and Test\n\nBefore any tests can be run, the repository needs to be prepared:\n\n### First time build\n\n```bash\n$ yarn # install all dependencies\n$ yarn workspace @balancer-labs/balancer-js build # build balancer-js first\n```\n\n### Regular build\n\n```bash\n$ yarn build # compile all contracts\n```\n\nMost tests are standalone and simply require installation of dependencies and compilation.\n\nIn order to run all tests (including those with extra dependencies), run:\n\n```bash\n$ yarn test # run all tests\n```\n\nTo instead run a single package's tests, run:\n\n```bash\n$ cd pkg/\u003cpackage\u003e # e.g. cd pkg/v2-vault\n$ yarn test\n```\n\nYou can see a sample report of a test run [here](./audits/test-report.md).\n\n### Foundry (Forge) tests\n\nTo run Forge tests, first [install Foundry](https://book.getfoundry.sh/getting-started/installation). The installation steps below apply to Linux or MacOS. Follow the link for additional options.\n\n```bash\n$ curl -L https://foundry.paradigm.xyz | bash\n$ source ~/.bashrc # or open a new terminal\n$ foundryup\n```\n\nThen, to run tests in a single package, run:\n```bash\n$ cd pkg/\u003cpackage\u003e # e.g. cd pkg/v2-vault\n$ yarn test-fuzz\n```\n\n## Security\n\nMultiple independent reviews and audits were performed by [Certora](https://www.certora.com/), [OpenZeppelin](https://openzeppelin.com/) and [Trail of Bits](https://www.trailofbits.com/). The latest reports from these engagements are located in the [`audits`](./audits) directory.\n\nBug bounties apply to most of the smart contracts hosted in this repository: head to [Balancer V2 Bug Bounties](https://docs.balancer.fi/reference/contracts/security.html#bug-bounty) to learn more.\n\nAll core smart contracts are immutable, and cannot be upgraded. See page 6 of the [Trail of Bits audit](https://github.com/balancer-labs/balancer-v2-monorepo/blob/master/audits/trail-of-bits/2021-04-02.pdf):\n\n\u003e Upgradeability | Not Applicable. The system cannot be upgraded.\n\n## Licensing\n\nMost of the Solidity source code is licensed under the GNU General Public License Version 3 (GPL v3): see [`LICENSE`](./LICENSE).\n\n### Exceptions\n\n- All files in the `openzeppelin` directory of the [`v2-solidity-utils`](./pkg/solidity-utils) package are based on the [OpenZeppelin Contracts](https://github.com/OpenZeppelin/openzeppelin-contracts) library, and as such are licensed under the MIT License: see [LICENSE](./pkg/solidity-utils/contracts/openzeppelin/LICENSE).\n- The `LogExpMath` contract from the [`v2-solidity-utils`](./pkg/solidity-utils) package is licensed under the MIT License.\n- All other files, including tests and the [`pvt`](./pvt) directory are unlicensed.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbalancer%2Fbalancer-v2-monorepo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbalancer%2Fbalancer-v2-monorepo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbalancer%2Fbalancer-v2-monorepo/lists"}