Phala Network Docs
  • Home
    • 👾Phala Network Docs
  • Overview
    • ⚖️Phala Network
      • 💎Phala Cloud
      • 🥷Dstack
      • 🔐GPU TEE
    • 💎PHA Token
      • 🪙Introduction
      • 👐Delegation
        • Delegate to StakePool
        • What is Vault
        • What is Share
        • WrappedBalances & W-PHA
        • Examples of Delegation
        • Use Phala App to Delegate
        • Estimate Your Reward
      • 🗳️Governance
        • Governance Mechanism
        • Join the Council
        • Voting for Councillors
        • Apply for Project Funding
        • Phala Treasury
        • Phala Governance
        • Setting Up an Account Identity
  • Phala Cloud
    • 🚀Getting Started
      • Sign-up for Cloud Account
      • Start from Cloud UI
      • Start from Cloud CLI
      • Start from Template
    • 🟧Launch an Eliza Agent
    • 📦Create CVM
      • Create CVM with Docker Compose
      • Create CVM with Private Docker Image
      • Set Secure Environment Variables
      • Access Your Applications
      • Setting Up Custom Domain
      • Debug Your Application
      • Deployment Cheat Sheet
    • ⚙️CVM Management
      • Upgrade Application
      • Resize Resources
      • Check Logs
      • Private Log Viewer
    • 🔄Deploy Docker App in TEE
      • Expose Service Port
      • Generate RA Report
      • Access Database
      • Create Crypto Wallet
    • 🛳️Setup a CI/CD Pipeline
    • 🛠️Phala Cloud CLI Reference
      • phala
        • auth
        • cvms
        • docker
        • simulator
    • Production Checklist
    • ❓FAQs
    • 🔍Troubleshooting
    • 📖Glossary
    • 📋References
    • 🔒Use Cases
      • TEE with AI
      • TEE with FHE and MPC
      • TEE with ZK and ZKrollup
  • Dstack
    • Overview
    • Getting Started
    • Hardware Requirements
    • Design Documents
      • Decentralized Root-of-Trust
      • Key Management Protocol
      • Zero Trust HTTPs (TLS)
    • Acknowledgement
  • LLM in GPU TEE
    • 👩‍💻Host LLM in GPU TEE
    • 🔐GPU TEE Inference API
    • 🏎️GPU TEE Benchmark
  • Tech Specs
    • ⛓️Blockchain
      • Blockchain Entities
      • Cluster of Workers
      • Secret Key Hierarchy
  • References
    • 🔐Setting Up a Wallet on Phala
      • Acquiring PHA
    • 🌉SubBridge
      • Cross-chain Transfer
      • Supported Assets
      • Asset Integration Guide
      • Technical Details
    • 👷Community Builders
    • 🤹Hackathon Guides
      • ETHGlobal Singapore
      • ETHGlobal San Francisco
      • ETHGlobal Bangkok
    • 🤯Advanced Topics
      • Cross Chain Solutions
      • System Contract and Drivers
      • Run Local Testnet
      • SideVM
    • 🆘Support
      • Available Phala Chains
      • Resource Limits
      • Transaction Costs
      • Compatibility Matrix
      • Block Explorers
      • Faucet
    • ⁉️FAQ
  • Compute Providers
    • 🙃Basic Info
      • Introduction
      • Gemini Tokenomics (Worker Rewards)
      • Budget balancer
      • Staking Mechanism
      • Requirements in Phala
      • Confidence Level & SGX Function
      • Rent Hardware
      • Error Summary
    • 🦿Run Workers on Phala
      • Solo Worker Deployment
      • PRBv3 Deployment
      • Using PRBv3 UI
      • PRB Worker Deployment
      • Switch Workers from Solo to PRB Mode
      • Headers-cache deployment
      • Archive node deployment
    • 🛡️Gatekeeper
      • Collator
      • Gatekeeper
  • Web Directory
    • Discord
    • GitHub
    • Twitter
    • YouTube
    • Forum
    • Medium
    • Telegram
  • Legacy
    • Information
    • ⚒️Phala SDK
    • 👨‍🚀Builders Program
    • 🥷AI Agent Contract
      • WapoJS Functions
      • Phala Agent Gateway
  • AI Agent Contract (Legacy)
    • 👩‍💻Getting Started
      • Build Your First AI Agent Contract
      • Build An Agent to Transact Onchain
      • Build Your AI Agent Contract with OpenAI
      • Build Your AI Agent Contract with LangChain
      • Integrate with 3rd Party API with HTTP Request
      • Run a Local Testnet With Docker
      • AI Agent Contract Templates
    • 🧙‍♂️Examples
      • Create a Weather Agent w/ Function Calling
    • ⛓️Supported Chains
    • FAQ
  • Agent Wars (Legacy)
    • 📜Introduction
    • 💸Tokenomics
    • ▶️Getting Started
      • Wallet Setup & Get PHA
      • Buy and Sell Keys
    • 🧑‍🏫Tutorial
Powered by GitBook
LogoLogo

Participate

  • Compute Providers
  • Node
  • Community
  • About Us

Resources

  • Technical Whitepaper
  • Token Economics
  • Docs
  • GitHub

More

  • Testnet
  • Explorer
  • Careers
  • Responsible Disclosure

COPYRIGHT © 2024 PHALA.LTD ALL RIGHTS RESERVED. May Phala be with you!

On this page
  • How to buy a key
  • How to sell a key
  • Key Bonding Curve

Was this helpful?

Edit on GitHub
  1. Agent Wars (Legacy)
  2. Getting Started

Buy and Sell Keys

PreviousWallet Setup & Get PHANextTutorial

Last updated 21 days ago

Was this helpful?

WARNING

This section is no longer recommended for deploying on Phala. To build and deploy securely and efficiently, please use the fully managed platform instead. Check out the doc on how to .

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 , 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.

How to buy a key

You can easily buy keys on AgentWar Dapp

  1. Click the Agent you want to buy on the Explore page

  2. You can find the details of the key on the Agent page. Note that the free chats are limited without a key.

  3. 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.

  4. 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.)

  5. After buying the key, you can find the number of keys you hold in the "Holders" tab.

How to sell a key

  1. Click "Trade" button in the detail page of the agent you want to sell

  2. 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.

  3. Click "SELL" button to confirm the onchain transaction. You will sign it in your connected wallet.

  4. Congratulations! Now you have sold the key to earn the profit.

Key Bonding Curve

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.

Total Keys
Price in PHA
Price in USD (PHA @ 0.15)

1

0.05

0.0075

10

5

0.75

50

125

18.75

500

2974

446.10

1000

4009

601.35

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.

To learn the details of the formula, please refer to .

▶️
Phala Cloud
get started
bonding curves
Agent Keys