{"id":15016193,"url":"https://github.com/primitivefinance/portfolio","last_synced_at":"2025-08-18T22:31:22.171Z","repository":{"id":97863232,"uuid":"487932909","full_name":"primitivefinance/portfolio","owner":"primitivefinance","description":"Portfolio is an automated market making protocol for implementing custom strategies at the lowest cost possible.","archived":false,"fork":false,"pushed_at":"2023-12-18T14:46:24.000Z","size":85523,"stargazers_count":110,"open_issues_count":8,"forks_count":6,"subscribers_count":7,"default_branch":"main","last_synced_at":"2024-04-14T04:24:18.467Z","etag":null,"topics":["forge","portfolio","primitive","rmm","solidity"],"latest_commit_sha":null,"homepage":"https://www.primitive.xyz/","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/primitivefinance.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":"2022-05-02T17:31:55.000Z","updated_at":"2024-04-26T21:41:13.634Z","dependencies_parsed_at":null,"dependency_job_id":"8ede6c7c-c75c-4614-b80d-ed947c1b647d","html_url":"https://github.com/primitivefinance/portfolio","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/primitivefinance%2Fportfolio","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/primitivefinance%2Fportfolio/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/primitivefinance%2Fportfolio/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/primitivefinance%2Fportfolio/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/primitivefinance","download_url":"https://codeload.github.com/primitivefinance/portfolio/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230284071,"owners_count":18202330,"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":["forge","portfolio","primitive","rmm","solidity"],"created_at":"2024-09-24T19:48:32.173Z","updated_at":"2024-12-18T14:13:12.943Z","avatar_url":"https://github.com/primitivefinance.png","language":"Solidity","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003e Beta: Portfolio is experimental software. Use at your own risk.\n\n# Portfolio by Primitive\n[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](https://github.com/primitivefinance/portfolio#contributing) [![](https://dcbadge.vercel.app/api/server/primitive?style=flat)](https://primitive.xyz/discord) [![Twitter Badge](https://badgen.net/badge/icon/twitter?icon=twitter\u0026label)](https://twitter.com/primitivefi)\n\nPortfolio is an automated market making protocol for implementing custom liquidity distribution strategies at the lowest cost possible.\n\n## Table of Contents\n\n- [Overview](#overview)\n- [Deployments](#deployments)\n- [Security](#security)\n- [Install](#install)\n- [Documentation](#documentation)\n- [Resources](#resources)\n- [Contributing](#contributing)\n- [License](#license)\n\n## Overview\n\nPortfolio is an automated market making protocol for creating custom liquidity distribution strategies at the lowest cost possible. Each pool in Portfolio can be created with a default strategy or custom strategy that defines a trading function, determining the available prices offered by the provider's liquidity. These pools all exist within the single Portfolio smart contract resulting in significantly lower gas costs for liquidity providers and swappers.\n\nRead the local [docs](./docs/src/), hosted docs [docs.primitive.xyz](https://docs.primitive.xyz), or the [formal specification](https://primitive.xyz/whitepaper) for more information.\n\n\n## Deployments\n\n### Canonical Cross-chain Deployment Addresses\n\n| Contract             | Canonical cross-chain address                |\n| -------------------- | -------------------------------------------- |\n| Portfolio 1.3.0-beta | `0x82360b9a2076a09ea8abe2b3e11aed89de3a02d1` |\n| Portfolio 1.4.0-beta | `n/a`                                        |\n| Portfolio 1.5.0-beta | `0x0000a37Fd680Ab248119b448545eF72C51Bf7530` |\n\n### Deployments by Chain\n\n| Network  | Portfolio 1.3.0-beta                                                                                                          | Portfolio v1.4.0-beta | Portfolio v1.5.0-beta                                                                                                 |\n| -------- | ----------------------------------------------------------------------------------------------------------------------------- | --------------------- | --------------------------------------------------------------------------------------------------------------------- |\n| Ethereum | [0x82360b9a2076a09ea8abe2b3e11aed89de3a02d1](https://etherscan.io/address/0x82360b9a2076a09ea8abe2b3e11aed89de3a02d1 )        | n/a                   | [0x0000a37Fd680Ab248119b448545eF72C51Bf7530](https://etherscan.io/address/0x0000a37fd680ab248119b448545ef72c51bf7530) |\n| Base     | n/a                                                                                                                           | n/a                   | n/a                                                                                                                   |\n| Sepolia  | [0x82360b9a2076a09ea8abe2b3e11aed89de3a02d1](https://sepolia.etherscan.io/address/0x82360b9a2076a09ea8abe2b3e11aed89de3a02d1) | n/a                   | n/a                                                                                                                   |\n\n| Network  | PortfolioRegistry v1.5.0-beta                                                                                         |\n| -------- | --------------------------------------------------------------------------------------------------------------------- |\n| Ethereum | [0x42776F58b6BC63492E0b7A7a937D1138DF716670](https://etherscan.io/address/0x42776f58b6bc63492e0b7a7a937d1138df716670) |\n\n| Network  | PositionRenderer v1.5.0-beta                                                                                          |\n| -------- | --------------------------------------------------------------------------------------------------------------------- |\n| Ethereum | [0xdDA01E1d7684Cc35e6a3A5803736D32d012B8C99](https://etherscan.io/address/0xdDA01E1d7684Cc35e6a3A5803736D32d012B8C99) |\n\n\n\n\n# Security\n\n[Visit Primitive Security](https://www.primitive.xyz/security) to view a comprehensive overview of the security initiatives of Portfolio.\n\n## Audits\n\n| Security Firm                                                                                                 | Date       | Review Time | Status    | Final Commit w/ Fixes                                                                                                                         |\n| ------------------------------------------------------------------------------------------------------------- | ---------- | ----------- | --------- | --------------------------------------------------------------------------------------------------------------------------------------------- |\n| [ChainSecurity](https://github.com/primitivefinance/security/blob/main/audits/portfolio/chainsecurity.pdf)    | 2022-05-31 | 8-weeks     | Completed | [c6f692f41c1d20ac09acb832923bd46500fd8e06](https://github.com/primitivefinance/portfolio/commit/c6f692f41c1d20ac09acb832923bd46500fd8e06)     |\n| [Trail of Bits](https://github.com/primitivefinance/security/blob/main/audits/portfolio/trailofbits.pdf)      | 2023-01-31 | 8-weeks     | Completed | n/a                                                                                                                                           |\n| [Spearbit #1](https://github.com/primitivefinance/security/blob/main/audits/portfolio/spearbit.pdf)           | 2023-03-31 | 5-weeks     | Completed | [tag/v1.1.0-beta](https://github.com/primitivefinance/portfolio/releases/tag/v1.1.0-beta)                                                     |\n| [Spearbit #1 Extension](https://github.com/primitivefinance/security/blob/main/audits/portfolio/spearbit.pdf) | 2023-05-12 | 2-weeks     | Competed  | [36e9efa28332fa03f6d5910edda2fec2f5937190](https://github.com/primitivefinance/portfolio/commit/36e9efa28332fa03f6d5910edda2fec2f5937190 )    |\n| Spearbit #2                                                                                                   | 2023-07-78 | 2-weeks     | Completed | [tag/v1.4.0-beta-spearbit-2023-08-complete](https://github.com/primitivefinance/portfolio/releases/tag/v1.4.0-beta-spearbit-2023-08-complete) |\n\n## Install\n\nTo install locally and compile contracts: \n\n#### [Required] Foundry. [Source](https://github.com/foundry-rs/foundry).\nIf not installed, run the following:\n```bash\n# First install foundryup\ncurl -L https://foundry.paradigm.xyz | bash\n\n# Restart terminal or reload `PATH`, then run foundryup\nfoundryup\n```\n#### [Required] Install Deps\n```bash\nforge install\n```\n\n#### Usage\n\n##### Testing\n```bash\nFOUNDRY_PROFILE=test forge test\n```\n\n##### Building\n```bash\nFOUNDRY_PROFILE=optimized forge build --skip test\n```\n\n##### Coverage\n\n[Optional] Install coverage gutters [vs code extension](https://github.com/ryanluker/vscode-coverage-gutters).\n\nThen run this to generate a coverage report:\n\n```bash\nforge coverage --report lcov\n```\n\n### Install Artifacts via NPM\nTo install the artifacts to use in your own project:\n\n\n```bash\nnpm install @primitivexyz/portfolio\n```\n\n\n# Documentation\n\n## Hosted\n[Visit Primitive Documentation](https://docs.primitive.xyz) to view the hosted documentation for Portfolio.\n\n\n## Local\n\n### Autogenerated documentation:\n\nGenerated from the natspc of the contracts.\n\n```bash\nFOUNDRY_PROFILE=default forge doc --build --serve --port 4000\n```\n\n### Written documentation:\n\n#### [Required] Rust \u0026 Cargo\nIf not installed, follow the [rust installation instructions](https://www.rust-lang.org/tools/install).\n\n#### [Required] Mdbook\nIf not installed, run the following:\n```bash\ncargo install mdbook\n```\n\n### Build and serve\n\n```bash\ncd docs\nmdbook serve --open\n```\n\n\n\n## Resources\n\n- [Hosted Documentation](https://docs.primitive.xyz)\n- [Portfolio Yellow Paper (Deprecated)](https://www.primitive.xyz/papers/yellow.pdf)\n- [RMM in desmos](https://www.desmos.com/calculator/8py0nzdgfp)\n- [Original codebase](https://github.com/primitivefinance/rmm-core)\n- [solstat](https://github.com/primitivefinance/solstat)\n- [Replicating Market Makers](https://github.com/angeris/angeris.github.io/blob/master/papers/rmms.pdf)\n- [RMM whitepaper](https://primitive.xyz/whitepaper)\n- [High precision calculator](https://keisan.casio.com/calculator)\n\n\n## Contributing\n\nImportant:\n- This codebase uses the FORGE formatter. This is not prettier. If you have not already, make sure if you use vs code that the `formatOnSave`config variable uses forge fmt instead of prettier.\n- Setup the proper settings using this guide: [forge fmt for formatOnSave vscode](https://github.com/juanfranblanco/vscode-solidity/pull/359#issue-1344943156).\n\nWhen making a pull request:\n- All tests pass.\n- Code coverage does not change.\n- Code follows the style guide:\n    - Follows Primitive [styling](https://github.com/primitivefinance/pso-sol) rules.\n    - Run `forge fmt`.\n    - Code is thoroughly commented with natspec where relevant.\n- If making a change to the contracts:\n    - Gas snapshots are provided and demonstrate an improvement (or an acceptable deficit given other improvements).\n    - New tests for all new features or code paths.\n- If making a modification to third-party dependencies, yarn audit passes.\n- A descriptive summary of the PR has been provided.\n\n\n## Copyright\n\n[AGPL-3.0](./LICENSE) © 2023 Primitive Bits, Inc.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprimitivefinance%2Fportfolio","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fprimitivefinance%2Fportfolio","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprimitivefinance%2Fportfolio/lists"}