17 Mar, 23

Sei Network: Solving the Exchange Trilemma

Sei Network: Solving the Exchange Trilemma
Nathan Lenga

Innovation Lead

The design and implementation of Sei Network are indicative of a novel paradigm that blends the best of app-specific and general-purpose blockchains. Accordingly, this blockchain is introducing a new era of innovation beyond the conventional spectrum through its approach to catering specifically to the DeFi sector of the industry. The architecture of Sei significantly iterates and optimises the Cosmos modules offered to developers to efficiently launch layer 1 blockchains.

With a focus on providing the most superior infrastructure for DeFi protocols, Sei network exists to mature the ecosystem through integrating effective methods implemented in TradFi to overcome the exchange trilemma – which has long plagued the blockchain space. Integrating native order books, parallelised transactions and a unique consensus model, Sei is poised to herald the dawn of novel liquidity levels and depth in trading markets, yielding substantial benefits for the wider industry. 

Sei Network Optimisation of the Cosmos SDKs

Sei exists as one of the interoperable layer 1 blockchains built in the Cosmos ecosystem through the utilisation of the network’s customisable software development kits (SDKs). These tools enable developers to launch layer 1 chains efficiently with existing modules such as consensus engines, node clients, governance mechanisms and much more. Whilst not a requirement, many Cosmos-based chains, including Sei can leverage the network’s Inter-Blockchain Communication (IBC) messaging capabilities in order to be directly integrated with more than 50 other blockchains.

Although the Sei Network is built with the Cosmos SDK and the Tendermint consensus core, the development team voted to optimise the infrastructure they were building on. Woven into the fabric of the layer 1 network is a decentralised version of a centralised order book (CLOB). All decentralised applications (dApps) existing on Sei can make use of this order book, making them capable of executing trades in a similar fashion to TradFi exchanges like the NASDAQ and centralised crypto exchanges such as Binance. In addition, Sei optimised the Tendermint consensus mechanism as well, making it the fastest Cosmos chain with transactions reaching finality after roughly 600 milliseconds. Further, the network introduced a twin-turbo consensus feature, improving transaction throughput by enabling certain transactions to be executed in parallel. The unique infrastructure underpinning Sei allows it to combat malicious frontrunning transactions techniques that are rife in other ecosystems; this protects individuals from having the value of their DeFi trades being scraped by on-chain bots.

Bridging General-Purpose and App-Specific Blockchains: Sector-Specific Blockchains

These optimisations render Sei as a far more unique blockchain than others in the Cosmos ecosystem, however, the network’s focus on bridging general-purpose and app-specific blockchains allows it to innovate further.

The majority of existing blockchains, including Ethereum, Polygon, Solana and Binance, are general-purpose networks. These chains have the fundamental purpose of offering an execution environment for smart contracts, however, are not tailored and modified for any specific sector of the industry. Instead, general-purpose blockchains concentrate on building a forum for any smart contract and DApp, irrespective of the category it relates to. In this way, many different ecosystems can exist on general-purpose blockchains, such as DeFi, SocialFi (financialisation of social media), NFTs and many more. Despite these types of blockchains being effective in connecting different focal areas in the industry, they will inherently be better suited for certain types of contracts and limiting for others.

Initially, to overcome the shortcomings of general-purpose blockchains, app-specific blockchains were developed – generally atop layer 0 solutions, like Cosmos and Polkadot, which offer the necessary SDKs and infrastructure to efficiently establish a blockchain. These app-specific networks will seek to provide a smart contract execution environment for a certain application. Take Uniswap, for example; if Uniswap Labs decided to build its own blockchain to provide an independent environment for its DApp, this would be an app-specific chain. Already, dYdX, the dominant perpetual exchange in the crypto space, with an annualised trading volume of over US$ 450 billion, announced that dYdX V4 would be its own Cosmos-based chain. Yet, like general-purpose blockchains, the app-specific approach is not without its imperfections. Whilst the network will be perfectly configured to optimise the performance of the application, the blockchain will fail to harness the power of the network effect – a feature of other general-purpose blockchains. When a variety of differently designed and focused applications exist on one shared distributed ledger, they share user bases, tokens can be used in seemingly independent dApps and additional layers of innovation can be built to act as a bridge between applications.

