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

# limit order (buy/sell)



## OpenAPI

````yaml /openapi.json post /api/v1/extension/token/limit_order
openapi: 3.0.1
info:
  title: echo/extension/v1/extension.proto
  version: version not set
servers:
  - url: /
security: []
tags:
  - name: ExtensionService
paths:
  /api/v1/extension/token/limit_order:
    post:
      tags:
        - ExtensionService
      summary: limit order (buy/sell)
      operationId: ExtensionService_LimitOrderTokenExtension
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/v1LimitOrderTokenExtensionRequest'
        required: true
      responses:
        '200':
          description: A successful response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/v1LimitOrderTokenExtensionResponse'
        default:
          description: An unexpected error response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/rpcStatus'
components:
  schemas:
    v1LimitOrderTokenExtensionRequest:
      type: object
      properties:
        token:
          title: token is the extension token (auth token)
          type: string
        chain:
          $ref: '#/components/schemas/v1CHAIN'
        input:
          title: input is the token address or pool address
          type: string
        direction:
          $ref: '#/components/schemas/v1TradeDirection'
        amount:
          title: |-
            amount is the amount to trade
            can be specific amount (for buy)
            or percentage of the balance (for sell)
          type: string
        targetMcap:
          title: >-
            target_mcap is the target market cap in usd to trigger the limit
            order

            this string must contain '<' or '>' sign to indicate the trigger
            condition

            basically it can be '<1000000' or '>1000000'
          type: string
        walletId:
          title: |-
            optional wallet_id to use for the trade
            if not set, primary wallet will be used
          type: string
        settings:
          $ref: '#/components/schemas/v1UserSettings'
        expiry:
          title: >-
            optional expiry time for the limit order

            not the actual time but duration from now, e.g. "1h" for 1 hour,
            "30m" for 30 minutes

            default is 24h if not set
          type: string
    v1LimitOrderTokenExtensionResponse:
      type: object
      properties:
        taskId:
          title: task_id is the id of the created limit order task
          type: string
    rpcStatus:
      type: object
      properties:
        code:
          type: integer
          format: int32
        message:
          type: string
        details:
          type: array
          items:
            $ref: '#/components/schemas/protobufAny'
    v1CHAIN:
      type: string
      default: CHAIN_UNSPECIFIED
      enum:
        - CHAIN_UNSPECIFIED
        - CHAIN_SOL
        - CHAIN_ETH
        - CHAIN_BSC
        - CHAIN_BASE
        - CHAIN_ROBINHOOD
    v1TradeDirection:
      type: string
      default: TRADE_DIRECTION_UNSPECIFIED
      enum:
        - TRADE_DIRECTION_UNSPECIFIED
        - TRADE_DIRECTION_BUY
        - TRADE_DIRECTION_SELL
    v1UserSettings:
      title: User settings
      type: object
      properties:
        buyFee:
          type: number
          format: double
        sellFee:
          type: number
          format: double
        buyTip:
          type: number
          format: double
        sellTip:
          type: number
          format: double
        buySlippage:
          type: number
          format: double
        sellSlippage:
          type: number
          format: double
    protobufAny:
      type: object
      properties:
        '@type':
          type: string
      additionalProperties:
        type: object

````