{"id":26055212,"url":"https://github.com/morpho-org/morpho-optimizers-subgraph","last_synced_at":"2025-07-24T11:05:28.510Z","repository":{"id":160294525,"uuid":"617053878","full_name":"morpho-org/morpho-optimizers-subgraph","owner":"morpho-org","description":"Morpho Subgraphs providing lot of useful and readable data","archived":false,"fork":false,"pushed_at":"2024-01-17T12:02:55.000Z","size":568,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-01-17T19:38:35.970Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","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}},"created_at":"2023-03-21T15:57:19.000Z","updated_at":"2023-08-18T11:29:12.000Z","dependencies_parsed_at":"2023-09-02T14:24:48.967Z","dependency_job_id":"a2f5b1f1-2ac9-41c2-887d-242951976da2","html_url":"https://github.com/morpho-org/morpho-optimizers-subgraph","commit_stats":null,"previous_names":["morpho-org/morpho-optimizers-subgraph"],"tags_count":30,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/morpho-org%2Fmorpho-optimizers-subgraph","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/morpho-org%2Fmorpho-optimizers-subgraph/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/morpho-org%2Fmorpho-optimizers-subgraph/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/morpho-org%2Fmorpho-optimizers-subgraph/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/morpho-org","download_url":"https://codeload.github.com/morpho-org/morpho-optimizers-subgraph/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242532348,"owners_count":20144726,"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:53.024Z","updated_at":"2025-03-08T10:01:22.071Z","avatar_url":"https://github.com/morpho-org.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Morpho Subgraph\n\nThe Morpho Subgraph is a collection of morpho-x lending protocols following the entities provided by Messari for Lending Protocols.\n\nSome of the entities are filled with Morpho specific data, permitting to track the evolution of the protocols regarding the peer-to-peer aspect of Morpho.\n\nAmong them, some properties are defined as \"internal\", meaning that they are not \"human readable\" and are used for internal computations. These properties are prepended with an underscore.\n\n\n## How Morpho works\n\nEach interaction on Morpho-x leads to an interaction on the underlying protocol. Because the Morpho protocol is an aggregation of multiple positions, that means that Morpho is a protocol user itself (regarding the underlying protocol, pool based).\n\nThat means that pool rates and pool indexes are updated each time a user interacts with Morpho.\n\nHowever, a supply on Morpho-x can lead to a Repay on the underlying protocol (If a Borrower is matched for example), and a Supply event on the underlying protocol (if the user is not fully matched).\nSo having a look to the transaction event on the underlying protocol does not really make sense for Financial statistic tracking.\n\n## Event flow\n\nThe classic event flow of an interaction on Morpho is the following:\n\n- Update of the rates and the indexes of the underlying protocol\n- Update of the indexes on Morpho.\n- Update of the deltas on Morpho.\n- Supplier/Borrower matched if any\n- Underlying protocol interaction\n- Emission of the event on Morpho (Supplied, Borrowed, Repaid or Withdrawn).\n\n## Protocols\nMorpho is currently deployed on top of Aave V2 mainnet and Compound V2 mainnet:\n\nCreates a table with the datasources list\n\n| Protocol       | Morpho Address                                                                                                         | Deployment block |\n|----------------|------------------------------------------------------------------------------------------------------------------------| ---------------- |\n| Morpho Aave V2 | [0x777777c9898d384f785ee44acfe945efdff5f3e0](https://etherscan.io/address/0x777777c9898d384f785ee44acfe945efdff5f3e0)  | 15383036 |\n| Morpho Compound V2 | [0x8888882f8f843896699869179fb6e4f7e3b58888](https://etherscan.io/address/0x8888882f8f843896699869179fb6e4f7e3b58888)  | 14860866 |\n\nAll Morpho Protocols are indexed in the same subgraph with different `LendingProtocol` entities.\n\n## Access through the Subgraph Network\n\nComing soon\n\n## P2P improvement\n\nThe Market entity has properties named `p2pSupplyInterestsImprovement` \u0026 `p2pBorrowInterestsImprovement` that are the improvement of the interests of the users that are matched on the P2P market compared to their equivalent position on the underlying pool.\n\nFor example, if Alice has $100 matched at a 1% yield per yer (0.5% on the underlying pool), after one year, the yield earned is $1, and it was about $0.5 on the pool\n\n## TODO\n- [ ] Add the Comp rewards for morpho-compound, since the protocol is redistributing comp rewards to users on pool\n- [ ] Add data about the p2p matching, such as number of matches, matched value etc.\n- [ ] Add Protocol Revenues. Not a problem for now since reserve factor is setted to 0.\n\n## Documentation\n\n- About [morpho-aave-v3](./docs/morpho-aave-v3.md)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmorpho-org%2Fmorpho-optimizers-subgraph","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmorpho-org%2Fmorpho-optimizers-subgraph","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmorpho-org%2Fmorpho-optimizers-subgraph/lists"}