Deriv statement
Returns the account's transactions: buys, sells, deposits and withdrawals, filtered by date and type and paged with limit and offset.
Risk warning: CFDs and spread bets are complex instruments and come with a high risk of losing money rapidly due to leverage. You can lose money on these products, and each provider publishes its own loss figure under FCA rules. You should consider whether you understand how they work and whether you can afford to take the high risk of losing your money. Automated and API trading can amplify losses through bugs, connectivity failures and runaway orders.
This is a message of the Deriv WebSocket API, not an HTTP endpoint. It has no method and no path: it is sent as JSON over an open WebSocket connection.
The message
- Name
- statement
- Direction
- Request, sent by the client
- Carried by
- WebSocket. Deriv's page marks this call as needing a login with the trade scope, so it is sent on the connection of one account. The demo and real addresses are not opened as printed: POST /trading/v1/options/accounts/{accountId}/otp returns the address for one account with a one time password already in it.
- Demo account
- wss://api.derivws.com/trading/v1/options/ws/demo
- Real account
- wss://api.derivws.com/trading/v1/options/ws/real
Fields
| Name | Type | Description |
|---|---|---|
| statementrequired | integer | Always 1. |
| action_type | string | Returns one type of transaction only: buy, sell, deposit or withdrawal. |
| date_from | integer | The first moment wanted, as Unix time in seconds. |
| date_to | integer | The last moment wanted, as Unix time in seconds. |
| description | integer | 1 adds the full description of each contract. 0 or 1. |
| limit | number | The most transactions to return, from 0 to 999. |
| offset | integer | How many transactions to skip, for paging. |
| passthrough | object | Anything you want carried through the call. It comes back unchanged inside echo_req. |
| req_id | integer | A number of your own that is returned on the answer, so answers can be matched to requests. |
What arrives
statement: The transactions that matched.
| Name | Type | Description |
|---|---|---|
| statement.count | number | How many transactions this answer holds. |
| statement.transactions | array of objects | One entry for each transaction. |
| statement.transactions[].action_type | string | The type of the transaction. |
| statement.transactions[].amount | number | The amount of the transaction. |
| statement.transactions[].balance_after | number | The balance once it was done. |
| statement.transactions[].contract_id | integer or null | The contract it belongs to, where it belongs to one. |
| statement.transactions[].transaction_id | integer | The id of the transaction. |
| statement.transactions[].transaction_time | integer | When it happened, as Unix time in seconds. |
| statement.transactions[].reference_id | integer or null | On a sell, the id of the buy transaction it closes. |
| echo_reqrequired | object | A copy of the request that was sent. |
| msg_typerequired | string | Names the kind of answer. Here it is statement. |
| req_id | integer | The number the request carried. Present only where the request had one. |
Sample
Written by this site from the fields recorded on this page. It has not been run against a terminal, a server or an account, and the values in it are placeholders. No credential is typed into it: where a field holds one, the placeholder says where it comes from. Nothing is entered on this site.
{
"statement": 1,
"description": 1,
"limit": 100,
"offset": 25
}Limits that apply at Deriv
| Limit | Value | Scope | Source |
|---|---|---|---|
| Headline limit | 80/min per logged in user (REST)Sources conflict developers.deriv.com states 60, checked . Deriv's API overview in the text form it publishes for AI tools gives REST 60 requests a minute per token, where its Limits page gives 80 a minute per logged in user. The same overview also gives 100 WebSocket requests a second per connection, 100 active subscriptions per connection and 5 concurrent WebSocket connections per user, none of which the Limits page mentions. Deriv's own pages disagree; the conflict is labelled, not resolved. Pace against 60. | user, REST | developers.deriv.comchecked |