Source: PermaDAO
The book continues from the previous chapter. The entire blockchain industry is an evolutionary history of expansion. Various routes are being tried in order to increase speed and reduce fees, but they all have their own ceilings. Until AO, a paradigm different from traditional blockchain emerged. Through clever design, the block space on AO is no longer a fixed supply of scarcity, but a resource that can be created infinitely as needed, thus giving AO the ability to infinitely expand!
This also makes possible AgentFi, an Agent-oriented financial model. 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 for the DeFi construction paradigm has always been limited to Ethereum. Now, let us walk into a platform with no performance limitations, 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. Is it Will a new picture emerge in your mind? A vision of financial equality where all users can create financial agents, and any computing unit can become a "financial institution" and provide customized financial services!
Why do we need a standard protocol for Agent?On the AO computer, processes communicate through messages, and message passing follows certain specifications. In fact, the same is true in the financial scene.
Customization is the starting point for diversification. If different types of financial Agents develop on their own, different protocol specifications will inevitably arise. In this way, the interaction between Agents will become a big problem. How to How can agents communicate with each other and 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 services created based on Agents to communicate with each other and then integrate. At the time when AgentFi was just getting started, such an agreement could 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 a commitment, which can be in the form of tokens, bonds, certificates, contractual rights, etc. Utilizing the Note model as a medium, FusionFi Protocol can support a variety of financial scenarios, such as trading, lending, pledging, 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: 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. The market making rules of this liquidity pool can Set it yourself. This also means that users do not need to rely on external platforms such as a capital pool using a unified market-making algorithm, but can independently implement the swap function and find any suitable counterparty in the entire network. In other words, when a user creates an Agent, he is actually creating a personal decentralized exchange. 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 seems very simple. In fact, for LP, it seems that it is a standard set of creation, deposit and then The process of adding, exchanging and withdrawing funds, but the difference is that the Agent is controlled by the user himself. For LP, the assets are in his own hands. This is actually the capability of AgentFi itself, and FusionFi establishes a relatively unified entrance (and data structure) for this set of capabilities.
You can understand that as an LP, all you need to complete are deposit and withdrawal operations, and just call the unified entry function. The function itself can be linked to multiple DeFi projects, and you can ignore how they interact and function in the future. This is the value of the protocol standard layer. Just like with the emergence of standards such as ERC20, the application layer adapts to users.
The following is a specific code example for adding liquidity.
As you can see, this function can be quickly implemented with just a few lines of core code.
constminLiquidity=awaitagent.getMinLiquidityByX(helloAmount,ammSlippageOfPercent)//Set the amount and slippage constaddLiquidityMessageId=awaitagent.addLiquidity(minLiquidity)//Initiate adding liquidityMessage constaddLiquidityResult=awaitgetProcessResult(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 the user and the AMM Agent.
1. When a user initiates an inquiry request, all AMM Agents with corresponding liquidity will automatically create a quotation. This quotation is a Note. The validity period of this Note is very short. If it cannot be quickly Once the transaction is completed, the Note will become invalid. AMM Agents are equivalent to makers.
2. All notes will be centrally stored in the system's Note Pool. The Note Pool acts as a shared storage space in the system to facilitate access by other entities.
3. The user selects the most suitable quotation Note from the Note Pool through the front-end web page and submits it to the Settlement Center for settlement. Settlement Center is responsible for performing specific settlement operations, such as swap here.
4. The Note is marked as "Settled" and the Swap is executed successfully.
Here, Settlement Center is a key component in FusionFi Protocol and 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 itself is 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 fuse liquidity from AMMs and order books.
Such integration brings great benefits. In the swap scenario, liquidity can come from user quotes or market-making nodes. Users can use the routing protocol to find liquidity in the entire Note pool and achieve the best transaction price. AMM provides basic liquidity to the market, but has the problem of large price impact and impermanent losses, while the order book allows users to place orders independently, which is suitable for large transactions and users with specific price needs. When integrated, AMM provides continuous liquidity while the order book reduces price impact and increases depth, making large trades more efficient. This model satisfies different types ofUsers' needs, from retail investors to institutions, can find suitable trading methods, thereby improving the utilization rate of funds and promoting the further maturity of the market.
Multiple Note Atomic Settlement
The above case is limited to settling one Note at a time, but in fact, FusionFi Protocol can also support settling multiple Notes at one time, and this settlement is Atomic. The status of a Note can only be changed after all Notes in a single settlement have been settled. Otherwise the status of all Notes will not be changed.
This brings some very useful features:
Large-amount transaction splitting: Large-amount orders are difficult to be taken by a single counterparty, and FFP supports large-amount orders. Split and take advantage of decentralized liquidity.
Multiple transactions can be combined 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 trading: Multi-hop trading is an extension of the order combination function. Assume that in the swap scenario, the replacement of A→C needs to be completed, but there is no direct path from A→C, but there is a path from A→B→C. FFP can realize the combination of A→B and B→C. Moreover, this multi-hop transaction is atomic, and there will be no situation where A→B succeeds and B→C fails.
Zero capital arbitrage: It is the so-called empty-handed wolf. The essence is that the arbitrageur settles two notes with interest rates at the same time. You can see the picture below.
Image source: https://x.com/Permaswap/status/1854212032511512992
Permaswap is the first The first AgentFi DEX built based on FusionFi Protocol, it is also the most mature DEX in the AO ecosystem. Anyone who is interested can experience the above features on Permaswap (aopsn.com).
Settlement Center
Obviously, Settlement Center is a key component in FusionFi Protocol. It will process all notes based on chronological order. As long as the AO's SU system is normal, the chronological order can be obtained. Anyone can extract notes from the note pool and submit them to Settle Center for settlement.
When the volume of note processing requests increases, the Settlement Center can also be easily expanded in a distributed manner, consisting of multiplesettlement process to offload settlement tasks. How much pressure there is is calculated based on the ID of the note and is divided into different settlement processes for processing.
Diversified applications of Note
The structured format of Note defined by FusionFi Protocol is actually very universal for various financial businesses. applicability. Therefore, Note can be used in various ways. It can not only be used to express quotations for spot transactions, but can also be used in futures trading, contract trading, lending and other scenarios. Therefore, FusionFi can integrate not only liquidity, but also various financial forms.
OutlookIn the author’s opinion, the Internet world is essentially a multi-point transaction, so solving high-frequency transactions between multiple groups is of high value, and AgentFi’s model can do almost everything DeFi scenario, and FusionFi Protocol can allow agents to conduct point-to-point matching more efficiently, and this matching is cross-protocol. Faced with a model in which competition for liquidity is the main method of competition in the DeFi field and monopoly of liquidity is the method of profit, the changes that FusionFi Protocol can bring are disruptive!
Of course, FusionFi Protocol is a brand new protocol standard and may need to be continuously adjusted and optimized based on business needs. This can refer to the models of BIP (Bitcoin Improvement Proposal) and EIP (Ethereum Improvement Proposals) to absorb creativity in co-creation.