The Graph Builders Newsletter - April 2024

🏗️ Subscribe to The Graph Builders Newsletter 🏗️

gm web3 builders,

Welcome to The Graph Builders Newsletter #16 for April 2024! Read on to learn more about how to earn GRT by taking part in the Sunrise Upgrade Program! 🏗️

New Releases

The Sunrise Upgrade Program Launched with 4M GRT Rewards Available

What is the Sunrise Upgrade Program?

The Sunrise Upgrade Program is composed of a variety of creative, technical and non-technical missions in support of The Graph’s Sunrise of Decentralized Data – a three-phased plan enabling all subgraphs to upgrade seamlessly to The Graph Network.

The Graph Foundation has allocated up to 4 Million GRT to reward The Graph community (and community newcomers) for their contributions around completed missions in this program. The successful completion of qualified missions earn individuals GRT rewards.

Pro tip: participants completing missions earlier are able to earn a larger amount of the reward pool.

All are welcome to join the movement! Sign up here!!

Who’s Upgraded?

Here are just a few of the teams that have already upgraded their subgraphs to The Graph Network. Go ahead and check out all of their subgraphs!

Snapshot - Three subgraphs on The Graph Network.

Vela Exchange - Four subgraphs on The Graph Network.

EtherFi - One subgraph on The Graph Network.

UNCX - 13 subgraphs on The Graph Network.

Streamr - One subgraph on The Graph Network.

Paintswap - Four subgraphs on The Graph Network.

eth_getBalance Available in Mappings

With graph-node 0.35.0 released, we can now get the balance of a wallet address in our mappings!

Imagine providing users with real-time wallet balance updates directly through our dapps, without the overhead of additional Ethereum network requests. With eth_getBalance, we can streamline user experiences in a variety of applications:

  1. Wallet Interfaces: Improve the user experience by displaying up-to-date wallet balances without requiring manual refresh or additional queries.
  2. DeFi Platforms: Enhance trading, lending, and liquidity provision services by using real-time balance data to ensure transactions are performed based on the latest available data.
  3. Marketplaces and Games: Check balances before transactions to validate that users have sufficient funds to purchase items or engage in gameplay, ensuring smoother transaction flows and reducing failed transactions.
