A quest to migrate Lens subgraph to Subsquid
This is the squid implementation of the Lens subgraph (https://github.com/rtomas/lens-protocol-subgraph).
Please note that, the subgraph has only been synced upto 33.2 millionth block. So it is not possible to compare the data with the squid.
- Batch Processing is used.
- An
EntityCacheis used to store the entities in memory to improve performance. schema.graphqlwas changed to represent Many to Many relationships.
- Please make sure to add the necessary DB config to
.envfile.
git clone https://github.com/secsec2025/lens-subgraph-migration.git
cd lens-subgraph-migration
npm ci
sqd up
sqd process &
sqd serve- The core structure stays same with the Subgraph.
Bytefields have been changed toString.AccountProfileFollowandProfileProfileFollowentities were added to represent Many to Many relationships. These entities will act as pivot tables.- Interface
Publicationwas removed. - Entity
FollowProfilewas added to keep track ofFollowandProfileentities.
- Time to fully sync - More than 48 hours
- Add more sample queries.
queries.md