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

# Simulate fees for a potential order

> Simulate fees for a potential order.

 Returns exact fee breakdown for a specific order before placing it,
 including Monaco protocol fees, application fees, total amounts,
 and the maximum quantity affordable at the given price.



## OpenAPI

````yaml /proto-openapi/api/openapi.yaml get /api/v1/fees/simulate
openapi: 3.0.3
info:
  title: Monaco Protocol API
  description: REST API for the Monaco Protocol hybrid CLOB exchange.
  version: 1.0.0
servers:
  - url: https://staging.apimonaco.xyz
    description: Staging server (Testnet)
security: []
tags:
  - name: AccountsService
  - name: ApplicationsService
  - name: AuthService
  - name: BuildercodeRewardsService
  - name: CopyTradingService
  - name: DelegatedAgentsService
  - name: FaucetService
  - name: FeesService
  - name: HealthService
  - name: ManagedMarketsService
    description: |-
      Wallet-authenticated maker assignments. The signed session must match both
       configured maker user and application. Owner IDs are process fences, never auth.
       Only wallet sessions are supported; delegated-agent sessions receive 403.
  - name: MarginAccountsService
    description: |-
      Current public isolated-margin semantics:
       - a user has one parent margin account per application scope
       - opening orders create or reuse isolated position buckets under that parent
       - parent account creation is handled internally by margin workflows
  - name: MarketService
  - name: OrderbookService
  - name: OrdersService
  - name: PositionsService
    description: |-
      Current public isolated-margin semantics:
       - positions link to a parent margin account and, when applicable, a bucket id
       - opening orders create or reuse isolated position buckets under the parent
       - users can open another isolated position by reusing the parent account with a different market bucket
  - name: PulseService
  - name: SweeperService
  - name: TraderCodeService
  - name: TradesService
  - name: WhitelistService
  - name: WithdrawalsService
paths:
  /api/v1/fees/simulate:
    get:
      tags:
        - FeesService
        - Fees
      summary: Simulate fees for a potential order
      description: |-
        Simulate fees for a potential order.

         Returns exact fee breakdown for a specific order before placing it,
         including Monaco protocol fees, application fees, total amounts,
         and the maximum quantity affordable at the given price.
      operationId: simulate_fees
      parameters:
        - name: tradingPairId
          in: query
          schema:
            type: string
            minLength: 1
            format: uuid
          description: Trading pair identifier (UUID)
          required: true
        - name: side
          in: query
          schema:
            type: string
            enum:
              - BUY
              - SELL
            minLength: 1
          description: Order side
          required: true
        - name: price
          in: query
          schema:
            type: string
            minLength: 1
          description: Price as decimal string
          required: true
        - name: quantity
          in: query
          schema:
            type: string
            minLength: 1
          description: Quantity as decimal string
          required: true
        - name: orderType
          in: query
          schema:
            type: string
            enum:
              - LIMIT
              - MARKET
              - STOP_LOSS
              - TAKE_PROFIT
              - STOP_LIMIT
              - TRAILING_STOP
            minLength: 1
          description: Order type
        - name: slippageToleranceBps
          in: query
          schema:
            type: integer
            format: int32
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SimulateFeesResponse'
        '400':
          description: Bad request (e.g., slippage with LIMIT order)
        '401':
          description: Authentication required
        '404':
          description: Trading pair or application not found
        '429':
          description: >-
            Read rate limit exceeded — every authenticated read draws one
            request from the account's read budget; retry after the interval in
            details.retryAfter
        '500':
          description: Internal server error
      security:
        - monacoSignature: []
        - monacoHttpSignature: []
