You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-[Demo Trading](https://www.binance.com/en/support/faq/how-to-test-my-functions-on-binance-spot-test-network-ab78f9a1b8824cf0a106b4229c76496d) - Uses real market data with simulated trading.
158
+
159
+
### Demo Trading vs Testnet
160
+
161
+
Binance offers two testing environments:
162
+
163
+
-**Demo Trading**: Uses real market data but simulated trading. This is ideal for testing strategies since market conditions match production. Available for Spot, USD-M Futures, and COIN-M Futures.
164
+
-**Testnet**: Separate environment with simulated market data. Market conditions are very different from real markets and not recommended for strategy testing.
165
+
166
+
To use demo trading, simply set `demoTrading: true` in the client options. See the [demo trading examples](./examples/REST/rest-spot-demo.ts) for more information.
// Use demo trading endpoints if requested and available
557
+
if(restClientOptions.demoTrading){
558
+
constdemoUrl=BINANCE_DEMO_BASE_URLS[urlKey];
559
+
if(demoUrl){
560
+
returndemoUrl;
561
+
}
562
+
thrownewError(
563
+
`Demo trading is currently not supported for the product group "${urlKey}". If demo trading should be available here, please open an issue on GitHub.`,
// Use demo trading endpoints if requested and available
426
+
if(isDemoTrading&&!isTestnet){
427
+
constdemoUrl=WS_KEY_DEMO_URL_MAP[resolvedWsKey];
428
+
if(demoUrl){
429
+
returndemoUrl;
430
+
}
431
+
thrownewError(
432
+
`Demo trading is currently not supported for the WebSocket key "${resolvedWsKey}". If demo trading should be available here, please open an issue on GitHub.`,
0 commit comments