Under The Hood of Polygon’s Biggest Protocol By Revenue

Julia Gallen
azuroprotocol
6 min readMar 14, 2024

--

Unveiling the secrets behind Azuro protocol’s success: an in-depth look at its core mechanics

February marked a significant milestone for Azuro, as it became the top protocol by revenue on Polygon.

Screenshot from https://defillama.com/top-protocols

Let’s see how one of the previously lesser-known protocols climbed up to the top.

Although Azuro is a protocol that encourages onchain games, this milestone was not just a stroke of in-game luck, but the result of strategic advancements in the Azuro tech and well-established implementations within its ecosystem. Azuro protocol is currently adopted by 22 prediction applications, and counting, with hundreds of new end users joining every day.

Screenshot from https://dune.com/azuro/stats

Bridge between real-world data, blockchains and dApps

What distinguishes Azuro from many other protocols is its over-arching approach to cover the needs of every participant in the system. Azuro isn’t only concerned with making smart contracts for on-chain gaming — it creates tooling to connect each link in the chain to each other to ensure a smooth interaction.

Diagram from https://gem.azuro.org/hub

Tooling to Connect Every Participant

Azuro can be viewed as a connector between three parties: real-world data, blockchain and applications. It provides smart contract infrastructure with the oracle that supports a plug-and-play solution for blockchains, on the one hand, and prediction apps, on the other, to allow both of them to interact with the real-world data.

Closer Look at the Architecture

To understand how it works, let’s look under the hood and check out its architecture.

Azuro’s smart contract architecture can be split into 3 main components: oracle, liquidity tree, and prediction engines.

1. Oracle: The Heart of Azuro

The oracle is the innovation in the smart contract logic that processes the info from the data provider and sends it to the apps.

Azuro’s oracle solution ensures real-time and accurate data access to real-world markets. However, it’s not a separate stand-alone solution. On the contrary, it’s connected to the smart contracts with an intricate web of functions.

So, functions across different contracts, particularly in Prediction Engines, interact with the oracle to fetch necessary data, ensuring fair and transparent prediction outcomes.

2. Liquidity Tree: Azuro’s Novel Approach

One of the most curious innovations of Azuro is its Liquidity Tree. This is a novel approach to data handling in peer-to-pool prediction markets because every deposit into the pool is viewed as a leaf in a segment tree data structure.

Leaves are the most remote elements in the segment tree. Two leaves (left and right) are combined into one parent node. Two nodes (left and right) are combined into another parent node and so on up to the single root of the entire segment tree. The root node of the segment tree represents the most up-to-date value of the sum of its child elements (leaves). The root has no parents, and the leaves have no children, making it a sort of a divide-and-conquer approach. Divide your data and conquer data management easy and fast.

This design allows for efficient tracking of liquidity data, and equitable distribution of profits and losses among liquidity providers.

3. Prediction Engines and Other Contracts

Diagram from https://gem.azuro.org/hub/blockchains/architecture

The modular architecture of Azuro’s contracts obviously gives apps and blockchains the flexibility they need to choose only the exact functionality for their use cases and not over-complicate their projects.

The contracts that allow for the predictions to be processed are called Prediction Engines — they contain the logic for the user’s prediction conditions.

The component that allows for the deployment of Azuro into the blockchains is the Factory contract. Let’s look at the code and analyse its capabilities.

  1. The code suggests that different “cores” and “beacons” can be plugged in and updated, providing flexibility for integration with various blockchains.
  2. Using the standard Ethereum token interfaces (like ERC721), it can be adapted to any EVM-compatible blockchain.
  3. OpenZeppelin’s BeaconProxy means upgradable smart contract patterns, which is essential for maintaining compatibility with evolving blockchain ecosystems.
  4. Allows customization of core types, liquidity pool settings, and fees, indicating adaptability to different blockchain requirements and use cases.

What’s helping the apps on Azuro navigate through their contracts and functionalities is that Azuro’s solutions are ready to use “out of the box” through an upgradable SDK.

You can peruse Azuro’s contracts and draw conclusions for yourself. The contracts are publicly available on GitHub .

The End-User Experience: A Real-World Scenario

Imagine Steve, a tennis aficionado who can predict who wins any game in Australian Open Tournament.

Steve wants to leverage his knowledge and goes to one of prediction apps that allows to earn by making predictions on sports events.

Of course, Steve wants fair resolves and odds for his predictions, so the go-to solution for him turns out to be on-chain. Now, what does exactly happen when Steve makes a prediction that, for example, Jannik Sinner wins all the phases in a match?

When users like Steve make predictions, the apps interface with Azuro’s smart contracts, using custom GraphQL queries packaged in the AzuroSDK. Apps interact with the liquidity pool contract, which creats a NewEvent that links to real-time market data and various conditions. Prediction Engines make sure that Steve’s prediction is processed according to the correct conditions given by the data provider. And when the data provider sends the information to Azuro backend, the contracts send the winnings back to Steve.

Growth Defined by Forward-Thinking Tech

Seeing how players like Steve succeed in leveraging solutions provided by Azuro, it’s no wonder that more and more users come to play in Azuro-powered prediction apps. As Azuro ecosystem grows, so does Azuro itself, adding more smart contracts for the apps to use. For instance, freebet contracts (another fairly new addition) are a great example of how Azuro continues to build its infrastructure, thus attracting more implementations and users.

Innovation is not just about creating new paths; it’s about growing with them and evolving as the world does. I’d even go as far as saying that Azuro’s journey is a testament to the transformative power of forward-thinking and adaptation in the digital age.

In other words, go with the flow :)

Azuro is the onchain predictions layer. It consists of modular tooling, oracle and liquidity solutions for EVM chains to host powerful prediction and gaming apps.

With its unique infrastructure layer approach, Azuro makes onchain predictions and gaming portable and composable. It allows anyone to engage and monetize users by building apps, integrations, and products quickly, permissionlessly and with zero upfront or running costs.

Disclaimer: This content is provided for informational purposes only, and should not be relied upon as legal, business, investment, financial or tax advice. References to any digital assets, projects and platforms do not constitute any recommendation for any action or an offer to provide investment, financial or other advisory services. This content may not under any circumstances be relied upon when making a decision to purchase any digital asset referenced herein.

--

--

Julia Gallen
azuroprotocol

Curious about new tech, ancient people, and timeless stories 📜