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

# List Swaps

> Swap one asset directly for another at the current market price —
this is the **instant / one-shot** trade flow. For recurring or
scheduled buys (DCA), use the broker schedules endpoints instead.

Direction is implied by which asset is AUD:
    - BUY a crypto: ``src_asset="AUD"``, ``dst_asset=<crypto code>``
    - SELL a crypto: ``src_asset=<crypto code>``, ``dst_asset="AUD"``

Listing returns swap history, most recent first. Retrieving by
``id`` returns the current state of a single swap — used after
``create`` to check whether ``status`` has moved from
``processing`` to ``processed``, ``error``, or ``canceled``.

Placing a new swap is a two-step flow: ``estimate`` first to
preview price, fees, and amounts, ask the user to confirm, then
``create`` to execute.
See the per-operation documentation for details.



## OpenAPI

````yaml /openapi.json get /api/private/swaps/
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/:
    get:
      tags:
        - Private
      summary: List Swaps
      description: |-
        Swap one asset directly for another at the current market price —
        this is the **instant / one-shot** trade flow. For recurring or
        scheduled buys (DCA), use the broker schedules endpoints instead.

        Direction is implied by which asset is AUD:
            - BUY a crypto: ``src_asset="AUD"``, ``dst_asset=<crypto code>``
            - SELL a crypto: ``src_asset=<crypto code>``, ``dst_asset="AUD"``

        Listing returns swap history, most recent first. Retrieving by
        ``id`` returns the current state of a single swap — used after
        ``create`` to check whether ``status`` has moved from
        ``processing`` to ``processed``, ``error``, or ``canceled``.

        Placing a new swap is a two-step flow: ``estimate`` first to
        preview price, fees, and amounts, ask the user to confirm, then
        ``create`` to execute.
        See the per-operation documentation for details.
      operationId: private_swaps_list
      parameters:
        - name: page
          required: false
          in: query
          description: A page number within the paginated result set.
          schema:
            type: integer
        - name: page_size
          required: false
          in: query
          description: Number of results to return per page.
          schema:
            type: integer
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedSwapReadList'
          description: ''
      security:
        - bearerAuth: []
components:
  schemas:
    PaginatedSwapReadList:
      type: object
      required:
        - count
        - results
      properties:
        count:
          type: integer
          example: 123
        next:
          type: string
          nullable: true
          format: uri
          example: http://api.example.org/accounts/?page=4
        previous:
          type: string
          nullable: true
          format: uri
          example: http://api.example.org/accounts/?page=2
        results:
          type: array
          items:
            $ref: '#/components/schemas/SwapRead'
    SwapRead:
      type: object
      description: >-
        Read-only view of a swap, extending the create serializer with
        aud_value.


        aud_value is null while the swap is processing and populated once it

        reaches a terminal state (processed/rejected). For AUD-involved trades

        the value is exact; for crypto-to-crypto it is the ticker-estimated

        AUD value at the time of finalization.
      properties:
        id:
          type: integer
          readOnly: true
        status:
          allOf:
            - $ref: '#/components/schemas/Status168Enum'
          readOnly: true
        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
        expected_price:
          type: string
          format: decimal
          nullable: true
          title: Expected price from user
        bought_amount:
          type: string
          format: decimal
          readOnly: true
          nullable: true
          description: Final amount bought by the customer
        sold_amount:
          type: string
          format: decimal
          readOnly: true
          nullable: true
          description: Final amount sold by the customer
        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)
        aud_value:
          type: string
          format: decimal
          readOnly: true
          nullable: true
          description: For reference purposes only.
      required:
        - aud_value
        - bought_amount
        - dst_asset
        - dst_fee
        - id
        - sold_amount
        - src_asset
        - src_fee
        - status
    Status168Enum:
      enum:
        - 5
        - 10
        - 12
        - 15
        - 20
        - 40
        - 60
      type: integer
      description: |-
        * `5` - quote
        * `10` - pending
        * `12` - estimated
        * `15` - processing
        * `20` - error
        * `40` - rejected
        * `60` - processed
  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>`.

````