# Normalized Trades

## POST /sailfish/trades/query

> Query normalized trades

```json
{"openapi":"3.1.0","info":{"title":"Sailfish API","version":"1.0.0"},"servers":[{"url":"https://free.sailfish.solanavibestation.com","description":"Free tier"},{"url":"https://basic.sailfish.solanavibestation.com","description":"Basic tier (requires Authorization header)"}],"paths":{"/sailfish/trades/query":{"post":{"summary":"Query normalized trades","operationId":"fetchTrades","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TradesQuery"}}}},"responses":{"200":{"description":"Map of trades grouped by backend-defined key (e.g. pool address or tick)","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"type":"array","items":{"$ref":"#/components/schemas/Trade"}}}}}}}}}},"components":{"schemas":{"TradesQuery":{"type":"object","properties":{"lower_tick":{"type":"integer"},"upper_tick":{"type":"integer"},"pool_types":{"type":"array","items":{"$ref":"#/components/schemas/PoolType"}},"pool_addresses":{"type":"array","items":{"type":"string"}},"token_addresses":{"type":"array","items":{"type":"string"}},"to_wallets":{"type":"array","items":{"type":"string"}},"from_wallets":{"type":"array","items":{"type":"string"}}},"required":["lower_tick","upper_tick","pool_types","pool_addresses","token_addresses","to_wallets","from_wallets"]},"PoolType":{"type":"string","enum":["RaydiumAmm","RaydiumCpmm","RaydiumClmm","RaydiumLaunchpad","PumpSwapAmm","PumpFunAmm","MeteoraDyn","MeteoraDynV2"]},"Trade":{"type":"object","description":"Normalized trade with base/quote semantics","properties":{"index":{"$ref":"#/components/schemas/TradeIndex"},"pool_address":{"type":"string"},"quote_token_address":{"type":"string"},"base_token_address":{"type":"string"},"quote_amount":{"type":"string","description":"Signed change in quote token balance"},"base_amount":{"type":"string","description":"Signed change in base token balance"},"price":{"type":"string","description":"base_token / quote_token"},"fee":{"type":"string"},"bribe":{"type":"string"},"from_wallet":{"type":"string"},"to_wallet":{"type":"string"},"from_wallet_account":{"type":"string","nullable":true},"to_wallet_account":{"type":"string","nullable":true}},"required":["index","pool_address","quote_token_address","base_token_address","quote_amount","base_amount","price","fee","bribe","from_wallet","to_wallet"]},"TradeIndex":{"type":"object","properties":{"tick":{"type":"integer","description":"Typically block/slot number"},"index_a":{"type":"integer","description":"Index within the tick"},"index_b":{"type":"integer","description":"Index within the transaction"},"tx_hash":{"type":"string"}},"required":["tick","index_a","index_b","tx_hash"]}}}}
```