Sei Networkprovides the solution to mend the fence between general-purpose and app-specific blockchains: the first sector-specific network. As a sector-specific blockchain, Sei is capable of leveraging the benefits of both ends of the spectrum without simultaneously bearing the weight of its weaknesses. Accordingly, Sei acts as the middle ground between general-purpose and app-specific blockchains, existing with the mission of building the best infrastructure for DeFi. DeFi-focused dApps can be deployed as smart contracts on Sei to leverage its technical breakthroughs, which are necessary for the applications to rival the experience of their centralised counterparts.

What Sei Network Offers as a Sector-Specific Blockchain

As the first sector-specific blockchain, Sei is providing a blueprint for the wider industry on the infrastructure quality necessary to support protocols that range across one single vertical of the cryptocurrency industry; in this situation, DeFi. DEXs, money markets, derivative and perpetual exchanges, along with options exchanges are vital pieces of Sei that can function more effectively on the sector-specific blockchain when juxtaposed with general-purpose chains. Due to the network’s focus on providing the most optimal environment for DeFi applications, certain features were created:

Native Order Matching Engine

For general-purpose blockchains, the value added from a native order-matching engine would be minimal in comparison to a DeFi-specific network; accordingly, few blockchains of this category integrate an order book into their infrastructure. As a result, the DeFi ecosystem must make use of automated market makers (AMMs) and similar models which are more likely to suffer from maximal extractable value (MEV) vulnerabilities such as arbitrage and sandwich attacks that arise when the smart contract rebalances its price. Likewise, AMMs rely on liquidity providers (LPs) lending their tokens by depositing them into a liquidity pool and incentivising such activity through distributing transaction fees to LPs. However, LPs remain exposed to price changes and the consequent trades in the pool, lowering the value of their position; this is known as impermanent loss (IL). When IL > fees are paid, rational LPs will not fund liquidity pools as their position will gradually lose value, meaning that traders will face significantly more slippage. 

On the other hand, order books do not require AMM functions and hence do not rely on LPs to provide depth for traders. Since the Nasdaq first introduced the electronic order book, this approach to matching buyers and sellers has acted as the TradFi industry’s gold standard; the value added in the crypto industry is much the same. In the context of Sei Network’s native order book engine, the feature acts as an on-chain list of buy and sell orders on a cryptocurrency. Trades are not executed based on an algorithm but instead when a buyer and seller are matched. These order books allow for more capital-efficient exchanges where users are not exposed to price changes when participating as LPs and market makers are able to ensure efficient markets in a similar capacity to TradFi.

Twin-Turbo Consensus

Sei’s consensus model is an iterative improvement of Tendermint which breaks it down to suit the specific needs of the DeFi sector. The Twin-Turbo consensus model is made up of two features: intelligent block propagation and optimistic block processing. The combination of these components of Sei Network allows it to reach finality in 600 milliseconds – noticeably less than the finality time of roughly 1 second for the Cosmos-built Tendermint BFT consensus mechanism. 

Intelligent block propagation is a way of transmitting block proposals in a blockchain system that increases the efficiency of the disseminating blocks such that consensus and validation can occur more efficiently. When a user submits a transaction to the network, it is shared with other nodes through a process of random gossiping. Upon receipt, validators initially verify the transaction for validity and subsequently add it to their local mempool. Block proposers then create blocks based on the state of their mempool and propose them for commitment.

Traditionally, block proposers would send the full block to the validators, but with intelligent block propagation, only a block proposal is sent which includes the hash of each transaction in the block. The proposal includes unique transaction identifiers and a reference to the full block; this transactional information is sent in parts and gossiped to the network. If a validator already has the transactions contained within the proposal in its local mempool, it can reconstruct the full block and verify its contents quickly given it does not need to wait for the full block to arrive. Once validators have all the transactions, either by reconstructing it themselves or waiting for the full block to arrive, the Tendermint BFT consensus mechanism is used to agree on the transaction order. 