components:
  schemas:
    SimulateFeesResponse:
      type: object
      properties:
        notional:
          example: '20000.00'
          type: string
          description: Notional value (price x quantity)
          nullable: true
        monacoTakerFee:
          example: '20.00'
          type: string
          description: Monaco protocol taker fee in quote token
          nullable: true
        monacoMakerRebate:
          example: '-5.00'
          type: string
          description: Monaco maker rebate in quote token (negative)
          nullable: true
        applicationTakerFee:
          example: '10.00'
          type: string
          description: Application-specific taker fee in quote token
          nullable: true
        totalTakerFees:
          example: '30.00'
          type: string
          description: Total taker fees (monaco + application)
          nullable: true
        takerTotalPayment:
          example: '20030.00'
          type: string
          description: Total amount paid by taker (notional + fees)
          nullable: true
        makerTotalReceipt:
          example: '19995.00'
          type: string
          description: Total amount received by maker (notional - rebate)
          nullable: true
        buyOrderLockAmount:
          example: '20030.00'
          type: string
          description: >-
            Amount locked for buy orders. For MARKET orders, includes slippage
            buffer.
          nullable: true
        monacoTakerFeeBps:
          example: 10
          deprecated: true
          type: integer
          description: >-
            DEPRECATED: whole-basis-points taker rate. An integer cannot
            represent fractional tiered rates (e.g. 6.5), so this echoes the
            flat trading_pairs column, NOT the tier-resolved rate the ledger
            charges. Kept for backward compatibility. Use
            monaco_taker_fee_bps_exact (or GET /api/v1/fees/tier).
          format: int32
          nullable: true
        monacoMakerRebateBps:
          example: -2
          deprecated: true
          type: integer
          description: >-
            DEPRECATED: whole-basis-points maker rebate. An integer cannot
            represent fractional tiered rebates (e.g. -1.15), so this echoes the
            flat trading_pairs column, NOT the tier-resolved rate. Kept for
            backward compatibility. Use monaco_maker_rebate_bps_exact (or GET
            /api/v1/fees/tier).
          format: int32
          nullable: true
        applicationTakerFeeBps:
          example: 5
          type: integer
          description: Application taker fee rate in basis points
          format: int32
          nullable: true
        applicationName:
          example: Monaco Trading Frontend
          type: string
          description: Application display name
          nullable: true
        maxQuantity:
          example: '99.95'
          type: string
          description: >-
            Maximum quantity affordable at the given price, accounting for fees
            and slippage. Powers the 100% range input on the FE.
          nullable: true
        maxQuantityRaw:
          example: '99950000000000000000'
          type: string
          description: Maximum quantity in RAW (smallest unit) format
          nullable: true
        slippageToleranceBps:
          example: 500
          type: integer
          description: Slippage tolerance used in the calculation (echoed back)
          format: int32
          nullable: true
        monacoTakerFeeBpsExact:
          example: '6.5'
          type: string
          description: >-
            Tier-resolved Monaco taker fee rate as a decimal basis-points string
            — the exact rate the ledger charges this caller (equals
            monaco_taker_fee / notional). Fractional and per-tier, e.g. "6.5".
            Prefer this over the deprecated integer monaco_taker_fee_bps.
          nullable: true
        monacoMakerRebateBpsExact:
          example: '-1'
          type: string
          description: >-
            Tier-resolved Monaco maker rebate as a decimal basis-points string
            (negative is a rebate) — the exact rate the ledger credits this
            caller. Fractional and per-tier, e.g. "-1". Prefer this over the
            deprecated integer monaco_maker_rebate_bps.
          nullable: true
  securitySchemes:
    monacoSignature:
      type: apiKey
      description: >-
        Ed25519 session-key request signing. Every authenticated request carries
        three headers: `X-Monaco-PublicKey` (64-char lowercase-hex session
        public key), `X-Monaco-Timestamp` (Unix milliseconds, within 30s of
        server time), and `X-Monaco-Signature` (hex ed25519 signature). The
        signature is over `METHOD\npath?query\ntimestamp_ms\nSHA256_hex(body)`,
        where the body hash is the SHA-256 of the empty byte string when there
        is no body. Obtain the session keypair from `POST
        /api/v1/auth/challenge` followed by `POST /api/v1/auth/verify`.
      name: X-Monaco-Signature
      in: header
    monacoHttpSignature:
      type: apiKey
      description: >-
        RFC 9421 Ed25519 session-key request signatures. Send Signature-Input,
        Signature, and Content-Digest together; never combine them with
        X-Monaco-* credentials. The monaco signature covers @method, @path,
        @query, and content-digest in that order, with created (Unix seconds
        within 30s of server time), keyid (registered lowercase-hex session
        public key), and alg=ed25519 parameters. Content-Digest uses RFC 9530
        sha-256 over the exact body bytes, including the empty body. Query
        coverage retains ordering and percent encoding. Timestamp freshness does
        not reject repeated identical requests; use endpoint idempotency where
        supported. Existing legacy signing remains supported during server-first
        migration; SDK RFC 9421 signing is opt-in. See
        https://docs.0xmonaco.com/reference/http-message-signatures for the
        complete profile and trust model.
      name: Signature
      in: header

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.