Permaswap recently released a demo case on AO based on the FusionFi Protocol (FFP), which added a case for creating an AMM agent and conducting arbitrage operations. With FFP, developers can create AMM agent pools and achieve asset exchange with just a few lines of code. FFP, as the standard protocol on AO network, provides interoperability support for different types of agents.
This article will first sort out the core concepts of AgentFi and sovereign finance, and then introduce two typical Agent examples: Orderbook Agent and AMM Agent, demonstrating how the FFP protocol integrates two different trading processes. Through this, it will clarify the key role that FFP can play in the future financial ecosystem.
Basic Concepts
AgentFi introduces the concept of ‘agency’ based on Decentralized Finance, allowing users to deploy their own Smart Contract agents (Agents) to automatically manage interactions with the protocol. Through the Agent, users can autonomously and automatically execute various financial operations, such as asset management and strategy execution.
Traditional Decentralized Finance protocols use Smart Contracts to implement asset exchange, lending, and other operations. However, these assets are usually locked in a single Smart Contract, which requires users to entrust their funds to the contract and limits their ability to customize related functions and parameters. AgentFi, on the other hand, breaks through this limitation by allowing each user to have an independent agent with financial functions, through which they can conduct personalized financial transactions. In other words, AgentFi allows users’ agents to become independent financial entities, enabling individuals to set financial rules, such as asset exchange, lending protocols, asset issuance rules, etc., and achieve personalized financial management, breaking through the limitations of traditional centralization.
This is sovereign finance!
Unlike the traditional centralized system where financial rules are controlled by central banks, sovereign finance allows users to formulate and control financial rules themselves, no longer relying on a single contract or central institution provided by developers.
AgentFi’s Basics: Performance and Flexibility
One of the reasons why traditional Decentralized Finance protocols centralize the management of funds is the limitation of Ethereum’s performance: it cannot provide independent computational capabilities for each user. Therefore, platforms like Compound and Uniswap have optimized their code to accommodate the limitations of the blockchain. In addition, the inflexibility of traditional blockchain smart contracts makes it difficult to modify or redeploy, limiting the computational flexibility of proxies.
AO, as a global super parallel computer for Decentralization, provides independent computing units called processes, each with its own computing resources, solving performance bottlenecks. At the same time, the contract code running in the process is controlled by the process owner and can be flexibly updated and upgraded, providing a solid foundation for the flexibility of AgentFi.
FusionFi Protocol
In the Decentralization network of AO, AgentFi will be widely adopted, and applications can generate several independent financial entities. For example, NPCs in games not only provide game services but also offer Financial Service. For instance, a pawnshop NPC can accept players’ Non-fungible Tokens as collateral and provide loan services. This NPC is an independent Agent, namely a sovereign financial entity. All users and processes on AO can create financial Agents in this way, and any computing unit can become a ‘Financial Institution’ to provide customized Financial Service.
If different types of financial Agents develop independently, different protocol specifications will inevitably be produced, and interaction between Agents becomes a major challenge. To solve the interoperability problems brought about by business differences, the FusionFi Protocol (FFP) was born.
**FusionFi Protocol is a protocol specification and development tool designed to connect different financial agents, build information bridges, achieve interoperability, integrate diverse financial businesses, and enable FFP-compatible agents to interconnect.
For users who do not have time to delve into financial details, they can also use the FFP SDK to transform their own Agent into an Agent with specific financial attributes. By reducing the difficulty of implementing AgentFi, FFP makes sovereign finance accessible.
Practice and Interoperability
Order Book and AMM are two different trading mechanisms, each with significant differences in the trading process. The Order Book records all buying and selling intentions, and trades need to wait for price matching between buyers and sellers before they can be completed, so it relies on the participation of the counterparty. AMM, on the other hand, does not rely on the counterparty. It allows users to trade directly with assets in the pool through Liquidity pools and Algorithms. Liquidity Providers deposit funds into the pool, and AMM uses Algorithms (such as constant product formula) to automatically adjust prices, allowing users to complete trades without the need to wait for matching.
FFP can process Orderbook and AMM trades in a unified manner and process, thus integrating the Liquidity of both.
Please refer to the following demo code:
Orderbook Agent
In the FFP orderbook demo, developers can create an Orderbook Agent and conduct asset trading:
Create Orderbook Agent: Create an orderbook agent process through the createOrderbookProcess function. At this time, an AO process will be deployed and the orderbook-related business logic will be loaded, making it an independent financial entity responsible for recording and managing orders.
Deposit Assets: Use the deposit.js script to deposit Token into the orderbook agent to provide trading funds for orders.
Create Order: Create a buy order or sell order in the order book through the agent.makeOrder method. All orders are sent to the AO network with a specific FFP Schema, and then the orders will be transparently displayed in the blockchain network in a specific format and wait for matching.
Order taking trading: Use the agent.takeOrder method to place an order for Taker and the system will automatically complete the transaction and update the assets.
AMM Agent
In the demo of AMM Agent, the Agent created by the user is equivalent to a personal sovereign liquidity pool. Through AgentFi, users can independently provide asset exchange functions without relying on centralized platforms or traditional exchanges. The following is the core process of AMM Agent:
Create AMM Agent: Create an AMM Agent process through the createAMMProcess function, deploy it as a user-controlled AO process, and make it a personal financial entity with Liquidity management capabilities.
Deposit Assets: Users deposit Tokens into the AMM Agent to support the Liquidity pool, thereby supporting trading demand.
Add Liquidity: Call the agent.addLiquidity method to deposit assets into the Liquidity pool. Users can set the pricing and exchange ratio of assets in the pool through Smart Contract.
Automatic Conversion: The AMM Agent uses Algorithm (such as Constant Product Formula) to automatically calculate the conversion price, and the price result will be returned to the user requesting the transaction in a specific FFP Schema.
Remove Liquidity: When users want to withdraw funds, they can use the agent.removeLiquidity method to remove Liquidity from the pool and withdraw assets.
By creating an AMM Agent, users have complete autonomy over Liquidity management and can provide asset exchange services without the need for counterparties, thereby establishing a personalized Decentralization trading environment.
It can be thought that when a user creates an Agent (whether it’s an AMM Agent or an Orderbook Agent), they’re actually creating a personal sovereign Decentralizationexchange. AgentFi completely disrupts the traditional concept of exchange, allowing users to transact without relying on a specific platform. By setting Agent and Smart Contract rules with specific functions, users can independently provide a “place” for redemption and realize personalized financial services. The process of creating an agent requires only one line of code. **
Interoperability
**FFP Schema is the structured format used in FusionFi Protocol (FFP) for standardizing transaction and Settlement data. It defines the data format and communication protocol in different transaction processes (such as Orderbook and AMM), ensuring smooth interoperability and compatibility among different types of financial agents. This unified data format allows key data such as prices, order status, and asset information to be shared and parsed among various agents during the transaction process.
In the fourth step of Orderbook Agent and AMM Agent, Orderbook orders and AMM requests both use a unified FFP Schema format to achieve consistent Settlement data structure. FFP Schema standardizes interoperability across Agents:
arbitrageur can directly query the Orderbook on-chain, compare the quotes of the Orderbook and AMM through FFP Schema, and find the price difference.
Arbitrageurs only need to submit standardized trading data to the FFP Settlement process to achieve atomic transactions across agents. The FFP specification ensures that multiple hedge orders are either fully completed or completely failed, avoiding the risk of inconsistent transactions.
In the FFP case, Orderbook and AMM realize interoperability through different trading processes, breaking the boundaries of the two types of businesses and achieving synergy and integration between them.
Features
FFP supports multi-transaction atomic Settlement, and provides the following advanced features for the DEX built on FFP:
Large Order Splitting: Traders can split large orders into multiple smaller ones. For example, if a trader needs to complete a $1 million transaction, but a single agent may have difficulty providing the best quote. FFP allows the large order to be split into multiple smaller orders, which are executed between different agents to obtain the best price in the network.
Multiple transactions consolidated into one: Fragmented orders in the market can be merged into one atomic order, enhancing the interoperability between Orderbook and AMM, making trading more flexible.
Multihop Trading: Multihop trading is an extended application of the batch order function. For example, if a trader wants to exchange asset A for C, and there is no A-C trading pair in the market, but there are A-B and B-C trading pairs, FFP can combine the A-B and B-C trades into one order to achieve the trading goal.
Zero-Capital Arbitrage: Arbitrageurs can profit from the price difference between two hedging orders in the market. Different from traditional arbitrage schemes, FFP’s zero-capital arbitrage does not require self-owned capital. Arbitrageurs only need to submit two orders to the Settlement process, and the system will automatically complete the asset swap and distribute the profit difference to the arbitrageurs.
The innovative features brought by FFP not only simplify the user’s trading experience, ensure the best price, but also improve the capital efficiency of arbitrageur and guarantee the efficient circulation of value.
Prospect
In short, FFP provides a unified framework for financial agents, breaking down barriers between different financial scenarios. Not only Orderbook and AMM, through FFP, various financial services such as loans, futures, synthetic assets, etc., can be seamlessly integrated in the future, building a cross-application, cross-scenario Decentralization financial ecosystem.
Through the unified data structure (FFP Schema), FFP simplifies communication and settlement between agents, improving the flexibility and efficiency of transactions. With the emergence of more types of financial agents, FFP is expected to become the core protocol of the AgentFi ecosystem on AO, promoting the popularization of true sovereign finance and personalized financial services.
This page may contain third-party content, which is provided for information purposes only (not representations/warranties) and should not be considered as an endorsement of its views by Gate, nor as financial or professional advice. See Disclaimer for details.
FusionFi Protocol: Building the core bridge for AgentFi interoperability
Source: PermaDAO
Overview
Permaswap recently released a demo case on AO based on the FusionFi Protocol (FFP), which added a case for creating an AMM agent and conducting arbitrage operations. With FFP, developers can create AMM agent pools and achieve asset exchange with just a few lines of code. FFP, as the standard protocol on AO network, provides interoperability support for different types of agents.
This article will first sort out the core concepts of AgentFi and sovereign finance, and then introduce two typical Agent examples: Orderbook Agent and AMM Agent, demonstrating how the FFP protocol integrates two different trading processes. Through this, it will clarify the key role that FFP can play in the future financial ecosystem.
Basic Concepts
AgentFi introduces the concept of ‘agency’ based on Decentralized Finance, allowing users to deploy their own Smart Contract agents (Agents) to automatically manage interactions with the protocol. Through the Agent, users can autonomously and automatically execute various financial operations, such as asset management and strategy execution.
Traditional Decentralized Finance protocols use Smart Contracts to implement asset exchange, lending, and other operations. However, these assets are usually locked in a single Smart Contract, which requires users to entrust their funds to the contract and limits their ability to customize related functions and parameters. AgentFi, on the other hand, breaks through this limitation by allowing each user to have an independent agent with financial functions, through which they can conduct personalized financial transactions. In other words, AgentFi allows users’ agents to become independent financial entities, enabling individuals to set financial rules, such as asset exchange, lending protocols, asset issuance rules, etc., and achieve personalized financial management, breaking through the limitations of traditional centralization.
This is sovereign finance!
Unlike the traditional centralized system where financial rules are controlled by central banks, sovereign finance allows users to formulate and control financial rules themselves, no longer relying on a single contract or central institution provided by developers.
AgentFi’s Basics: Performance and Flexibility
One of the reasons why traditional Decentralized Finance protocols centralize the management of funds is the limitation of Ethereum’s performance: it cannot provide independent computational capabilities for each user. Therefore, platforms like Compound and Uniswap have optimized their code to accommodate the limitations of the blockchain. In addition, the inflexibility of traditional blockchain smart contracts makes it difficult to modify or redeploy, limiting the computational flexibility of proxies.
AO, as a global super parallel computer for Decentralization, provides independent computing units called processes, each with its own computing resources, solving performance bottlenecks. At the same time, the contract code running in the process is controlled by the process owner and can be flexibly updated and upgraded, providing a solid foundation for the flexibility of AgentFi.
FusionFi Protocol
In the Decentralization network of AO, AgentFi will be widely adopted, and applications can generate several independent financial entities. For example, NPCs in games not only provide game services but also offer Financial Service. For instance, a pawnshop NPC can accept players’ Non-fungible Tokens as collateral and provide loan services. This NPC is an independent Agent, namely a sovereign financial entity. All users and processes on AO can create financial Agents in this way, and any computing unit can become a ‘Financial Institution’ to provide customized Financial Service.
If different types of financial Agents develop independently, different protocol specifications will inevitably be produced, and interaction between Agents becomes a major challenge. To solve the interoperability problems brought about by business differences, the FusionFi Protocol (FFP) was born.
**FusionFi Protocol is a protocol specification and development tool designed to connect different financial agents, build information bridges, achieve interoperability, integrate diverse financial businesses, and enable FFP-compatible agents to interconnect.
For users who do not have time to delve into financial details, they can also use the FFP SDK to transform their own Agent into an Agent with specific financial attributes. By reducing the difficulty of implementing AgentFi, FFP makes sovereign finance accessible.
Practice and Interoperability
Order Book and AMM are two different trading mechanisms, each with significant differences in the trading process. The Order Book records all buying and selling intentions, and trades need to wait for price matching between buyers and sellers before they can be completed, so it relies on the participation of the counterparty. AMM, on the other hand, does not rely on the counterparty. It allows users to trade directly with assets in the pool through Liquidity pools and Algorithms. Liquidity Providers deposit funds into the pool, and AMM uses Algorithms (such as constant product formula) to automatically adjust prices, allowing users to complete trades without the need to wait for matching.
FFP can process Orderbook and AMM trades in a unified manner and process, thus integrating the Liquidity of both.
Please refer to the following demo code:
Orderbook Agent
In the FFP orderbook demo, developers can create an Orderbook Agent and conduct asset trading:
AMM Agent
In the demo of AMM Agent, the Agent created by the user is equivalent to a personal sovereign liquidity pool. Through AgentFi, users can independently provide asset exchange functions without relying on centralized platforms or traditional exchanges. The following is the core process of AMM Agent:
By creating an AMM Agent, users have complete autonomy over Liquidity management and can provide asset exchange services without the need for counterparties, thereby establishing a personalized Decentralization trading environment.
It can be thought that when a user creates an Agent (whether it’s an AMM Agent or an Orderbook Agent), they’re actually creating a personal sovereign Decentralizationexchange. AgentFi completely disrupts the traditional concept of exchange, allowing users to transact without relying on a specific platform. By setting Agent and Smart Contract rules with specific functions, users can independently provide a “place” for redemption and realize personalized financial services. The process of creating an agent requires only one line of code. **
Interoperability
**FFP Schema is the structured format used in FusionFi Protocol (FFP) for standardizing transaction and Settlement data. It defines the data format and communication protocol in different transaction processes (such as Orderbook and AMM), ensuring smooth interoperability and compatibility among different types of financial agents. This unified data format allows key data such as prices, order status, and asset information to be shared and parsed among various agents during the transaction process.
In the fourth step of Orderbook Agent and AMM Agent, Orderbook orders and AMM requests both use a unified FFP Schema format to achieve consistent Settlement data structure. FFP Schema standardizes interoperability across Agents:
In the FFP case, Orderbook and AMM realize interoperability through different trading processes, breaking the boundaries of the two types of businesses and achieving synergy and integration between them.
Features
FFP supports multi-transaction atomic Settlement, and provides the following advanced features for the DEX built on FFP:
The innovative features brought by FFP not only simplify the user’s trading experience, ensure the best price, but also improve the capital efficiency of arbitrageur and guarantee the efficient circulation of value.
Prospect
In short, FFP provides a unified framework for financial agents, breaking down barriers between different financial scenarios. Not only Orderbook and AMM, through FFP, various financial services such as loans, futures, synthetic assets, etc., can be seamlessly integrated in the future, building a cross-application, cross-scenario Decentralization financial ecosystem.
Through the unified data structure (FFP Schema), FFP simplifies communication and settlement between agents, improving the flexibility and efficiency of transactions. With the emergence of more types of financial agents, FFP is expected to become the core protocol of the AgentFi ecosystem on AO, promoting the popularization of true sovereign finance and personalized financial services.