Broker API HubMenu

Deriv proposal_open_contract

messageproposal_open_contractDeriv WebSocket APIWebSocketTrading

Returns the current price and state of a contract the account holds. With subscribe set to 1 an update follows each time it changes, and with no contract_id the stream covers every open contract.

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.

Independent and unofficialdevelopers.deriv.comchecked The definition file it was checked against

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.

Deriv's workflow page uses this to watch a contract after buying it: send it with the contract_id and subscribe set to 1.

The message

Name
proposal_open_contract
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

NameTypeDescription
proposal_open_contractrequiredintegerAlways 1.
contract_idintegerThe contract to report on, as portfolio or buy returns it. Left out, the stream covers all open contracts.
subscribeinteger1 starts a stream. The only value allowed is 1.
passthroughobjectAnything you want carried through the call. It comes back unchanged inside echo_req.
req_idintegerA number of your own that is returned on the answer, so answers can be matched to requests.

What arrives

proposal_open_contract: The contract as it stands now. This list is a selection: the vendor's definition holds about sixty fields, many of them for one contract type only.

NameTypeDescription
proposal_open_contract.contract_idintegerThe id of the contract.
proposal_open_contract.contract_typestringThe contract type.
proposal_open_contract.underlying_symbolstringThe symbol the contract is on.
proposal_open_contract.currencystringThe currency of the contract.
proposal_open_contract.buy_pricestringThe price the contract was bought at.
proposal_open_contract.bid_pricestringThe price the contract could be sold back at now.
proposal_open_contract.payoutstringWhat the contract pays out.
proposal_open_contract.profitstringThe latest bid price less the buy price.
proposal_open_contract.profit_percentagenumberThe profit as a percentage.
proposal_open_contract.current_spotstringThe current price of the symbol, where it is licensed to be streamed.
proposal_open_contract.current_spot_timeintegerThe time of that price, as Unix time in seconds.
proposal_open_contract.entry_spotstring or nullThe first valid price of the symbol for the contract.
proposal_open_contract.exit_spotstring or nullThe price the contract ended on, or was sold at.
proposal_open_contract.date_startintegerWhen the contract started, as Unix time in seconds.
proposal_open_contract.date_expiryintegerWhen the contract ends, as Unix time in seconds. Not used for contracts counted in ticks.
proposal_open_contract.is_expiredinteger1 where the contract has expired, 0 where it has not.
proposal_open_contract.is_soldinteger1 where the contract has been sold, 0 where it has not.
proposal_open_contract.is_valid_to_sellinteger1 where the contract can be sold back now, 0 where it cannot.
proposal_open_contract.is_valid_to_cancelinteger1 where the contract can be cancelled, 0 where it cannot.
proposal_open_contract.statusstring or nullopen, sold, won, lost or cancelled.
proposal_open_contract.sell_pricestring or nullThe price the contract was sold at, once it has been sold.
proposal_open_contract.sell_timeinteger or nullWhen the contract was sold, as Unix time in seconds.
proposal_open_contract.limit_orderobjectThe stop loss, stop out and take profit on the contract.
proposal_open_contract.transaction_idsobjectThe id of the buy transaction and, once sold, of the sell transaction.
proposal_open_contract.validation_errorstringThe message where the contract fails validation, for example where it cannot be sold now.
proposal_open_contract.idstringThe id of the stream on this connection.
subscription.idrequiredstringThe id of the stream on this connection. Sent with forget to stop it. The subscription object is present only where the request asked for a stream.
echo_reqrequiredobjectA copy of the request that was sent.
msg_typestringNames the kind of answer. Here it is proposal_open_contract. The definition does not mark it as required on this answer.
req_idintegerThe 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.

{
  "proposal_open_contract": 1,
  "contract_id": 11111111,
  "subscribe": 1
}

Limits that apply at Deriv

LimitValueScopeSource
Headline limit80/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, RESTdevelopers.deriv.comchecked