# Commands

## Market data

### Tickers (Read)

Show the current mid price and 24h statistics. Omit `--pair` to get all active pairs.

```bash
bp-fusion tickers
bp-fusion tickers --pair BTC-EUR
bp-fusion tickers --pair BTC-EUR,ETH-EUR
```

### Trading pairs (Read)

Show active trading pairs with order sizing constraints (min/max order size, tick size, price increments).

```bash
bp-fusion pairs
bp-fusion pairs --pair BTC-EUR
bp-fusion pairs --pair BTC-EUR,ETH-EUR
bp-fusion pairs -o csv > pairs.csv
```

### Orderbook (Read)

```bash
bp-fusion orderbook BTC-EUR
bp-fusion orderbook BTC-EUR --depth 5
```

| Flag | Default | Description |
|---|---|---|
| `--depth`, `-d` | `10` | Price levels per side (1–100) |

### Candles (Read)

Show OHLCV candlestick data for a trading pair.

```bash
bp-fusion candles BTC-EUR
bp-fusion candles BTC-EUR --interval 1h
bp-fusion candles BTC-EUR --interval 1h --limit 48
bp-fusion candles BTC-EUR --interval 5m --from 2024-01-01T00:00:00Z --to 2024-01-02T00:00:00Z
bp-fusion candles BTC-EUR --interval 1d --limit 30 -o json
```

| Flag | Default | Description |
|---|---|---|
| `--interval` | `1d` | Bar interval: `1m`, `5m`, `10m`, `15m`, `30m`, `1h`, `4h`, `1d` |
| `--from` | — | Start time (RFC3339) |
| `--to` | — | End time (RFC3339) |
| `--limit` | `1440` | Bars to return, counted back from `--to`. When set, `--from` is ignored (1–1440) |

### Assets (Read)

List supported assets (crypto and fiat) with their type.

```bash
bp-fusion assets
bp-fusion assets --asset BTC
bp-fusion assets --asset BTC,ETH,EUR
bp-fusion assets -o json
```

---

## Account

### Account info (Read)

Show your 30-day traded volume and current fee tier.

```bash
bp-fusion account info
bp-fusion account info -o json
```

Output columns: `30D VOLUME` · `TIER` · `FEE` · `NEXT TIER` · `NEXT FEE`

### Balances (Read)

```bash
bp-fusion account balances
bp-fusion account balances -o json
```

---

## Orders

### List orders (Read)

```bash
bp-fusion orders list
bp-fusion orders list --pair BTC-EUR
bp-fusion orders list --pair BTC-EUR,ETH-EUR
bp-fusion orders list --status open
bp-fusion orders list --limit 50
bp-fusion orders list --from 2024-01-01T00:00:00Z --to 2024-12-31T23:59:59Z
```

Accepted `--status` values: `open`, `closed`, `new`, `partially-filled`, `filled`, `canceled`, `filled-and-canceled`, `done-for-day`, `rejected`

### Get a single order (Read)

```bash
bp-fusion orders get <order-id>
bp-fusion orders get <order-id> -o json
```

### Create an order (Trade)

Use `--quantity` for the **base currency** amount (e.g. `0.0001` BTC), or `--amount` for the **quote currency** amount (e.g. `30` EUR). These flags are mutually exclusive.

```bash
# Limit order — buy 0.0001 BTC at 50000 EUR
bp-fusion orders create --pair BTC-EUR --side buy --type limit --limit-price 50000 --quantity 0.0001

# Market order — spend 30 EUR on BTC
bp-fusion orders create --pair BTC-EUR --side buy --type market --amount 30
```

By default, `create` shows a preview and asks for confirmation:

```
  Pair:        BTC-EUR
  Side:        buy
  Type:        limit
  Limit Price: 50000
  Quantity:    0.0001 (base currency)

Place this order? [y/N]:
```

Use `--yes` to skip the prompt (useful in scripts):

```bash
bp-fusion orders create --pair BTC-EUR --side buy --type market --amount 30 --yes
```

### Cancel an order (Trade)

```bash
bp-fusion orders cancel <order-id>
bp-fusion orders cancel <order-id> --yes   # skip confirmation
```

---

## Trades

### List trades (Read)

```bash
bp-fusion trades list
bp-fusion trades list --pair BTC-EUR
bp-fusion trades list --pair BTC-EUR,ETH-EUR
bp-fusion trades list --order-id <order-id>
bp-fusion trades list --limit 100
bp-fusion trades list --from 2024-01-01T00:00:00Z --to 2024-12-31T23:59:59Z
bp-fusion trades list -o csv > trades.csv
```

### Get a single trade (Read)

```bash
bp-fusion trades get <trade-id>
bp-fusion trades get <trade-id> -o json
```

---
