Jan 16, 2024

How Polymarket is bringing prediction markets to life with Goldsky Mirror

Polymarket is the leading onchain prediction market, with realtime trading activity supported by Goldsky Mirror.

How Polymarket is bringing prediction markets to life with Goldsky Mirror cover image

About

Polymarket is a prediction marketplace that allows users to wager on outcomes of current events, sporting matchups, political races, and more.

Industry

Prediction Market

Using

Goldsky Subgraphs, Goldsky Mirror

$32M

28 day trading volume

30k

28 day matched trades

400+

Events written / second

99.9%

Uptime

Polymarket is an onchain prediction marketplace, allowing users to bet on outcomes of highly-debated current events, sporting matchups, political races, and more. With bets handled using a decentralized, non-custodial protocol, Polymarket has quickly become the leading onchain prediction market, with daily transaction volume recently hitting $5.7M.

Goldsky powers important pieces of the realtime data behind Polymarket’s application infrastructure, giving the team reliable subgraph indexing and the ability to stitch together complex onchain-offchain datasets with Mirror.

High Stakes Infrastructure Challenges

When serving data at Polymarket scale, the need for reliable indexing and flexible data workflows are critical. Thousands of monthly active users rely on the platform to accurately track bets, see the latest spreads, and comment on popular posts. Polymarket knew they needed a better solution for their two biggest challenges — data reliability and onchain-offchain workflows.

Data Reliability

Polymarket’s infrastructure is reliant on subgraphs for fast indexing and streamlined data retrieval. But not all subgraphs are created equally — persistent issues with lag, missing data, and service interruptions were common with Polymarket’s original hosted provider.

The team’s subgraphs would sync properly and seem to be running smoothly, only to return inconsistent data or slow to a standstill. And without a functional self-serve option, there was no way to unblock issues when they came up.

Onchain to Offchain

Another challenge Polymarket faced was finding a better way to match offchain user data to onchain transactions. Usernames, comments, and leaderboards are critical components of the Polymarket experience, and the team needed a way to bring these elements directly into the UX. Polymarket looked into building an in-house ETL, but the complexities of onchain data made it a major hurdle for engineering.

"Things like delay, dealing with multiple RPC providers, and chain reorgs are all very costly problems to solve," said Liam Kovatch, Polymarket’s Head of Engineering.

Betting on Goldsky

With the core problems clearly defined, Polymarket’s team came to Goldsky to explore new solutions. Goldsky’s hosted subgraph offering and flexible data pipeline product, Mirror, gave Polymarket the tools they needed to dramatically improve indexing resiliency and map user data to onchain transactions.

Better Indexing, Better Reliability

“Goldsky replaces a lot of our API calls, and the realtime data is super helpful,” said Liam. “We can work with raw events or subgraphs, and iterate quickly.”

With 99.9% uptime, automatic handling for reorgs, and intelligent RPC load-balancing, Goldsky’s subgraphs offer an elevated level of performance compared to similar offerings in the space.

“We were building a subgraph recently, but the API provider we were using didn’t have an event we needed. We tried using event handlers from another subgraph provider, but the API didn’t support local testing,” Liam said. “When we threw it into Goldsky, it just worked. The infrastructure is more sophisticated, with much better RPC handlers.”

Mapping User Data with Mirror

The biggest unlock, according to Liam, was Goldsky Mirror. Polymarket uses Amazon RDS as a content management system to store offchain data like usernames, comments, and profiles. Mirror seamlessly integrated into this existing infrastructure, giving Polymarket the power to map onchain activity to the data contained in the CMS.

“Since Mirror lets you post to any Postgres database, we were able to set up tables for onchain data in the same database as our existing one. This let us build highly complex APIs that easily join onchain and offchain data.”

Mirror allows Polymarket to pull all of the trades associated with a username, augment trades with comments, and return results back to the frontend UX in realtime. Dashboard views for Polymarket’s top holders, recent activity, and leaderboards are all powered by Goldsky Mirror under the hood.

Leaderboard

Service and Support

Goldsky offers industry-leading SLAs and white glove support service to customers. Proactive alerting, subgraph optimizations, and integration support are readily available to help builders create the most reliable and resilient experiences in Web3.

Liam Kovatch, Head of Engineering

Polymarket requires realtime data in order to power the platform that our customers trade on. We’ve been looking for a reliable partner for low-latency data for a long time, and Goldsky has exceeded our expectations in almost every single category.

Realtime Data Streaming with Goldsky

Goldsky’s mission is to unleash the full potential of Web3 data.

We’re solving complex data engineering challenges so that builders can focus on what matters most — building transformational applications and delivering value to users.

Sign up for full access to Goldsky's realtime data streaming platform today, and be sure to give us a follow on Twitter for the latest news and announcements.

© Endless Sky Inc. All rights reserved.

Loading system status...