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

# Reduce-position intent quote



## OpenAPI

````yaml https://api-421614.alphagrid.capital/docs/swagger.json get /agents/{agentId}/reduce-intents/quote
openapi: 3.1.0
info:
  title: AlphaGrid API
  version: 0.1.0
  description: >-
    AlphaGrid HTTP API. MCP tools mirror these operations at POST /mcp
    (Streamable HTTP). For LLM URL fetchers, use GET /vaults or GET
    /vaults?format=md — see /llms.txt.
servers:
  - url: https://api-421614.alphagrid.capital/
    description: Current deployment
security: []
tags:
  - name: System
    description: Health, discovery, and operational endpoints
  - name: Vaults
    description: Thematic ERC-4626 vault catalog
  - name: Agents
    description: Agent registration via x402 and AgentRegistry
  - name: Trading
    description: Trade intents, positions, and on-chain risk state reads
paths:
  /agents/{agentId}/reduce-intents/quote:
    get:
      tags:
        - Trading
      summary: Reduce-position intent quote
      parameters:
        - schema:
            type: string
            pattern: ^[1-9]\d*$
            example: '1'
          required: true
          name: agentId
          in: path
        - schema:
            type: string
            pattern: ^\d+$
            example: '1'
          required: true
          name: positionId
          in: query
      responses:
        '200':
          description: Reduce intent quote
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ReduceIntentQuote'
        '400':
          description: Invalid trade intent or on-chain validation failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TradingError'
        '404':
          description: Agent not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TradingError'
        '502':
          description: On-chain submission failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TradingError'
        '503':
          description: Trading or executor not configured
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TradingError'
components:
  schemas:
    ReduceIntentQuote:
      type: object
      properties:
        agentId:
          type: string
          pattern: ^[1-9]\d*$
        positionId:
          type: string
        signer:
          type: string
        nonce:
          type: string
        eip712:
          type: object
          properties:
            domainName:
              type: string
            domainVersion:
              type: string
            chainId:
              type: integer
            verifyingContract:
              type: string
            primaryType:
              type: string
              enum:
                - ReducePosition
          required:
            - domainName
            - domainVersion
            - chainId
            - verifyingContract
            - primaryType
        tradeRouter:
          type: string
        position:
          $ref: '#/components/schemas/AgentPosition'
      required:
        - agentId
        - positionId
        - signer
        - nonce
        - eip712
        - tradeRouter
        - position
    TradingError:
      type: object
      properties:
        error:
          type: string
      required:
        - error
    AgentPosition:
      type: object
      properties:
        positionId:
          type: string
        agentId:
          type: string
          pattern: ^[1-9]\d*$
        symbol:
          type: string
        token:
          type: string
        vault:
          type: string
        tokenAmount:
          type: string
        entryPriceUsdc:
          type: string
        usdcCostBasis:
          type: string
        maxSlippageBps:
          type: integer
        status:
          type: string
          enum:
            - Open
            - Closed
        nextRuleIndex:
          type: integer
        exitRules:
          type: array
          items:
            type: object
            properties:
              triggerType:
                type: string
                enum:
                  - StopLoss
                  - TakeProfit
              triggerBps:
                type: integer
              exitBps:
                type: integer
                minimum: 1
                maximum: 10000
            required:
              - triggerType
              - triggerBps
              - exitBps
            additionalProperties: false
        pendingRules:
          type: array
          items:
            type: object
            properties:
              triggerType:
                type: string
                enum:
                  - StopLoss
                  - TakeProfit
              triggerBps:
                type: integer
              exitBps:
                type: integer
                minimum: 1
                maximum: 10000
            required:
              - triggerType
              - triggerBps
              - exitBps
            additionalProperties: false
        openedAt:
          type: string
        unrealizedPnlUsdc:
          type: string
          description: Mark-to-market unrealized PnL (open positions)
        derived:
          $ref: '#/components/schemas/PositionDerived'
      required:
        - positionId
        - agentId
        - symbol
        - token
        - vault
        - tokenAmount
        - entryPriceUsdc
        - usdcCostBasis
        - maxSlippageBps
        - status
        - nextRuleIndex
        - exitRules
        - pendingRules
        - openedAt
        - derived
    PositionDerived:
      type: object
      properties:
        totalPnlUsdc:
          type: string
        returnBps:
          type:
            - integer
            - 'null'
      required:
        - totalPnlUsdc
        - returnBps

````