---
title: "Trade ledger, profit and CSV export for a wallet"
method: GET
path: "/v1/ledger"
---

# Trade ledger, profit and CSV export for a wallet

`GET /v1/ledger`

## Request

- Base URL: `https://qmax.exchange/api`
- URL: `https://qmax.exchange/api/v1/ledger`
- Auth: none declared

Every QX and QSwap trade of a wallet over the last `days`, read from the public archive's event log, with average-cost positions, realized and unrealized profit (at QMax's current mid or pool price) and estimated fees. Estimated from on-chain transfers; fees include the venues' fees. Not tax advice. Expensive: results are cached for 60 seconds.

## Query parameters

- `identity` string, required
- `format` 'json' | 'csv'
- `days` integer

## Response `200`

The ledger (JSON), or a CSV download

## Other responses

- `400`: Bad identity or days
- `503`: Busy; retry shortly

---

[API](https://skmtc.dev/qmax/apis/qmax-api.md) · [All operations](https://skmtc.dev/qmax/apis/qmax-api/llms.txt) · [OpenAPI document](https://skmtc.dev/qmax/apis/qmax-api/revisions/af70e2813a7a?raw)
