{"id":26054845,"url":"https://github.com/morpho-org/public-allocator","last_synced_at":"2025-04-11T02:51:07.936Z","repository":{"id":228054153,"uuid":"752472465","full_name":"morpho-org/public-allocator","owner":"morpho-org","description":null,"archived":false,"fork":false,"pushed_at":"2025-01-14T09:57:36.000Z","size":627,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-03-25T00:40:43.025Z","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":"gpl-2.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/2024-03-11-morpho-public-allocator-cantina-managed.pdf","citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-02-03T23:54:21.000Z","updated_at":"2025-01-14T09:57:39.000Z","dependencies_parsed_at":"2024-03-28T18:59:45.365Z","dependency_job_id":"d463e79c-7268-4d9b-bb3d-786ef4b4e2e7","html_url":"https://github.com/morpho-org/public-allocator","commit_stats":null,"previous_names":["morpho-org/public-allocator"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/morpho-org%2Fpublic-allocator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/morpho-org%2Fpublic-allocator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/morpho-org%2Fpublic-allocator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/morpho-org%2Fpublic-allocator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/morpho-org","download_url":"https://codeload.github.com/morpho-org/public-allocator/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248333075,"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:22.828Z","updated_at":"2025-04-11T02:51:07.911Z","avatar_url":"https://github.com/morpho-org.png","language":"Solidity","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Public Allocator\n\n## Overview\n\n[MetaMorpho](https://github.com/morpho-org/metamorpho) is a protocol for funds allocations and risk management on top of [Morpho Blue](https://github.com/morpho-org/morpho-blue).\nThe Public Allocator is a contract that MetaMorpho vault owners can enable as [allocator](https://github.com/morpho-org/metamorpho?tab=readme-ov-file#allocator) to let anybody reallocate the vault's funds to fill their liquidity needs.\n\nThe Public Allocator's function `reallocateTo` ([source](https://github.com/morpho-org/public-allocator/blob/7271fbd60881ff32a466a588f99344c6bf72629a/src/PublicAllocator.sol#L108), [interface](https://github.com/morpho-org/public-allocator/blob/7271fbd60881ff32a466a588f99344c6bf72629a/src/interfaces/IPublicAllocator.sol#L62)) reallocates some liquidity from multiple markets to one market.\nIt takes as input `withdrawals`, a list of pairs, which will be the markets and amounts that will be reallocated, and `supplyMarketParams`, a `MarketParams`, which is the market in which to supply the reallocated funds.\nNote that the `id` of the markets in `withdrawals` must be sorted, and that `supplyMarketParams` cannot be a market of `withdrawals`.\n\nThe Public Allocator provides the possibility to the vault owner or a per vault settable admin to constrain the public reallocation:\n\n- **Max flows**: Each market has a max inflow (`maxIn`) and max outflow (`maxOut`), that can be set by the vault owner or the Public Allocator vault admin.\n  The markets from which funds are withdrawn through `reallocateTo` increase their `maxIn` and decrease their `maxOut`, and the market in which funds are deposited decrease their `maxOut` and increase their `maxIn`.\n- **Fee**: If set, user must pay a fee in ETH to be able to call `reallocateTo`.\n  The vault owner or the Public Allocator vault admin can set this fee, as well as taking the accumulated fees out by calling `transferFee`.\n\n## Deployments\n\nSee the [documentation](https://docs.morpho.org/addresses#public-allocator).\n\n## Testing\n\nTo run tests: `forge test`.\nNote that running the tests this way will use this repository's compilation settings for dependencies (Morpho \u0026 MetaMorpho), potentially different from the settings used for deployment of those dependencies.\n\n## Audits\n\nAll audits are stored in the [audits](./audits/)' folder.\n\n## License\n\nAll files are licenced under `GPL-2.0-or-later`, see [`LICENSE`](./LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmorpho-org%2Fpublic-allocator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmorpho-org%2Fpublic-allocator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmorpho-org%2Fpublic-allocator/lists"}