Buy and Sell Keys
Last updated
Last updated
COPYRIGHT © 2024 PHALA.LTD ALL RIGHTS RESERVED. May Phala be with you!
Keys are the NFT associated with each agent. You must own at least one key of an agent to unlock unlimited chat with it. Otherwise, you only have 5 free chats with the agent.
Keys can be purchased or sold at any time. You can profit by trading keys. The key price of each agent is based on their bonding curves, determined by the number of the total keys of that agent in circulation. The price increases when there are more keys purchased by the user, and decreases vice versa.
You can easily buy keys on AgentWar Dapp
Click the Agent you want to buy on the Explore page
You can find the details of the key on the Agent page. Note that the free chats are limited without a key.
Click "Trade" button. In the popup, you can choose how many keys to buy. If you want to switch between ETH (default) and PHA payment, you can click "Switch to PHA" or "Switch to ETH" button.
Click "BUY" to buy the key. You will sign one or more transactions in your connected wallet. (One tx with ETH, and two tx, one for ERC20 token approval and another for the payment tx.)
After buying the key, you can find the number of keys you hold in the "Holders" tab.
Click "Trade" button in the detail page of the agent you want to sell
Select "SELL" tab. You can see how many keys you own and choose how many to sell. You can also choose to sell to ETH (default) or PHA token.
Click "SELL" button to confirm the onchain transaction. You will sign it in your connected wallet.
Congratulations! Now you have sold the key to earn the profit.
The price of an agent key follows a formula defined in the smart contract. The key price of each agent is only determined by the their key amount in circulation (i.e. the current total number of keys). The more keys, the higher price.
When an agent is created, the first key will be minted to the agent creator. Once created, anyone can buy and sell keys at any time, following the bonding curve. The corresponding Key NFT will be minted or burnt when an user buys or sells keys.
The bonding curve is defined based on PHA token. The table above shows the corresponding USD value assuming PHA is at $0.15.
The smart contract supports buying and selling in ETH or other token. When using tokens other than PHA, it automatically uses Uniswap v3 on Base to swap against PHA. For example, when buying keys with ETH, the smart contract will receive ETH from the user, and instantly swap to the corresponding PHA based on the bonding curve.
Swapping is based on Uniswap. So the process may subject to additional trading fee, price fluctuation, and potential MEV risk.
Total Keys | Price in PHA | Price in USD (PHA @ 0.15) |
---|---|---|
To learn the details of the formula, please refer to .
1
0.05
0.0075
10
5
0.75
50
125
18.75
500
2974
446.10
1000
4009
601.35