---
title: "Get all swap messages in the pool's current batch."
method: GET
path: "/cosmos/liquidity/v1beta1/pools/{pool_id}/batch/swaps"
tags: ["Query"]
---

# Get all swap messages in the pool's current batch.

`GET /cosmos/liquidity/v1beta1/pools/{pool_id}/batch/swaps`

## Request

- The document declares no server URL.
- Auth: none declared

Returns a list of all swap messages in the current batch of the pool with pagination result.

## Path parameters

- `pool_id` string, uint64, required

## Query parameters

- `pagination.key` string, byte
- `pagination.offset` string, uint64
- `pagination.limit` string, uint64
- `pagination.count_total` boolean

## Response `200`

A successful response.

- object: the response type for the QueryPoolBatchSwapMsgs RPC method. This includes list of all currently existing swap messages of the batch and paging results that contain next_key and total count.
  - `swaps` object[]
    - `msg_height` string, int64
    - `msg_index` string, uint64
    - `executed` boolean
    - `succeeded` boolean
    - `to_be_deleted` boolean
    - `order_expiry_height` string, int64
    - `exchanged_offer_coin` object: Coin defines a token with a denomination and an amount. NOTE: The amount field is an Int which implements the custom method signatures required by gogoproto.
      - `denom` string
      - `amount` string
    - `remaining_offer_coin` object: Coin defines a token with a denomination and an amount. NOTE: The amount field is an Int which implements the custom method signatures required by gogoproto.
      - `denom` string
      - `amount` string
    - `reserved_offer_coin_fee` object: Coin defines a token with a denomination and an amount. NOTE: The amount field is an Int which implements the custom method signatures required by gogoproto.
      - `denom` string
      - `amount` string
    - `msg` object: `MsgSwapWithinBatch` defines an sdk.Msg type that supports submitting a swap offer request to the batch of the liquidity pool. Submit swap offer to the liquidity pool batch with the specified the `pool_id`, `swap_type_id`, `demand_coin_denom` with the coin and the price you're offering and `offer_coin_fee` must be half of offer coin amount * current `params.swap_fee_rate` and ceil for reservation to pay fees. This request is stacked in the batch of the liquidity pool, is not processed immediately, and is processed in the `endblock` at the same time as other requests. You must request the same fields as the pool. Only the default `swap_type_id` 1 is supported. See: https://github.com/tendermint/liquidity/tree/develop/doc https://github.com/tendermint/liquidity/blob/develop/x/liquidity/spec/04_messages.md
      - `swap_requester_address` string, sdk.AccAddress: account address of the origin of this message
      - `pool_id` string, uint64: id of swap type, must match the value in the pool. Only `swap_type_id` 1 is supported.
      - `swap_type_id` integer: id of swap type. Must match the value in the pool.
      - `offer_coin` object: Coin defines a token with a denomination and an amount. NOTE: The amount field is an Int which implements the custom method signatures required by gogoproto.
        - `denom` string
        - `amount` string
      - `demand_coin_denom` string: denom of demand coin to be exchanged on the swap request, must match the denom in the pool.
      - `offer_coin_fee` object: Coin defines a token with a denomination and an amount. NOTE: The amount field is an Int which implements the custom method signatures required by gogoproto.
        - `denom` string
        - `amount` string
      - `order_price` string, sdk.Dec: limit order price for the order, the price is the exchange ratio of X/Y where X is the amount of the first coin and Y is the amount of the second coin when their denoms are sorted alphabetically.
  - `pagination` object: pagination defines the pagination in the response. not working on this version.
    - `next_key` string, byte
    - `total` string, uint64

## Other responses

- `400`: Bad Request
- `500`: Internal Server Error
- `default`: An unexpected error response.

## Changes

- **2021-06-14** `72ec621a68fb`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/tendermint/apis/cosmos-sdk-liquidity-module-rest-and-grpc-gateway-docs/changes/cosmos/liquidity/v1beta1/pools/:pool_id/batch/swaps/get.md)

---

[API](https://skmtc.dev/tendermint/apis/cosmos-sdk-liquidity-module-rest-and-grpc-gateway-docs.md) - [All operations](https://skmtc.dev/tendermint/apis/cosmos-sdk-liquidity-module-rest-and-grpc-gateway-docs/llms.txt) - [OpenAPI document](https://skmtc.dev/tendermint/apis/cosmos-sdk-liquidity-module-rest-and-grpc-gateway-docs/revisions/ba84c1cbfb4b?raw)
