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

# Execute Swap

> Direct execution flow: validates wallet, fetches token metadata,
builds task request, and submits to task service. No plan_storage dependency.



## OpenAPI

````yaml POST /api/v2/swap/execute
openapi: 3.0.3
info:
  description: Multi-chain DEX trading API for developers
  license:
    name: ''
  title: Shuriken API v2
  version: 2.0.0
servers:
  - url: https://api.shuriken.trade
security: []
tags:
  - description: SplitNOW cross-chain split plan + execute
    name: V2 Splits
  - description: Wallet archive lifecycle (archive / unarchive / bulk-archive)
    name: Wallets
  - description: Token discovery, metadata, and pricing
    name: V2 Tokens
  - description: Quote and execute swaps
    name: V2 Swap
  - description: Limit orders and stop-loss
    name: V2 Trigger
  - description: Managed-agent invocation
    name: V2 Agents
  - description: Portfolio positions and PnL
    name: V2 Portfolio
  - description: User account management
    name: V2 Account
  - description: WebSocket stream discovery, session bootstrap, and channel authorization
    name: V2 WebSocket
  - description: Perpetual trading on Hyperliquid
    name: V2 Perps
  - description: Agent-proposed trade suggestions
    name: V2 Suggestions
paths:
  /api/v2/swap/execute:
    post:
      tags:
        - V2 Swap
      summary: POST /api/v2/swap/execute — Managed execution (Shuriken signs & submits)
      description: >-
        Direct execution flow: validates wallet, fetches token metadata,

        builds task request, and submits to task service. No plan_storage
        dependency.
      operationId: execute_swap
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ExecuteSwapRequest'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse_SwapStatus'
          description: Swap task created
        '400':
          description: Invalid params or wallet not found
      security:
        - bearer_auth: []
components:
  schemas:
    ExecuteSwapRequest:
      description: |-
        POST /api/v2/swap/execute request body

        Direct execution: accepts all params, gets fresh quote, creates task.
        Matches Jupiter/1inch pattern (no plan_storage dependency).
      properties:
        amount:
          description: Amount in base units (e.g., lamports for SOL, wei for EVM)
          type: string
        chain:
          description: 'Chain identifier: "solana", "base", "bsc"'
          type: string
        inputMint:
          description: Token address to sell
          type: string
        outputMint:
          description: Token address to buy
          type: string
        slippageBps:
          description: 'Slippage tolerance in basis points (default: 100 = 1%)'
          format: int32
          type: integer
        walletId:
          description: Shuriken wallet ID to use for the swap
          type: string
      required:
        - chain
        - inputMint
        - outputMint
        - amount
        - walletId
      type: object
    ApiResponse_SwapStatus:
      description: V2 success response envelope
      properties:
        data:
          properties:
            errorCode:
              nullable: true
              type: string
            errorMessage:
              nullable: true
              type: string
            status:
              description: 'Status: "submitted", "pending", "success", "failed"'
              type: string
            taskId:
              type: string
            txHash:
              nullable: true
              type: string
          required:
            - taskId
            - status
          type: object
        pagination:
          $ref: '#/components/schemas/PaginationInfo'
          nullable: true
        requestId:
          type: string
      required:
        - data
        - requestId
      type: object
    PaginationInfo:
      description: Page-based pagination info (per RFC)
      properties:
        hasMore:
          type: boolean
        limit:
          format: int32
          minimum: 0
          type: integer
        page:
          format: int32
          minimum: 0
          type: integer
        total:
          format: int32
          minimum: 0
          nullable: true
          type: integer
      required:
        - page
        - limit
        - hasMore
      type: object
  securitySchemes:
    bearer_auth:
      bearerFormat: JWT or sk_{keyId}_{secret}
      description: >-
        Use `Authorization: Bearer <jwt>` for user auth or `Authorization:
        Bearer sk_{keyId}_{secret}` for API key auth.
      scheme: bearer
      type: http

````