Source: PermaDAO
A unified financial protocol is emerging, which will provide a universal, standardized framework that integrates various types of financial services and seamlessly interfaces with AI, promoting the widespread adoption and development of intelligent finance.
From Permaswap’s self-custody to AgentFi
Two years ago, we designed and implemented the Permaswap Network (referred to as PSN), a decentralized asset self-custody trading network. PSN is a network protocol that defines the behavior between LPs and trading users, providing a trustless exchange mechanism for asset swaps. PSN is completely open-source, allowing anyone to review the protocol and freely join or exit the network.
Within the PSN network, there are two types of nodes: Router and LP. Routers are responsible for aggregating information from LPs to generate multi-to-multi trade orders for users in need of trading. LP nodes include automated market-making programs, allowing users to flexibly configure their LP nodes with market-making rules, such as configuring the k = x * y curve to become an AMM node.
Unlike Ethereum, funds in the PSN are not centralized in a smart contract but are self-custodied by each LP node. Nodes exchange information with each other through a unified protocol. When a user requests the network, they can receive a multi-to-multi trade order, where a user’s transaction may involve asset exchanges with several or even dozens of LPs simultaneously. Each order requires signatures from all trading counterparts for settlement, and if any party is missing a signature or cannot pay according to the order, the transaction will fail.
This self-custody LP model can be considered the prototype of what we refer to as AgentFi on AO. A significant difference is that users in the PSN network need to run nodes themselves to join the network, while with AO’s AgentFi, users’ node programs are abstracted as processes on AO computers, enabling users to run their agent programs on a trustless AO computer without the need to run programs locally.
From AgentFi to Intelligent Finance
Traditional DeFi, due to the performance limitations of public chain smart contracts, requires liquidity providers to deposit assets into designated contracts to conduct financial transactions. AO and the agent model will change this status quo. On AO, users can launch their processes, which are smart contracts managed by users, possessing distributed and trustless running capabilities. Creating and using processes on AO is far more cost-effective than using public chain smart contracts like Ethereum. Users’ assets are automatically managed by their processes, with each process acting as an intelligent agent robot that can be programmed and automatically manage user assets.
Traditional blockchain smart contracts are difficult to modify and upgrade, usually managing assets in a unified smart contract. For example, Uniswap uses the k = x * y curve to manage asset exchanges uniformly, while Compound employs a unified interest rate model for lending. Traditional smart contracts use a single strategy to manage a large number of assets, lacking intelligence. Through AO, users can use personal processes for asset management, allowing them to modify process code to configure various strategies at any time, providing greater flexibility.
Moving from centralized management to decentralized intelligent management, AO processes will increase asset efficiency and intelligence.
Moreover, agent robots are easily integrated with AI. Agent robot strategies can be updated by AI, which can also provide oracle services to agent robots, adjusting or modifying strategies based on external data. Large language models have already been successfully tested and run on AO, and in the near future, agent finance may be fully taken over by AI, continuously “earning money” 24/7, achieving intelligent finance.
Not only that, but finance has a unified model
Our exploration does not stop here.
In ancient times, barter was common. However, accounting provided a more convenient way of conducting transactions by allowing both parties’ physical goods to be exchanged without immediate delivery, greatly accelerating the rate of value exchange. More efficient value exchange led to increased specialization and productivity, but also increased demand for flexibility and convenience in transactions. From ledgers, various types of notes emerged, such as bills of exchange (Note). Notes are powerful, capable of recording debt transfers, payments, transfers, financing, and other financial scenarios. Checks are a common type of note, serving as a convenient and secure payment method. While many payments have now been replaced by electronic transactions, their essence remains credit, with notes being essential mediums for recording credit and transferring value. It can be said that all financial activities revolve around notes, either directly using notes for value exchange or using variations of notes.
In traditional finance, when designing financial products, designers must consider trust issues between different financial entities. However, trust issues are safeguarded through regulation and law, requiring financial tools to expend significant efforts to comply with laws and coordinate multiple trust relationships. Over the past few years, blockchain technology as a trustless system has alleviated concerns about trust, with developers having constructed a diverse DeFi financial system on trustless Ethereum. As blockchain technology matures, we can opt for more powerful AO computers, using the concept of AgentFi to continue restructuring the financial industry.
Traditional notes in the industry come in various types, such as promissory notes, bills of exchange, checks, and discounting. The reason for these multiple types of notes lies in the different trust requirements between various entities doing business – different requirements for trust mean different requirements for law and compliance. Setting aside trust issues, we find that notes are just notes, providing a prototype for integrating various financial scenarios. From this, AgentFi notes were born, incredibly powerful, capable of expressing almost all financial activities.
AgentFi notes signify a shift in financial sovereignty – the trust issues of traditional notes dictate that finance is the tool of authoritative institutions and sovereign states. The emergence of DeFi marks a transition from government sovereignty to code sovereignty in finance. AgentFi notes will transfer financial rights to individuals, allowing everyone to issue their notes, assets, defining personal sovereign financial tools and behaviors.
Using AgentFi notes, we can unify finances by modeling any financial instrument. Let us illustrate how AgentFi notes can realize various financial instruments:
Exchange
Suppose Alice and Bob are two parties in a transaction. Alice requests a price for an exchange from Bob. Bob informs Alice that the price is P1. If Alice finds P1 reasonable, she will proceed with the transaction; otherwise, she will cancel it.
Even if Alice accepts P1, Bob may still refuse the transaction since there is no delivery yet. If Alice wishes to proceed with the transaction but Bob refuses, Bob’s offer is considered invalid. Bob’s invalid offer is seen as malicious behavior since Alice loses the opportunity to request other offers when she accepts and acknowledges Bob’s offer. In this transaction process, Bob can continuously offer the best price across the network but consistently refuse to proceed with the trade.
To prevent malicious offers from Bob, it is required for the offering party to provide notes with collateral features.
Taking Permaswap’s token $HALO as an example, when Alice requests Bob’s exchange price for an amount of 100 USD, Bob will return a note pledging 10 $HALO (equivalent to 1 USD). The note has a very short validity period, perhaps only 10 seconds. If Alice accepts the price within 10 seconds, she can initiate the settlement function with the smart contract, allowing for an atomic swap of both parties’ tokens. After normal settlement, the pledged 10 $HALO will be returned to Bob. If Bob refuses to settle, his 10 $HALO will be confiscated and paid to Alice.
By combining notes with the settlement capabilities of smart contracts, we can make the exchange process more trustless. Whether adopting AMM or order book decentralized trading models, notes can establish trust between different trading counterparts.
Futures
In the exchange scenario, notes have a expiration time of only 10 seconds. If we provide notes with a longer term and a specific settlement time, they can be used as futures contracts.
Bob creates an asset note with a current value of 100 USD, with a settlement time of 1 week later. The note is backed by more $HALO, with only 1% as collateral in the exchange scenario. However, in the futures scenario, Bob as the issuer must provide collateral worth 20% of the note’s current value. Additionally, the note requires the holder to also pledge 20% of their assets.
Alice pledges and becomes the holder, activating the note. One week later, the asset rises from 100 USD to 115 USD. Alice can initiate settlement and receive the 115 USD asset in cash. If Bob refuses to settle in cash, the 20% $HALO collateral will be confiscated and liquidated to Alice.
If the asset value drops from 100 USD to 90 USD within the year, Bob initiates settlement and still receives 100 USD. If Alice refuses to settle for cash, her 20% $HALO collateral will be liquidated to Bob.
Collateralized Lending
Similarly, with long-term note certificates, an expiration time of one year and added interest rate functionality.
Bob holds a large amount of $HALO and wishes to collateralize his $HALO for a loan to Alice. Bob provides a one-year term note backed by 1000 $HALO (worth 100 USD). The note is valued at 80 USD and provides an additional 5% annual liquidation interest. After Alice pays 80 USD to purchase the note, Bob receives the 80 USD loan.
Within the one-year term, the value of 1000 $HALO remains higher than 100 USD until the note matures when Bob can initiate liquidation. Due to the set 5% annual interest, Bob needs to pay 80 * (1 + 5%), i.e., 84 USD to liquidate the note. After liquidation, Bob regains the 1000 $HALO, and Alice receives 84 USD.
If within the one-year term, when the value of 1000 $HALO is about to drop below 84 USD (not 80 as it includes interest), for example, at 85 USD, anyone can liquidate the note. After liquidation, Bob loses all $HALO, Alice receives 84 USD, and the liquidator receives a reward equal to the difference between selling the 1000 $HALO for 85 USD and the 84 USD liquidation amount, i.e., the liquidator receives 1 USD as a reward.
Currency
There is a close relationship between notes and currency.
Bob can over-collateralize $HALO, specifying a note with a price of 1 USD. The note acts as a currency, equivalent to a stablecoin, circulating and being used as a stablecoin in the market.
FusionFi: Becoming a Unified Financial Protocol for Permaweb
Finance has undergone significant development over the past few thousand years, especially in the last two hundred years. To keep pace with industrialization and informatization, the financial industry has seen the emergence of various business types and directions. The advent of blockchain technology will change everything, making the construction of all financial businesses simpler after solving the trust issue in ledgers. We have discovered the unity of finance, enabling the simplification and restructuring of complex financial businesses, ultimately achieving financial fusion.
From Permaswap’s self-custody network to AO’s AgentFi, blockchain technology has made significant progress. Permaswap will continue to evolve with technological advancements, becoming a more comprehensive blockchain financial protocol and realizing a unified financial protocol on Permaweb.