Optimistic block processing relates more to the Tendermint consensus mechanism in how it enables the Sei Network to offer users a better trading experience through lower latency and efficient finality. The Tendermint BFT approach is as follows: the prevote step, followed by the pre-commit step and then finally, the state changes relevant to the block are committed to the chain. Under optimistic block processing, validators will initiate the task of processing transactions whilst waiting for the pre-commit step. Validators will optimistically process the first block proposal they receive by writing the altered state following the transactions in the block to a cache. If the block is accepted, no processing is required as the state changes stored in the cache will be committed to the chain; otherwise, the cache will be cleared and a new block will be appended to the chain without the use of optimistic block processing.

Parallelisation of Transactions

Many upcoming layer 1 blockchains, including Sui Network and Aptos, have integrated parallel execution engines which allow certain transactions, depending on their state impact, to be executed in parallel. Sei takes a different approach when processing transactions in parallel which leverages and optimises the Cosmos SDK that dictates the way in which blocks are updated to the chain; validators initially run the BeginBlock function, subsequently running DeliverTx logic and finally EndBlock logic. The latter has been optimised by Sei to be able to be executed in parallel rather than in sequential order.

The parallelisation of the DeliverTx logic in Sei involves mapping the message types to the resources they would use. This mapping considers the sending and receiving account addresses and at runtime, the chain identifies the relevant resources for the transaction. To ensure that transactions related to the same account are executed sequentially, a directed acyclic group is created based on the dependencies of the transaction, taking into consideration other transactions and contracts that are involved. In the event of a transaction conflict, Sei utilises a model akin to First-In-First-Out (FIFO) to sequentially execute transactions that relate to one single address; evidently, this prevents transaction conflicts from occurring by avoiding multiple transactions changing the same state simultaneously. However, for transactions that do not require sequential execution, they can be executed in parallel. Importantly, developers must specify at the chain level, how relevant transactions make use of different message types so that the chain can determine which transactions can be executed in parallel. 

Conversely, Sei Network achieves the parallelisation of the EndBlock logic with a focus on native on-chain order book-related transactions. Notably, DEXs deployed on Sei do not share a single order book; instead, each DEX (and other DApp) can leverage its own order book to ensure that it is optimised for its protocol. For this reason, when two unique buy and sell orders have been batched via independent the order book, Sei parallelizes the execution of the transactions given they do not both impact the state. In some instances, where the same address is transacting on different DEXs, utilising independent order books, the EndBlock transactions will be executed sequentially. Accordingly, this approach enables Sei Network to execute more transactions through the CLOB at the same time, subsequently resulting in lower fees.

Sei Network’s Native Price Oracles

Sei comes with an integrated, native oracle system to internally facilitate the pricing of assets. Validators are expected to contribute to the ecosystem as oracles to ensure the most accurate and dependable pricing information. To keep the oracle data fresh, the voting windows, whereby validators submit price data, can be adjusted to occur as frequently as every block, resulting in prompt and up-to-date asset pricing.

During the voting process, validators submit their proposed exchange rates for the specified window. Upon the completion of the voting window, all of the submitted exchange rate votes are collected and a weighted median is computed to determine the legitimate exchange rate for each asset based on social consensus. Given the importance of providing price data for a sector-specific blockchain, validators who are not participating or contributing incorrect price information face slashing penalties. Each validator is assigned a miss count that tracks the number of voting windows in which they failed to participate or provided false information. Only in the case that a validator’s miss count exceeds a specified threshold over an extended period, the collateral they put up to participate in consensus is slashed.

Frequent Batch Auctioning to Prevent Frontrunning

Given the anticipated volume of transactions that will be executed on Sei, MEV is a substantial concern as validators are encouraged to implement exotic methods to capture excess value on the chain. In response, Sei’s platform and execution process has been specifically designed to prevent front-running and unfair profit-taking on behalf of validators which is possible given their ability to order transactions. Whilst not all MEVs are malicious and is in fact important to ensure efficient markets, certain unethical MEV practices, for example, front-running, have become an inherent problem in traditional sequentially executed blockchain systems.

