---
agentTools:
  projectIndex: https://ociswap.readme.io/llms.txt
---

# Returns a paginated list of pool events of a token, newest first

Returns a paginated list of pool events of a token, newest first

# OpenAPI definition

```json
{
  "openapi": "3.0.0",
  "info": {
    "version": "0.6.1",
    "title": "Ociswap API",
    "description": "Ociswap API",
    "license": {
      "name": "MIT License",
      "url": "https://api.ociswap.com/license"
    }
  },
  "servers": [
    {
      "url": "https://api.ociswap.com"
    }
  ],
  "security": [],
  "paths": {
    "/tokens/{token_identifier}/events": {
      "get": {
        "operationId": "token_events",
        "description": "Returns a paginated list of pool events of a token, newest first",
        "summary": "Returns a paginated list of pool events of a token, newest first",
        "parameters": [
          {
            "name": "token_identifier",
            "in": "path",
            "required": true,
            "description": "Unique identifier of the token to fetch. This can be either its resource address or its slug.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "description": "Use this cursor to paginate through the list of items. Provide the next_cursor value from a previous response to retrieve the next set of results.",
            "schema": {
              "type": "integer",
              "default": 0
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Specifies the maximum number of items to be returned per page. Adjust this value to control the number of results shown in each response.",
            "schema": {
              "type": "integer",
              "default": 50,
              "maximum": 100
            }
          },
          {
            "name": "type",
            "in": "query",
            "description": "Specify the event types to be retrieved by listing them as a comma-separated sequence. By default, all event types are returned.",
            "schema": {
              "type": "array",
              "items": {
                "$ref": "#/components/schemas/EventType"
              }
            },
            "style": "form",
            "explode": false
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/EventList"
          },
          "400": {
            "description": "Invalid request",
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "description": "Not found",
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "description": "An unexpected error occured",
            "$ref": "#/components/responses/Error"
          }
        }
      }
    }
  },
  "components": {
    "responses": {
      "Error": {
        "description": "Error response",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "required": [
                "error"
              ],
              "properties": {
                "error": {
                  "type": "string",
                  "description": "Error message"
                }
              }
            }
          }
        }
      },
      "EventList": {
        "description": "Successful response",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "data": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Event"
                  }
                },
                "next_cursor": {
                  "type": "integer"
                }
              }
            }
          }
        }
      }
    },
    "schemas": {
      "ResourceAddress": {
        "description": "Bech32m-encoded human readable version of the resource (fungible, non-fungible) global address or hex-encoded id.",
        "type": "string"
      },
      "TransactionID": {
        "description": "Bech32m-encoded human readable version of the transaction id.",
        "type": "string"
      },
      "Decimal": {
        "description": "String-encoded decimal representing the amount of a related fungible resource.",
        "type": "string",
        "format": "decimal"
      },
      "NonFungibleId": {
        "description": "String-encoded non-fungible ID.",
        "type": "string"
      },
      "Event": {
        "anyOf": [
          {
            "$ref": "#/components/schemas/InstantiatePoolEvent"
          },
          {
            "$ref": "#/components/schemas/AddLiquidityEvent"
          },
          {
            "$ref": "#/components/schemas/RemoveLiquidityEvent"
          },
          {
            "$ref": "#/components/schemas/SwapEvent"
          }
        ]
      },
      "TokenEmbedded": {
        "type": "object",
        "required": [
          "address",
          "name",
          "symbol"
        ],
        "properties": {
          "address": {
            "$ref": "#/components/schemas/ResourceAddress"
          },
          "name": {
            "type": "string"
          },
          "symbol": {
            "type": "string"
          },
          "slug": {
            "type": "string"
          },
          "icon_url": {
            "type": "string"
          }
        }
      },
      "PoolEmbedded": {
        "type": "object",
        "properties": {
          "address": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "slug": {
            "type": "string"
          },
          "fee_rate": {
            "$ref": "#/components/schemas/Decimal"
          },
          "x": {
            "$ref": "#/components/schemas/TokenEmbedded"
          },
          "y": {
            "$ref": "#/components/schemas/TokenEmbedded"
          },
          "base_token": {
            "description": "The token that is recommended to be used as the base token for this pool in a user interface",
            "type": "string",
            "enum": [
              "x",
              "y"
            ]
          }
        }
      },
      "Amounts": {
        "type": "object",
        "properties": {
          "token": {
            "$ref": "#/components/schemas/Decimal"
          },
          "xrd": {
            "$ref": "#/components/schemas/Decimal"
          },
          "usd": {
            "$ref": "#/components/schemas/Decimal"
          }
        }
      },
      "BaseAmounts": {
        "type": "object",
        "properties": {
          "xrd": {
            "$ref": "#/components/schemas/Decimal"
          },
          "usd": {
            "$ref": "#/components/schemas/Decimal"
          }
        }
      },
      "InstantiatePoolEvent": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "instantiate_pool"
            ]
          },
          "timestamp": {
            "type": "string",
            "format": "date-time"
          },
          "transaction_id": {
            "$ref": "#/components/schemas/TransactionID"
          },
          "pool": {
            "$ref": "#/components/schemas/PoolEmbedded"
          }
        }
      },
      "AddLiquidityEvent": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "add_liquidity"
            ]
          },
          "timestamp": {
            "type": "string",
            "format": "date-time"
          },
          "transaction_id": {
            "$ref": "#/components/schemas/TransactionID"
          },
          "pool": {
            "$ref": "#/components/schemas/PoolEmbedded"
          },
          "left_bound": {
            "$ref": "#/components/schemas/Bound"
          },
          "right_bound": {
            "$ref": "#/components/schemas/Bound"
          },
          "lp_nft_id": {
            "$ref": "#/components/schemas/NonFungibleId"
          },
          "x": {
            "$ref": "#/components/schemas/Amounts"
          },
          "y": {
            "$ref": "#/components/schemas/Amounts"
          },
          "liquidity": {
            "$ref": "#/components/schemas/Amounts"
          }
        }
      },
      "RemoveLiquidityEvent": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "remove_liquidity"
            ]
          },
          "timestamp": {
            "type": "string",
            "format": "date-time"
          },
          "transaction_id": {
            "$ref": "#/components/schemas/TransactionID"
          },
          "pool": {
            "$ref": "#/components/schemas/PoolEmbedded"
          },
          "lp_nft_id": {
            "$ref": "#/components/schemas/NonFungibleId"
          },
          "x": {
            "$ref": "#/components/schemas/Amounts"
          },
          "y": {
            "$ref": "#/components/schemas/Amounts"
          },
          "liquidity": {
            "$ref": "#/components/schemas/Amounts"
          }
        }
      },
      "SwapEventToken": {
        "type": "object",
        "properties": {
          "price": {
            "$ref": "#/components/schemas/Amounts"
          },
          "amount": {
            "$ref": "#/components/schemas/Amounts"
          },
          "fee": {
            "$ref": "#/components/schemas/Amounts"
          }
        }
      },
      "SwapEvent": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "swap"
            ]
          },
          "swap_type": {
            "type": "string",
            "enum": [
              "buy_x",
              "sell_x"
            ]
          },
          "timestamp": {
            "type": "string",
            "format": "date-time"
          },
          "transaction_id": {
            "$ref": "#/components/schemas/TransactionID"
          },
          "pool": {
            "$ref": "#/components/schemas/PoolEmbedded"
          },
          "x": {
            "$ref": "#/components/schemas/SwapEventToken"
          },
          "y": {
            "$ref": "#/components/schemas/SwapEventToken"
          },
          "volume": {
            "$ref": "#/components/schemas/BaseAmounts"
          },
          "fee": {
            "$ref": "#/components/schemas/BaseAmounts"
          }
        }
      },
      "EventType": {
        "type": "string",
        "enum": [
          "instantiate_pool",
          "add_liquidity",
          "remove_liquidity",
          "swap"
        ]
      },
      "Bound": {
        "type": "object",
        "properties": {
          "price": {
            "$ref": "#/components/schemas/Decimal"
          },
          "tick": {
            "type": "integer"
          }
        }
      }
    }
  },
  "x-readme": {
    "explorer-enabled": true,
    "proxy-enabled": true
  },
  "_id": {
    "buffer": {
      "0": 101,
      "1": 18,
      "2": 175,
      "3": 145,
      "4": 46,
      "5": 146,
      "6": 246,
      "7": 0,
      "8": 30,
      "9": 1,
      "10": 34,
      "11": 138
    }
  }
}
```