# Txs

## GET /v2/txs/swap/{pair-id}

> swap tx history by pair\_address (50 CU)

```json
{"openapi":"3.0.3","info":{"title":"Ave API (REST)","version":"2.1.0"},"servers":[{"url":"https://prod.ave-api.com"},{"url":"https://data.ave-api.xyz"}],"security":[{"ApiKeyAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"X-API-KEY"}},"schemas":{"SwapTxsResponse":{"type":"object","properties":{"txs":{"type":"array","items":{"$ref":"#/components/schemas/SwapTx"}}}},"SwapTx":{"type":"object","properties":{"tx_id":{"type":"string","description":"Transaction id"},"time":{"type":"integer","description":"Unix epoch seconds"},"chain":{"type":"string"},"pair":{"type":"string"},"sender":{"type":"string"},"from_address":{"type":"string"},"from_symbol":{"type":"string"},"from_amount":{"type":"string"},"from_price_usd":{"type":"string"},"to_address":{"type":"string"},"to_symbol":{"type":"string"},"to_amount":{"type":"string"},"to_price_usd":{"type":"string"},"price":{"type":"string"},"price_usd":{"type":"string"},"block_number":{"type":"integer"}},"required":["tx_id","time","chain","pair","sender","from_address","from_symbol","from_amount","from_price_usd","to_address","to_symbol","to_amount","to_price_usd","price","price_usd","block_number"]}}},"paths":{"/v2/txs/swap/{pair-id}":{"get":{"summary":"swap tx history by pair_address (50 CU)","parameters":[{"name":"pair-id","in":"path","required":true,"description":"pair address and chain in format `<pair_address>-<chain>` (e.g. '2prhzdRwWzas2f4g5AAjyRUBcQcdajxd8NAzKcqhv76P-solana')","schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"description":"number of txs returned (default: 100, max: 300)","schema":{"type":"integer","default":100,"maximum":300}},{"name":"from_time","in":"query","required":false,"description":"unix epoch seconds for start time (earliest 90 days ago)","schema":{"type":"integer"}},{"name":"to_time","in":"query","required":false,"description":"unix epoch seconds for end time (default: current time)","schema":{"type":"integer"}},{"name":"sort","in":"query","required":false,"description":"sort order for returned txs: 'asc' or 'desc' (default: asc)","schema":{"type":"string","default":"asc"}}],"responses":{"200":{"description":"successful response with swap txs","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SwapTxsResponse"}}}},"400":{"description":"bad request"},"401":{"description":"unauthorized (missing or invalid API key)"},"403":{"description":"forbidden (API key expired)"},"500":{"description":"server error"}}}}}}
```

## GET /v2/txs/liq/{pair-id}

> liquidity change tx history by pair\_address (50 CU)

```json
{"openapi":"3.0.3","info":{"title":"Ave API (REST)","version":"2.1.0"},"servers":[{"url":"https://prod.ave-api.com"},{"url":"https://data.ave-api.xyz"}],"security":[{"ApiKeyAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"X-API-KEY"}},"schemas":{"LiqTxsResponse":{"type":"object","properties":{"txs":{"type":"array","items":{"$ref":"#/components/schemas/LiqTx"}}}},"LiqTx":{"type":"object","properties":{"tx_id":{"type":"string","description":"Transaction id"},"time":{"type":"integer","description":"Unix epoch seconds"},"chain":{"type":"string"},"pair":{"type":"string"},"sender":{"type":"string"},"from_address":{"type":"string"},"from_symbol":{"type":"string"},"from_amount":{"type":"string"},"from_price_usd":{"type":"string"},"to_address":{"type":"string"},"to_symbol":{"type":"string"},"to_amount":{"type":"string"},"to_price_usd":{"type":"string"},"price":{"type":"string"},"price_usd":{"type":"string"},"block_number":{"type":"integer"}},"required":["tx_id","time","chain","pair","sender","from_address","from_symbol","from_amount","from_price_usd","to_address","to_symbol","to_amount","to_price_usd","price","price_usd","block_number"]}}},"paths":{"/v2/txs/liq/{pair-id}":{"get":{"summary":"liquidity change tx history by pair_address (50 CU)","parameters":[{"name":"pair-id","in":"path","required":true,"description":"pair address and chain in format `<pair_address>-<chain>` (e.g. '2prhzdRwWzas2f4g5AAjyRUBcQcdajxd8NAzKcqhv76P-solana')","schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"description":"number of transactions to return (default: 100, max: 300)","schema":{"type":"integer","default":100,"maximum":300}},{"name":"from_time","in":"query","required":false,"description":"unix epoch seconds for start time (earliest 90 days ago)","schema":{"type":"integer"}},{"name":"to_time","in":"query","required":false,"description":"unix epoch seconds for end time (default: current time)","schema":{"type":"integer"}},{"name":"sort","in":"query","required":false,"description":"sort order for returned txs: 'asc' or 'desc' (default: asc)","schema":{"type":"string","default":"asc"}},{"name":"type","in":"query","required":false,"description":"tx type: 'all', 'addLiquidity', 'removeLiquidity', 'createPair'","schema":{"type":"string","default":"all"}}],"responses":{"200":{"description":"successful response with liquidity transactions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LiqTxsResponse"}}}},"400":{"description":"bad request"},"401":{"description":"unauthorized (missing or invalid API key)"},"403":{"description":"forbidden (API key expired)"},"500":{"description":"server error"}}}}}}
```

