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

# Close a prediction proposal

> Close a proposal (creator only). Sells the creator's entire remaining position and puts the proposal in a sell-only state. Closing with no remaining position fails with `NOTHING_TO_SELL` (422).



## OpenAPI

````yaml /openapi.json post /api/v1/predictions/proposals/{id}/close
openapi: 3.1.0
info:
  title: Murmo API
  version: 1.0.0
  description: >-
    REST API for the Murmo trading platform. Spot swaps, prediction markets,
    perpetual futures, social copy-trading groups, portfolio, and chat —
    everything a bot or AI agent needs to trade on Solana with a single API key.


    **The money contract:** every monetary value on the wire is a full-precision
    plain decimal **string** (e.g. `"12.50"`), never a number, never raw base
    units, never scientific notation, never rounded. Send money the same way.
    See the *Money & precision* guide.


    **Auth:** send `Authorization: Bearer murmo_...` on every request. Keys are
    created in the Murmo app.
  contact:
    name: Murmo Support
    email: support@murmo.xyz
servers:
  - url: https://api.alpha-labs.trade
    description: Production
  - url: http://localhost:3000
    description: Local development
security:
  - bearerAuth: []
tags:
  - name: Identity
    description: Who am I, which key is this, and what is my rate budget.
  - name: Account
    description: >-
      Wallet value, balances, holdings, PnL, and the deposit address for funding
      in.
  - name: Spot
    description: Token discovery and group spot proposals.
  - name: Stocks
    description: >-
      Ondo tokenized stocks: the supported-ticker catalog and ticker-based
      trading over the group/proposal flow.
  - name: Predictions
    description: >-
      Polymarket-backed prediction markets: browse events, propose, predict,
      sell, claim.
  - name: Perpetuals
    description: 'Phoenix RISE perps: markets, proposals, open/increase/reduce/close/claim.'
  - name: Groups
    description: 'Copy-trade groups: membership, admin, and auto-follow.'
  - name: Portfolio
    description: Cross-vertical open positions, past positions, and trade history.
  - name: Chat
    description: Group chat over REST (the stateless counterpart to the WebSocket gateway).
