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.

TWAP

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?

TWAP

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

  1. A clearing price is computed based on supply and demand.
  2. Matching orders gradually clear at this uniform price.
  3. 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

1

market structure: 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 they 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).

TWAP

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).

Decentralization vs Fairness

The Situation 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 (MMers) 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

  1. The fastest exchange will be the most liquid exchange.
  2. Markets for special, unpopular or particularly risky assets will not be traded by most MMers and thus only standard products will have efficient markets.
  3. 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.
  4. MMers and exchanges will be paid for 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.
  5. 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 MMers (stale-quote sniping).

Decentralized markets

"Decentralized" can be understood in multiple ways:

  • The underlying infrastructure is a distributed blockchain: This usually implies a downside for speed with respect to centralized infrastructure.
  • absence of admin control of a permissionless protocol
  • referring to shared and permissionless ownership of a product, such as flat distributions of governance tokens that can be bought by anyone

What is typically not mentioned is that just because a DeFi protocol is permissionless and offers the same rights to any user, it is in practice often not fair in that technically sophisticated and professional users can have a huge advantage (for example, AMMs where orders can be frontrun), so much so, that a whole industry has evolved around extractive strategies.

The typical DeFi user in the future would treat DeFi like other chores: passively. Yet, finance functioning as the TradFi system described above requires the participation of active professionals, in particular for market making. When protocols ask normal users to take on a passive role for such tasks, they will generally be exploited: Liquidity provision in an AMM is the canonical example where providers generally suffer higher impermanent loss than what can sustainably be paid as compensation. Clearly, more complicated products would demand more active and very demanding market making. Therefore, a distinction between passive users and active specialized firms emerges, which in practice is still at odds with the ethos of treating everyone equally. Relying on specialized firms, which will be subject either to regulation requirements or free to extract, with effectively special powers is a form of centralization that blockchains do not yet dissolve.

  • Since the GLOB is less about speed, it is well suited to run on networks that are inherently slower. There is no need for blocktimes faster than a second, and the number of interactions / transactions with the GLOB are reduced to built-in algorithmic trading. This avoids blockchains spending massive amounts on infrastructure required to synch a global decentralized state fast at high TPS.

  • GLOBs level the playing field and ensure that markets are truly neutral. This will become clear in particular applications, such as prediction markets that are actually credible neutral by disabling adverse selection frontrunning and oracle extractable value (OEV), and swaps that disable these and other speed-based attacks. By providing built-in tools, they furthermore enable passive LPs to earn a spread just like a MM.

  • With GLOBs, there is no cost to create and interact instantly in a new market, on any asset, by anyone. There is no need to rely on MMers or onboard LPs.

  • Every GLOB markets can scale to any size. The more participants, the better the market will function. This needs to be compared to the current state of DeFi where AMMs have no chance to scale bigger than other exchanges due to the issues of IL and CLOBs would suffer compared to centralized exchanges, with the same professional firms able to serve both anyway.

In summary, markets can now be started for free to trade anything instantly while giving any passive user the same rights and prices as the most professional one: A truly fair market that incentivizes what counts -- a competition on price, and rewarding precisely those who predict future prices best.

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

1

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.

2

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

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. The worst casino-like strategies at the cost of the user can be disabled, but there are more advantages:

  • Permissionless & Pseudonymous (all insider information free to appear early)
  • Promised payouts (no banning or bankruptcy)
  • Censorship resistance (important for whistle-blowing at the highest level)
  • Clear rules (no special roles and manipulation)

Decentralized Swaps

todo

Prediction Markets

The Challenge

