Hourglass: Making Money Modular
Hourglass is an order book based dex that uses Layer0 to enable cross chain stable swaps. The atomic unit of Hourglass is the "Minute Market", a modular order book.
To try out Hourglass for yourself, go here. To become part of the Hourglass community, follow Hourglass on Twitter and join us on Telegram. The launch press release can be found here.
Despite billions of dollars of investment into and transfers across bridges, moving value between chains is still complicated, expensive, and risky. To date, over $2.8 billion has been lost to hacks in the crypto sector. We believe that tomorrow can be different.
Hourglass is a modular liquidity layer powered by Layer0 with best-in-class rates for bridging and swapping. By using synchronized on chain order books, Hourglass facilitates cross chain swaps, combining DeFi’s accessibility and trustlessness with CeFi’s cost and depth.
Background
(If you are familiar with DeFi or short on time, skip to “Building a Better Market”)
Is the Future Multichain?
Ethereum arose from the need for smart contracts—something its predecessor, Bitcoin, was unable to support. Ever since, thousands of new blockchains have been created with a similar purpose of filling a gap in market or technological needs (see the Fat Protocol Thesis for a likely explanation behind this rush for new chains). Over eight years later, we still see new chains emerge daily. As long as innovation and untapped market demand continue, we expect continued proliferation. Ultimately, the viability of these chains and the larger crypto ecosystem as a whole depend on cross chain value transfer.
Is the Future Multistable?
At the end of the day, stablecoins are tokenized-debt denominated in dollars. Debt is demand driven rather than supply driven: as long as someone wants to hold a stablecoin, a lender will emerge to issue it. We do not expect to see total market dominance by a single player. Stablecoins lack meaningful differentiation besides the creditworthiness of the issuer, and creditworthiness is a matter of perspective. A Bahamian stablecoin holder may simply prefer a stablecoin issued in the Bahamas, in the same way that many firms prefer to do business in jurisdictions that they’re familiar with. Given the lack of differentiation at the product level it seems very unlikely that we see consolidation around a single stablecoin.
Bridging Today
Bridging has been approached as a subset of the Oracle Problem. For two blockchains to communicate, both blockchains need access to the other chains’ state. This requires an off chain intermediary that can read and write to both chains. The first bridges simply trusted a web of specific multisig wallets—a necessary but primitive first step. A variety of different approaches have since been used to provide increasingly stronger guarantees around other blockchains’ states.
The next wave of bridges allowed users to lock assets on one chain and mint “proxy” assets on a second chain. This approach has several limitations:
Speed: The value of the wrapped assets depends on their redeemability, which in turn depends on the uptime of the issuance/redemption stack.
Fungibility: The wrapped assets are rarely interchangeable with other wrapped assets, leading to fragmentation.
Liquidity/Adoption: While some wrapped assets have gained widespread adoption (WBTC), this fungibility problem has limited their adoption and led to liquidity bottlenecks.
These earlier bridging systems are intrinsically fragile, as any issue with the oracle or smart contract can allow for infinite minting or redemption, destroying the bridge and the value of all outstanding assets.
The next generation of bridges focused on atomic swaps (enabling users to trade for equivalent or similar assets on the destination chain). These systems relied on pools1 and typically offered superior liquidity. While implementation details varied significantly between instances, these systems were generally accepted as more secure, often relying on oracles rather than multisigs. Only funds in the pools were at risk (rather than both pools and wrapped asset collateral). However, these pools have proved to be a critical security risk: centralized funds have led to massive hacks.
Unbundling the Bridging Stack
Early bridging systems were monolithic, with the same team managing both the liquidity and the off-chain transaction verification system. Modularizing the system (allowing third parties to handle transaction verification) allows for both better security and greater interconnectivity. LayerZero, Wormhole, Axelar, and CCIP all now offer chain-to-chain message passing, allowing third party developers to build their own dapps. This set the stage for third parties - like Hourglass - to stand on the shoulders of giants like Layer0 and focus solely on improving the liquidity layer.
Building a Global Liquidity Layer
As the stablecoin landscape expands and the number of blockchains increases, the number of possible combinations of ‘coin X on chain Y’ increases exponentially. Flows between chains are highly volatile and often resemble a 'hot ball of money' -- assets flood onto a chain in response to marketing, airdrops, or other opportunities and rotate through new chains over time2. Today, most crypto volume happens through pools. Unfortunately, pools are both inefficient and increasingly insecure as more chains and stables come online. With pools, trade sizes are capped by the availability of assets, and assets must sit passively in smart contracts waiting for buyers. Pricing usually relies on the ratio of the assets in the pool, meaning that trades that approach the maximum trade size incur severe slippage.
Unifying capital in omni-stablecoin pools exposes liquidity providers to risk. A vulnerability in any stablecoin in the pool, chain the stablecoin is issued on, or messaging system used to convey state between chains could wipe out the entire pool. Linear increases in asset/chain support lead to exponential increases in risk. Pool based bridge hacks account for more than 2.8 billion of losses to hacks in the sector over the past 5 years. Subdividing the pools into many smaller pools can reduce risk, but this comes with the price of capital efficiency.
2.7 2.8 billion has been lost in bridge hacks so far and counting!
What if there were a way for supply to be created in response to demand? Where only the funds in transit were at risk and where there was no cap on the size of an order that could be placed?
Building a Better Market
Compared to pools, order books enable more responsive markets, with the texture of liquidity adjusting in response to market dynamics. This leads to greater depth when markets are calm and lower losses in periods of high volatility3. However, order book based marketplaces are heavily reliant on market maker performance to provide this liquidity. In an order book based marketplace, the quality of the user experience depends heavily on the size, price, and amount of orders that a trader is buying or selling into. These in turn are mainly determined by market makers4. It is fair to say that market makers are one of the main determinants of UX on most trading platforms. Please see this writeup for an explanation of market making, spreads, and price discovery if these terms are unfamiliar to you.
ETH is a technically hostile environment for order books. Traditional price discovery on order books is predicated on a computationally rich environment with very low latency, neither of which Ethereum offers today. The key hurdles to building an on chain order book are:
Improving price discovery and robustness against MEV/latency based arbitrage. Slow block times mean that any quote offered on chain needs to be good for at least one block—plenty of time for significant market movement. This makes it very risky/expensive for market makers to offer competitive quotes, a problem that market makers don’t encounter in modern CeFi. Miners have been able to extract billions through ordering transactions.
Reducing the amount of gas costs borne by market makers. For market makers, the costs associated with canceled trades need to be covered by the profits of the trades that do clear. Nasdaq has about 35 canceled trades per matched order; by this logic, the profits for an on chain market maker need to be at least 36x the gas cost of placing an order to break even, further impacting the viability of offering competitive quotes.
Our core focus has been developing strategies to overcome these issues.
Unified Pricing: Slow block time leaves any orders near spot vulnerable to arbitrage, as the markets can move before orders can be canceled. To mitigate this, both traditional AMMs and Hourglass employ pricing logic that operates independently of the original order. In Hourglass’s case, each “pair” of stables has a prespecified price oracle. By doing away with traditional limit order based price discovery, the amount of orders placed and canceled is drastically reduced and market makers can safely offer quotes much closer to spot. A reason we opted to start with stablecoins is because managing the pricing module is simpler. This model is flexible and can be used to replicate almost any other on chain liquidity system while improving capital efficiency. For example, it would be possible to replicate AMM pricing by creating an on chain synthetic pool as an oracle. Anyone can create a new “pair” with a new pricing logic, all on chain.
Recycling Maker Orders: Writing new orders is expensive. By allowing maker orders to pair again once filled, Hourglass greatly reduces the number of orders placed while also solving MEV by making queue position permanent. Makers maintain their relative position unless they fail to honor a quote. This should lead to the most reliable makers moving towards the front of the queue which in turn will lead to more frequent and predictable matches and higher profits. We believe this performance based equity will lead to superior liquidity quality over time5.
Batched Settlement: Batching simplifies escrow risk, enhances capital efficiency, reduces the number of cross chain calls, provides checkpoints for rollbacks (improving safety), simplifies asset pricing, raises the rate of internal pairing, and increases predictability for makers. This will be covered in greater depth in a later document specifically on singlechain trades6.
From an engineering standpoint, Hourglass is one of the first viable on chain order books.
Minute Markets
So you have a viable on chain order book? Now what? We used the breakthroughs described in the previous section to build what we call a “Minute Market”. Minute Markets are individual on chain order books that use a prespecified oracle to support a distinct asset pair, such as USDT-DAI. Today, Minute Markets only support market orders and require a predetermined settlement window. Anyone can spin up a composable Minute Market for any asset pair around any oracle. It is possible, for example, to replicate the performance of an AMM as a Minute Market by using the constant product formula as an oracle and a synthetic pools.
Hourglass
By networking “Minute Markets”, Hourglass is able to offer highly efficient cross chain swaps. The basic functionality is straightforward: takers place an order and Hourglass matches this order with another taker order or one of our liquidity providers. The exact funds required are swapped on chain at the time of transaction at the oracle specified market price. Please see the Hourglass Gitbook to learn more about how Hourglass works under the hood.
A Man for All Markets
Hourglass focuses on filling the needs of several key sets of stakeholders:
• Market Makers: Hourglass offers a more equitable playing field than RFQ systems. Hourglass provides open access, fixed amount of time to source assets, and clear rules. Our primary distinguishing characteristic is rewarding good performance with higher fill rates.
• Traders: Hourglass simply provides better liquidity. By providing market makers with a superior playing field, we are able to offer lower fees and greater depth than other venues.
• Ecosystems: Hourglass simplifies secure and cost-effective onboarding of users. Hourglass allows any user on any chain to convert any stable into any other stable on any other chain, in one click.
• Stablecoin Projects: Hourglass provides a secure and flexible distribution venue. Today, a small number of platforms control stablecoin distribution, locking out emerging stablecoins. Even for incumbents these venues are expensive. Participation also requires underwriting whatever other assets are in the pool.
Closing Thoughts
Markets tend to emerge organically when needed and have strong network effects once established, making it very rare for a new market to be both novel and useful. We’re cautiously optimistic that Hourglass may be an exception to this norm, as it provides immediate, substantial improvements to trading fees and security as outlined in this document. Hourglass borrows from AMM innovation (single price for buyers and sellers) while offering the flexibility, efficiency, and responsiveness of order books. Over time, we expect to see systems like Hourglass expand beyond stables to other asset classes, leveraging more complex pricing systems. In a modular future, liquidity deserves a layer of its own.
To try out Hourglass for yourself, go here. To become part of the Hourglass community, follow Hourglass on Twitter and join us on Telegram. The launch press release can be found here.
Pools are smart contracts that contain two or more assets that can be swapped, usually using the ratio of side assets to determine a price.
Local demand for stablecoins tends to be much more volatile than it does for other tokens as the price itself often becomes an outlet for other tokens.
Being able to “turn off” exposure (i.e. expand spreads) during periods of uncertainty lowers market maker losses, allowing market makers to profitably offer tighter spreads/greater depth when the market is calm. This avoided “adverse selection” plays a major role in why basic AMMs, which do not adjust pricing/depth in response to market conditions, will usually underperform order books.
Many would argue that it is possible to take this logic too far. At some point making markets less hostile for market makers makes them increasingly hostile for traders.
Additionally, this eliminates the main remaining source of MEV as market makers are no longer competing using gas for their position in the queue.
Because Layer0 (and most cross chain messaging services) support strict ordering, batching helps avoid race conditions.