paths:
  /api/v1/predictions/proposals/{id}/close:
    post:
      tags:
        - Predictions
      summary: Close a prediction proposal
      description: >-
        Close a proposal (creator only). Sells the creator's entire remaining
        position and puts the proposal in a sell-only state. Closing with no
        remaining position fails with `NOTHING_TO_SELL` (422).
      operationId: closePredictionProposal
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
      responses:
        '200':
          description: The closed proposal and the closing trade (or null).
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      proposal:
                        $ref: '#/components/schemas/PredictionProposal'
                      trade:
                        oneOf:
                          - $ref: '#/components/schemas/PredictionTrade'
                          - type: 'null'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          description: 'Proposal already closed or resolved (`code: PROPOSAL_INACTIVE`).'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '422':
          description: 'No remaining position to sell (`code: NOTHING_TO_SELL`).'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    PredictionProposal:
      type: object
      properties:
        id:
          type: string
        groupId:
          type: string
        createdById:
          type: string
        eventId:
          type: string
          description: >-
            Event slug (e.g. `presidential-election-winner-2028`). Legacy
            proposals may hold older identifier formats.
        marketId:
          type: string
          description: Market slug for the specific market within the event.
        outcomeMint:
          type: string
          description: >-
            Venue outcome-token id for the chosen side (legacy proposals hold a
            Solana mint address).
        eventTitle:
          type: string
          nullable: true
        marketTitle:
          type: string
          nullable: true
        eventImageUrl:
          type: string
          nullable: true
        isYes:
          type: boolean
        status:
          type: string
          enum:
            - PENDING
            - ACTIVE
            - CLOSED
            - RESOLVED
            - FAILED
          description: >-
            PENDING = buy settling (visible only to its creator); ACTIVE = open;
            CLOSED = sell-only; RESOLVED = market resolved; FAILED = buy gave
            up, funds returned (creator-only).
        result:
          type: string
          nullable: true
          enum:
            - 'YES'
            - 'NO'
            - INVALID
            - CANCELLED
            - null
          description: >-
            Resolution outcome; null until resolved. INVALID = 50/50 resolution
            — both sides redeem at $0.50 per contract.
        didWin:
          type: boolean
          nullable: true
          description: >-
            Whether the proposal's side won; null until resolved (false on
            INVALID — both sides claim $0.50).
        reason:
          type: string
          nullable: true
        resolvedAt:
          type: string
          format: date-time
          nullable: true
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
    PredictionTrade:
      type: object
      properties:
        id:
          type: string
        proposalId:
          type: string
        groupId:
          type: string
        walletAddress:
          type: string
        tradeType:
          type: string
          enum:
            - BUY
            - SELL
            - CLAIM
            - LOST
        tokenAmount:
          $ref: '#/components/schemas/DecimalString'
        tokenDecimals:
          type: integer
        pricePerTokenUsd:
          $ref: '#/components/schemas/MoneyString'
        totalCostUsd:
          allOf:
            - $ref: '#/components/schemas/MoneyString'
          description: >-
            Gross fill value (tokenAmount × pricePerTokenUsd). The venue fee is
            charged on top on buys and deducted from delivery on sells;
            pnlPct/pnlUsd are already net of it.
        venueFeeUsd:
          allOf:
            - $ref: '#/components/schemas/MoneyString'
          description: >-
            Venue fee charged at match on this fill. "0" on fee-free trades
            (claims, resolutions).
        pnlPct:
          oneOf:
            - $ref: '#/components/schemas/DecimalString'
            - type: 'null'
          description: Exit trades only (SELL/CLAIM/LOST); null on buys. Net of venue fees.
        pnlUsd:
          oneOf:
            - $ref: '#/components/schemas/MoneyString'
            - type: 'null'
          description: Exit trades only (SELL/CLAIM/LOST); null on buys. Net of venue fees.
        txSignature:
          type: string
          nullable: true
        createdAt:
          type: string
          format: date-time
    Error:
      type: object
      description: >-
        Errors come in two shapes. Coded business errors: `{ message, code }`.
        Generic framework errors: `{ statusCode, message, error }` (message may
        be an array of validation strings).
      properties:
        statusCode:
          type: integer
          example: 400
        message:
          oneOf:
            - type: string
            - type: array
              items:
                type: string
          example: Query parameter "groupId" is required
        error:
          type: string
          example: Bad Request
        code:
          type: string
          description: >-
            Stable machine-readable code on business errors (e.g.
            NOT_GROUP_MEMBER, MARKET_NOT_ACTIVE, AMOUNT_BELOW_MINIMUM,
            MIN_ORDER_SIZE, NO_LIQUIDITY, FUNDING_REFUNDED). The full list is
            published as error-catalog.json.
          example: NOT_GROUP_MEMBER
    DecimalString:
      type: string
      description: >-
        A non-money decimal (percentage, ratio, price) as a full-precision plain
        decimal string (never scientific notation).
      example: '4.27'
    MoneyString:
      type: string
      description: >-
        A monetary amount as a full-precision plain decimal string in USD —
        never a number, never raw base units, never scientific notation, never
        rounded. Parse with a decimal library; round only for display.
      example: '12.50'
  responses:
    Unauthorized:
      description: Missing or invalid credential.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Forbidden:
      description: >-
        Authenticated but not permitted (e.g. not a group member, or the product
        is restricted in your region).
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    NotFound:
      description: Resource not found.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Send your API key as `Authorization: Bearer murmo_...`. Keys are created
        in the Murmo app. Header-only — keys are never read from the query
        string. Valid for the REST API under /api/v1 only (not the GraphQL
        endpoint).

````