> ## 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.

# Add-to-position intent quote



## OpenAPI

````yaml https://api-421614.alphagrid.capital/docs/swagger.json get /agents/{agentId}/add-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}/add-intents/quote:
    get:
      tags:
        - Trading
      summary: Add-to-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: Add intent quote
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AddIntentQuote'
        '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:
    AddIntentQuote:
      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:
                - AddToPosition
          required:
            - domainName
            - domainVersion
            - chainId
            - verifyingContract
            - primaryType
        tradeRouter:
          type: string
        allocation:
          type: object
          properties:
            used:
              type: string
            cap:
              type: string
            available:
              type: string
          required:
            - used
            - cap
            - available
        position:
          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
            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
            - openedAt
            - derived
      required:
        - agentId
        - positionId
        - signer
        - nonce
        - eip712
        - tradeRouter
        - allocation
        - position
    TradingError:
      type: object
      properties:
        error:
          type: string
      required:
        - error
    PositionDerived:
      type: object
      properties:
        totalPnlUsdc:
          type: string
        returnBps:
          type:
            - integer
            - 'null'
      required:
        - totalPnlUsdc
        - returnBps

````