Tap to Trade in Gate Square, Win up to 50 GT & Merch!
Click the trading widget in Gate Square content, complete a transaction, and take home 50 GT, Position Experience Vouchers, or exclusive Spring Festival merchandise.
Click the registration link to join
https://www.gate.com/questionnaire/7401
Enter Gate Square daily and click any trading pair or trading card within the content to complete a transaction. The top 10 users by trading volume will win GT, Gate merchandise boxes, position experience vouchers, and more.
The top prize: 50 GT.
 comes into being.
As the interaction protocol between Agents, FusionFi Protocol defines the interaction rules between Agents, allowing various financial businesses based on Agents to interoperate and integrate. At the early stage of AgentFi, such a protocol can be said to be quite forward-looking.
FFP(FusionFi Protocol)
FusionFi Protocol is a protocol launched by outprog, the founder of EverVision, at the 2024 Arweave Asia conference.
The key concept in the FusionFi Protocol is Note, which is an abstract representation model of a promise that can take the form of Tokens, bonds, certificates, contract rights, etc. By using the Note model as a medium, the FusionFi Protocol can support a variety of financial scenarios, such as trading, lending, stake, etc.
FusionFi Protocol not only provides a protocol specification, but also provides developers with a trap AgentFi development tool (FFP SDK) to help developers create AgentFi more efficiently and simply.
Currently, FusionFi Protocol has two types of instances: AMM Agent and Orderbook Agent.
AMM Agent
Taking AMM Agent as an example, each AMM Agent can be understood as an individual sovereign liquidity pool, and the market-making rules of this liquidity pool can be set independently. This also means that users do not need to rely on external platforms, such as a fund pool that adopts a unified market-making algorithm, to independently implement swap functions and can search for any suitable counterparty across the network. In other words, when users create an Agent, they are actually creating a Decentralization exchange that belongs to individuals. Then the 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 simple, but for LPs, it’s actually a trap to create, deposit, add liquidity, exchange, and withdraw. The difference is that the Agent is controlled by the user themselves, and for LPs, the assets are in their own hands. This is actually the ability of AgentFi, and FusionFi is designed to unify this trap ability and establish a relatively unified entry (and data structure).
You can think of it as an LP, all you need to do is deposit and withdraw, call the unified entry function. The function itself can be linked to multiple Decentralized Finance projects, and you don’t need to worry about how they interact or function in the future, which is the value of the protocol standard. It’s similar to the application layer adapting to users after the introduction of standards such as ERC20.
Below is the specific code example for adding Liquidity.
As you can see, you can quickly implement this function with just a few lines of core code.
const minLiquidity = await agent.getMinLiquidityByX(helloAmount, ammSlippageOfPercent)//Set the quantity and Slippage
const addLiquidityMessageId = await agent.addLiquidity(minLiquidity)//Initiate the message to add Liquidity
const addLiquidityResult = await getProcessResult(addLiquidityMessageId, ammProcess)// Get the result
Source code example:
Note lifecycle
Here we can switch to the perspective of Note and take another look at the trading process between users and AMM Agents.
When a user initiates an 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, and if it cannot be quickly executed, the Note will become invalid. AMM Agents act as makers.
All Notes will be stored centrally in the system’s Note Pool, which serves as a shared storage space for easy access by other entities.
Users select the most suitable quotation note from the front-end webpage and submit it to the Settlement Center for Settlement from the Note Pool. The Settlement Center is responsible for executing specific Settlement operations, such as swap here.
Note marked as ‘Settlement’, the Swap was successfully executed.
Here, the Settlement Center is a key component of the FusionFi Protocol, responsible for handling various Note Settlement operations within the system.
Actually, for the Orderbook Agent, it’s the same. The limit order in the Orderbook Agent itself is a Note, and its Settlement process is exactly the same as the quote agent created by the AMM Agent. This means that the FusionFi Protocol can actually integrate Liquidity from both AMM and order book.
This integration brings great benefits. In the swap scenario, Liquidity can come from user quotes or from market-making Nodes. Users can use routing protocols to find Liquidity throughout the entire Node pool, achieving the best execution price. AMM provides basic Liquidity to the market, but it has the issues of large price impact and Impermanent Loss. On the other hand, the order book allows users to act as independent Makers, suitable for large trades and users with specific price requirements. After the integration, AMM provides continuous Liquidity, while the order book reduces price impact and increases Depth, making large orders trading more efficient. This model meets the needs of different types of users, from retail investors to institutions, allowing them to find suitable trading methods and thereby improving capital utilization and driving further market maturity.
Multiple Note Atomic Settlement
The above example is limited to settling only one Note at a time, but in fact, the FusionFi Protocol can also support settling multiple Notes at once, and this type of settlement is atomic. All Notes in a single settlement must be settled before the status of the Note can be changed. Otherwise, the status of all Notes will not be changed.
This brings some very useful features:
Large transaction split: Large orders are difficult to be filled by a single counterparty. FFP supports splitting large orders, making full use of dispersed Liquidity.
Multiple Transactions Aggregated into One Order: Multiple transactions can be combined into one atomic order. This can to some extent improve the transaction speed, which is crucial for high-frequency traders and complex trading scenarios.
Multi-hop trading: Multi-hop trading is an extension of the merge order function. Assuming that in the swap scenario, a 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 merge order from A to B and B to C. Moreover, this multi-hop trading 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 takes two notes with interest rate differentials and settles them at the same time. You can see the picture below.
Image source:
Permaswap is the first AgentFi DEX built on the FusionFi Protocol, and it is currently the most mature DEX in the AO ecosystem. You can experience the above features at Permaswap (aopsn.com).
Settlement Center
Obviously, in the FusionFi Protocol, Settlement Center is a key component. It will process all the notes based on the time order, as long as the AO’s SU system is functioning properly, the time order can be obtained. Anyone can extract notes from the note pool and submit them to the Settle Center for Settlement.
When the volume of processing requests with notes expands, the Settlement Center can also easily scale out in a distributed manner, with multiple settlement processes to offload Settlement tasks. Depending on the pressure, the tasks are distributed to different settlement processes based on the ID of the note for processing.
The diversified applications of Note
The structured format of Note defined by the FusionFi Protocol actually has strong universality for various financial businesses. Therefore, the application of Note is diverse. It can be used not only to represent quotes for spot trading, but also for futures trading, contract trading, lending, and other scenarios. Therefore, FusionFi can integrate not only liquidity but also various financial forms.
Outlook
In my opinion, the essence of the internet world is multi-point trading. Therefore, solving high-frequency transactions between multiple groups has great value. The AgentFi model can cover almost all Decentralized Finance scenarios, while the FusionFi Protocol enables more efficient point-to-point matching between agents, and this matching is cross-protocol. Facing the Decentralized Finance field where competing for Liquidity is the main competition method and monopolizing Liquidity as the profit model, the changes brought by FusionFi Protocol are disruptive!
Of course, FusionFi Protocol is a brand new protocol standard, which may need to be continuously adjusted and optimized according to business needs. This can refer to the pattern of BIP (Bitcoin Improvement Proposal) for BTC and EIP (Ethereum Improvement Proposals) for Ethereum Improvement Proposals, absorbing creativity in co-creation.
Reference materials:
Smart Finance: From AgentFi to FusionFi
FusionFi Protocol: Core Element for Achieving AgentFi Interoperability
FusionFi Protocol Documentation
protocol Introduction.md
This article was first published on PermaDAO
Original link: