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

# Quote a perp open

> Compute expected entry, liquidation price, position size, and
funding/borrow rate for a hypothetical perp open.

Reads live Pyth from the in-process oracle map; falls back to the
venue's quote API when the feed is missing. Cached for 10s by
`(market_id, side, size, leverage)`.




## OpenAPI

````yaml openapi-spec/trading.yaml post /perp/sol/quote
openapi: 3.0.3
info:
  title: Raze Trading API
  description: >
    Trading endpoints for Solana token swaps — quote, buy, sell, atomic

    round-trips and raw instructions. Perpetuals (Jupiter Perps + Phoenix) live

    here too.


    Quotes can also be **streamed**: `/swap/sol/quote/stream` is a WebSocket
    that

    pushes a fresh quote whenever the pools under your route move. It is not

    describable in OpenAPI — see

    [Streaming quotes](/api-reference/router/quote-stream).


    Write utilities (`/utils/sol/*` — launch, transfer, burn, consolidate, fees)

    moved to the History API on `https://api.raze.bot` (see `history.yaml`).


    Runs on port 8082.


    **Auth methods**: `Authorization: Bearer sk_...` header, `X-API-Key: sk_...`
    header, or `?apiKey=sk_...` query param.
  version: 2.1.0
servers:
  - url: https://router.raze.bot
    description: >-
      Raze global trading router — GeoDNS routes to the nearest region
      automatically
security: []
paths:
  /perp/sol/quote:
    post:
      summary: Quote a perp open
      description: |
        Compute expected entry, liquidation price, position size, and
        funding/borrow rate for a hypothetical perp open.

        Reads live Pyth from the in-process oracle map; falls back to the
        venue's quote API when the feed is missing. Cached for 10s by
        `(market_id, side, size, leverage)`.
      operationId: perpQuote
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PerpQuoteRequest'
            example:
              market_id: jup:SOL-PERP
              side: long
              collateral_usdc_e6: 100000000
              leverage_bps: 50000
              slippage_bps: 50
      responses:
        '200':
          description: Quote computed (check `success` for failure modes)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PerpQuoteResponse'
      security:
        - ApiKeyAuth: []
        - BearerAuth: []
components:
  schemas:
    PerpQuoteRequest:
      type: object
      required:
        - market_id
        - side
        - collateral_usdc_e6
        - leverage_bps
      properties:
        market_id:
          type: string
          example: jup:SOL-PERP
        side:
          type: string
          enum:
            - long
            - short
        collateral_usdc_e6:
          type: integer
          format: int64
          description: >-
            Collateral the user is putting up, denominated in USDC micros (1e6 =
            $1).
          example: 100000000
        leverage_bps:
          type: integer
          description: Leverage in basis-points (10000 = 1x).
          example: 50000
        slippage_bps:
          type: integer
          description: Optional slippage tolerance in bps. Defaults to 50 (0.5%).
          default: 50
          example: 50
    PerpQuoteResponse:
      type: object
      properties:
        success:
          type: boolean
        data:
          $ref: '#/components/schemas/PerpQuote'
        error:
          type: string
          description: Set when `success=false`.
    PerpQuote:
      type: object
      properties:
        market_id:
          type: string
        venue:
          type: string
          enum:
            - jup
            - phoenix
        side:
          type: string
          enum:
            - long
            - short
        entry_price:
          type: integer
          format: int64
          description: Expected entry price in USDC micros.
        est_liquidation_price:
          type: integer
          format: int64
        size:
          type: integer
          format: int64
          description: Position size after applying leverage to collateral.
        mechanism:
          type: string
          enum:
            - funding
            - borrow_fee
          description: >
            Funding mechanism the venue uses. `funding` = sign-flipping rate
            paid

            between longs and shorts; `borrow_fee` = always paid by both sides

            to LPs (Jupiter Perps). Quote consumers must not conflate the two.
        funding_or_borrow_bps_per_hour:
          type: integer
          format: int64
          description: >-
            Hourly funding/borrow rate in bps. Signed for `funding`, positive
            for `borrow_fee`.
        fee_bps:
          type: integer
        quote_ts_ms:
          type: integer
          format: int64
        slot:
          type: integer
          format: int64
        provider:
          type: string
          enum:
            - oracle
            - venue-api
            - cache
          description: Source the entry price came from.
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key
    BearerAuth:
      type: http
      scheme: bearer

````