Prediction markets 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 AMM (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 MMers 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

1

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.

User Stories

Alice gets information

Alice is interested in presidential elections. There are two candidates that matter. She visits acro.bet to look up the current probability for either. She can see the history in a chart dating back several months. She does not bet herself.

Bob goes all in

Bob clicks a link to a prediction market on the question "If OpenAI has achieved AGI internally by the end of the year" on his X timeline.

Since Bob works for OpenAI, he knows the answer is YES. He should not talk about it yet, but nobody can easily tie his wallet to his name.

The market goes live in 12h and runs for a few months. Bob deposits a large amount on YES. As a consequence, the odds change such that his return would only be a few percent.

Within hours, still before the market has started, enough people have been putting money on NO so that the current return for Bob at the start of the market ends up being 2.5x. The market goes live.

Bob checks every day and sees how a bit of his deposit has been converted into about 2.5x as much bet slips on YES. [Remark: the market has not changed much.]

A few weeks in Bob has converted about 90% of his money, when OpenAI plans to announce that AGI has been achieved.

A few hours before the announcement, the market has moved to 1.8x (probably someone from the news sites). Within minutes after the announcement, the return drops to 1.11x, and the market still gives a 10% chance NO. Within hours this drops further to 2%. Bob withdraws the remaining 10% of his money to bet in another market with better opportunities, since his return on YES orders has now dropped to about 2% (as the internal price of YES has reached 98 cents).

On the next day, NO is at 0.1% (because most people betting on it have stopped doing so). The market resolves to YES. Bob withdraws about 2.4 times of the 90% of his deposit that was converted.

Charlie turns wisdom into gold

Charlie spots a market on the chance that the world will end within 3h in a TG channel. The link to the market was posted by a bot. The argument is that because the Flat Earth got a crack it will fold, making everyone fall off. He has been reading on 4chan that there were strong arguments for a flat Earth, but is not fully convinced about the crack. If he is totally honest, he actually thinks that Earth is probably round.

A marker in the middle on a slider between DOOM and FINE indicates that the market is currently undecided. Charlie moves the slider towards FINE (not all the way), enters some token amount and does not tick "Never buy DOOM" in the confirmation dialogue.

He is now observing live how his collateral is converted into FINE such that for each bit of collateral he gets about twice as much FINE. He shares his position on X.

A few minutes later, he observes that his FINE bar is growing very fast. Charlie adds some funds to his collateral to profit from these amazing returns! Then he calls a friend to talk about football. [Here, lots of people have bet on DOOM.]

Coming back to the app an hour later, he finds that he now has more collateral than he ever deposited, and that he is currently betting on DOOM. The market has totally shifted from being very sure about DOOM earlier to being very sure about FINE now. It has moved all the way to the right, more than Charlie's slider. [As the market starting pricing DOOM very low, Charlie started to buy DOOM cheaply, or equivalently, sell FINE at a huge profit. Once all FINE was sold, he kept buying cheap DOOM]

Charlie decides that the world is still very fine and that it is probably not going to end at all. He checks in his portfolio: He owns a lot of collateral (about 5 times more than he deposited!) and a growing stack of DOOM bets. He decides to go all-in on FINE now. [This time, the change of side happens due to user update, not due to a market price change.]

He watches how his DOOM bets disappear in favor for a small additional amount of collateral [Because the market is quite sure about FINE now, even if less sure than Charlie, there's not much to get here. Each FINE slip costing almost one dollar automatically combines with a DOOM slip and converts back to one dollar].

His DOOM position decreases, reached zero while his collateral peaks, and then flips to FINE again. From here, his collateral shrinks and seemingly converts almost at one to one to FINE (he gets slightly more, of course). Some minutes later, 3h have passed and the market resolves to FINE, turning his FINE bets into collateral ready to be withdrawn

Famous people bet on X (and Bob)

Balaji posts that the price of Bitcoin reaches $1 Million in 2 weeks. GCR comments that this is wrong. Balaji replies he would be willing to bet a large sum at 1:1 odds. Someone @'s Cobie.

Cobie shares a link to an acro.bet market "Will Bitcoin reach 1M by ..." that he just created.

Balaji deposits $1M and sets the slider to the middle position for 1:1 odds. GCR is busy.

Bob deposits $1000 after moving the slider very near to NO and ticks "Never buy YES". The market now has $1000 of Bob staked against $1000 of Balaji and says that the chance that BTC reaches 1M is 50%. [This is because Balaji put so much money he can set the odds for now.]

GCR finds a moment and deposits $19M all-in on NO. The market jumps to 5% on YES, 95% on NO.

All three are fully staked and converting a fixed fraction of their funds per second into bet slips. Other people join, and the market odds are changing as a consequence.

Balaji would be unstaked if the market gave him under 2 YES slips for every dollar spent, but this never happens. YES is never popular enough. Bob however has been unstaked sometimes, ensuring that he always got at least about 8% more slips than dollars spent (since his limit price is how sure he was on the slider - 92.6% in this example). Someone calls out Cobie for collecting 100s of k of trading fees from this that he does not need. Cobie shows on-chain proof that he set things up such that they will be automatically transferred to the wallet of his favorite NGO when the market resolves.

Wager among friends

Alice visits her family for a round birthday.

There are a lot of people.

The question comes up if Dave did a handstand or just a headstand last year. Dave is not here, and a video recording is with someone at home.

The disagreement is wild.

Someone makes a market and shares the link. About half the people take their phone and, using the app store account, put a few dollars behind their opinion.

Later, it turns out that no video can be found. The funds are returned.

Oh, just kidding (but possible). Dave did do the handstand. Winners get paid.

Stream Swaps