# Endpoints

Quick reference for all Turbine API endpoints.

Base URL:

```
https://api.turbinefi.com/api/v1
```

***

## Authentication (authentication.md)

| Method | Path        | Description                               | Auth |
| ------ | ----------- | ----------------------------------------- | ---- |
| POST   | `/api-keys` | Register a new API key (wallet signature) | No   |

***

## Markets (markets.md)

| Method | Path                   | Description                  | Auth |
| ------ | ---------------------- | ---------------------------- | ---- |
| GET    | `/markets`             | List all markets             | No   |
| GET    | `/stats/{marketId}`    | Get market statistics        | No   |
| GET    | `/holders/{marketId}`  | Get top token holders        | No   |
| GET    | `/activity/{marketId}` | Get market activity feed     | No   |
| GET    | `/platform/stats`      | Get platform-wide statistics | No   |
| GET    | `/comments/{marketId}` | Get market comments          | No   |
| POST   | `/comments/{marketId}` | Post a comment               | Yes  |

***

## Orderbook (orderbook.md)

| Method | Path                    | Description         | Auth |
| ------ | ----------------------- | ------------------- | ---- |
| GET    | `/orderbook/{marketId}` | Get orderbook depth | No   |

***

## Orders (orders.md)

| Method | Path                      | Description                      | Auth |
| ------ | ------------------------- | -------------------------------- | ---- |
| POST   | `/orders`                 | Submit a signed order            | Yes  |
| GET    | `/orders`                 | Get open orders for a trader     | Yes  |
| DELETE | `/orders/{hash}`          | Cancel an open order             | Yes  |
| GET    | `/users/{address}/orders` | Get all orders across markets    | Yes  |
| GET    | `/failed-trades`          | Get failed trade settlements     | No   |
| GET    | `/pending-trades`         | Get trades awaiting confirmation | No   |
| GET    | `/settlements/{txHash}`   | Look up settlement status        | No   |

***

## Trades (trades.md)

| Method | Path                        | Description                           | Auth |
| ------ | --------------------------- | ------------------------------------- | ---- |
| GET    | `/trades/{marketId}`        | Get recent trades for a market        | No   |
| GET    | `/users/{address}/activity` | Get user trade and settlement history | Yes  |

***

## Positions (positions.md)

| Method | Path                         | Description                         | Auth |
| ------ | ---------------------------- | ----------------------------------- | ---- |
| GET    | `/positions/{marketAddress}` | Get user position in a market       | Yes  |
| POST   | `/positions/{marketId}/sync` | Force-sync position from blockchain | Yes  |
| GET    | `/users/{address}/positions` | Get all positions across markets    | Yes  |

***

## Quick Markets (quick-markets.md)

| Method | Path                                   | Description                    | Auth |
| ------ | -------------------------------------- | ------------------------------ | ---- |
| GET    | `/quick-markets/{asset}`               | Get active quick market        | No   |
| GET    | `/quick-markets/{asset}/history`       | Get recent quick markets       | No   |
| GET    | `/quick-markets/{asset}/price`         | Get current asset price        | No   |
| GET    | `/quick-markets/{asset}/price-history` | Get 20-minute price history    | No   |
| GET    | `/quick-markets/{asset}/price-stream`  | SSE stream of real-time prices | No   |

***

## Resolution (resolution.md)

| Method | Path                     | Description                  | Auth |
| ------ | ------------------------ | ---------------------------- | ---- |
| GET    | `/resolution/{marketId}` | Get market resolution status | No   |

***

## Gasless Relayer (gasless-relayer.md)

| Method | Path                            | Description                          | Auth |
| ------ | ------------------------------- | ------------------------------------ | ---- |
| POST   | `/relayer/ctf-approval`         | Approve CTF transfers gaslessly      | Yes  |
| POST   | `/relayer/usdc-permit`          | Approve USDC spending gaslessly      | Yes  |
| POST   | `/relayer/ctf-redemption`       | Redeem outcome tokens for USDC       | Yes  |
| POST   | `/relayer/batch-ctf-redemption` | Batch redeem across multiple markets | Yes  |
| POST   | `/relayer/propose-resolution`   | Propose market resolution via UMA    | Yes  |
| POST   | `/relayer/settle-market`        | Settle market after dispute window   | Yes  |
| GET    | `/pending-claims`               | Get pending redemptions              | No   |
| GET    | `/failed-claims`                | Get failed redemptions               | No   |

***

## WebSocket (websocket.md)

| Protocol | Path      | Description                                    | Auth |
| -------- | --------- | ---------------------------------------------- | ---- |
| WS       | `/stream` | Real-time orderbook, trade, and market updates | No   |

### Event Types

| Event             | Description                      | Scope                   |
| ----------------- | -------------------------------- | ----------------------- |
| `orderbook`       | Full orderbook snapshot          | Per-market subscription |
| `trade`           | Trade executed                   | Per-market subscription |
| `trade_error`     | Settlement failed                | Per-market subscription |
| `order_cancelled` | Order cancelled                  | Per-market subscription |
| `quick_market`    | Quick market created or resolved | All clients             |
