Skip to content

secsec2025/lens-subgraph-migration

Repository files navigation

Lens Subgraph Migration

A quest to migrate Lens subgraph to Subsquid

Introduction

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.

What is Changed?

  • Batch Processing is used.
  • An EntityCache is used to store the entities in memory to improve performance.
  • schema.graphql was changed to represent Many to Many relationships.

How to start?

  • Please make sure to add the necessary DB config to .env file.
git clone https://github.com/secsec2025/lens-subgraph-migration.git
cd lens-subgraph-migration
npm ci
sqd up
sqd process &
sqd serve

GraphQL Schema Changes

  • The core structure stays same with the Subgraph.
  • Byte fields have been changed to String.
  • AccountProfileFollow and ProfileProfileFollow entities were added to represent Many to Many relationships. These entities will act as pivot tables.
  • Interface Publication was removed.
  • Entity FollowProfile was added to keep track of Follow and Profile entities.

Squid Stats

  • Time to fully sync - More than 48 hours

What's Next to Do?

  • Add more sample queries. queries.md

About

lens-subgraph-migration

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published