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

# Estimate Swap

> Preview the price, fees, and amounts for a swap without placing it.

Inputs: ``src_asset``, ``dst_asset``, and exactly one of
``req_spend_amount`` (how much of ``src_asset`` to spend) or
``req_get_amount`` (how much of ``dst_asset`` to receive). For
a buy set ``src_asset="AUD"`` and ``dst_asset`` to the crypto
code; for a sell set ``src_asset`` to the crypto code and
``dst_asset="AUD"``.

Returns the estimated price, per-asset fees (``src_fee``,
``dst_fee``), estimated amounts, and ``estimated_price_exact``.
No funds are moved.

This is a mandatory preview step before ``create``. Pass the
returned ``estimated_price_exact`` as ``expected_price`` on
``create`` for slippage protection.



## OpenAPI

````yaml /openapi.json post /api/private/swaps/estimate/
openapi: 3.0.3
info:
  title: Digital Surge API
  version: '2.0'
  description: >-
    Digital Surge is an Australian cryptocurrency exchange. This API provides
    programmatic access to your account: live AUD pricing for hundreds of
    assets, instant swaps, recurring buys, price triggers, portfolio balances,
    transaction history, and crypto withdrawals.


    **Authentication** — create an API key in the Digital Surge app under
    *Account Settings → API Keys* and send it with every request:
    `Authorization: Bearer <your-api-key>`. Read-only and read & write keys are
    available.


    **Guides and interactive documentation** — https://digitalsurge.com.au/docs


    **AI agents** — connect via the Digital Surge MCP server:
    https://mcp.digitalsurge.com.au/mcp
servers:
  - url: https://app.digitalsurge.com.au
    description: Production
security: []
tags:
  - name: Public
    description: Unauthenticated endpoints — market data, asset info, pricing
  - name: Private
    description: Authenticated endpoints — trading, portfolio, account management
paths:
  /api/private/swaps/estimate/:
    post:
      tags:
        - Private
      summary: Estimate Swap
      description: |-
        Preview the price, fees, and amounts for a swap without placing it.

        Inputs: ``src_asset``, ``dst_asset``, and exactly one of
        ``req_spend_amount`` (how much of ``src_asset`` to spend) or
        ``req_get_amount`` (how much of ``dst_asset`` to receive). For
        a buy set ``src_asset="AUD"`` and ``dst_asset`` to the crypto
        code; for a sell set ``src_asset`` to the crypto code and
        ``dst_asset="AUD"``.

        Returns the estimated price, per-asset fees (``src_fee``,
        ``dst_fee``), estimated amounts, and ``estimated_price_exact``.
        No funds are moved.

        This is a mandatory preview step before ``create``. Pass the
        returned ``estimated_price_exact`` as ``expected_price`` on
        ``create`` for slippage protection.
      operationId: private_swaps_estimate_create
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SwapEstimateRequest'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/SwapEstimateRequest'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/SwapEstimateRequest'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SwapEstimate'
          description: ''
      security:
        - bearerAuth: []
components:
  schemas:
    SwapEstimateRequest:
      type: object
      description: >-
        A swap quote: the estimated price, per-asset fees, and amounts for a
        proposed swap. No funds move.
      properties:
        src_asset:
          type: string
          minLength: 1
          title: Source asset
        dst_asset:
          type: string
          minLength: 1
          title: Destination asset
        req_get_amount:
          type: string
          format: decimal
          nullable: true
          title: Requested amount to get
          description: Net amount, after subtracting the fee
        req_spend_amount:
          type: string
          format: decimal
          nullable: true
          title: Requested amount to spend
          description: Total amount, incl. the fee
      required:
        - dst_asset
        - src_asset
    SwapEstimate:
      type: object
      description: >-
        A swap quote: the estimated price, per-asset fees, and amounts for a
        proposed swap. No funds move.
      properties:
        src_asset:
          type: string
          title: Source asset
        dst_asset:
          type: string
          title: Destination asset
        req_get_amount:
          type: string
          format: decimal
          nullable: true
          title: Requested amount to get
          description: Net amount, after subtracting the fee
        req_spend_amount:
          type: string
          format: decimal
          nullable: true
          title: Requested amount to spend
          description: Total amount, incl. the fee
        src_fee:
          type: string
          format: decimal
          readOnly: true
          nullable: true
          title: Fee (sold asset)
        dst_fee:
          type: string
          format: decimal
          readOnly: true
          nullable: true
          title: Fee (bought asset)
        estimated_price:
          type: string
          format: decimal
          readOnly: true
        estimated_price_exact:
          type: string
          format: decimal
          readOnly: true
        est_sell_amount:
          type: string
          readOnly: true
        est_buy_amount:
          type: string
          readOnly: true
        estimate_id:
          type: string
          format: uuid
          readOnly: true
        slippage:
          type: string
          format: decimal
          readOnly: true
      required:
        - dst_asset
        - dst_fee
        - est_buy_amount
        - est_sell_amount
        - estimate_id
        - estimated_price
        - estimated_price_exact
        - slippage
        - src_asset
        - src_fee
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Personal API key, created in the Digital Surge app under Account
        Settings → API Keys. Send it with every request as `Authorization:
        Bearer <your-api-key>`.

````