{"id":26054840,"url":"https://github.com/morpho-org/morpho-aavev3-optimizer","last_synced_at":"2025-06-27T04:33:35.280Z","repository":{"id":160865589,"uuid":"567235691","full_name":"morpho-org/morpho-aavev3-optimizer","owner":"morpho-org","description":"Core contracts of Morpho Optimizers on AaveV3","archived":false,"fork":false,"pushed_at":"2025-06-19T07:53:23.000Z","size":4998,"stargazers_count":40,"open_issues_count":4,"forks_count":16,"subscribers_count":9,"default_branch":"main","last_synced_at":"2025-06-19T08:42:00.565Z","etag":null,"topics":["blockchain","decentralized","defi","finance","protocol"],"latest_commit_sha":null,"homepage":"","language":"Solidity","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/morpho-org.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":"audits/runtime-verification-morpho-aave-v3-report.pdf","citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2022-11-17T11:11:43.000Z","updated_at":"2025-06-02T07:32:47.000Z","dependencies_parsed_at":null,"dependency_job_id":"fce28f2e-c74c-45de-8c2f-3d24700bd441","html_url":"https://github.com/morpho-org/morpho-aavev3-optimizer","commit_stats":null,"previous_names":["morpho-org/morpho-aavev3-optimizer","morpho-org/morpho-aave-v3"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/morpho-org/morpho-aavev3-optimizer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/morpho-org%2Fmorpho-aavev3-optimizer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/morpho-org%2Fmorpho-aavev3-optimizer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/morpho-org%2Fmorpho-aavev3-optimizer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/morpho-org%2Fmorpho-aavev3-optimizer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/morpho-org","download_url":"https://codeload.github.com/morpho-org/morpho-aavev3-optimizer/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/morpho-org%2Fmorpho-aavev3-optimizer/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262188397,"owners_count":23272341,"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":["blockchain","decentralized","defi","finance","protocol"],"created_at":"2025-03-08T10:00:20.804Z","updated_at":"2025-06-27T04:33:35.254Z","avatar_url":"https://github.com/morpho-org.png","language":"Solidity","readme":"# Morpho-AaveV3 Optimizer\n\n\u003cpicture\u003e\n  \u003csource media=\"(prefers-color-scheme: dark)\" srcset=\"https://i.imgur.com/uLq5V14.png\"\u003e\n  \u003cimg alt=\"\" src=\"https://i.imgur.com/ZiL1Lr2.png\"\u003e\n\u003c/picture\u003e\n\n---\n\n## What are Morpho Optimizers?\n\nMorpho Optimizers improve the capital efficiency of positions on existing lending pools by seamlessly matching users peer-to-peer.\n\n- Morpho's rates stay between the supply rate and the borrow rate of the pool, reducing the interest paid by the borrowers while increasing the interest earned by the suppliers. It means that you are getting boosted peer-to-peer rates or, in the worst-case scenario, the APY of the pool.\n- Morpho also preserves the same experience, the same liquidity, and the same parameters (collateral factors, oracles, …) as the underlying pool.\n\nTL;DR: Instead of borrowing or lending on your favorite AaveV3 pool, you would be better off using Morpho-AaveV3.\n\n---\n\n## Contracts overview\n\nThe Morpho protocol is designed at its core, with the main Morpho contract delegating calls to the PositionsManager implementation contract (to overcome the contract size limit).\n\nThe main user's entry points are exposed in the [`Morpho`](./src/Morpho.sol) contract. It inherits from [`MorphoGetters`](./src/MorphoGetters.sol), which contains all the functions used to query Morpho-AaveV3, [`MorphoSetters`](./src/MorphoSetters.sol), which contains all the functions used by the governance to manage the protocol, [`MorphoInternal`](./src/MorphoInternal.sol), and [`MorphoStorage`](./src/MorphoStorage.sol), where the protocol's internal logic \u0026 storage is located. This contract delegates call to the [`PositionsManager`](./src/PositionsManager.sol), that has the same storage layout: this contract inherits from [`PositionsManagerInternal`](./src/PositionsManagerInternal.sol), which contains all the internal accounting logic and in turn inherits from [`MatchingEngine`](./src/MatchingEngine.sol), which contains the matching engine internal functions.\n\nIt also interacts with [`RewardsManager`](./src/RewardsManager.sol), which manages AaveV3's rewards, if any.\n\n---\n\n## Documentation\n\n- [White Paper](https://whitepaper.morpho.org)\n- [Yellow Paper](https://yellowpaper.morpho.org/)\n- [Morpho Documentation](https://docs.morpho.org/concepts/morpho-optimizers)\n\n---\n\n## Audits\n\nAll audits are stored in the [audits](./audits/)' folder.\n\n---\n\n## Bug bounty\n\nA bug bounty is open on Immunefi. The rewards and scope are defined [here](https://immunefi.com/bounty/morpho/).\nYou can also email [security@morpho.org](mailto:security@morpho.org) if you find something worrying.\n\n---\n\n## Deployment Addresses\n\n### Morpho-Aave-V3 Optimizer (Ethereum)\n\n- Morpho Proxy: [0x33333aea097c193e66081e930c33020272b33333](https://etherscan.io/address/0x33333aea097c193e66081e930c33020272b33333)\n- Morpho Implementation: [0xf835456cb1de3e39ab50a8a9fbb07ebec3a8ff67](https://etherscan.io/address/0xf835456cb1de3e39ab50a8a9fbb07ebec3a8ff67)\n- PositionsManager: [0xcecc755730904b3a6c20ce9aaba181aa4593f869](https://etherscan.io/address/0xcecc755730904b3a6c20ce9aaba181aa4593f869)\n\n### Common (Ethereum)\n\n- ProxyAdmin: [0x99917ca0426fbc677e84f873fb0b726bb4799cd8](https://etherscan.io/address/0x99917ca0426fbc677e84f873fb0b726bb4799cd8)\n\n---\n\n## Importing contracts\n\nUsing forge:\n\n```bash\nforge install morpho-dao/morpho-aave-v3\n```\n\n---\n\n## Development\n\n### Getting Started\n\n- Install [Foundry](https://github.com/foundry-rs/foundry).\n- Run `make install` to initialize the repository.\n- Create a `.env` file according to the [`.env.example`](./.env.example) file.\n\n### Testing with [Foundry](https://github.com/foundry-rs/foundry) 🔨\n\nTests are run against a fork of Ethereum, which allows us to interact directly with AaveV3. Note that you need an RPC provider with access to Ethereum.\n\nFor testing, make sure `foundry` is installed and install dependencies (git submodules) with:\n\n```bash\nmake install\n```\n\nTo run tests on different protocols, navigate a Unix terminal to the root folder of the project and run the command of your choice:\n\nTo run the whole test suite:\n\n```bash\nmake test\n```\n\nOr to run only tests matching an input:\n\n```bash\nmake test-Borrow\n```\n\nOr to run only unit, internal, integration, or invariant tests:\n\n```bash\nmake test-[unit/internal/integration/invariant]\n```\n\nFor the other commands, check the [Makefile](./Makefile).\n\n### VSCode setup\n\nConfigure your VSCode to automatically format a file on save, using `forge fmt`:\n\n- Install [emeraldwalk.runonsave](https://marketplace.visualstudio.com/items?itemName=emeraldwalk.RunOnSave)\n- Update your `settings.json`:\n\n```json\n{\n  \"[solidity]\": {\n    \"editor.formatOnSave\": false\n  },\n  \"emeraldwalk.runonsave\": {\n    \"commands\": [\n      {\n        \"match\": \".sol\",\n        \"isAsync\": true,\n        \"cmd\": \"forge fmt ${file}\"\n      }\n    ]\n  }\n}\n```\n\n---\n\n## Test coverage\n\nTest coverage is reported using [foundry](https://github.com/foundry-rs/foundry) coverage with [lcov](https://github.com/linux-test-project/lcov) report formatting (and optionally, [genhtml](https://manpages.ubuntu.com/manpages/xenial/man1/genhtml.1.html) transformer).\n\nTo generate the `lcov` report, run:\n\n```bash\nmake coverage\n```\n\nThe report is then usable either:\n\n- via [Coverage Gutters](https://marketplace.visualstudio.com/items?itemName=ryanluker.vscode-coverage-gutters) following [this tutorial](https://mirror.xyz/devanon.eth/RrDvKPnlD-pmpuW7hQeR5wWdVjklrpOgPCOA-PJkWFU)\n- via html, using `make lcov-html` to transform the report and opening `coverage/index.html`\n\n---\n\n## Storage seatbelt\n\n[foundry-storage-check](https://github.com/Rubilmax/foundry-storage-diff) is currently running on every PR to check that the changes introduced are not modifying the storage layout of proxied smart contracts in an unsafe way.\n\n---\n\n## Questions \u0026 Feedback\n\nFor any questions or feedback, you can send an email to [contact@morpho.org](mailto:contact@morpho.org).\n\n---\n\n## Licensing\n\nThe code is under the GNU AFFERO GENERAL PUBLIC LICENSE v3.0, see [`LICENSE`](./LICENSE).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmorpho-org%2Fmorpho-aavev3-optimizer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmorpho-org%2Fmorpho-aavev3-optimizer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmorpho-org%2Fmorpho-aavev3-optimizer/lists"}