Introducing Hydro SDK

The Full-Stack Solution for Building Modern Decentralized Exchanges and DeFi Marketplaces

Tian Li
Hydro Protocol
4 min readApr 3, 2019

--

In December 2018, we stopped relying on 0x to settle orders and created a new decentralized exchange protocol called Hydro.

Technically, we were very confident in both the unique features of the Hydro architecture and its robustness and security. However, the migration came with a big market risk: The old smart contract contains the entire on-chain state. By migrating away from 0x, we must discard the approval state of every DDEX customer and essentially start over from scratch.

Fortunately, 3 months after the upgrade, the transition worked out just fine:

Total number of transactions on all 0x Relayers compared to DDEX on Hydro by quarter. Hydro launched on DDEX December 17, 2018. (data source: Ethereum ledger)

The Hydro smart contract has performed well in production environment, matching over 60,000 transactions without a hitch. We also followed up with a 1.1 release in March 2019 to further improve performance.

With a smooth initial launch behind us, the next step is to make Hydro available for everyone. However, we didn’t want to build an SDK just for the sake of having a SDK. We wanted to tackle an important problem worth solving.

Defining the Problem

First, a brief recap of the DEX development problem space. Back in 2013, if you wanted to create a DEX, you’d write your own blockchain. The development cost was substantial.

In 2017, projects such as EtherDelta took advantage of generalized computing platforms such as Ethereum to build smart contract based DEXs. Although much easier than before, the challenge was still quite daunting. Writing, securing, and upgrading smart contracts is no joke.

This is where open source projects such as 0x came in. Instead of every DEX writing their own smart contracts, everyone could just use the one provided by 0x. In early 2018, the number of 0x powered DEXs exploded in popularity.

A key problem remains: although you can stack a web app directly on top of a smart contract to get a functioning exchange, this naive implementation performs poorly due to front running and order collision. The performance can be drastically improved by the addition of a middle-ware layer. However, the development cost of the latter option is significantly higher.

In 2018, the nuances of the naive (what 0x calls “open”) model vs. hybrid (what 0x calls “matching”) model was not well understood. Naturally, the overwhelming majority of developers chose the easier option available. However, as theoretical architectures meet reality, the picture has shifted drastically over time:

Historical snapshots of the # of 0x Relayers from 2017–2019 Q1. (data source)

Within a year, the vast majority of Open Mode 0x relayers has either shut down, pivoted, or switched to Matching Mode. Outside the 0x ecosystem, the same story is repeated. Hybrid exchanges such as IDEX dominate the field.

In 2019, a robust middle-ware layer is essentially a standard component for DEXs. And as of yesterday, you’d have to write it all from scratch.

Introducing Hydro SDK

Hydro SDK is an open source framework containing all the core modules necessary to create modern decentralized exchanges.

The goal of Hydro SDK is to reduce unnecessary development cost

Although Hydro SDK is a full stack framework, it is not meant as a turnkey solution. By open sourcing essential building blocks, our goal is to reduce costly and repetitive work. It is our hope that the time and effort saved can be redirected to improve usability and liquidity, leading to a new wave of marketplaces for DeFi products.

Try it Today

The Hydro SDK is available on GitHub today. For the sake of comprehensibility, we kept the initial version simple. In the days ahead, we plan to release a wide range of additional modules and features.

Screenshot from the Hydro Relayer SDK Front End

You can checkout the Hydro Relayer SDK Github here. To get started just:

The whole setup should take less than 5 minutes.

--

--