What is a GLOB?
The main idea
Consider the time weighted average price order (TWAP), a common strategy for whales to lower price impact by splitting their trade into many smaller ones that are executed over time.
Note how each individual trade is instant, but together they seem to approximate a continuous process of finite duration. Intuitively, the faster this duration is set, the higher the price impact will be.
Can we have markets that are so smooth that every trade must be a perfect, continuous stream, such that even the building blocks themselves are already streaming?
The answer is yes. This idea, together with the one of limits recorded in a book, is the GLOB.
Context
We implemented the Gradual Limit Order Book (GLOB) as CosmWasm smart contracts. GLOBs enable a new way of trading without middlemen and were introduced and are studied further in
- Liquid Prediction Markets Without Frontrunning (Andreas Finke), 13p, 2023, accepted at CfC St Moritz 2024 [Invention of the GLOB in the context of prediction markets]
- Gradual Limit Order Books (Ermis Mitsou and Andreas Finke), 29p, 2024, to appear [Rigorous mathematical exposure of the GLOB for general applications]
For the time being, these papers are not public. Please contact us to indicate interest.
Meanwhile, we invite you to browse through the next pages to learn what the GLOB entails and why it is a good idea.
GLOBs in one page
The gradual limit order book (GLOB) is a novel market structure1.
The GLOB is a disruptive invention that has many advantages over previous market structures and simultaneously is very well suited for decentralized networks. It enables efficient markets that are always fair for all users by construction. Additionally, GLOB markets scale to any size without costs or risks.
The key difference to the common central limit order book (CLOB) or pool-based automated market makers (AMM) is that the GLOB forbids instantaneous trades and instead clears markets at a uniform price over time. Previously, market takers could suddenly fill maker orders (or liquidity provider (LP) positions in an AMM) at a first-come first-served basis such that changes to the sequence of the trades had an acute impact on the respective prices paid by the individual actors. In a GLOB, the order in time plays no distinguished role; time matters only proportionally to how much of it has passed.
A simplified version of the algorithm
- A clearing price is computed based on supply and demand.
- Matching orders gradually clear at this uniform price.
- Whenever supply and demand change, restart at step 1.
This robustly mitigates a large array of extractive high-frequency trading strategies. Additionally, it gives the two sides of the market a chance to match with each other directly (aggregated p2p), thereby removing the need for liquidity providers as middlemen. The GLOB ensures that every actor's trade is consensual and open: a trade requires publicly expressed, sustained interest in acquiring or selling a position at prices better than some personal limit, and can be stopped at any moment during its streaming execution by the actor.
When the market price crosses limits of users, their trade streams automatically start and stop respectively (or restart, or even change side for those providing two limits). This means that GLOBs ship with built-in trading automation. It is this empowering of traders to act as if they were market makers that allows for GLOBs to function without designated middlemen.
Footnotes
market structure: here, a mechanism for buyers and sellers to exchange any kind of asset
Continuity
While CLOBs are often referred to as continuous markets because trades can happen at any moment, in a GLOB, they can start, stop and finish at any moment, such that even the execution (the volume traded) in itself is continuous.
The so-called continuous markets are discontinuous in the sense that time matters not proportionally to how much of it has passed, but by the order of trades, which is highly problematic.
Frequent Batch Auctions
Frequent Batch Auctions (FBAs) are a previous attempt of market microstructure research to smooth markets by setting a minimum time scale on which trades can happen.
FBAs disable some HFT by a combination of two elements: stopping execution of trades within batches to aggregate intents, and hiding the state of the market apart from the price of each sudden clearing happening at the end of each batch. As a consequence, they are less continuous than CLOBs, and inefficient due to the sealing that is necessary to avoid new and often worse extractive strategies.
In comparison, GLOBs are more continuous than CLOBs, while still removing the core problem of inflated importance of time ordering.
Trading speed
Furthermore, GLOBs do not have to make a tradeoff choosing any particular smoothing time constant. Instead, they allow for users to choose their speed. GLOBs even allow for very slow execution when desired (for TWAPs, DCA and for derivatives markets with natural time scale set by an expiration date).
GLOBs are far more transparent for MMers than FBAs and even CLOBs, allowing them to compete in the open by matching large orders after the flow is known and reducing inventory risk (no stale-quote sniping / adverse selection).
Frequently Asked Questions
Q: Is there an intuitive reason for why the GLOB is superior?
A: Yes. Markets have an well-known property: Splitting up a trade into many
small ones over time (TWAPping) is a common strategy to lower price impact. A
lot of trades and transactions between different actors make this behavior
emerge effectively, but a single trade is very different in that it fills
immediately, which opens the door to extractive attacks (sandwich a buy order
with buy and sell, or remove phantom liquidity to match the order at a worse
price, etc). The GLOB realizes that the emergent behavior is the one that makes
most sense and enforces it at the most fundamental level. More precisely, it
enforces (roughly) Slippage = Size * Speed
for any trade1.
Q: OK, this is rather abstract. Is there a simpler reason?
A: There are two: A speed cap and uniform price for everyone at any moment disables HFT extraction. And buyers and sellers can be matched directly over time for better prices without the need to have or pay for a third party that is not competitive.
Q: Is this new in DeFi?
A: Yes. It's also new in TradFi and would have positive impact there, too. In DeFi, it can be adopted more quickly.
Q: Is instant liquidity not something desirable? You're disabling it??
A: One might prefer markets with deeper liquidity which would give users the ability to hedge risks by quickly exiting large positions, for example. Markets aim to do so, but of course liquidity is always finite (else, prices would never change).
An actor who seeks to profit from this liquidity in the occasion of a global disruptive event would need to ensure that they are first (more precisely, in the first group among the liquidity available up to some price impact). One must realize they always profit at the cost of liquidity providers (and instead of anyone coming next). This adverse selection against LPs is a real problem, for example even for the constant arbitrages between dark pools and lit exchanges, or, as described above, to the point of disabling liquidity in prediction markets, where the importance of incoming news is amplified. Either the liquidity provider is able to delete their limit orders fast (meaning no instant liquidity after all where we wanted it most!) or the volume traded is essentially an arb of the price to its new external value at the cost of the LP and without further benefit. The common user and even professionals who are not first do not profit from this "instant liquidity" but have to carry its cost one way or another.
In a GLOB, one acknowledges that high urgency should come at a premium, and allows the price to change with (nearly) no volume cleared such that all trading volume is due to actual exchanges between participants with different opinions or interests - arguably the essence of what trading should really be about.2
It is worth clarifying that individuals can still make fast trades (although not with exactly zero time duration). Here, a doubling of the speed would match against double the position of a taker at their limit, or roughly double the price impact in between limits. In the case where their size is small compared to the market, trades can effectively be instant. Otherwise, it is up to the individual to decide between the tradeoff of speed and price impact. Furthermore, MMers are invited to compete for taking the order a posteriori, matching it with a similarly sped-up position on the other side: If the user has set a good limit, trading will barely commence until matching. Once matched, the order will be taken at no price worse than the limit. For a market order, setting a duration of at least a few blocks for bigger amounts leaves time for MMers to react such that most of the order could still be taken at a competitive price.
Footnotes
This formula holds approximately, with some proportionality constant, and in between limits. At limits, prices get "stuck" and the constant decreases as new positions on the opposite side are activated and positions at the same side are deactivated.
To make money in a prediction market while predicting the outcome, all that is needed is to consistently buy the side priced less than its true chances at the current moment (which is a time-dependent process). Changing side is equivalent to selling other positions. Exiting fast, however, is not required at all, and would only create an uneven playing field with the cost of destroying the market.
Applications
GLOBs have the power to revolutionize finance on blockchains. This page provides a high-level overview; more details will be added in corresponding subsections.
Decentralized Prediction Markets
Prediction markets (PMs) have been posited as a key application of blockchain technology and have driven much of the latter's early development. There are a bunch of advantages:
- Clear rules (eg. transparent fee structure and execution, no special roles)
- Permissionlessness (no banning of great traders)
- Pseudonymity (information free to appear)
- Promised payouts (no bankruptcy)
- Censorship resistance (enabling trust when stakes are high, such as for whistle-blowing)
Prediction markets have so far suffered from low liquidity. GLOBs can change that.
Decentralized Swaps
Because of Uniswap's initial success, many still believe that the problem of exchanging pairs of arbitrary fungible digital assets on blockchains is solved. While theoretically true, the simple automated market makers turned out to be unsuitable both for illiquid as well as for popular assets due to losses of passive liquidity and other inefficiencies.
Furthermore, while order books nowadays exist on blockchains to mitigate the worst problems of automated market makers, they can never be competitive with centralized exchanges: liquidity needs speed, and speed is cheaper for centralized entities than on distributed ledger systems.
Due to the fundamental changes to the market microstructure in GLOBs, they finally enable scalable decentralized exchanges.
Stay tuned for more
Swaps
The Status Quo in TradFi
Markets have evolved historically from a structure that made sense when humans traded among each other at special venues to a perverse system where speed is elevated above all. Specialized firms called Market Makers (MMs) provide liquidity but have to understand and protect themselves from the tricks of High Frequency Trading (HFT). Investors can nowadays generally instantly trade deep books at small spreads. What appears to be working well at first means that
- The fastest exchange will be the most liquid exchange.
- Markets for special, unpopular or particularly risky assets will not be traded by most MMs and thus only standard products will have efficient markets.
- Regulations and enforcements are needed to tame the worst extractive strategies and protect users, and actors must go through surveillance, registrations and licenses for each product offer.
- MMs and exchanges must be paid for providing the algorithms, tech and infra of the HFT arms race (a sort of prisoner's dilemma that wastes human resources) and still yet, more money is siphoned off by purely extractive HFT firms. This money has to ultimately come from somewhere.
- Those who manage to trade first in special moments, for example to exit in a market-wide crash, or for assets strongly tied to an aspect of the real world with incoming news, get vastly different prices at the cost of those who come second or later, often also including MMs (stale-quote sniping).
Decentralized Markets
Truly decentralized, liquid markets for fungible digital assets should not require the participation of specialized entities.
However
- Current market mechanisms rely on liquidity middlemen, also on blockchains.
- When assets are new, or rare, risky, and for example created by a user to be traded based on local trust, such middlemen are again unlikely to participate, and markets for such assets will therefore be too illiquid. This is the reason that we have not yet seen applications at scale that leverage the democratic nature of blockchains to the fullest.
- For popular assets with large volume, due to high costs of providing speed in decentralized systems in comparison to centralized exchanges, it is clear that decentralized exchanges cannot outcompete centralized exchanges. Not just the liquidity, but the markets themselves will be centralized for popular assets.
The GLOB removes the need for speed. Markets are now cheap and efficient, even on blockchains. At the same time, because filling order intents on each side are aggregated and traders are taking the role of liquidity providers, the scaling is such that with increasing participation prices become increasingly stable without professional participation.
The GLOB thus enables markets that scale from the smallest and most special use cases (such as just one trader and one filler, or two traders, which are safe and fair by default), to ultimately power the biggest decentralized marketplaces that can outcompete centralized exchanges because they are cheaper and simpler to run.
Prediction Markets
The Challenge
Prediction markets (PMs) are hard to market-make. Each collection of all bet slips has a fixed, real value. But which slip receives and pays out all this value at maturity, irrevocably, is uncertain. Additionally, prediction markets are interesting precisely in situations of high information asymmetry. Whoever supplies liquidity faces the risk of selling undervalued bet slips to an insider.
To cope with this (and even make large profits), betting platforms typically use two tricks:
- high fees (rakes)
- edge
The edge could be:
- Market-specific (advanced prediction algorithms or employing leading experts for the kind of markets selected on offer)
- Banning users who are too good
- Others, such as:
- delays of live stream
- manipulation (withholding of information, marketing)
Sustainable real-money prediction markets on general topics that are permissionless cannot rely such edge used in the betting space, nor can fees be high or users will lose money on average and be disincentivized.
Liquidity Issues
Adverse Selection
The problem of thin PMs is mentioned as motivation for the invention of the first automated market maker (a special AMM well suited for PMs with conditional questions) by Robin Hanson. However, the passive AMM will always lose money against even the most basic arbitrage, for example after the result is in. At the resolution of the market, this loss is cemented as permanent. Previous efforts have found that these costs are typically higher than the value brought by the information aggregation, and therefore have not lead to profitable businesses in two decades. Research has produced AMMs that take fees dynamically but these are still too passive to avoid high fees when they are not needed.
P2P
The only way to run prediction markets is therefore p2p. Even experts and potential insiders often disagree with each other. The concept of debate is as old as human civilization. Therefore, the expectation is that, at least for some interesting and controversial topics with passionate communities, trading volume can be substantial not just for irrational all-in bets (wager with any odds on a favorite) such as seen in sports betting. Interestingly, it is not irrational to participate in such entertainment, as it is very difficult to lose money:
- if the market is accurate and takes negligible fees, the expectation value is zero on both sides for each binary market (No expected loss no matter what one bets on.)
- if the market is not accurate but the user picks a side randomly, there is still no loss expected across markets, because one can both win and loose with the same probability.
Frontrunning
When there are no MMs willing to participate, CLOBs technically still allow p2p trades (one needs to make a small modification such as to match bids with bids on the opposite side, and similar with asks, besides the usual bids and asks of the same asset). To this end, some predictors would have to set limit orders, which is a UX challenge1.
More importantly, this approach is not viable for the reason of speed-based adverse selection against such users in a way that is not just simply exploiting some total passivity of LPs, but something very human: it takes time to update limits whenever new information clearly changes the odds. (This might be a sudden reveal of the outcome itself, a factor such as a goal being scored in a sports game, a press conference or the release of a report, a whistle-blower posting something...)
As a consequence, even the best predictor tend to lose money just for being a little bit slower than someone with decent predictions and faster execution. CLOB-based prediction markets are therefore exploitative in the long run against its best human predictors, which is unacceptable and would limit their adoption.
The Solution
We conclude that what is needed is a p2p trading structure that can be slowed down sufficiently for people to share their belief and then, over time, gradually and automatically invest in and trade bet slips when the market prices them cheaper than what the user believes are the winning chances.
Furthermore, trading should happen in a way that speed is not relevant beyond the time duration in which someone upholds a controversial opinion, such that all orders are streamed at a reasonably (potentially very slow for long-duration markets) time scale such that everyone gets the same price at any moment.
And this is, of course, the GLOB.
Footnotes
The UX challenge as well as the adverse selection frontrunning in this section could be addressed with algorithmic trading automation. However, this leads to frontrunning in the form of sandwich attacks. FBAs mitigate this particular attack vector but have their own challenges. While the combination of carefully designed FBAs and trading automation might avoid most pitfalls, the GLOB is a simpler, more efficient and more transparent solution that ensures the lowest possible spreads for its users.