# Developer Highlights #2 - "Building ambitious subgraphs" part 1

**URL:** <https://forum.thegraph.com/t/developer-highlights-2-building-ambitious-subgraphs-part-1/1898>\
**Category:** Resources\
**Tags:** subgraph-devs, developer-highlights\
**Created:** [April 5, 2021, 7:34pm UTC](https://forum.thegraph.com/t/developer-highlights-2-building-ambitious-subgraphs-part-1/1898 "2021-04-05T19:34:19Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Slimchance](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.thegraph.com/slimchance/32/409_2.png) [@Slimchance](https://forum.thegraph.com/u/Slimchance)\
**Post date:** [April 5, 2021, 7:34pm UTC](https://forum.thegraph.com/t/developer-highlights-2-building-ambitious-subgraphs-part-1/1898/1 "2021-04-05T19:34:19Z")

</div>

![IMG_20210430_195354_568](https://us1.discourse-cdn.com/flex020/uploads/thegraph1/original/1X/6eec0082bc5afd583748f1c40607a1ac9302ab5b.jpeg)  
  

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:

- Dealing with external contracts with non-ideal behavior (incomplete & missing events, etc.)
- Tips for filtering and paginating large data sets
- Tips for designing a graphql schema
- and more …  
  

This is the first of two parts. I also recommend watching the [second part](https://forum.thegraph.com/t/developer-highlights-3-sebastian-siemssen-ivan-herger-enzyme-finance-building-ambitious-subgraphs-part-2/2059).

Watch the full episode, or jump straight to each topic using the timestamps below the video.

[![](https://us1.discourse-cdn.com/flex020/uploads/thegraph1/original/2X/4/4f5e2fb401f3fe9df0126c76cdc1dcc3c6346bf2.jpeg "Developer Highlights #2 - "Building ambitious Subgraphs" Part 1") ](https://www.youtube.com/watch?v=4V2o5YJooOM)

[00:00](https://www.youtube.com/watch?v=4V2o5YJooOM&t=0s)​ Episode overview

[02:54](https://www.youtube.com/watch?v=4V2o5YJooOM&t=174s)​ Enzyme Finance - Protocol overview  
[09:43](https://www.youtube.com/watch?v=4V2o5YJooOM&t=583s)​ Enzyme Finance - How subgraphs are used  
[17:06](https://www.youtube.com/watch?v=4V2o5YJooOM&t=1026s)​ Enzyme Finance - How the subgraph performance have increased

[19:39](https://www.youtube.com/watch?v=4V2o5YJooOM&t=1179s)​ Smart Contract Design - Write events with data retrieval in mind  
[23:18](https://www.youtube.com/watch?v=4V2o5YJooOM&t=1398s)​ Smart Contract Design - Upgradable contracts (proxy pattern)

[25:40](https://www.youtube.com/watch?v=4V2o5YJooOM&t=1540s)​ Schema Design - Build the schema close to the data Requirements  
[27:11](https://www.youtube.com/watch?v=4V2o5YJooOM&t=1631s)​ Schema Design - Limitations to filter and sort  
[30:21](https://www.youtube.com/watch?v=4V2o5YJooOM&t=1821s)​ Schema Design - Low/High level data  
[32:22](https://www.youtube.com/watch?v=4V2o5YJooOM&t=1942s)​ Schema Design - Upgradable Protocols

[33:58](https://www.youtube.com/watch?v=4V2o5YJooOM&t=2038s)​ Pagination - Capabilities and limitations  
[38:23](https://www.youtube.com/watch?v=4V2o5YJooOM&t=2303s)​ Pagination - Exactly-once Guarantees  
[40:38](https://www.youtube.com/watch?v=4V2o5YJooOM&t=2438s)​ Pagination - Counting

[42:01](https://www.youtube.com/watch?v=4V2o5YJooOM&t=2521s)​ Avoiding Fatal Errors - About  
[45:03](https://www.youtube.com/watch?v=4V2o5YJooOM&t=2703s)​ Avoiding Fatal Errors - Try/catch  
[49:25](https://www.youtube.com/watch?v=4V2o5YJooOM&t=2965s)​ Avoiding Fatal Errors - Don’t throw exceptions  
[51:06](https://www.youtube.com/watch?v=4V2o5YJooOM&t=3066s)​ Avoiding Fatal Errors - nonFatalErrors  
[54:02](https://www.youtube.com/watch?v=4V2o5YJooOM&t=3242s)​ Avoiding Fatal Errors - Required properties in the schema

[55:55](https://www.youtube.com/watch?v=4V2o5YJooOM&t=3355s)​ Mappings - Save/Load performance Impact

[00:57:20](https://www.youtube.com/watch?v=4V2o5YJooOM&t=3440s)​ Interfaces - An often missed feature  
[00:58:40](https://www.youtube.com/watch?v=4V2o5YJooOM&t=3520s)​ Interfaces - Union Types  
[01:00:45](https://www.youtube.com/watch?v=4V2o5YJooOM&t=3645s)​ Interfaces - Type Field  
[01:02:41](https://www.youtube.com/watch?v=4V2o5YJooOM&t=3761s)​ Interfaces - Entity Utils

We encourage anyone to ask questions about these topics below.

---

<div class="post-metadata">

**Author:** ![SpaceTraveler](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.thegraph.com/spacetraveler/32/565_2.png) [@SpaceTraveler](https://forum.thegraph.com/u/SpaceTraveler)\
**Post date:** [April 6, 2021, 10:11am UTC](https://forum.thegraph.com/t/developer-highlights-2-building-ambitious-subgraphs-part-1/1898/2 "2021-04-06T10:11:06Z")

</div>

If Ivan and Sebastian could start all over again with the subgraphs for Enzyme Finance, what would they do differently now? What were the key lessons they’ve learned?

---

<div class="post-metadata">

**Author:** ![Slimchance](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.thegraph.com/slimchance/32/409_2.png) [@Slimchance](https://forum.thegraph.com/u/Slimchance)\
**Post date:** [May 3, 2021, 12:45pm UTC](https://forum.thegraph.com/t/developer-highlights-2-building-ambitious-subgraphs-part-1/1898/3 "2021-05-03T12:45:16Z")

</div>

Hi everyone!  
We just published the second Developer Highlights!  
Ivan Herger & Sebastian Siemssen from Enzyme Finance have been perfecting their subgraphs for 2 years. Both beginners and experienced subgraph developers will have a lot to learn from their journey. In the first part we are looking at

- Smart contract design
- Schema design
- Pagination
- Avoiding Fatal Errors
- Interfaces

Watch the full episode, or jump straight to each topic using the timestamps below the video.
