Previous article review:

(AgentFi - A new concept of DeFi driven by AO)

To recap, the overall blockchain industry is a history of evolution in scaling. Various routes are being attempted to speed up and reduce costs, but each has its own ceiling. Until AO, a paradigm different from traditional blockchains emerged. Through clever design, the block space on AO is no longer a fixed supply scarce resource but an infinitely creatable resource based on demand, thus endowing AO with limitless scalability!

This also makes the Agent-oriented financial model—AgentFi—possible, which has a wider range of application scenarios compared to traditional DeFi.

Traditional DeFi protocols originated from Ethereum, and even though various L2 and high-performance new public chains have emerged, people's imagination of the DeFi building paradigm has always been limited to Ethereum. Now, let us step into a platform completely free from performance limitations, reminiscent of the internet's evolution from read-only to read-write, from algorithms to autonomy, and reimagine what on-chain finance should look like. Does a completely new picture emerge in your mind? A vision where all users can create financial Agents, where any computing unit can become a financial institution, providing customized financial services!

Why do we need a standard protocol for Agents?

In an AO computer, processes communicate with each other through messages, and message passing follows certain specifications. This is also the case in financial scenarios.

Customization is the starting point for diversification. If different types of financial Agents develop independently, it will inevitably lead to different protocol specifications. This raises a major challenge for interaction between Agents: how to enable communication between Agents and facilitate matching?

To avoid the lack of interoperability caused by the absence of a unified specification, the FusionFi Protocol (FFP) was born.

The FusionFi Protocol, as an interaction protocol between Agents, defines the interaction rules between Agents, allowing various financial services created based on Agents to be interoperable and thus integrate into one. At the very beginning of AgentFi, such a protocol can be considered quite forward-looking.

FusionFi Protocol:连接所有金融代理

FFP (FusionFi Protocol)

The FusionFi Protocol was introduced by outprog, the founder of EverVision, at the 2024 Arweave Asia Conference.

The key concept in the FusionFi Protocol is Note. It is an abstract representation model of a commitment, and its form can be tokens, bonds, certificates, contractual rights, etc. By using the Note model as a medium, the FusionFi Protocol can support a rich variety of financial scenarios such as trading, lending, staking, etc.

The FusionFi Protocol not only provides a protocol specification but also offers developers a set of development tools for AgentFi (FFP SDK), helping developers create AgentFi more efficiently and simply.

Currently, the FusionFi Protocol has instances of both AMM Agent and Orderbook Agent.

AMM Agent

Taking AMM Agent as an example, each AMM Agent can be understood as a liquidity pool of "personal sovereignty" where the market-making rules of this liquidity pool can be set by the user. This also means that users do not need to rely on external platforms, such as a capital pool that uses a unified market-making algorithm, and can autonomously achieve swap functionality, finding any suitable counterpart across the entire network. In other words, when a user creates an Agent, they are actually creating a decentralized exchange belonging to themselves. Then, the FusionFi Protocol allows many such "personal exchanges" to form a peer-to-peer network for more efficient and flexible matching.

The following is the core process of AMM Agent:

FusionFi Protocol:连接所有金融代理

It seems simple, but for LPs, it appears to be a standard process of creating deposits, adding liquidity, and executing withdrawals, with the difference being that Agents are controlled by the users themselves, and assets are in their own hands. This is actually the capability of AgentFi itself, while FusionFi establishes a relatively unified entry point (and data structure) for this capability.

You can understand that, as an LP, what you need to do is simply deposit and withdraw, by calling a unified entry function. The function itself can link to multiple DeFi projects; how they interact later can be disregarded, which is the value of this layer of protocol standards. It is similar to how applications adapt to users after standards like ERC20 are established.

Here is a specific code example for adding liquidity.

It can be seen that with just a few lines of core code, this functionality can be quickly realized.

const minLiquidity = await agent.getMinLiquidityByX(helloAmount, ammSlippageOfPercent)//Set amount and slippage

const addLiquidityMessageId = await agent.addLiquidity(minLiquidity)//Initiate adding liquidity message

const addLiquidityResult = await getProcessResult(addLiquidityMessageId, ammProcess)//Get result

Code example source:

https://github.com/permadao/ffp-demo

Note lifecycle

Here we can switch to the perspective of Notes and take another look at the transaction process between users and AMM Agents.

1. When a user initiates a price inquiry request, all AMM Agents with corresponding liquidity will automatically create a quote, which is a Note. This Note has a very short validity period; if it cannot be executed quickly, it will expire. AMM Agents act as makers.

2. All Notes will be centrally stored in the system's Note Pool, which serves as a shared storage space in the system, facilitating access for other entities.

3. Users select the most suitable quote Note from the Note Pool through the frontend webpage and submit it to the Settlement Center for settlement. The Settlement Center is responsible for executing the specific settlement operations, such as the swap here.