The issue arises due to the transparent nature of blockchains; all pending transactions, that is, transactions sitting in the mempool waiting to be included in a proposed block, are visible. This means that when a validator sees an incoming market order, they can insert their own order transaction to buy the cryptocurrency and subsequent limit order to sell the token at a higher price. The value captured comes at the expense of the initial trader who had their purchase transaction pending in the mempool.

Fortunately, Sei Network’s use of frequent batch auctioning (FBA) is capable of preventing certain types of malicious MEV from being extracted, particularly front-running. FBA is a mechanism that aggregates all market orders going through Sei’s order book engine and executes them at the same uniform clearing price. Rather than incoming bid orders being executed at different prices based on how they are matched to ask orders and vice versa, the use of FBA calculates the fair price of transactions by averaging the prices of all existing buy orders. This average becomes the clearing price, ensuring that all existing limit orders are filled at their intended price and incoming market orders are executed at a fair value. This eliminates the opportunity for validators to front-run an order and profit from trades as the buy price they set for their transaction will likely be altered based on the other market orders in the batch of transactions.

A simple example of this would be an order book for a Sei-based DEX with two sell orders at US$100 and US$101, as well as two unique incoming buy orders at the market price. With a sequential execution process, the first market buy order would be executed at US$100 and subsequently US$101. However, through Sei’s FBA mechanism, the average execution price would be the average of the sell orders, US$100.50, meaning that both market orders would be executed at the same, fair-valued price, based on the existing sell orders in the batch. Evidently, the use of FBA makes it exceedingly difficult for validators to front-run trades to get their transactions executed ahead of the two market buy orders and sell to said buy orders in the same block.

Liquidity

All of these optimisations allow Sei Network to move close towards being capable of providing the best infrastructure and environment for DeFi applications. Importantly, however, as well as what Sei offers dApps on a technical level, the blockchain similarly achieves its goal from an economic perspective. With an on-chain order book engine, front-running protections, near-instant finality and more, Sei is likely to see substantial amounts of liquidity being locked into the contracts deployed on the chain.

Liquidity is a critical aspect of the growth and stability of the DeFi space. It refers to the ease with which assets can be bought or sold without affecting the market price. A market with high liquidity allows assets to be traded at their fair market value, making it more efficient and stable. Furthermore, unparalleled levels of liquidity and effective utilisation of funds through decentralised versions of CLOBs results in Sei-based exchanges providing its users with greater depth and reduced slippage when performing transactions. This is foundationally crucial to the Sei Network DeFi economy as it relates to the widely held macroeconomic belief that liquidity drives markets. Accordingly, with the features to on-ramp significant levels of liquidity, Sei Network is suited to be the vanguard of growth with respect to the DeFi industry.

The Exchange Trilemma

The exchange trilemma refers to the inability of a trading platform to simultaneously offer a scalable, decentralised and capital-efficient exchange for securities and cryptocurrencies. Solutions that attempt to overcome the exchange trilemma have been proposed, however, after a period of time, it has become clear that only two prongs have thus far been concurrently conquered. There are three key verticals under the exchange trilemma: scalability, decentralisation and capital efficiency.

sei network exchange trilemma

Exchange Scalability

The scalability of an exchange refers to its ability to push through a significant volume of trades without sacrificing performance issues. If the exchange has a high throughput when large amounts of individuals are leveraging the platform to execute trades, it is scalable. In the context of blockchains, scalability is often a difficult task to achieve given the importance of simultaneously balancing the important principle of decentralisation. As exchanges must have transactions validated by the nodes lending their computing power, most are typically not as scalable as their centralised counterparts. Nonetheless, designs for scalable exchanges have been implemented, including AMMs and CEXs, however, these respectively result in a lack of capital efficiency and decentralisation.

Decentralisation

Decentralisation relates to how geographically, ideologically and technologically dispersed and diverse an exchange is. If an exchange is executing and validating transactions through a centralised order book and storing trades on a single server, it is fundamentally not decentralised. Similarly, if there is no one point of failure or necessity for trusting an entity behind the platform, the exchange is decentralised. Certain exchanges whereby transactions are executed and validated by a large number of nodes providing security to the network are significantly more decentralised. Decentralisation is often in direct opposition to scalability with respect to blockchain infrastructure; nonetheless, for exchanges that prioritise decentralisation, a plethora of models have emerged, including AMMs and CLOBs.

