Skip to content

edson1ve/bot-diff-template

Repository files navigation

Digits Trading App

A self-hosted digit trading app built on the Deriv WebSocket API. Supports Matches/Differs, Over/Under, and Even/Odd contract types with real-time tick streaming and digit frequency statistics.

Prerequisites

  • Node.js 18.18 or later

Step 1: Register Your App ID

  1. Log in to your Deriv account and go to the API Token page to create a token with the required scopes.
  2. Navigate to App Registration and register a new application.
  3. Set the Redirect URI to the URL where you will host this app (e.g. http://localhost:3000 for local development).
  4. Copy the App ID shown after registration — you will need it in the next step.

Step 2: Configure .env.production

Copy .env.example to .env.production and fill in your values:

cp .env.example .env.production

Edit .env.production:

NEXT_PUBLIC_DERIV_APP_ID=your_app_id_here
NEXT_PUBLIC_DERIV_REDIRECT_URI=https://your-registered-redirect-uri.com
NEXT_PUBLIC_DERIV_APP_NAME=your_app_name_here
NEXT_PUBLIC_DERIV_REFERRAL_LINK=your_referral_link_here
NEXT_PUBLIC_DERIV_OAUTH_SCOPES=trade,account_manage
NEXT_PUBLIC_DERIV_ENV=production
Variable Description
NEXT_PUBLIC_DERIV_APP_ID Your Deriv app ID from the App Registration dashboard
NEXT_PUBLIC_DERIV_REDIRECT_URI OAuth redirect URI — must exactly match the URI registered in your Deriv app
NEXT_PUBLIC_DERIV_APP_NAME App name shown in the header
NEXT_PUBLIC_DERIV_REFERRAL_LINK Affiliate referral link shown to unauthenticated users (optional)
NEXT_PUBLIC_DERIV_OAUTH_SCOPES Comma-separated OAuth scopes (e.g. trade,account_manage)
NEXT_PUBLIC_DERIV_ENV production to connect to the live Deriv endpoint; preview for staging

For local development, copy .env.production to .env.local — Next.js will load .env.local automatically and it takes precedence over .env.production.

Step 3: Local Development

npm install
npm run dev

The app is available at http://localhost:3000.

Step 4: Build for Production

npm run build

This produces a fully static export in the /out directory. Serve the contents of /out from any web server or static file host.

  • Join Deriv → enlace de referido https://bit.ly/3Qc9tYi - trading.criptoinversiones.org → link al sitio oficial

About

Trading app generated by Deriv App Builder

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors