Introducing Gnosis Protocol V2 and Balancer-Gnosis-Protocol

In the first partnership of its kind, with Balancer Labs we’re building the DEX to offer traders the best prices and MEV protection.

Gnosis
GnosisDAO
7 min readApr 28, 2021

--

One year ago, Gnosis Protocol v1 launched, introducing a new DEX mechanism to Ethereum.

Today, we are happy to announce the planned launch for Gnosis Protocol V2 (GPv2). Gnosis Protocol V2 leverages batch auctions to provide MEV protection, plus integration with liquidity sources across DEXs, to offer traders the best prices.

Ahead of the launch, we have some huge news to share, which includes the proof-of-concept CowSwap DEX live today, with gas fees currently 90% subsidized, through which new features of GPv2 will be progressively rolled out.

For GPv2, we’re also teaming up with Balancer to launch a partnership integration, Balancer-Gnosis-Protocol, expected to be live in mid-June with a stable version of GPv2 built on top of the Balancer V2 vault. While the Balancer-Gnosis-Protocol is interoperable with any DEX, it will be especially gas efficient when trading against Balancer pools. This together forms the crypto cinematic universe crossover event, Balancer-Gnosis-Protocol (BGP).

We’ve incorporated the learnings from Gnosis Protocol v1 into the upcoming launch of V2, with an additional emphasis on user experience and the ability to tap into any liquidity source on-chain, while continuing to protect traders from MEV (Maximal Extractable Value), which is a phenomenon currently capturing value up to 0,1% of all DEX orders on Ethereum since January 2020.¹

GPv2 just might… fix this.

Owls in the Dark Forest

In 2020, the Ethereum community was jolted by a blockchain horror story. In that story, we learned of the dark forest in which any valuable, detectable action could lead to defeat. While Ethereum was the world, the dark forest was the mempool: the darkened space in which pending transactions wander.

While the issue was first highlighted in 2019, it’s only been recently that Maximal Extractable Value, previously referred to as Miner Extractable Value, has gained widespread attention. Initially coined by Phil Daian, MEV is described as “value that is extractable by miners directly from smart contracts as cryptocurrency profits”². This has led to a total of $402.6 Million extracted from Ethereum users since January 1st 2020³, which accounts for 13,7% of all the transaction fees generated on Ethereum in that time.⁴

Until recently, the most common form of MEV users suffered from was frontrunning. Frontrunning occurs when one party acts on information about confirmed, but not yet executed transactions and uses this information to advantageously execute their transactions beforehand. This can be very rewarding, because the frontrunner can execute transactions before a significant change in an asset’s price and profit substantially from the difference. While its ultimate effect on Ethereum has been higher gas prices, MEV in the form of frontrunning harms DEXs the most, because traders may experience both transactions failing and transactions for prices worse than their initial order was quoted. Frontrunning was largely the domain of arbitrage bots of Ethereum. However, this is no longer the case with miners now directly frontrunning blocks’ transaction orders. We expect to see this result in even more MEV extracted from users in the near future.⁵

However, frontrunning is not the only form of MEV currently extracted on Ethereum. Backrunning or “sandwiching” a transaction are other forms of MEV that have gained popularity in recent months. This is in large part due to the new MEV-geth client software developed by the Flashbot team, a team assembled to shine light on concerns raised by the MEV dark forest.⁶ Unlike previously, wherein only a handful of entities with access to mining pool resources could extract MEV, now with the MEV-geth client release, anyone can more easily monitor transactions for MEV and submit these arbitrage opportunities to a network of “collaborating” miners that will share the “reward” with them. This has led to an estimated increase of 136% in MEV extracted since January 2021.⁷

Owls, however, can also see in the dark forest.

Trade today on the GPv2 proof-of-concept CowSwap DEX, with gas fees currently 90% subsidized.

Gnosis Protocol V2 addresses the MEV problem by leveraging its batch auction mechanism, combined with off-chain order placement and access to any on-chain liquidity on Ethereum.

Improving on Gnosis Protocol v1, GPv2 optimizes for coincidence of wants (CoWs), which can be explained as “an economic phenomenon where two parties each hold an item the other wants, so they exchange these items directly.” This means, on GPv2, when two traders each hold an asset the other wants, an order can be settled directly between them without an external market maker or liquidity provider. This leads to better prices for traders, because it results in a lower spread. Only excess order amounts that cannot be settled directly with other GPv2 traders are sent to the underlying AMMs (Automated Market Makers). Ultimately, the batch auction mechanism settles orders on the protocol in consecutive, recurring batches, which are limited in size only by the gas block limit. Each batch enforces uniform clearing prices, meaning all orders executed within a given batch receive assets priced equally against other orders. From a user’s perspective, tapping into the global on-chain liquidity pool means that on GPv2 traders receive a price quote that guarantees they will receive the same price or better than other existing DEXs.⁸

These unique design qualities of GPv2 offer traders MEV protection in both cases:

  • If GPv2 finds CoWs, there’s no need to settle trades using other on-chain liquidity sources as the liquidity itself is within the batch. The MEV attack surface is therefore completely eliminated as the transaction cannot be replicated using other mechanisms such as transaction ordering. Due to GPv2’s uniform clearing prices, the outcome of trades within a batch does not rely on relative ordering.
  • If GPv2 does not find CoWs, it taps into the on-chain liquidity pool that offers the best price for the auction settlement, and due to the tight slippage enforced by Gnosis Protocol V2’s solvers, the transactions become much harder to replicate by MEV actors as the trades become unprofitable for them and only authenticated solvers can submit batch settlement solutions.

Users submit trade orders with a degree of flexibility as solvers need to find the most optimal way to settle them. In GPv2, instead of using a central operator or a constant function market maker to determine trade settlements, the protocol uses a “party” called solver, who is the party in charge of providing the settlement solution to the batch auctions. Solvers compete against each other to submit the most optimal batch settlement solution and each time a solver submits a successful batch settlement solution, the protocol rewards them with tokens, meaning that the protocol rewards solvers for solving the batch auction optimization problem. Anyone can become a solver, although, in order to become one, there are certain requirements:

  • To become a solver, an Ethereum address needs to deposit a bond in the form of tokens. Asset type and amounts are pending to be defined by the GnosisDAO or GnosisProtocolDAO.
  • Once the tokens have been staked (locked up), GnosisDAO/GnosisProtocolDAO has to vote to approve or reject the Ethereum address that will identify the solver. If the vote is successful, the solver's Ethereum address will be included in the allowlist (verification) solvers contract.
  • Additionally, a solver must have the technical knowledge to create the appropriate batch settlement solutions or take the risk of being slashed by the GnosisDAO/GnosisProtocolDAO for wrongdoing.

Solvers are encouraged to compete against each other to deliver the best order settlement for traders in exchange for the reward of each batch. Since the most optimal trade settlement may be accomplished through different combinations, we believe solving order settlement through decentralized and permissionless competition means GPv2 can provide the fairest prices across decentralized finance.

Using the batch auction mechanism combined with off-chain order placement and access to any on-chain liquidity on Ethereum, Gnosis Protocol V2 is a new way for traders to defend against MEV, and leave the dark forest unharmed.

However, the eyesight of owls alone cannot save every user…

The Crypto Cinematic Universe Crossover Event of the Summer: Balancer-Gnosis-Protocol

Read The Crypto Cinematic Universe Crossover Event of the Summer: Balancer-Gnosis-Protocol (BGP) from Balancer Labs on our joint partnership.

Gnosis and Balancer have teamed up to deliver a peerless DEX experience. Balancer-Gnosis-Protocol (BGP) combines the best of both protocols, with Balancer V2’s flexible liquidity pools enabled by a single-vault architecture and asset managers in combination with Gnosis Protocol V2’s price finding mechanism and MEV protection. Balancer-Gnosis-Protocol (BGP) will encompass several release stages:

Stage 1

  • CowSwap alpha (GPv2): Today, trade on Gnosis Protocol V2 in alpha now on the proof-of-concept CowSwap DEX, with gas fees currently 90% subsidized. On CowSwap, new features of GPv2 will be progressively rolled out. Users should note, while peer-reviewed, CowSwap is currently undergoing a more formal audit, and users participate at their own risk.

Stage 2

  • Balancer V2: Balancer V2 was recently released for developers, and traders will have the ability to migrate liquidity over the coming weeks. In this stage, liquidity will be incentivized to move from Balancer V1 to Balancer V2 with a $BAL incentive program.
  • CowSwap beta (GPv2): CowSwap migrates to the final GPv2 contracts integrated with Balancer V2.

Stage 3

  • Balancer-Gnosis-Protocol: Targeted for mid-June, Balancer V2 will be fully integrated with Gnosis Protocol V2 to form Balancer-Gnosis-Protocol, and a joint incentive program will kick off.

With collaboration, we can out-cooperate the competition — traditional finance — through providing unparalleled decentralization, transparency, and value in our tools.

Watch out soon for a long read on how Gnosis Protocol V2 tackles MEV with step-by-step block analysis and a more detailed announcement of the BGP launch targeted for mid-June.

Questions? Join the Gnosis Discord Server. For updates on the development of Gnosis Protocol V2, CowSwap, and Balancer-Gnosis-Protocol, follow @GnosisPM on Twitter and make sure to check the Gnosis Protocol category in our forum.

[1] https://explore.flashbots.net/ & https://duneanalytics.com/queries/4494/8769
[2] https://arxiv.org/abs/1904.05234
[3] https://explore.flashbots.net/
[4] https://explore.flashbots.net/ & https://duneanalytics.com/queries/39135
[5] https://www.coindesk.com/ethermine-adds-front-running-software-to-help-miners-offset-eip-1559-revenue-losses
[6] https://arxiv.org/abs/1904.05234
[7] https://explore.flashbots.net/
[8] The proof-of-concept CowSwap dapp is currently only integrated with Uniswap V2, but new liquidity sources such as Balancer v2 and SushiSwap are gradually being integrated. When we release the final version of GPv2, the Balancer-Gnosis-Protocol (BGP), then all substantial on-chain liquidity DEX sources will be integrated.

--

--