🏦Marketplace

The Capx marketplace is a dynamic platform where users can buy, sell, and trade AI agents and their fractions. By providing a centralized location for these transactions, Capx ensures liquidity, price discovery, and seamless interaction between buyers and sellers. This section explains the functionalities and benefits of the Capx marketplace and provides examples of how to list and trade AI agents.


Key Features of the Capx Marketplace

  1. Listing AI Agents:

    • Users can list their AI agents for sale or trade on the marketplace.

    • AI agents are represented as Non-Fungible Tokens (NFTs), allowing for transparent and secure ownership transfers.

  2. Trading Fractions:

    • AI agents can be fractionalized into ERC-20 tokens, enabling partial ownership.

    • These fractions can be traded on the marketplace, providing liquidity and investment opportunities for a broader audience.

  3. Price Discovery:

    • The marketplace facilitates price discovery through bidding and auction mechanisms.

    • Sellers can set reserve prices, and buyers can place bids to determine the market value of AI agents and their fractions.

  4. Liquidity Pools:

    • Liquidity pools enable users to trade AI agent fractions with minimal friction.

    • Liquidity pools are created with AI agent fractions on one side and Capx tokens on the other side.

    • By providing liquidity, users earn transaction fees, incentivizing active participation in the marketplace.


Listing AI Agents

To list an AI agent on the Capx marketplace, follow these steps:

  1. Navigate to the Marketplace:

    • Access the marketplace from the Capx dashboard by clicking on the "Marketplace" tab.

  2. Select Your AI Agent:

    • Choose the AI agent you want to list from your portfolio. If the AI agent is not yet tokenized, you will need to create an NFT for it.

  3. Set Listing Details:

    • Enter the listing details, including the sale price, reserve price (if applicable), and auction duration.

    • Provide a detailed description of the AI agent, highlighting its features and capabilities.

  4. List for Sale:

    • Confirm the listing, and your AI agent will be available for potential buyers to view and bid on.


Trading AI Agent Fractions

Fractional ownership enables multiple users to invest in a single AI agent. Here's how to trade AI agent fractions:

  1. Create Fractions:

    • Fractionalize your AI agent NFT into ERC-20 tokens using the provided Solidity contracts (as explained in the previous section).

    • Specify the total number of fractions and the initial price per fraction.

  2. List Fractions on the Marketplace:

    • Navigate to the "Marketplace" tab and select "List Fractions."

    • Enter the details for your fractional tokens, including the price and the number of fractions available for sale.

  3. Trading and Liquidity Pools:

    • Buyers can purchase fractions directly from the listing or trade fractions in liquidity pools.

    • Liquidity pools are created with AI agent fractions paired with Capx tokens, ensuring a stable market for trading.

    • Providing liquidity to these pools allows users to earn transaction fees, encouraging active participation.


Example Listing and Trading Workflow

  1. Create and List an AI Agent NFT:

    • Deploy the AgentNFT contract to create an NFT for your AI agent.

    • List the NFT on the marketplace with a set price or reserve price for auction.

// AgentNFT.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/access/Ownable.sol";

contract AgentNFT is ERC721, Ownable {
    uint256 public nextTokenId;

    constructor() ERC721("AgentNFT", "AIA") {}

    function mint(address to) external onlyOwner {
        _safeMint(to, nextTokenId);
        nextTokenId++;
    }
}
  1. Fractionalize and List Fractions:

    • Deploy the FractionalToken contract to create ERC-20 tokens representing fractions of your AI agent NFT.

    • List these fractions on the Capx marketplace, paired with Capx tokens to create liquidity pools.

// FractionalToken.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import "@openzeppelin/contracts/access/Ownable.sol";

contract FractionalToken is ERC20, Ownable {
    IERC721 public agentNFT;
    uint256 public tokenId;
    bool public fractionsCreated;

    constructor(address _agentNFT, uint256 _tokenId) ERC20("AgentFraction", "AIF") {
        agentNFT = IERC721(_agentNFT);
        tokenId = _tokenId;
        fractionsCreated = false;
    }

    function createFractions(uint256 amount) external onlyOwner {
        require(agentNFT.ownerOf(tokenId) == address(this), "Contract does not own the NFT");
        require(!fractionsCreated, "Fractions already created");
        _mint(msg.sender, amount);
        fractionsCreated = true;
    }

    function redeem(uint256 amount) external {
        require(fractionsCreated, "Fractions not created yet");
        _burn(msg.sender, amount);
        if (totalSupply() == 0) {
            agentNFT.transferFrom(address(this), msg.sender, tokenId);
            fractionsCreated = false;
        }
    }
}

How to Use the Contracts

  1. Deploy the AgentNFT Contract:

    • Deploy the AgentNFT contract to create NFTs representing AI agents.

    • Use the mint function to create a new NFT for each AI agent.

  2. Deploy the FractionalToken Contract:

    • Deploy the FractionalToken contract with the address of the AgentNFT contract and the tokenId of the AI agent NFT.

    • Use the createFractions function to mint ERC-20 tokens representing fractions of the AI agent NFT.

  3. Create Liquidity Pools:

    • Pair the fractional tokens with Capx tokens to create liquidity pools on the Capx marketplace.

    • Users can trade fractions of AI agents in these pools, providing liquidity and earning transaction fees.

  4. Trading and Redeeming Fractions:

    • Users can buy and sell fractions in the liquidity pools.

    • Users who accumulate all fractions can redeem them for full ownership of the AI agent NFT.


The Capx marketplace provides a robust platform for monetizing AI agents through listing, trading, and fractional ownership. By leveraging liquidity pools with Capx tokens, the marketplace ensures liquidity and price discovery, making it easier for users to buy, sell, and trade AI agents and their fractions. This innovative approach democratizes access to AI technology, enabling more users to invest in and benefit from AI agents on Capx.

Last updated