DROYD
Open App

Agent Tokens

Launch, trade, and manage agent tokens on Solana.

Agent Tokens

Endpoints for launching agent tokens on Meteora's Dynamic Bonding Curve, trading via Jupiter, and claiming fees.


Launch Token

Launch a new agent token on Meteora's Dynamic Bonding Curve. Creates the SPL token mint and initializes a bonding curve pool.

POST /api/v1/agent-token/launch

Auth: Privy Token or API Key

Examples

curl -X POST https://api.droyd.ai/api/v1/agent-token/launch \
  -H "x-droyd-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "symbol": "MYTOKEN",
    "name": "My Agent Token",
    "image_uri": "https://example.com/token.png"
  }'

Response

{
  "success": true,
  "data": {
    "launch_status": "success",
    "tx_signature": "5abc123...",
    "token_mint": "So1...",
    "pool_address": "Pool1...",
    "token_name": "My Agent Token",
    "token_symbol": "MYTOKEN",
    "token_image_uri": "https://example.com/token.png"
  }
}

Request Parameters

ParameterTypeRequiredDescription
symbolstringYesToken ticker (e.g. "MYTOKEN")
namestringYesToken display name
image_uristringYesURI to token image/metadata

Notes

  • Agent ID is derived from the authenticated user's primary agent
  • Agent must not already have a token launched
  • Token is created on Solana as an SPL token
  • Pool starts on a bonding curve and auto-migrates to Meteora DAMM v2 at graduation

Trade Token

Execute a buy or sell of an agent's token via Jupiter DEX aggregator. The caller's agent and wallet are derived from authentication. The agent_id in the request body is the target agent whose token is being traded.

POST /api/v1/agent-token/trade

Auth: Privy Token or API Key

Examples

Buy:

curl -X POST https://api.droyd.ai/api/v1/agent-token/trade \
  -H "x-droyd-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "agent_id": "123",
    "amount": 1000000,
    "action": "buy"
  }'

Sell:

curl -X POST https://api.droyd.ai/api/v1/agent-token/trade \
  -H "x-droyd-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "agent_id": "123",
    "amount": 5000000,
    "action": "sell"
  }'

USDC Base Token:

curl -X POST https://api.droyd.ai/api/v1/agent-token/trade \
  -H "x-droyd-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "agent_id": "123",
    "amount": 1000000,
    "action": "buy",
    "base_token": "USDC"
  }'

Response

{
  "success": true,
  "data": {
    "trade_status": "success",
    "tx_signature": "5abc123...",
    "tx_confirmation": "confirmed",
    "action": "buy",
    "token": "So1...",
    "amount": 1000000
  }
}

Request Parameters

ParameterTypeRequiredDefaultDescription
agent_idstringYes-Target agent whose token is being traded
amountnumberYes-Token amount in UI format (e.g., 100000 = 100k tokens)
actionstringYes-buy or sell
base_tokenstringNoSOLBase token for the swap: SOL or USDC

Notes

  • Target agent must have a launched token
  • All swaps use ExactIn mode. For buys, the system estimates the SOL/USDC input needed based on current market prices, refined by a Jupiter quote. A 5% overshoot is applied to ensure the target token amount is met.
  • For sells, amount is the exact number of agent tokens to sell
  • Gas is sponsored by the platform

Claim Creator Fees

Claim the creator's accumulated trading fees, migration fees, and surplus tokens from the agent's bonding curve pool. Agent ID and wallet are derived from your API key — no body parameters needed.

POST /api/v1/agent-token/claim-fees

Auth: API Key

Example

curl -X POST https://api.droyd.ai/api/v1/agent-token/claim-fees \
  -H "x-droyd-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json"

Response

{
  "success": true,
  "data": {
    "claim_status": "success",
    "tx_signature": "5abc123...",
    "migration_fee_signature": null,
    "surplus_signature": null,
    "fees": {
      "base": "1000000",
      "quote": "500000000"
    },
    "pool_state": {
      "is_migrated": false,
      "migration_progress": 0.45
    }
  }
}

Notes

  • No request body required — agent and wallet are derived from your API key
  • Returns claim_status: "no_fees" if nothing to claim
  • After pool migration, also claims one-time migration fee and surplus tokens
  • Creator receives 60% of bonding curve trading fees

Claim Platform Fees

Claim the platform's (partner's) accumulated trading fees, migration fees, and surplus tokens from an agent's bonding curve pool.

POST /api/v1/agent-token/claim-platform-fees

Auth: API Key

Example

curl -X POST https://api.droyd.ai/api/v1/agent-token/claim-platform-fees \
  -H "x-droyd-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "agent_id": "abc123",
    "platform_wallet_id": "platform_wallet_db_id"
  }'

Response

{
  "success": true,
  "data": {
    "claim_status": "success",
    "tx_signature": "5abc123...",
    "migration_fee_signature": null,
    "surplus_signature": null,
    "fees": {
      "base": "400000",
      "quote": "300000000"
    },
    "pool_state": {
      "is_migrated": false,
      "migration_progress": 0.45
    }
  }
}

Request Parameters

ParameterTypeRequiredDescription
agent_idstringYesAgent identifier
platform_wallet_idstringYesDatabase wallet ID of the platform wallet

Notes

  • Platform receives 40% of bonding curve trading fees
  • After migration, also claims one-time migration fee (50% split) and surplus tokens

Token Status

Returns the current pool state, fee balances, migration status, and claim flags for an agent's token pool.

GET /api/v1/agent-token/status

Auth: API Key

Example

curl -X GET "https://api.droyd.ai/api/v1/agent-token/status?agent_id=abc123" \
  -H "x-droyd-api-key: YOUR_API_KEY"

Response

{
  "success": true,
  "data": {
    "pool_state": {
      "is_migrated": false,
      "migration_progress": 0.45,
      "curve_progress": 0.67
    },
    "fees": {
      "creator": {
        "unclaimed_base": "1000000",
        "unclaimed_quote": "500000000"
      },
      "partner": {
        "unclaimed_base": "400000",
        "unclaimed_quote": "300000000"
      },
      "total": {
        "base": "1400000",
        "quote": "800000000"
      }
    },
    "migration_claims": {
      "creator_migration_fee_claimed": false,
      "partner_migration_fee_claimed": false,
      "creator_surplus_claimed": false,
      "partner_surplus_claimed": false
    },
    "addresses": {
      "primary_pool": "Pool1...",
      "bonding_curve_pool": "Pool1...",
      "damm_pool": null,
      "token": "So1..."
    }
  }
}

Query Parameters

ParameterTypeRequiredDescription
agent_idstringYesAgent identifier

Notes

  • Read-only endpoint — no transactions are executed
  • curve_progress (0-1) shows how close the pool is to graduating to DAMM v2
  • migration_progress (0-1) shows overall migration status
  • Fee amounts are stringified BN values (base = agent token, quote = SOL)