youtube image
From YouTube: Developer Highlights #2 - "Building ambitious Subgraphs" Part 1

Description

Timestamps and Info:

Developer Highlights #2 | “Building ambitious subgraphs” Part 1
Sebastian Siemssen & Ivan Herger | Enzyme Finance

For the second Developer Highlights, we get to speak with Sebastian Siemssen & Ivan Herger.

Ivan and Sebastian are long time members and developers in our community and have been working on subgraphs for Enzyme Finance (formerly Melon Protocol) for more than 2 years. They are going to share the challenges they faced and the lessons they learned along the way. In this episode we’ll explore some of the more demanding event tracking, data aggregation and scaling requirements of a DeFi subgraph and the patterns and solutions they came up with to solve them.

This is the first of two parts. You can find the second part here:
https://www.youtube.com/watch?v=4V2o5YJooOM

00:00 Episode overview

02:54 Enzyme Finance - Protocol overview
09:43 Enzyme Finance - How subgraphs are used
17:06 Enzyme Finance - How the subgraph performance have increased

19:39 Smart Contract Design - Write events with data retrieval in mind
23:18 Smart Contract Design - Upgradable contracts (proxy pattern)

25:40 Schema Design - Build the schema close to the data Requirements
27:11 Schema Design - Limitations to filter and sort
30:21 Schema Design - Low/High level data
32:22 Schema Design - Upgradable Protocols

33:58 Pagination - Capabilities and limitations
38:23 Pagination - Exactly-once Guarantees
40:38 Pagination - Counting

42:01 Avoiding Fatal Errors - About
45:03 Avoiding Fatal Errors - Try/catch
49:25 Avoiding Fatal Errors - Don't throw exceptions
51:06 Avoiding Fatal Errors - nonFatalErrors
54:02 Avoiding Fatal Errors - Required properties in the schema

55:55 Mappings - Save/Load performance Impact

00:57:20 Interfaces - An often missed feature
00:58:40 Interfaces - Union Types
01:00:45 Interfaces - Type Field
01:02:41 Interfaces - Entity Utils

The Graph Webpage: https://thegraph.com/
The Graph Discord https://discord.gg/vtvv7FP
The Graph Forum: https://forum.thegraph.com/