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

# Sell tokens

> Build sell transactions for one or more wallets.

Provide either `percentage` (0.01–100) or `tokensAmount` (number or per-wallet array).




## OpenAPI

````yaml openapi-spec/trading.yaml post /swap/sol/sell
openapi: 3.0.3
info:
  title: Raze Trading API
  description: >
    Trading endpoints for Solana token swaps — quote, buy, sell, and raw
    instructions.


    Runs on port 8082.


    **Auth methods**: `Authorization: Bearer sk_...` header, `X-API-Key: sk_...`
    header, or `?apiKey=sk_...` query param.
  version: 2.0.0
servers:
  - url: https://router.raze.bot
    description: >-
      Raze global trading router — GeoDNS routes to the nearest region
      automatically
security: []
paths:
  /swap/sol/sell:
    post:
      summary: Sell tokens
      description: >
        Build sell transactions for one or more wallets.


        Provide either `percentage` (0.01–100) or `tokensAmount` (number or
        per-wallet array).
      operationId: sell
      parameters:
        - name: X-API-Key
          in: header
          required: false
          schema:
            type: string
          description: >-
            API key for authenticated access (alternative to Authorization
            header)
        - name: Authorization
          in: header
          required: false
          schema:
            type: string
          description: Bearer sk_... — alternative to X-API-Key
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SellRequest'
            examples:
              sellAll:
                summary: Sell 100% of holdings
                value:
                  walletAddresses:
                    - 62ThHC1rs2GUfa8J4Qjcj5GD2MSL2d65pcJtenNieDnm
                  tokenAddress: DezXAZ8z7PnrnRJjz3wXBoRgixCa6xjnB7YaB1pPB263
                  percentage: 100
              sellFixed:
                summary: Sell fixed token amount
                value:
                  walletAddresses:
                    - 62ThHC1rs2GUfa8J4Qjcj5GD2MSL2d65pcJtenNieDnm
                  tokenAddress: DezXAZ8z7PnrnRJjz3wXBoRgixCa6xjnB7YaB1pPB263
                  tokensAmount: 500000
              sellPerWallet:
                summary: Multiple wallets, per-wallet amounts
                value:
                  walletAddresses:
                    - 62ThHC1rs2GUfa8J4Qjcj5GD2MSL2d65pcJtenNieDnm
                    - 7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU
                  tokenAddress: DezXAZ8z7PnrnRJjz3wXBoRgixCa6xjnB7YaB1pPB263
                  tokensAmount:
                    - 1000000
                    - 2000000
              nonSolOutput:
                summary: Token → USDC
                value:
                  walletAddresses:
                    - 62ThHC1rs2GUfa8J4Qjcj5GD2MSL2d65pcJtenNieDnm
                  tokenAddress: DezXAZ8z7PnrnRJjz3wXBoRgixCa6xjnB7YaB1pPB263
                  percentage: 100
                  outputMint: EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v
      responses:
        '200':
          description: Transactions generated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SellResponse'
              example:
                success: true
                transactions:
                  - 4hXTCkRzt9WyecNzV1XPgCDfGAZzQKNxLXgynz5QDuWJ...
        '400':
          description: Invalid parameters or no balance to sell
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Could not get sell quote
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security: []
components:
  schemas:
    SellRequest:
      type: object
      properties:
        walletAddresses:
          type: array
          items:
            type: string
          minItems: 1
          example:
            - 62ThHC1rs2GUfa8J4Qjcj5GD2MSL2d65pcJtenNieDnm
        tokenAddress:
          type: string
          example: DezXAZ8z7PnrnRJjz3wXBoRgixCa6xjnB7YaB1pPB263
        percentage:
          type: number
          description: >-
            Percentage of holdings to sell (0.01–100). Required if tokensAmount
            not provided.
          minimum: 0.01
          maximum: 100
          example: 100
        tokensAmount:
          oneOf:
            - type: number
            - type: array
              items:
                type: number
          description: >-
            Fixed token amount(s). Single number applies to all wallets; array
            is per-wallet. Required if percentage not provided.
          example: 500000
        outputMint:
          type: string
          description: >-
            Output token mint. Omit for native SOL output. Use for token →
            non-SOL swaps.
          example: EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v
        slippageBps:
          type: integer
          default: 9990
          minimum: 0
          maximum: 10000
          example: 9990
        transactionsFeeLamports:
          type: number
          description: Priority fee per transaction in lamports
          example: 100000
        feeTipLamports:
          type: number
          description: Tip in lamports. Public — min 0.001 SOL (1000000 lamports) enforced.
          example: 1000000
          minimum: 1000000
        tipWallet:
          type: string
          description: Custom tip recipient wallet (auth only)
        tipLamports:
          type: number
          description: Custom tip amount in lamports (auth only)
          example: 1000000
        feeWallet:
          type: string
          description: Custom fee recipient wallet (auth only)
        feeBps:
          type: number
          description: Custom fee in basis points (auth only)
          example: 50
        encoding:
          type: string
          enum:
            - base58
            - base64
          default: base64
      required:
        - walletAddresses
        - tokenAddress
    SellResponse:
      type: object
      properties:
        success:
          type: boolean
          example: true
        transactions:
          type: array
          items:
            type: string
      required:
        - success
        - transactions
    ErrorResponse:
      type: object
      properties:
        success:
          type: boolean
          example: false
        error:
          type: string
        details:
          type: string
      required:
        - success
        - error

````