> For the complete documentation index, see [llms.txt](https://docs.lighter.xyz/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.lighter.xyz/api/orders/export.md).

# export

Export trades and funding payments, limited to 12 months or 1M trades. END\_TS\_IN\_MS - START\_TS\_IN\_MS should not be larger than 12 months in milliseconds, both timestamps should be greater than or equal to 17 January 2025 00:00:00 UTC (lighter's mainnet genesis)

```json
{"openapi":"3.0.0","info":{"title":"Lighter API","version":"1.0.0"},"tags":[{"name":"orders"}],"servers":[{"url":"https://mainnet.zklighter.elliot.ai","description":"Lighter mainnet"},{"url":"https://testnet.zklighter.elliot.ai","description":"Lighter testnet"},{"url":"https://api.rh.lighter.xyz","description":"Lighter on Robinhood Chain mainnet"},{"url":"https://api.rh-testnet.lighter.xyz","description":"Lighter on Robinhood Chain testnet"}],"paths":{"/api/v1/export":{"get":{"summary":"export","operationId":"export","tags":["orders"],"description":"Export trades and funding payments, limited to 12 months or 1M trades. END_TS_IN_MS - START_TS_IN_MS should not be larger than 12 months in milliseconds, both timestamps should be greater than or equal to 17 January 2025 00:00:00 UTC (lighter's mainnet genesis)","parameters":[{"name":"authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"account_index","in":"query","required":false,"schema":{"type":"integer","format":"int64","default":"-1"}},{"name":"market_id","in":"query","required":false,"schema":{"type":"integer","format":"int16","default":"255"}},{"name":"type","in":"query","required":true,"schema":{"type":"string","enum":["funding","trade"]}},{"name":"start_timestamp","in":"query","required":false,"schema":{"type":"integer","format":"int64","minimum":1735689600000,"maximum":1830297600000}},{"name":"end_timestamp","in":"query","required":false,"schema":{"type":"integer","format":"int64","minimum":1735689600000,"maximum":1830297600000}},{"name":"side","in":"query","required":false,"schema":{"type":"string","enum":["all","long","short"],"default":"all"}},{"name":"role","in":"query","required":false,"schema":{"type":"string","enum":["all","maker","taker"],"default":"all"}},{"name":"trade_type","in":"query","required":false,"schema":{"type":"string","enum":["all","trade","liquidation","deleverage","market-settlement"],"default":"all"}},{"name":"aggregate","in":"query","required":false,"schema":{"type":"boolean","format":"boolean","default":"false"}}],"responses":{"200":{"description":"A successful response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExportData"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResultCode"}}}}}}}},"components":{"schemas":{"ExportData":{"type":"object","properties":{"code":{"type":"integer","format":"int32"},"message":{"type":"string"},"data_url":{"type":"string"}},"title":"ExportData","required":["code","data_url"]},"ResultCode":{"type":"object","properties":{"code":{"type":"integer","format":"int32"},"message":{"type":"string"}},"title":"ResultCode","required":["code"]}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.lighter.xyz/api/orders/export.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