Capital Efficiency

The final prong of the exchange trilemma is capital efficiency which refers to the ability of the exchange to effectively utilise as much of its users’ resources and liquidity as possible. Capital-efficient exchanges will facilitate an effective trading experience for users by maximising their return on investments. In this way, AMMs, which rely on LPs depositing funds to create a trading environment, often at the expense of LPs who face severe IL, is not capital efficient. Comparatively, CLOBs and CEXs do not require capital underpinning the order book and instead utilise market makers that contribute to the depth of the market, similar to the value added by LPs, yet do not require users to face loss. 

Examples of Exchange Failing to Overcome the Trilemma

The most dominant exchange in the DeFi space, Uniswap, is highly decentralised and relatively scalable at the protocol level, however, relies on users depositing liquidity as LPs to allow for the seamless execution of trades. For this reason, there is a common understanding in the space that being an LP without active management is not a profitable opportunity given the fact that IL > fees paid. In this way, Uniswap opts to prioritise decentralisation and scalability through its AMM model, however fails to achieve capital efficiency as an exchange.

On the other hand, centralised cryptocurrency exchanges, like Binance and Coinbase, utilise an order book model, like Sei Network, yet, fail to decentralise the execution of transactions. Using an order book allows for capital efficiency with a market-maker model rather than an LP mechanism. Similarly, given the use of a centralised server as opposed to leveraging a decentralised network of validators, sequentially executing trades through an order book is highly scalable. Fundamentally, however, these CEXs are not decentralised – this sacrifice is made in order to achieve capital efficiency and scalability.

How Sei Network Solves the Exchange Trilemma

Sei is aiming to become the decentralised NASDAQ by solving the exchange trilemma by offering DEX modules for dApps to provide capital-effective, decentralised and scalable infrastructure for exchanges. Fundamentally, Sei offers a CLOB engine that developers can integrate into their DEXs. This means that Sei-based exchanges will not utilise AMM structures that result in capital inefficiencies whereby LPs face IL when trades are being made through the smart contract. Additionally, as a blockchain with a diverse set of validators under the Tendermint BFT consensus model which functions like delegated proof of stake (dPoS), the CLOB is not centralised, enabling Sei to provide its users with decentralised infrastructure for exchanges. 

However, CLOBs are often not scalable. Whilst this inability to scale effectively with CLOBs might have prevented Sei from overcoming the exchange trilemma, by parallelising EndBlock logic, the Sei Network is able to execute different trades coming into independent order books simultaneously. This revolution is foundational to what powers Sei’s ability to overcome the trilemma.

Furthermore, Sei becomes the decentralised equivalent of the NASDAQ through the native order matching engine. This acts as a plugin that enables new projects to instantly leverage the innovations made at the base layer. In a similar sense, the NASDAQ offers to order books for new financial products such that they can obtain a capital-efficient solution to execute transactions. Despite the fact that DEXs can utilise independent on-chain order books, depending on the throughput and the size of the exchange, it might benefit from Sei’s shared liquidity model. By dApps plugging into an order book established for other protocols to link back to it, transactions occurring on the platform can be pooled and matched with more trades, allowing for shared liquidity across the ecosystem. The NASDAQ functions in a similar capacity whereby different marketplaces can post their orders on the primary order book hosted by the exchange to offer faster throughput for each trade by leveraging alternative marketplaces.

Conclusion

Sei Network is in a unique position to create a public groundswell of opinion relating to its novel network, taking advantage of the current market sentiment by responding to a demand for a blockchain that considers DeFi infrastructure at the protocol layer. Notably, as the first sector-specific blockchain, Sei is setting a standard in the space relating to its approach to particular areas of the industry. Nevertheless, given the sheer complexity of Sei, the blockchain is still in its testnet, however, will likely be launching into mainnet in Q2 of 2023. Considering the composability and efficiency of Sei with respect to DeFi applications, it is possible that many more financial innovations can occur in this sector of the industry through the passage of time.

