---
updatedAt: 2026-03-02T07:11:36.000Z
agentTools:
  projectIndex: https://doc-deriv.readme.io/llms.txt
---

# Digit Matches/Differs

If you select "**Matches**", you will win the payout if the **last digit** of the **last tick** is the **same** as your **prediction**.

<HTMLBlock>{`
<div style="display: flex; justify-content: center;">
  <img src="https://files.readme.io/576b492a7b2929f8cc17a4c475f3a63f939a383cbe81feee546d7f700bfb3262-Web_Trade_Clip_-_Digits_Matches_Medium.gif" width="300" style="margin-right: 10px;" />
  <img src="https://files.readme.io/d8b9de671385ff3f0b4de6f6e112195780192089b4f1746fc64e07f20631a465-DTrader_Responsive_Trade_Clip_Differs_Medium.gif" width="300" />
</div>
`}</HTMLBlock>

If you select "**Differs**", you will win the payout if the **last digit** of the **last tick** is **not the same** as your **prediction**.

## Trading Flow

1. **Authorize using your token**: Call <a href="https://legacy-api.deriv.com/api-explorer/#authorize" target="_blank" rel="noopener noreferrer">authorize</a> API using your token. Ensure that the token has the trading scope enabled.
2. **Fetch Available Instruments**: Use the <a href="https://legacy-api.deriv.com/api-explorer/#active_symbols" target="_blank" rel="noopener noreferrer">active\_symbols</a> API to retrieve a list of all trading instruments offered on Deriv.
3. **Get Contract Details**: Using the <a href="https://legacy-api.deriv.com/api-explorer/#contracts_for" target="_blank" rel="noopener noreferrer">contracts\_for</a> API, obtain a list of contracts available for a specific instrument.
4. **Request a Price**: Use the <a href="https://legacy-api.deriv.com/api-explorer/#proposal" target="_blank" rel="noopener noreferrer">proposal</a> API to get a quote. This will return an ID for the proposed trade.\
   For the Matches/Differs options, use the following:

   1. Set  **`contract_type`**:

      1. For **Matches**, use: "`DIGITMATCH`"
      2. For **Differs**, use: "`DIGITDIFF`"

      <Image align="center" src="https://files.readme.io/c850884d85432e3539b42abcf969d74c0e3d123c158325179ca599c2e987cbed-Screenshot_2024-10-23_at_5.38.36_PM.png" />
   2. For the **Last Digit Prediction**: set the `barrier` between 0-9. Eg: **`barrier: "9"`**
5. **Buy the Contract**: Execute the trade by using the <a href="https://legacy-api.deriv.com/api-explorer/#buy" target="_blank" rel="noopener noreferrer">buy</a> API with the ID from the proposal response. This action returns a unique **`contract_id`**.
6. **Monitor the Contract Status**: Check the contract's progress or outcome using the <a href="https://legacy-api.deriv.com/api-explorer/#proposal_open_contract" target="_blank" rel="noopener noreferrer">proposal\_open\_contract</a> API with the **`contract_id`**.
7. **Close the Contract Early** (if Needed): If you want to exit before the contract’s expiration, use the sell API with the **`contract_id`**.