import { BigInt } from "@graphprotocol/graph-ts"
import { ethereum } from "@graphprotocol/graph-ts"
// Function to handle a specific event and fetch balance
export function handleSomeEvent(event: SomeEvent): void {
let address = event.params.userAddress;
let balance = ethereum.getBalance(address);
// Now you can use 'balance' as needed, for example, store it in an entity
let entity = new Entity(event.transaction.hash.concatI32(event.logIndex.toI32()
entity.balance = balance;;

Note: eth_getBalance requires subgraphs to be apiVersion to be 0.0.9 or higher.

Timeseries + Aggregations in live on The Graph Network

The new timeseries and aggregations features significantly enhance data handling within subgraphs. They are currently available in Subgraph Studio and are also available on The Graph Network!

So, why are these features exciting? Feel free to jump into the readme or continue reading for an example use-case!

By allowing builders to define timeseries and aggregation entities in a subgraph’s schema, builders can programmatically perform computations over specified intervals, such as computing daily averages of transaction values. This automation streamlines data processing, and reduces query load, resulting in a better building experience.

For instance, consider a simplified schema for tracking daily average transaction values:

type Transaction @entity(timeseries: true) {
id: ID!
timestamp: BigInt!
value: BigDecimal!
type DailyTransactionStats @aggregation(intervals: ["day"], source: "Transaction") {
id: ID!
timestamp: BigInt!
averageValue: BigDecimal! @aggregate(fn: "avg", arg: "value")

This setup automatically calculates daily averages, enabling efficient and simplified data queries for analytics, thus enhancing the user experience by providing quick access to aggregated data insights.

The following aggregation functions are supported:

sum - Sum of all values

count - Number of values

min - Minimum value

max - Maximum value

first - First value

last - Last value

Want to see Timeseries + Aggregations in action? Check out this workshop with Simon Emanuel Schmid on a recent episode of The Graph Builders Office Hours!

Ecosystem Announcements

TODO: Upgrade from Hosted Service to Network Endpoints

Now is the time to upgrade your hosted service subgraph to the network. It's easy to do and more and more hosted service subgraphs are doing so on a daily basis.

If any builders are using the Hosted Service version of Uniswap v3, the endpoint will eventually deprecate in favor of The Graph Network version of Uniswap V3.

This means builders will soon have to change the endpoints used in their dapp from hosted service subgraph endpoints to The Graph Network subgraph endpoints.

If you're using a hosted service subgraph that does not exist on The Graph Network, reach out to the team that owns the hosted service subgraph and refer them to the upgrade documentation.

This announcement will go out in every Builders Newsletter to ensure clarity during the sunsetting of the Hosted Service.  If any builders see X’s (Tweets) of these reminders, please retweet, as it helps all builders in The Graph ecosystem!

Newly Supported Chains

The Graph Network now has 45+ chains supported! Here are the newly supported chains that were added in April:

  • Polygon Amoy
  • Etherlink Testnet
  • Xlayer Sepolia
  • Xlayer Mainnet
  • Mode
  • Astar zKyoto

Chain Deprecations

These were the chains that were deprecated in the month of April.

  • Polygon Mumbai
  • Astar zKatana
  • Astar zkEVM-Sepoli

Hackathon Highlights

Zero to Dapp Day at Belgrade Blockchain Week (Thurs, May 30th)

Are you new to building on Ethereum? Or perhaps you just want to touch up your skills? Come along for a day of intro workshops to help beginner to intermediate developers learn how to ship a full stack dapp quickly and easily! Attendees will learn about solidity, NextJS, Scaffold-ETH, The Graph and more!

Sign up and learn to build with Developer Relations Engineer Kevin Jones of Edge & Node!

Learning Corner

The Graph Builders Office Hours - Thursdays 5pm UTC

Jump into The Graph Builders Office Hours every Thursday at 5pm UTC hosted by Edge & Node Developer Relations Marcus Rein inThe Graph Discord.

Each session includes live workshops and Q&A discussions with developers who are building in The Graph Ecosystem.

Missed an episode? Start building fast with all 35 Episodes of the (!) The Graph Builders Office Hours workshops!

Here are a few recent episodes:

Developer Survey

Building The Graph Network is a collaborative effort, and the core devs would love to hear your feedback!

Thanks for reading and happy hacking! 💌

Marcus Rein
Developer Relations and Success
Edge & Node, working on The Graph

About The Graph

The Graph is the source of data and information for the decentralized internet. As the original decentralized data marketplace that introduced and standardized subgraphs, The Graph has become web3’s method of indexing and accessing blockchain data. Since its launch in 2018, tens of thousands of developers have built subgraphs for dapps across 50+ blockchains - including  Ethereum, Arbitrum, Optimism, Base, Polygon, Celo, Fantom, Gnosis, and Avalanche.

As demand for data in web3 continues to grow, The Graph enters a New Era with a more expansive vision including new data services and query languages, ensuring the decentralized protocol can serve any use case - now and into the future.

Discover more about how The Graph is shaping the future of decentralized physical infrastructure networks (DePIN) and stay connected with the community. Follow The Graph on X, LinkedIn, Instagram, Facebook, Reddit, and Medium. Join the community on The Graph’s Telegram, join technical discussions on The Graph’s Discord.

The Graph Foundation oversees The Graph Network. The Graph Foundation is overseen by the Technical Council. Edge & Node, StreamingFast, Semiotic Labs, The Guild, Messari, GraphOps, Pinax and Geo are eight of the many organizations within The Graph ecosystem.

Graph Builders
Marcus Rein
May 9, 2024

Marcus Rein

View all blog posts