Constructs
Chain Abstraction & Intent-Based Swaps
Concept of Chain Abstraction
Chain abstraction simplifies user interactions with blockchain technology by hiding the complexities and technical details, making cross-chain transactions as intuitive as single-chain operations. This allows users to seamlessly engage with decentralized applications (DApps) without worrying about the underlying blockchain.
This approach also enhances liquidity by enabling access across various blockchains, eliminating the need for permanent liquidity pools and utilizing private liquidity. Chain abstraction holds the potential to create more user-friendly and interconnected blockchain ecosystems, paving the way for broader adoption and enhanced functionality in DeFi.
To illustrate chain abstraction, imagine that every time you need to pay for your coffee with a bank card, you would need a card that matches the terminal's bank. Otherwise, you wouldn't be able to make the payment. With chain abstraction, you can use any bank card on any terminal without any issues, making the process much simpler and more convenient.
Intent-Based Swaps Concept
An intent is an order type where users define the desired result rather than the method of execution. The basic idea is straightforward: rather than dealing with the complexities of determining paths, bridging, switching between chains, and covering interchain transaction fees, users can rely on a service provider to manage these tasks. This makes transactions across different chains fast, inexpensive, and straightforward.
Intent-based swaps have three consequential steps:
Intent. The user specifies their intent to swap tokens from the source chain to the destination chain. The destination chain can be the same as the source chain, and tokens on the source chain can be bridged or swapped for other types of tokens on the destination chain. After signing the intent, it becomes an intent-based order and flows into an order pool (unified order network), where relevant participants (executors and the matching engine) track it, looking for “mirror” orders.
Execution. The QuoteX matching algorithm, along with competing executors, fulfills the user's intent-based order at the best price, with the winning executor submitting the user’s transaction to the target chain.
Clearing. After verifying that the execution of the intent-based order is complete, QuoteX repays the winning executor with the funds they provided on the destination chain.
In this model, transactions on the target chain are executed at the lowest possible base fee that the executors can offer.
It's also worth mentioning that anyone who can sign an order can be a user of Quotex, not just regular DeFi users. Our user base can include DeFi protocols, market makers, automated trading software, and others.
Quotex Intent-Based Architecture
Quotex's intent-based architecture can be split into a three-layer system, each corresponding to a step in executing intent-based swaps: the intent layer, execution layer, and clearing layer. This process involves a signed intent order flowing into a unified order network, where a matching engine finds a mirror order or executors compete for execution if a mirror order is absent, followed by a clearing layer that verifies the execution and processes repayment to relevant executors.
Below is a diagram of how the Quotex Intent-Based Architecture is built:
Intent Layer
1a. User Intent: The user fills in their intent and signs it, which becomes an order in the system. The order is not a transaction per se.
1b. Order Flow: The order flows into an order pool within the unified order network.
Execution Layer
2. Order Arrival: When a new order arrives in the unified order network, it triggers the matching engine to start the execution process.
2a. Matching Engine Process - Mirror Orders. The matching engine first looks for mirror orders within the unified order network. For this explanation, let's assume no mirror orders are found.
2b. Matching Engine Process - Executors.The matching engine proposes relevant executors in the executor pool to compete for the order's execution.
3. Order Claiming: The executor that wins the bid claims the order, prompting the matching engine to call the execution contract.
4a. Funds Blocking: The execution contract blocks the funds specified in the order to be swapped.
4b. Execution Notification: The execution contract notifies the executor that the funds are blocked, and they can proceed with the order execution.
5. Fund Transfer: The executor transfers the funds to the user on the destination chain.
Clearing Layer
6a. Verification: The execution contract verifies that the funds have been transferred by the executor to the user on the destination chain.
6b. Fund Release: Upon successful verification, the execution contract releases the blocked funds of the user.
6c. Executor Compensation: The execution contract transfers the user’s funds to the executor on the source chain.
Intent-Based Swaps as a driver for Chain Abstraction
Intent-Based Swaps serve as a pivotal driver for Chain Abstraction due to their capacity to streamline cross-chain transactions with a focus on interoperability, efficiency, user experience, and scalability within blockchain ecosystems.
Intent-Based Swaps:
abstract away the intricacies of individual blockchain protocols, allowing users to specify their desired transaction outcomes without concerning themselves with the underlying technical nuances of each blockchain. This abstraction layer fosters seamless interoperability by enabling transactions to traverse different chains effortlessly;
optimize transaction routing across multiple blockchains. Through intelligent algorithms and routing mechanisms, these swaps identify and execute transactions via the most efficient path, leading to faster transaction settlement times and reduced costs;
play a vital role in ensuring scalability, as the blockchain landscape continues to evolve with the introduction of new chains. By providing users access to a multitude of blockchain functionalities through a single platform, these swaps contribute to the scalability of blockchain ecosystems by mitigating the limitations imposed by individual chains;
simplify user engagement with diverse blockchain networks using a unified interface, eliminating the complexities associated with managing multiple blockchain protocols and enhancing user adoption.
Scaling Chain Abstraction in DeFi by integrating Quotex
The trend of chain abstraction in DeFi is shaping the market's medium-term development. Historically, DeFi projects have often had to develop their own solutions to keep up with new technological trends. However, this approach is not always feasible because (i) it cannot be technically unified, and (ii) it requires significant resource allocation, which is not rational for many projects. A good example is bridge infrastructure: as DeFi became cross-chain, instead of creating their own bridges, protocols integrated with specialized infrastructure protocols to bridge their tokens.
Recognizing the imminent need for infrastructure to support intent-based swaps and the emerging trend of chain abstraction, we have decided to develop tools that enable DeFi protocols to integrate Quotex services seamlessly. These tools, namely the Houdini API & Widgets, aim to enhance the efficiency of cross-chain interactions and improve the overall user experience in DeFi.
With Houdini API & Widgets, any DApp can integrate Quotex for their services. The Houdini API enables users to access intent-based transaction executions via the protocol’s interface, while the tailored widgets provide market participants with straightforward access to Quotex, enhancing their services and improving user experience. By creating these products, we are committed to supporting and developing DeFi along the vector of chain abstraction.
Consider a potential example: Lending Protocol Q operates on Chains X and Y. For a user to unstake their USDT on Chain X and stake it in a pool on Chain Y, they would traditionally need to unstake, use a third-party bridge, bridge to Network Y, pay a commission, wait for the transaction, and then stake it in the pool on Chain Y.
If Lending Protocol Q integrates the Houdini API into its operations, it could provide users with a single point of entry on any chain. The user could then stake on Chain Y using assets from any chain, including Chain X. Under the hood, the lending contract on Chain Y would use Quotex to swap assets with minimal waiting time, at a low cost, and efficiently.
Alternatively, Lending Protocol Q can integrate a widget that pops up when cross-chain transactions are needed. This way, the user would not need to change windows or go to a third-party service, as they could complete their bridge operations without leaving the Lending Q platform.
Unified Order Network
What is a Unified Order Network?
Unified Order Network is a mega-layer of the Quotex intent-based architecture. It consists of 2 parts: (i) order pool, which stores all intent-based orders; and (ii) executors pool, where all executors are integrated. The interactions of the pools are processed by a matching engine.
Unified Order Network has 3 main functions: (i) to save, structure, and composite all intent-based orders in a secured space; (ii) integrate executors and provide them access to the order pool; and (iii) create a space for the matching engine to operate.
Order Type
Within Quotex architecture an order is a signed intent by a user. There are several types of orders based on: type of order execution, source and destination chains, and assets.
Orders based on the source and destination chains:
Single chain. If the source and destination chain matches.
Cross-chain. If the source and destination chain are different.
Orders based on the execution type:
Limit orders. Allows users to trade by setting an order to buy or sell cryptocurrency at a specific price or better;
Auction based orders. Enables users to trade through an auction where the price starts high and decreases until it reaches the limit of the sum minus slippage.
Orders based on the asset type:
Bridge. Users swap asset A for asset A on different chains.
Swap. User swaps asset A for asset B either on the same chain or cross-chain.
Separately we should mention mirror-type orders. Mirror orders are the type of orders when different users want to execute opposite transactions, allowing them to be inter-executed.
For example, User A wants to bridge 1,000 USDT from ERC-20 to BNB, and User B wants to bridge 1,000 USDT from BNB to ERC-20, so their orders are matched and executed against each other.
Who can be an executor?
Quotex is committed to expanding the base of executors, as this drives competition, which ultimately benefits users by providing lower prices and fostering innovations in DeFi.
In theory anyone can be an executor by integrating in the Unified Order Network. Practically, we see the following categories of executors to take part in executions of intent-based orders:
Matching Engine. Matching Engine can execute mirror orders by its own, therefore reducing the costs for a swap for users and making it more efficient.
DeFi Users. Any user either intentionally or unintentionally can be an executor. Unintentional execution by another user happens when he signs a mirror order to the relevant order. Otherwise for any DeFi user to intentionally execute orders he should integrate within a unified order network and execute preferred order.
Market Makers. Professional entities that provide liquidity and facilitate trades by executing orders and balancing liquidity across various platforms are one of the categories that should take advantage of executing intent-based swaps in a unified order network.
Intent-Based Protocols. Our unified order network forms the foundation for a mega layer that supports all intent-based swaps. This means that any other intent-based protocol can integrate with the unified order network, allowing their executors to execute intent-based orders from QuoteX or any other protocol that has integrated their order pool into the unified order network.
Other DeFi Protocols. These can include lending platforms, yield farming protocols, and decentralized exchanges that integrate with the Unified Order Network to enhance their liquidity management.
Automated Trading Software. Bots and automated systems that execute trades based on predefined algorithms and strategies to optimize efficiency and profitability can be integrated to execute intent-based orders;
Potentially other executors, such as, however not limited to, institutional trades, CEXes and others.
Unified Order Network as a Mega-Layer for Intent-Based Protocols
With the increasing number of intent-based protocols, we recognize the imminent need for the aggregation of intent-based swaps, similar to how DEX aggregation became necessary with the proliferation of DEXs. Instead of merely aggregating intent-based protocols and their routes, we have decided to create a foundational mega-layer.
The Unified Order Network will serve as this foundational mega-layer for intent-based protocols, streamlining and enhancing the execution of cross-chain transactions. This setup simplifies the transaction process across various blockchain environments and significantly improves the reliability and speed of these operations, making it a critical component in the broader decentralized finance ecosystem.
Technically, this means creating circumstances around a unified order network that allows other intent-based protocols to integrate with our order and/or executor pools. This enables them to source their intent-based orders for executors within the unified order network to execute, or allow their executors to execute respective orders from the unified order network.
This integration does not compromise the independence of other intent-based protocols. Instead, it offers new opportunities: (i) providing their users with more efficient execution of their orders by integrating with the Quotex order pool, and (ii) offering more earning opportunities for their executors by integrating with the Quotex Executor Pool.
By acting as a central hub, the Unified Order Network facilitates the seamless interaction of different protocols, ensuring that orders, such as mirror-type transactions, are paired and processed optimally.
Matching Engine
What is the Matching Engine?
The Matching Engine is a unique code that uses a matching algorithm to execute intent-based orders. It is a key component of the Quotex Intent-Based Architecture, working alongside intent-based orders and the unified order network. Its main function is to find the best routes to execute intent-based transactions.
Types of Orders Matching
There are three types of order matching within the Quotex Architecture:
Order-to-Order (Mirror Order). The Automated algorithm of Matching Engine executes opposite orders of different users against each other.
Order-to-Executor. The Matching Engine proposes an order to a pool of executors, who then compete to execute the order at the most favorable price for the user.
Complex Match.This involves two or more executors executing the order. Or a mirror order may be executed partially, with one or more executors completing the rest of the order.
Matching Engine Algorithm
The logic behind the matching algorithm ensures users enjoy the most favorable conditions for their trades, prioritizing (i) price, (ii) slippage, (iii) execution time, and (iv) execution integrity. The algorithm takes all these details into account to find the most efficient path for executing intent-based orders.
Based on these priorities, the algorithm typically executes transactions in the following order:
Order-to-Order (Mirror Order). The cheapest, most efficient, and fastest type of trade for users.
Order-to-Executor. Executors compete on price to execute the order, providing the best price for the user.
Complex Orders. These require more than one transaction, resulting in higher execution costs.
Please note that this is a basic explanation of the algorithm. In practice, complex orders might be more efficient to execute than order-to-executor. For example, if User A wants to swap 1,000,000 USDT on chain X for USDC on chain Y, instead of executing the entire order through a single executor for 998,000 USDC, the algorithm might swap 900,000 USDT for 900,000 USDC via a mirror order and the remaining 100,000 USDT via the same executor for 99,800 USDC. Thus, User A receives 999,800 USDC instead of 998,000 USDC.
Last updated