DISCLAIMER

Zerocap Pty Ltd carries out regulated and unregulated activities.

Spot crypto-asset services and products offered by Zerocap are not regulated by ASIC. Zerocap Pty Ltd is registered with AUSTRAC as a DCE (digital currency exchange) service provider (DCE100635539-001).

Regulated services and products include structured products (derivatives) and funds (managed investment schemes) are available to Wholesale Clients only as per Sections 761GA and 708(10) of the Corporations Act 2001 (Cth) (Sophisticated/Wholesale Client). To serve these products, Zerocap Pty Ltd is a Corporate Authorised Representative (CAR: 001289130) of AFSL 340799

All material in this website is intended for illustrative purposes and general information only. It does not constitute financial advice nor does it take into account your investment objectives, financial situation or particular needs. You should consider the information in light of your objectives, financial situation and needs before making any decision about whether to acquire or dispose of any digital asset. Investments in digital assets can be risky and you may lose your investment. Past performance is no indication of future performance.

FAQs

What is the Sei Network and its purpose?

The Sei Network is a novel blockchain paradigm that combines the best of app-specific and general-purpose blockchains. It is designed to cater specifically to the DeFi sector of the industry, aiming to overcome the exchange trilemma that has long plagued the blockchain space. It does this by integrating native order books, parallelised transactions, and a unique consensus model.

How does Sei Network optimize the Cosmos SDKs?

Sei Network is built with the Cosmos SDK and the Tendermint consensus core. However, the development team has optimized the infrastructure they were building on. They’ve integrated a decentralized version of a centralized order book (CLOB) into the layer 1 network, and all decentralized applications (dApps) on Sei can use this order book. Sei also optimized the Tendermint consensus mechanism, making it the fastest Cosmos chain with transactions reaching finality after roughly 600 milliseconds.

What is the concept of sector-specific blockchains in the context of Sei Network?

Sei Network introduces the concept of sector-specific blockchains, which is a middle ground between general-purpose and app-specific blockchains. As a sector-specific blockchain, Sei leverages the benefits of both ends of the spectrum without bearing the weight of their weaknesses. It exists with the mission of building the best infrastructure for DeFi, allowing DeFi-focused dApps to be deployed as smart contracts on Sei to leverage its technical breakthroughs.

What features does Sei Network offer as a sector-specific blockchain?

Sei Network offers several features as a sector-specific blockchain. These include a native order matching engine, a twin-turbo consensus model, parallelisation of transactions, native price oracles, frequent batch auctioning to prevent frontrunning, and a focus on liquidity. These features allow Sei Network to provide an optimal environment for DeFi applications.

How does Sei Network solve the exchange trilemma?

Sei Network aims to solve the exchange trilemma by offering a scalable, decentralized, and capital-efficient exchange for securities and cryptocurrencies. It achieves this by offering DEX modules for dApps to provide capital-effective, decentralized, and scalable infrastructure for exchanges. It uses a CLOB engine that developers can integrate into their DEXs, avoiding the capital inefficiencies of AMM structures. It also maintains decentralization through a diverse set of validators under the Tendermint BFT consensus model.

Like this article? Share
Latest Insights
Weekly Crypto Market Wrap: 7th October 2024

Zerocap is a market-leading digital asset firm, providing trading, liquidity and custody to forward-thinking institutions and investors globally. To learn more, contact the team at

Weekly Crypto Market Wrap: 30th September 2024

Zerocap is a market-leading digital asset firm, providing trading, liquidity and custody to forward-thinking institutions and investors globally. To learn more, contact the team at

Weekly Crypto Market Wrap: 23rd September 2024

Zerocap is a market-leading digital asset firm, providing trading, liquidity and custody to forward-thinking institutions and investors globally. To learn more, contact the team at

Receive Our Insights

Subscribe to receive our publications in newsletter format — the best way to stay informed about crypto asset market trends and topics.

Want to see how bitcoin and other digital assets fit into your portfolio?

Contact Us
Ready to sign up?
Create an Account