{"id":26054873,"url":"https://github.com/morpho-org/morpho-blue-snippets","last_synced_at":"2025-04-11T02:51:09.565Z","repository":{"id":207625279,"uuid":"708831104","full_name":"morpho-org/morpho-blue-snippets","owner":"morpho-org","description":null,"archived":false,"fork":false,"pushed_at":"2024-10-03T14:12:00.000Z","size":13610,"stargazers_count":13,"open_issues_count":5,"forks_count":9,"subscribers_count":7,"default_branch":"main","last_synced_at":"2025-03-25T00:40:43.620Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Solidity","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/morpho-org.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":"2023-10-23T13:31:43.000Z","updated_at":"2025-02-08T06:04:43.000Z","dependencies_parsed_at":"2024-01-19T15:27:46.712Z","dependency_job_id":"7d488659-50f8-43a3-835c-88f31efe14f1","html_url":"https://github.com/morpho-org/morpho-blue-snippets","commit_stats":null,"previous_names":["morpho-org/morpho-blue-snippets"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/morpho-org%2Fmorpho-blue-snippets","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/morpho-org%2Fmorpho-blue-snippets/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/morpho-org%2Fmorpho-blue-snippets/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/morpho-org%2Fmorpho-blue-snippets/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/morpho-org","download_url":"https://codeload.github.com/morpho-org/morpho-blue-snippets/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248333078,"owners_count":21086189,"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":[],"created_at":"2025-03-08T10:00:27.163Z","updated_at":"2025-04-11T02:51:09.544Z","avatar_url":"https://github.com/morpho-org.png","language":"Solidity","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Morpho Blue Snippets\n\n## Typescript \u0026 Solidity based snippets related to Morpho Protocols\n\n\u003e [!IMPORTANT]\n\u003e This repository contains smart contracts that have been developed for educational, experimental, or demonstration purposes only.\nBy using or interacting with these smart contracts, you acknowledge and accept the following:\n\u003e 1. The smart contracts in this repository have not been audited and are provided \"as is\" with no guarantees, warranties, or assurances of any kind. The authors and maintainers of this repository are not responsible for any damages, losses, or liabilities that may arise from the use or deployment of these smart contracts.\n\u003e 2. The smart contracts in this repository are not intended for use in production environments or for the management of real-world assets, funds, or resources. Any use or deployment of these smart contracts for such purposes is done entirely at your own risk.\n\u003e 3. The smart contracts are provided for reference and learning purposes, and you are solely responsible for understanding, modifying, and deploying them as needed.\n\n## Morpho Blue related functions in Solidity\n\nOne can use the logic provided in the following:\n\n1. Functions to get data:\n\n- `supplyAPY`\n- `borrowAPY`\n- `supplyAssetsUser`\n- `borrowAssetsUser`\n- `collateralAssetsUser`\n- `marketTotalSupply`\n- `marketTotalBorrow`\n- `userHealthFactor`\n\n2. Functions to modify state:\n\n- `supply`\n- `supplyCollateral`\n- `withdrawCollateral`\n- `withdrawAmount`\n- `withdraw50Percent`\n- `withdrawAll`\n\n3. Functions using callbacks:\n\n- `leverageMe`\n- `deLeverageMe`\n\n## MetaMorpho related functions in Solidity:\n\nOne can use the logic provided in the following:\n\n1. Functions to get data:\n\n- `totalDepositVault`\n- `vaultAssetsInMarket`\n- `totalSharesUserVault`\n- `supplyQueueVault`\n- `withdrawQueueVault`\n- `totalCapCollateral`\n- `supplyAPYMarket`\n- `supplyAPYVault`\n\n2. Functions to modify state:\n\n- `depositInVault`\n- `withdrawFromVaultAmount`\n- `redeemAllFromVault`\n\n## Getting Started\n\n- Install [Foundry](https://book.getfoundry.sh/getting-started/installation)\n- Install [yarn](https://classic.yarnpkg.com/lang/en/docs/install/#mac-stable)\n- Run `foundryup`\n- Run `forge install`\n- Create a `.env` file according to the `.env.example` file.\n\n## Testing with Foundry\n\nYou can run tests by running the command:\n\n```bash\nforge test\n```\n\n## Questions \u0026 Feedbacks\n\nIf you have any questions or need further assistance, please don't hesitate to reach out on [Discord](https://discord.morpho.org).\n\n## License\n\nThe code is under the MIT License. See [`LICENSE`](./LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmorpho-org%2Fmorpho-blue-snippets","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmorpho-org%2Fmorpho-blue-snippets","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmorpho-org%2Fmorpho-blue-snippets/lists"}