## GET /v2/address/tx

> token tx history for wallet address (100 CU)

```json
{"openapi":"3.0.3","info":{"title":"Ave API (REST)","version":"2.1.0"},"servers":[{"url":"https://prod.ave-api.com"},{"url":"https://data.ave-api.xyz"}],"security":[{"ApiKeyAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"X-API-KEY"}},"schemas":{"WalletTxsResponse":{"type":"object","properties":{"result":{"type":"array","items":{"$ref":"#/components/schemas/WalletTx"}}}},"WalletTx":{"type":"object","properties":{"id":{"type":"string","description":"Transaction id"},"time":{"type":"integer","description":"Unix epoch seconds"},"chain":{"type":"string"},"transaction":{"type":"string"},"block_number":{"type":"integer"},"sender":{"type":"string"},"to":{"type":"string"},"from_address":{"type":"string"},"from_price_usd":{"type":"string"},"from_symbol":{"type":"string"},"from_amount":{"type":"string"},"to_address":{"type":"string"},"to_price_usd":{"type":"string"},"to_symbol":{"type":"string"},"to_amount":{"type":"string"},"wallet_address":{"type":"string"}},"required":["id","time","chain","transaction","block_number","sender","to","from_address","from_price_usd","from_symbol","from_amount","to_address","to_price_usd","to_symbol","to_amount","wallet_address"]}}},"paths":{"/v2/address/tx":{"get":{"summary":"token tx history for wallet address (100 CU)","parameters":[{"name":"wallet_address","in":"query","required":true,"description":"wallet address (e.g. '6vPLQSv1zBoMxw5tWddu7uoq22swzBiJqLVXvMfTnm1z')","schema":{"type":"string"}},{"name":"chain","in":"query","required":true,"description":"chain name (e.g. 'solana')","schema":{"type":"string"}},{"name":"token_address","in":"query","required":true,"description":"token address (e.g. 'BZJwxWB1YMsY5whCnGsVVyfvv3mkvqUrDckz3cGtR9MB')","schema":{"type":"string"}},{"name":"from_time","in":"query","required":false,"description":"unix epoch seconds for start time (earliest 15 days ago)","schema":{"type":"integer"}},{"name":"to_time","in":"query","required":false,"description":"end time (RFC3339, default: now)","schema":{"type":"string"}},{"name":"page_size","in":"query","required":false,"description":"number of results per page (default and max: 100)","schema":{"type":"integer","default":100,"maximum":100}},{"name":"last_id","in":"query","required":false,"description":"pagination, only needed for next page","schema":{"type":"string"}}],"responses":{"200":{"description":"Successful response with wallet transactions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WalletTxsResponse"}}}},"400":{"description":"bad request"},"401":{"description":"unauthorized (missing or invalid API key)"},"403":{"description":"forbidden (API key expired)"},"500":{"description":"server error"}}}}}}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://ave-cloud.gitbook.io/data-api/rest/txs.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
