Source: PermaDAO
Continued from last time. The entire blockchain industry is an evolutionary history of expansion. In order to increase speed and reduce fees, various routes are being tried, but each has its own ceiling. Until AO, a paradigm different from the traditional blockchain was born. Through clever design, the block space on AO is no longer a scarce commodity with a fixed supply, but a resource that can be created infinitely as needed, thus giving AO the ability to expand infinitely!
This also makes Agent-oriented financial model-AgentFi possible. Compared with traditional DeFi, AgentFi has a wider range of application scenarios.
The traditional DeFi protocol originated from Ethereum. Although various L2 and high-performance new public chains have been born, people's imagination of the DeFi construction paradigm has always been limited to Ethereum. Now, let's walk into a platform with no performance restrictions, just like recalling the development process of the Internet from read-only, to read-write, to algorithm, to autonomy, and re-imagine what on-chain finance should look like. Will a new picture emerge in your mind? A financial equality scene where all users can create financial agents, and any computing unit can become a "financial institution" to provide customized financial services!
Why do we need a standard protocol for agents?
On AO computers, processes communicate through messages, and message delivery follows certain specifications. In fact, the same is true in financial scenarios.
Customization is the starting point of diversification. If different types of financial agents develop on their own, they will inevitably produce different protocol specifications. In this case, the interaction between agents becomes a big problem. How can agents communicate with each other and then match each other?
In order to avoid the lack of interoperability caused by the lack of unified specifications, FusionFi Protocol (FFP) came into being.
As an interaction protocol between agents, FusionFi Protocol defines the interaction rules between agents, allowing various financial businesses created based on agents to communicate with each other and then integrate. At the time when AgentFi was just starting out, such a protocol can be said to be quite forward-looking.
FFP (FusionFi Protocol)
FusionFi Protocol is a protocol launched by EverVision founder outprog at the 2024 Arweave Asia Conference.
The key concept in FusionFi Protocol is Note. It is an abstract representation model of commitment, which can be in the form of tokens, bonds, certificates, contract rights, etc. Using the Note model as a medium, FusionFi Protocol can support a variety of financial scenarios, such as trading, lending, staking, etc.
FusionFi Protocol not only provides a protocol specification, but also provides developers with a set of AgentFi development tools (FFP SDK) to help developers create AgentFi more efficiently and simply.
Currently, FusionFi Protocol already has two instances of AMM Agent and Orderbook Agent.
AMM Agent
Taking AMM Agent as an example, each AMM Agent can be understood as a "personal sovereignty" liquidity pool, and the market-making rules of this liquidity pool can be set by itself. This also means that users can independently implement the swap function without relying on external platforms such as a fund pool that uses a unified market-making algorithm, and can find any suitable counterparty in the entire network. In other words, when a user creates an Agent, he is actually creating a decentralized exchange that belongs to him. Then FusionFi Protocol can allow many such "personal exchanges" to form a peer-to-peer network to achieve more efficient and flexible matching.
The following is the core process of AMM Agent:
It looks simple, but in fact, for LP, it seems to be a standard process of creating deposits, adding, exchanging and withdrawing, but the difference is that the Agent is controlled by the user himself, and for LP, the assets are in his own hands. This is actually the ability of AgentFi itself, and FusionFi has established a relatively unified entrance (and data structure) for this set of capabilities.
You can understand that as an LP, all you need to do is deposit and withdraw funds by calling a unified entry function. The function itself can be linked to multiple DeFi projects, and you don’t need to worry about how they interact and work in the future. This is the value of the protocol standard layer. It is similar to the application layer adapting to users after there are standards such as ERC20.
The following is a specific code example of adding liquidity.
As you can see, only a few lines of core code are needed to quickly implement this function.
const minLiquidity = await agent.getMinLiquidityByX(helloAmount, ammSlippageOfPercent) //Set the amount and slippageconst addLiquidityMessageId = await agent.addLiquidity(minLiquidity) //Initiate a message to add liquidityconst addLiquidityResult = await getProcessResult(addLiquidityMessageId, ammProcess) //Get the result
Code use case source:
https://github.com/permadao/ffp-demo
Note Life cycle
Here we can switch to the perspective of Note and take a look at the transaction process between users and AMM Agents.
1. When a user initiates an inquiry request, all AMM Agents with corresponding liquidity will automatically create a quotation, which is a Note. The validity period of this Note is very short. If it cannot be traded quickly, the Note will become invalid. AMM Agents are equivalent to makers.
2. All Notes will be centrally stored in the Note Pool of the system. The Note Pool acts as a shared storage space in the system for easy access by other entities.
3. Users select the most suitable quotation Note from the Note Pool through the front-end web page and submit it to the Settlement Center for settlement. The Settlement Center is responsible for performing specific settlement operations, such as the swap here.
4. The Note is marked as "settled" and the Swap is successfully executed.
Here, the Settlement Center is a key component in the FusionFi Protocol, which is responsible for handling various Note settlement operations in the system.
In fact, the same is true for Orderbook Agent. The limit order in Orderbook Agent is itself a Note, and its settlement process is exactly the same as the quotation agent created by AMM Agent. This means that FusionFi Protocol can actually integrate liquidity from AMM and order book.
Such integration brings great benefits. In the swap scenario, liquidity can come from user quotes or from market-making nodes. And users can use the routing protocol to find liquidity in the entire Note pool to achieve the best transaction price. AMM provides basic liquidity for the market, but there are problems of large price impact and impermanent loss, while the order book allows users to place orders independently, which is suitable for large transactions and users with specific price requirements. After integration, AMM provides continuous liquidity, and the order book reduces price impact and increases depth, making large-order transactions more efficient. This model meets the needs of different types of users. From retail investors to institutions, they can find suitable trading methods, thereby improving capital utilization and promoting further maturity of the market.
Multi-Note Atomic Settlement
The above example is limited to settling only one Note at a time, but in fact, FusionFi Protocol can also support the settlement of multiple Notes at a time, and this settlement is atomic. The status of a Note can only be changed after all Notes in a single settlement are settled. Otherwise, the status of all Notes will not be changed.
This brings some very useful features:
Large transaction splitting: Large orders are difficult to be taken by a single counterparty. FFP supports splitting large orders to make full use of decentralized liquidity.
Multiple transaction consolidation: Multiple transactions can be merged into one atomic order. This can improve transaction speed to a certain extent. For high-frequency traders and complex trading scenarios, this efficiency improvement is crucial.
Multi-hop transactions: Multi-hop transactions are an extension of the order consolidation function. Assume that in a swap scenario, the swap from A to C needs to be completed, but there is no direct path from A to C, but there is a path from A to B to C. FFP can realize the consolidation of A to B and B to C. Moreover, this multi-hop transaction is atomic, and there will be no situation where A to B succeeds and B to C fails.
Zero-capital arbitrage: It is the so-called empty-handed arbitrage. In essence, the arbitrageur settles two notes with interest rate differentials at the same time. You can see the picture below.
Image source: https://x.com/Permaswap/status/1854212032511512992
Permaswap is the first AgentFi DEX built on FusionFi Protocol, and it is also the most mature DEX in the AO ecosystem. If you are interested, you can experience the above features on Permaswap (aopsn.com).
Settlement Center
Obviously, in FusionFi Protocol, Settlement Center is a key component. It processes all notes based on time order, and as long as AO's SU system is normal, the time order can be obtained. Anyone can extract a note from the note pool and submit it to the Settle Center for settlement.
When the number of note processing requests increases, the Settlement Center can also easily expand in a distributed manner, with multiple settlement processes to handle settlement tasks. No matter how much pressure there is, it will be calculated based on the note ID and diverted to different settlement processes for processing.
Diversified Applications of Note
The structured format of Note defined by FusionFi Protocol actually has very strong universal applicability for various financial businesses. Therefore, Note can be applied in a variety of ways. It can not only be used to represent quotation sheets for spot transactions, but also in scenarios such as futures transactions, contract transactions, and lending. Therefore, FusionFi can integrate not only liquidity, but also various financial forms.
Outlook
In my opinion, the essence of this Internet world is multi-point transactions, so solving high-frequency transactions between multiple groups has high value, and AgentFi's model can do almost all DeFi scenarios, while FusionFi Protocol can make Agents more efficient in point-to-point matching, and this matching is cross-protocol. Faced with the DeFi field, which uses competition for liquidity as the main way of competition and monopolizing liquidity as a way of profit, the changes that FusionFi Protocol can bring are subversive!
Of course, FusionFi Protocol is a brand-new protocol standard, and it may need to be continuously adjusted and optimized according to business needs. This can refer to the models of BIP (Bitcoin Improvement Proposal) Bitcoin Improvement Proposal and EIP (Ethereum Improvement Proposals) Ethereum Improvement Proposal, and absorb creativity in co-creation.