< Back to all articles

Liquidity Aggregation: Automation with Relay Nodes

December 28, 2023

The issue of the excessive complexity of many products and services presented in the DeFi space has been a big motivation for the Kinetex team from the project's beginning. 

Overcomplicated processes and a lack of intuitive interfaces have been seriously hindering the popularity and growth of the decentralized services, as only experienced crypto users felt confident enough to use them. Therefore, the Kinetex team prioritized user experience while creating innovative cross-chain solutions. 

Earlier this week, the Kinetex team discussed the Kinetex Advanced Router, a feature that helped to streamline user experience while swapping via the Liquidity Aggregation mode. Today, let's look at another feature that made Liquidity Aggregation so user-friendly — automation. 

Why Does Automation Matter?

The crypto market is witnessing an extraordinary surge in the number of digital assets and blockchain networks appearing. It only intensifies the challenge of connecting networks and enabling efficient and smooth liquidity transfer between them. Consequently, newer, improved cross-chain solutions are gaining the utmost significance due to their potential to establish more robust connections between chains, thereby overcoming a major obstacle to DeFi growth. 

However, these technologies have limitations, such as insufficient user-friendliness and high time requirements, particularly when taking more complex routes involving two or more networks. Such routes go through cross-chain bridges notorious for their high gas costs, reoccurring hack attacks, and slowness. For instance, transferring assets through a single bridge can take 15 to 30 minutes, based on the technology and block confirmation time in the networks involved. Moreover, manual control can also be quite laborious and tiring, as users must remain online for the duration of the swapping process to sign transactions. 

Kinetex Automation

Driven by the aim to make the DeFi industry, in general, and cross-chain solutions, in particular, more efficient and easy to use, Kinetex has introduced an automated execution of swaps on all major EVM-compatible chains, including Ethereum, BNB Smart Chain, Arbitrum, Avalanche, Polygon, etc.

In order to provide automation, Kinetex implements relay nodes that run each smart contract automatically in every network. They serve to confirm and execute transactions, calculate related gas costs, search the optimal routes (learn more about it here), and process intermediate assets without requiring extra user interactions. This way, Kinetex frees users from staying online to confirm each step individually throughout the swapping procedure, making crypto trading easier and less time-consuming. 

Besides, such a solution has potential in other use cases in the future, offering an automated way to manage liquidity and execute various tasks such as buying and selling goods and services, implementing trading strategies, and transferring NFTs in games and marketplaces.

Lastly, apart from enhancing user convenience, relay nodes allow Kinetex to significantly improve security during crypto transfers by acting as transaction relays. They ensure no direct interaction with liquidity and account balances occurs as users' assets are sent to the routes' designated points, and swapped assets are returned straight to their balances.

Workflow 

To start an automatic swap, a user only needs to allow access to the tokens being swapped and sign the necessary route data. Once relay nodes receive the signature, they can work further themselves, and the user can safely exit the dApp without having to worry about seeing it through. 

After receiving the user's confirmation, the nodes launch smart contracts with the allowance to the balances of the tokens that are being swapped. As mentioned before, relay nodes also take responsibility for paying gas for users, thus eliminating the need for the latter to stress about managing native coins for gas payments. Relay nodes help pay fees in the first and intermediate networks, charging from the swapped assets (for crypto assets supporting the EIP-2612 standard) or offering the escrow method (users need to make a small deposit to pay gas fees in any network).

Thus, all swaps via the Liquidity Aggregation mode are executed completely automatically, enabling Kinetex users to trade coins and tokens in a more straightforward, seamless, and efficient way.

Automating Swapping through Bridges

Regarding automatic, one-click swaps through bridges, it is standard to use those bridges that can simultaneously execute a callback to the target network as the token transfer is made. By leveraging the cross-chain messaging protocol's ability to transfer liquidity and data in a single transaction, it's feasible to transmit additional instructions for the swap.

However, this approach has several drawbacks. Firstly, only some bridges support the ability to transmit data and liquidity simultaneously. Secondly, such an approach costs extra gas since the data transferred to the target network is kept in on-chain storage. Thirdly, the entire swap route becomes available to the public, facilitating the right environment for MEV attacks.

Eliminating all the issues mentioned above has been made possible through Kinetex's automation solution using relayers. These relayer nodes facilitate the interaction with funds received from any bridge and transfer them to a user-owned minimal proxy smart contract. The subsequent swap steps are launched by relayers, following the route the user signs. 

To avoid disclosing the complete route during swap initialization and hence protect users from possible MEV attacks, Kinetex splits routes into several parts equivalent to the number of networks they consist of, and each part gets passed to the appropriate network as the swaps progress.

Final Thoughts

The Kinetex team has been working hard to ensure that the products they offer users are truly user-oriented and accessible. The first solution, Liquidity Aggregation, is a testament to the team's commitment to making the DeFi space more welcoming to users. 

As the team moves forward with the next generation of Kinetex, Flash Trade, it stays dedicated to ensuring the best user experience and security possible. This new mode will redefine cross-chain trading for users, further simplifying the process of swapping crypto.

Kinetex Network: Website | Kinetex dApp