4. Notes are marked as "settled" and the swap is successfully executed.

Here, the Settlement Center is a key component of the FusionFi Protocol, responsible for handling various Note settlement operations within the system.

In fact, it is the same for the Orderbook Agent. The limit order in the Orderbook Agent itself is a Note, and its settlement process is identical to that of the quote Agent created by the AMM Agent. This means that the FusionFi Protocol can actually integrate liquidity from both AMM and order books.

Such integration brings great benefits. In the swap scenario, liquidity can come from user quotes as well as market-making nodes. Users can leverage routing protocols to search for liquidity throughout the Note pool to achieve the best execution price. AMM provides basic liquidity to the market, but it has issues with significant price impact and impermanent loss, while order books allow users to place orders autonomously, suitable for large transactions and users with specific price needs. After integration, AMM provides continuous liquidity, while order books reduce price impact and increase depth, making large transactions more efficient. This model meets the needs of different types of users, allowing both retail and institutional participants to find suitable trading methods, thereby improving capital utilization and promoting further market maturation.

Multi-Note atomic settlement

The above examples are limited to settling one Note at a time, but in reality, the FusionFi Protocol can also support settling multiple Notes at once, and this settlement is atomic. All Notes in a single settlement must be completed before the Note's status can be changed. Otherwise, none of the Notes' statuses will be changed.

This brings some very useful features:

  • Large transaction splitting: Large orders are difficult to be absorbed by a single counterparty, and FFP supports the splitting of large orders to fully utilize dispersed liquidity.

  • Multiple transactions merging: Multiple transactions can be merged into a single atomic order. This can enhance trading speed to some extent, and this efficiency improvement is crucial for high-frequency traders and complex trading scenarios.

  • Multi-hop trading: Multi-hop trading is an extension of the merging function. Suppose that in a swap scenario, we need to complete the exchange from A to C, but there is no direct path from A to C; however, there is a path from A to B to C. FFP can realize the merging of A to B and B to C. Moreover, this multi-hop trading is atomic, meaning there will be no situation where A to B succeeds but B to C fails.

  • Zero capital arbitrage: This is what is known as "making a fortune without any investment." The essence is that arbitrageurs take two notes that have interest rate differentials and settle them simultaneously. See the diagram below.

FusionFi Protocol:连接所有金融代理

Image source: https://x.com/Permaswap/status/1854212032511512992

Permaswap is the first AgentFi DEX built on the FusionFi Protocol and is currently the most mature DEX in the AO ecosystem. Interested users can experience the above features on Permaswap (aopsn.com).

Settlement Center

Clearly, in the FusionFi Protocol, the Settlement Center is a key component. It processes all Notes based on chronological order, and as long as the AO SU system is functioning properly, it can retrieve that chronological order. Anyone can extract Notes from the Note pool and submit them to the Settle Center for settlement.

When the volume of note processing requests increases, the Settlement Center can easily scale through a distributed manner, with multiple settlement processes handling settlement tasks. The amount of pressure is calculated based on the note IDs and distributed to different settlement processes for handling.

FusionFi Protocol:连接所有金融代理

Diverse applications of Notes

The structured format defined by the FusionFi Protocol for Notes actually has strong universal applicability for various financial services. Therefore, the application methods of Notes are diverse. They can be used not only for representing spot trading quotes but also for futures trading, contract trading, lending, and other scenarios. Therefore, FusionFi can integrate not just liquidity but also a variety of financial forms.

Outlook

In the author's view, the essence of this internet world is multi-point transactions, so solving high-frequency trading among multiple groups has high value. The AgentFi model can cover almost all DeFi scenarios, and the FusionFi Protocol allows Agents to conduct peer-to-peer matching more efficiently, and this matching is cross-protocol. Faced with the DeFi domain's main competition method of seizing liquidity and the model of monopolizing liquidity for profit, the changes brought by the FusionFi Protocol are disruptive!

Of course, the FusionFi Protocol is a brand new protocol standard and may still need to be continuously adjusted and optimized according to business needs. This can refer to the model of BIP (Bitcoin Improvement Proposal) and EIP (Ethereum Improvement Proposals), absorbing ideas in co-creation.

Reference materials:

1. Smart Finance: From AgentFi to FusionFi

https://x.com/perma_daoCN/status/1801474305597050906

2. FusionFi Protocol: Core Element for Achieving AgentFi Interoperability

https://x.com/Permaswap/status/1854212032511512992

3. FusionFi Protocol Documentation

https://github.com/zyjblockchain/ffp-doc/blob/main/doc/FusionFi Protocol Introduction.md

This article was first published on PermaDAO

Original link: https://mp.weixin.qq.com/s/r5bhvWVhoEdohbhTt_7b5A