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

# Trade on Polymarket

> Executes a trade on Polymarket.



## OpenAPI

````yaml /api/swagger.json post /polymarket/trade
openapi: 3.0.1
info:
  title: BLOOD-V3 API
  contact: {}
  version: 0.0.1
servers:
  - url: //localhost:50000/api/v1
security: []
paths:
  /polymarket/trade:
    post:
      tags:
        - Polymarket
      summary: Trade on Polymarket
      description: Executes a trade on Polymarket.
      requestBody:
        description: Trade request
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/handlers.tradePolymarketRequest'
        required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/handlers.tradePolymarketResponse'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/handlers.ErrorResponse'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/handlers.ErrorResponse'
components:
  schemas:
    handlers.tradePolymarketRequest:
      type: object
      properties:
        direction:
          type: string
          description: Direction is either "buy" or "sell"
        price:
          type: number
          description: >-
            Price is the price you want to buy/sell at (between 0 and 1) (if not
            provided, will use the market price)
        size:
          type: string
          description: >-
            Size is the amount of USDC you want to spend (for buys) or the
            amount of shares you want to sell (for sells)
        slippage:
          type: number
          description: >-
            Slippage is the maximum slippage you're willing to accept (between 0
            and 100)
        token_id:
          type: string
          description: TokenID is the ID of the outcome you want to trade
        wallet_id:
          type: string
          description: WalletID is the ID of the wallet you want to trade with
    handlers.tradePolymarketResponse:
      type: object
      properties:
        order_id:
          type: string
          description: OrderID is the ID of the order that was created
        status:
          type: string
          description: Status is the status of the order
    handlers.ErrorResponse:
      type: object
      properties:
        error:
          type: string

````