Content
- What is Sei Network?
- Sei Network’s Optimisation of Cosmos Infrastructure
- Consensus
- Parallelisation
- Price Oracles
- Frequent Batch Auctioning
- Transaction Order Bundling
- How these Optimisations Enable Trading Applications
- Conclusion
- About Zerocap
- DISCLAIMER
- FAQs
- What is the Sei Network and how does it optimise the Cosmos chain?
- What is the role of the Sei Network's native order-matching engine?
- How does the Sei Network achieve faster transaction processing and finality times?
- What is the significance of parallel transaction execution in the Sei Network?
- How does the Sei Network minimise Maximum Extractable Value (MEV)?
16 May, 23
Sei Network’s Optimisation of the Cosmos Chain: Exploring the SEI Cosmos Ecosystem
- What is Sei Network?
- Sei Network’s Optimisation of Cosmos Infrastructure
- Consensus
- Parallelisation
- Price Oracles
- Frequent Batch Auctioning
- Transaction Order Bundling
- How these Optimisations Enable Trading Applications
- Conclusion
- About Zerocap
- DISCLAIMER
- FAQs
- What is the Sei Network and how does it optimise the Cosmos chain?
- What is the role of the Sei Network's native order-matching engine?
- How does the Sei Network achieve faster transaction processing and finality times?
- What is the significance of parallel transaction execution in the Sei Network?
- How does the Sei Network minimise Maximum Extractable Value (MEV)?
General purpose and application-specific blockchains are different in the same way that a library and a specialised research lab are different; both provide a similar function however one is universal while the other is suited to one particular purpose. Built using the Cosmos SDK, Sei Network is the first sector-specific blockchain, customising the Cosmos framework to provide specific features for its intended niche, thereby bridging the gap between general-purpose and application-specific chains and acting similarly to a specialised research institution. In doing so, Sei Network makes it possible for novel financial products to emerge and opens up new possibilities for protocols functioning in the realm of trading.
What is Sei Network?
Historically there have been two categories of blockchain, the generalised blockchain and the application-specific blockchain. Generalised blockchains are designed to be flexible and accommodate a large ecosystem and a wide range of use cases. By extension, generalised blockchains harness the network effect whereby their utility increases with the size of their user base and vice versa. Conversely, application-specific blockchains are designed for a specific protocol and are optimised as such. They often have more limited functionality compared to generalised blockchains but can offer better performance for the use case they were designed for. Nevertheless, without a variety of different applications sharing functionality and user bases, application-specific blockchains fail to harness the network effect. Sei Network is the first sector-specific blockchain designed to provide both the specialisation and efficiency of application-specific blockchains as well as the composability and community of generalised blockchains. The SEI Network, as a part of the broader SEI cosmos ecosystem, is pioneering the way for sector-specific blockchains.
Accordingly, Sei is geared towards providing the best trading experience for users across a plethora of markets. However, unlike most application-specific blockchains, Sei has the capacity to effectively host a diverse array of DApps. Being built on the Cosmos software development kits (SDKs), Sei leverages the Inter-Blockchain Communication (IBC) protocol to communicate with over 50 other blockchains in the Cosmos ecosystem. Nonetheless, this does not restrict Sei to Cosmos, rather allows it to utilise existing IBC connections to other chains, such as Ethereum and Solana. This enables the network to specialise without sacrificing composability, providing an environment for efficient trading applications with the network effect.
Source: Delphi Digital
DEXs themselves are ironically chronically underserved in the present blockchain landscape despite their indispensability within the DeFi industry. Requiring a degree of reliability, scalability and speed that few other DApps do, DEXs have succeeded in spite of the drawbacks of their application layer. Being primarily built on generalised blockchains such as Ethereum or Solana to leverage their thriving DeFi ecosystems, DEXs face a number of challenges. Specifically, current infrastructure tends to be unscalable and congested with slow finality times. These drawbacks are exemplified by the present predominant application layer, Ethereum. Possessing a modest transaction throughput of ~ 30 transactions per second and a lengthy 15-minute finality time. Despite these limitations, developers tend to be reluctant to build their projects on application-specific blockchains due to their lack of composability.
As a sector-specific blockchain, Sei delivers a host of technical advancements focused on enhancing trading applications across all financialised industries. Of its technical advancements, the foremost is Sei’s native order-matching engine. This engine allows DEXs built on Sei to deploy their own Central Limit Order Book (CLOB) by maintaining order books on-chain and providing functionality to create markets. To create a new order book, users can deploy a smart contract onto Sei and submit a transaction to add a new order book to the registered smart contract. The CLOB-related transactions are executed atomically in the scope of a block. The matching engine first processes order cancellations, adds limit orders to the order book, processes market orders, and then matches limit orders. The engine will then call the relevant smart contract to handle asset settlement. The Sei order placement and the matching engine ensure orders are getting filled with maximal liquidity and support partial executions if there is not enough liquidity to fill the entire order. Thus, Sei’s native order-matching engine provides exchanges with the necessary tools to create and maintain their own order books.
As well as its order matching engine, Sei boasts a number of other optimisations designed to facilitate DeFi applications. These include optimisations of Cosmos’ existing infrastructure, SDKs and other modules. For example, Sei leverages a cutting-edge version of Tendermint consensus known as twin turbo consensus, which boasts lightning-fast finality times of just 600 milliseconds through its intelligent block propagation and optimistic block processing mechanisms. Additionally, Sei supports parallel transaction execution, resulting in reduced latency and a more responsive user experience. Furthermore, Sei is a permissioned blockchain, meaning that developers are required to submit and pass a proposal through the governance structure before deploying it. This ensures that the network only supports DApps that are in alignment with community values thereby reducing congestion. These optimizations make Sei a highly scalable, efficient, and user-friendly platform for trading-related applications.
Sei Network’s Optimisation of Cosmos Infrastructure
In order to facilitate an efficient market, DeFi applications require a number of optimisations. Built using the Cosmos SDK and Tendermint Byzantine Fault Tolerance (BFT) software, the Sei blockchain is highly customised for the needs of DEXs. Specifically, the network has modified both the Cosmos SDK and Tendermint Core to allow for faster transaction processing and finality times, ensuring the market makers can update their prices frequently, minimising risk and tightening spreads.
Sei Network achieves these optimisations via the ABCI++, an interface that adds programmability to the underlying consensus mechanism, Tendermint. ABCI itself is an interface that defines the boundary between a blockchain and the applications running on it. It is employed by Tendermint to ensure that a consensus engine running in one process can manage an application state running in another. By customising ABCI, Sei has implemented changes to both its Tendermint BFT consensus mechanism and its method for transaction execution.
Consensus
Sei utilises a modified version of Tendermint BFT to improve finality times and suit it to the needs of the DeFi sector. Its consensus model is dubbed twin turbo consensus and allows the Sei to achieve a 600 millisecond finality time, 40% less than the 1-second finality time provided by Cosmos’s implementation of Tendermint BFT. Sei achieves this feat via intelligent block propagation and optimistic block processing.
Intelligent block propagation is a mechanism for expediting the process of disseminating proposed blocks throughout the network. The system functions via a gossip protocol; when full nodes receive a transaction they propagate it to other nodes in the network. Upon receiving a transaction, validator nodes verify its validity before adding it to their local mempool where block proposers can analyse the transactions and proceed to create a block proposal. Block proposers will then disseminate the block proposal, including the unique identifiers for each transaction to each validator node within the network before sending the entire block. This enables validators to reconstruct the block proposal from their own mempool thereby decreasing the time a validator has to wait before receiving a block. If a validator’s mempool does not contain the requisite transactions to reconstruct the block, it will wait to receive all of the block parts from the network and reconstruct it. This process significantly expedited the process of receiving a block for validation, thereby allowing the process to occur more rapidly.
While intelligent block propagation is a way of efficiently transmitting block proposals, optimistic block processing is Sei’s specific optimization of the Tendermint consensus mechanism. Specifically, validators begin optimistically processing transactions and adding the state write, (a snapshot of the changes needed to update the blockchain’s state) to a data cache (a temporary storage space used to speed up data access and retrieval) during the pre-commit phase. This process is referred to as optimistic because it assumes that the data from the cache will be committed following the pre-commit phase, meaning that very little transaction processing will need to occur before the commit:
Source: Sei Whitepaper
Upon receiving a new block proposal, validators verify the validity of the proposal, ensuring the block is formatted correctly. Subsequently, the validators proceed to the steps taken before voting on whether to confirm the block (referred to as the prevote steps). During this period, optimistic block processing occurs. If any transactions contained within the block are determined to be invalid the block proposal is rejected and the corresponding state write discarded. To negate the possibility of future rounds encountering the same problem and wasting computational resources during the prevote and pre-commit stages, any consecutive processing for the same block height (the number of blocks in a blockchain since its inception) is no longer performed optimistically. This process significantly expedites the process of validating and committing proposed blocks without sacrificing security. The theoretical improvement in latency can be represented using the following equation:
In this equation, Tprevote is the prevote latency, which refers to the time taken for validators to exchange their prevotes, indicating their intent to vote for a particular block. Tprecommit is the precommit latency, which refers to the time taken for validators to exchange their precommits, indicating their agreement on a particular block. N is the number of transactions in the block, and T is the average latency of a single transaction.
Combined, the processes of intelligent block propagation and optimistic block propagation are referred to as twin turbo consensus. Sei claims that this system supports an 83% improvement in transaction throughput. These improvements enable Sei Network to avoid congestion and provide a better user experience while supporting the intensive requirements of high-functioning DeFi applications.
Parallelisation
The Cosmos SDK provides customizable BeginBlock, DeliverTx, and EndBlock functions for validators to perform state updates. The BeginBlock function activates when a block proposal created by the block proposer is received, allowing developers to include certain functions at the beginning of each block. Upon receiving a block proposal, to ensure that each transaction is processed by the appropriate application, the Tendermint consensus mechanism sends a DeliverTx message to the application for each transaction. Once DeliverTx has been run for each transaction in the block, the EndBlock function is executed, allowing developers to insert custom logic at the end of each block.
Transactions are processed during the DeliverTx phase, resulting in state changes for most transactions. However, Central Limit Order Book (CLOB) transactions undergo basic processing during DeliverTx and state changes are applied during the EndBlock function. Sei Network optimised these functions for parallel transaction processing whereby multiple transactions can be processed simultaneously. While the traditional method of sequential transaction processing is comparable to a single-lane road while parallel transaction processing is comparable to a multilane highway.
Source: Dall-E
To enable parallel transaction processing during the DeliverTx phase, Sei leverages its key-value data storage mechanism. Transactions updating the same key cannot be executed in parallel as this may lead to race conditions and non-determinism. This system is similar to a cupboard with a cup inside. If two individuals open the cupboard simultaneously, with the expectation that they will be able to use the cup, conflict may occur because the individuals did not account for the second party. Similarly, if two transactions access the same key and update the associated value simultaneously, the state of the value may not be accurately reflected in either. To avoid this circumstance, transaction message types are mapped to the keys they need to access, allowing messages updating different keys to be processed simultaneously while messages updating the same key are processed sequentially based on block ordering.
Similarly, to ensure transactions operating on the same dependencies do not come into conflict, Sei makes use of a Directed Acyclic Graph (DAG) of dependencies between resources for each message within a transaction, enforcing sequential processing for those operating on the same dependency. DAGs are a type of data structure that allows for efficient processing and storage of data. It’s like having multiple shortcuts to get to your destination, rather than only being able to take the main road. Leveraging this mechanism allows parallelism even within transactions for messages updating different keys. To support flexibility within this system, dependency mappings are defined as templates and populated at runtime, thereby permitting support for a variety of message types.
Market-based transactions utilise a separate mechanism for parallelism referred to as market-based parallelism. CLOB-related transactions are processed by Sei’s native order-matching engine at the end of each block. To provide parallelism for these CLOB-related transactions, Sei categorises them as either dependent or independent. Orders taking place on different markets are considered independent unless dependency overlaps are defined between markets within their smart contracts.
Tests ran to determine the improvements made as a result of parallelism brought to light the efficiency of this system. Block times were reduced by up to 91% over sequential order execution. Simultaneously, the parallel processing model reduced latency and increased the transaction throughput when compared to sequential processing. Importantly, comparative performance increases tracked with throughput, meaning as the block size increases, the increase in efficiency becomes greater for the parallel execution mechanism when compared to the traditional execution mechanism.
Source: Jayendra Jog on Twitter
Price Oracles
One of the key optimisations made for the DeFi sector by Sei Network is its integration of price oracles, modifying validators so they are required to participate as oracles. Voting periods are frequent and brief at only 1 block long. In conjunction with the performance increases made in the consensus and processing mechanisms, exchange rates can be updated continuously ensuring they remain accurate. During the voting window, validators propose their exchange rates which are weighed based on voting power and the median becomes the designated exchange rate. Validators that abstain or provide bad data are designated with a miss count which, after passing a certain threshold, results in a penalty. The integration of price oracles ensures that DeFi applications have access to high-quality and reliable data feeds. Furthermore, this system minimises the number of external dependencies relied upon by DApps.
Frequent Batch Auctioning
Frequent batch auctioning (FBA) enables Sei to clear market orders at a specific price. It is designed to negate the harmful effects of MEV by preventing frontrunning. FBA works by aggregating market orders at the end of each block and executing them together. During each batch, buy and sell orders are matched against each other, and trades are executed at a single uniform clearing price. This process allows for more efficient use of network resources, as all orders are processed simultaneously instead of individually. It also ensures frontrunners cannot order their transactions within a block to obtain a favourable trade because all trades are executed at the same price.
Transaction Order Bundling
Sei makes use of order bundling to streamline the user experience and enhance performance. There are two specific types of order bundling. Client order bundling involves routing orders going to multiple trading markets. During block processing, Sei will correctly route all orders to their respective smart contracts. By bundling orders across different markets, Sei is able to reduce gas costs for market makers and improve overall performance. Chain-level order bundling involves the bundling of multiple market-related transactions and processing them in one virtual machine instantiation, which in turn reduces latency by roughly 1 ms per order. This reduction in latency can be meaningful during periods of high throughput, helping to improve overall trading performance.
How these Optimisations Enable Trading Applications
Unlike other DApps that may only require simple storage and retrieval of data, trading-related applications with relation to DeFi, NFTs, gaming and more rely on complex financial transactions, requiring advanced computations and high-speed processing. For instance, DEXs must handle a significant number of transactions, including order placement, order matching, and order execution, all of which require intensive computation. Similarly, many non-DEX applications also require substantial computational power to execute financial operations such as lending, borrowing, and trading, among others. Considering these applications are the use case for Sei, optimisations are necessary to give the network a competitive edge over generalised blockchains.
The reductions in block time brought about by parallelisation may be the foremost optimisation made by Sei in this area. Block time refers to the time taken for the network to create a new block and validate the transactions in it before the block is added to the blockchain. For DeFi applications, block time is critical because it affects the speed and efficiency of the transactions that take place on the network. For Sei itself, this optimisation affects not only the efficiency of DApps but also the speed of price oracle, ensuring that exchange rates on the network remain accurate.
Additionally, using its twin-turbo consensus mechanism, Sei Network provides significant reductions in finality time. Finality time refers to the time taken for a transaction/block to be confirmed as an immutable part of the blockchain. This is important because it affects the risk associated with transactions. Long finality times can be problematic, especially for trading applications, because time delays may result in missed opportunities or failed transactions. Conversely, fast finality times facilitate more efficient transactions and give users confidence in the security of said transactions.
Another crucial optimisation is the minimisation of MEV enabled by FBA. MEV stands for Maximum Extractable Value and relates to the concept of reordering transactions in a block to obtain profit. The process of extracting MEV oftentimes involves users implementing market manipulation strategies such as frontrunning. These strategies are particularly prevalent in the DeFi sector, frequently resulting in losses for transactors. By aggregating market orders at the end of each block and executing them at a uniform price, FBA effectively discourages harmful forms of MEV for market orders. Consequently, users can enjoy a fair transaction environment with a minimised risk of market manipulation arising from entities seeking to capture MEV.
Conclusion
Sei prunes the Cosmos garden to provide the best environment for the flourishing of its native applications that extend to the realms of NFTs, DeFi, gaming and beyond. The SEI Network, with its unique position in the SEI cosmos, is set to redefine the standards for trading-related applications. Its numerous optimisations of the Cosmos framework make Sei the optimal base layer for various trading applications. With its efficient consensus mechanism, fast transaction processing and integration of mechanisms such as price oracles and FBA, Sei is uniquely positioned to attract numerous developers looking to build financial infrastructure. As a result, Sei is poised to become a leading player in the trading-related market, heralding novel levels of liquidity through inviting new market participants into the ecosystem.
About Zerocap
Zerocap provides digital asset investment and digital asset custodial services to forward-thinking investors and institutions globally. For frictionless access to digital assets with industry-leading security, contact our team at [email protected] or visit our website www.zerocap.com
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 how does it optimise the Cosmos chain?
The Sei Network is the first sector-specific blockchain, built using the Cosmos SDK. It customises the Cosmos framework to provide specific features for its intended niche, bridging the gap between general-purpose and application-specific chains. The Sei Network optimises the Cosmos chain by providing both the specialisation and efficiency of application-specific blockchains as well as the composability and community of generalised blockchains. It is geared towards providing the best trading experience for users across a plethora of markets and has the capacity to effectively host a diverse array of DApps.
What is the role of the Sei Network’s native order-matching engine?
The Sei Network’s native order-matching engine is one of its key technical advancements. It allows DEXs built on Sei to deploy their own Central Limit Order Book (CLOB) by maintaining order books on-chain and providing functionality to create markets. The engine processes order cancellations, adds limit orders to the order book, processes market orders, and then matches limit orders. It ensures orders are getting filled with maximal liquidity and supports partial executions if there is not enough liquidity to fill the entire order.
How does the Sei Network achieve faster transaction processing and finality times?
The Sei Network achieves faster transaction processing and finality times through a combination of intelligent block propagation and optimistic block processing, referred to as twin turbo consensus. Intelligent block propagation expedites the process of disseminating proposed blocks throughout the network, while optimistic block processing allows validators to begin processing transactions and adding the state write to a data cache during the pre-commit phase. This significantly expedites the process of validating and committing proposed blocks without sacrificing security.
What is the significance of parallel transaction execution in the Sei Network?
Parallel transaction execution is a key optimisation in the Sei Network. It allows for multiple transactions to be processed simultaneously, resulting in reduced latency and a more responsive user experience. This is particularly beneficial for trading-related applications that require advanced computations and high-speed processing. The Sei Network leverages its key-value data storage mechanism and a Directed Acyclic Graph (DAG) of dependencies between resources for each message within a transaction to enable parallel transaction processing.
How does the Sei Network minimise Maximum Extractable Value (MEV)?
The Sei Network minimises MEV through the use of Frequent Batch Auctioning (FBA). FBA works by aggregating market orders at the end of each block and executing them together at a single uniform clearing price. This process allows for more efficient use of network resources, as all orders are processed simultaneously instead of individually. It also ensures frontrunners cannot order their transactions within a block to obtain a favourable trade because all trades are executed at the same price, thereby discouraging harmful forms of MEV for market orders.
Like this article? Share
Latest Insights
Zerocap Shines at Blockies & Australian Crypto Convention
This past weekend marked a significant milestone for Zerocap as we participated in two of Australia’s premier crypto events: the prestigious Blockies Awards and the
Weekly Crypto Market Wrap: 25th November 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: 18th November 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.