> ## Documentation Index
> Fetch the complete documentation index at: https://docs.chainstream.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Dex - 建立代幣

> 在指定 DEX 上建立新代幣



## OpenAPI

````yaml /zh-Hant/api-reference/openapi-defi-zh-Hant.yaml POST /v2/dex/{chain}/create
openapi: 3.1.0
info:
  title: Defi Service API
  description: Defi Service API ⚡️
  version: '1.0'
  contact:
    name: AI
    url: https://github.com/chainstream-io/defi-service
    email: ai@sx.ai
servers:
  - url: https://api.chainstream.io
    description: Production
security: []
tags:
  - name: Endpoints
    description: ''
paths:
  /v2/dex/{chain}/create:
    post:
      tags:
        - Dex
      summary: Dex - 建立代幣
      description: 在指定 DEX 上建立新代幣
      operationId: create.token
      parameters:
        - name: chain
          required: true
          in: path
          description: 支援網路列表中的鏈名稱
          schema:
            $ref: '#/components/schemas/ChainSymbol'
      requestBody:
        required: true
        description: Token creation parameters
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateTokenInput'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateTokenReply'
      security:
        - bearer: []
components:
  schemas:
    ChainSymbol:
      type: string
      enum:
        - sol
        - bsc
        - eth
    CreateTokenInput:
      type: object
      properties:
        dex:
          type: string
          description: 交易所使用的 DEX 標識符
          example: raydium
          enum:
            - raydium
            - pumpfun
            - moonshot
            - candy
            - launchpad
        userAddress:
          type: string
          description: 發起交易的錢包公鑰
          example: oQPnhXAbLbMuKHESaGrbXT17CyvWCpLyERSJA9HCYd7
          minLength: 8
          maxLength: 64
        priorityFee:
          type: string
          description: 優先費（SOL），用於提高交易處理速度
          example: '1000'
        name:
          type: string
          description: 要建立的代幣名稱
          example: Candy Token
          minLength: 1
          maxLength: 32
        symbol:
          type: string
          description: 代幣符號/簡稱
          example: CANDY
          minLength: 1
          maxLength: 10
        uri:
          type: string
          description: 代幣元資料 URI（通常指向圖片或 JSON）
          example: https://assets.candyproject.com/token/icon.png
        image:
          type: string
          description: 代幣圖片 URL（Base64 或 HTTPS）
          example: https://assets.candyproject.com/token/icon.png
        extra:
          type: object
          description: 已建立代幣的附加元資料
          example:
            decimals: 6
            migrateType: amm
            slippage: 100
            buyAmount: 0
            supply: 1000000000000000
            totalSellA: 793100000000000
            totalFundRaisingB: 85000000000
            totalLockedAmount: 0
            cliffPeriod: 0
            unlockPeriod: 0
            shareFeeReceiver: oQPnhXAbLbMuKHESaGrbXT17CyvWCpLyERSJA9HCYd7
            shareFeeRate: 1000
      required:
        - dex
        - userAddress
        - name
        - symbol
    CreateTokenReply:
      type: object
      properties:
        serializedTx:
          type: string
          description: Base64 編碼的代幣建立交易
          example: >-
            AQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAEDRgYGpQEDAQIABQcICQoLDA0ODwAAAAAAAAAAAAAQERITFBUWFxgZGhscHR4fAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=
        mintAddress:
          type: string
          description: 需要簽名的代幣鑄造地址
          example: So11111111111111111111111111111111111111112
      required:
        - serializedTx
        - mintAddress
  securitySchemes:
    bearer:
      scheme: bearer
      bearerFormat: JWT
      type: http

````