> ## Documentation Index
> Fetch the complete documentation index at: https://docs.whitebit.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Spot Trading

> Programmatic access to 750+ trading pairs across 360+ crypto assets on WhiteBIT.

export const RegionBaseUrl = ({className = "", showBaseUrl = true}) => {
  const [region, setRegionState] = useState(() => {
    if (typeof window !== 'undefined') {
      return localStorage.getItem("api-region-preference") || "com";
    }
    return "com";
  });
  const [mounted, setMounted] = useState(false);
  const observerRef = useRef(null);
  const isSyncingRef = useRef(false);
  const updateAllContentOnPage = targetRegion => {
    try {
      const domainFrom = targetRegion === "eu" ? "whitebit.com" : "whitebit.eu";
      const domainTo = targetRegion === "eu" ? "whitebit.eu" : "whitebit.com";
      const links = document.querySelectorAll('a');
      links.forEach(link => {
        let href = link.getAttribute('href');
        if (href && href.includes(domainFrom)) {
          link.setAttribute('href', href.replace(domainFrom, domainTo));
        }
      });
      const walker = document.createTreeWalker(document.body, NodeFilter.SHOW_TEXT, {
        acceptNode: node => {
          if (node.parentElement?.closest('.region-toggle-component')) {
            return NodeFilter.FILTER_REJECT;
          }
          return node.textContent.includes(domainFrom) ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_REJECT;
        }
      });
      let currentNode;
      while (currentNode = walker.nextNode()) {
        currentNode.textContent = currentNode.textContent.replace(new RegExp(domainFrom, 'g'), domainTo);
      }
      console.log(`[RegionSync] Global content updated to ${domainTo}`);
    } catch (e) {
      console.error("[RegionSync] Error updating content:", e);
    }
  };
  const updateRegion = (newRegion, source) => {
    if (region === newRegion) return;
    console.log(`[RegionBaseUrl] Updating to "${newRegion}" (Source: ${source})`);
    if (source === 'observer') {
      isSyncingRef.current = true;
      setTimeout(() => isSyncingRef.current = false, 1000);
    }
    setRegionState(newRegion);
    localStorage.setItem("api-region-preference", newRegion);
    updateAllContentOnPage(newRegion);
    if (source === 'user-click') {
      window.dispatchEvent(new CustomEvent("regionChange", {
        detail: newRegion
      }));
      attemptToUpdateNativeDropdown(newRegion, 0);
      setTimeout(() => attemptToUpdateNativeDropdown(newRegion, 1), 500);
      setTimeout(() => attemptToUpdateNativeDropdown(newRegion, 2), 1500);
    }
  };
  const attemptToUpdateNativeDropdown = (targetRegion, attempt) => {
    if (isSyncingRef.current) return;
    try {
      const targetUrl = targetRegion === "eu" ? "https://whitebit.eu" : "https://whitebit.com";
      const targetDesc = targetRegion === "eu" ? "EU Server" : "Production Server";
      const selects = document.querySelectorAll('select');
      for (const select of selects) {
        if (select.innerHTML.includes('whitebit.com') || select.innerHTML.includes('whitebit.eu')) {
          select.value = targetUrl;
          select.dispatchEvent(new Event('change', {
            bubbles: true
          }));
          return;
        }
      }
      const buttons = Array.from(document.querySelectorAll('button, [role="combobox"]'));
      const serverSelector = buttons.find(btn => {
        if (btn.closest('a') || btn.closest('[class*="card"]') || btn.closest('nav')) {
          return false;
        }
        const txt = btn.textContent || "";
        const isServerDropdown = (txt.includes('Production Server') || txt.includes('EU Server') || txt.includes('WhiteBIT Global Server') || txt.includes('WhiteBIT EU Server')) && !txt.includes('Run') && !txt.includes('Send') || btn.getAttribute('role') === 'combobox';
        return isServerDropdown;
      });
      if (serverSelector) {
        const currentText = serverSelector.textContent || "";
        if (currentText.includes(targetDesc)) return;
        serverSelector.click();
        setTimeout(() => {
          const options = document.querySelectorAll('[role="option"], li, button');
          for (const opt of options) {
            const optText = opt.textContent || "";
            if (optText.includes(targetDesc) || optText.includes(targetUrl)) {
              opt.click();
              return;
            }
          }
        }, 100);
      }
    } catch (e) {
      console.error("[Sync] Error:", e);
    }
  };
  useEffect(() => {
    setMounted(true);
    updateAllContentOnPage(region);
    const handleStorageChange = e => {
      if (e.key === "api-region-preference" && e.newValue) {
        updateRegion(e.newValue, 'storage');
      }
    };
    const handleRegionChange = e => {
      if (e.detail !== region) {
        updateRegion(e.detail, 'event');
      }
    };
    window.addEventListener("storage", handleStorageChange);
    window.addEventListener("regionChange", handleRegionChange);
    observerRef.current = new MutationObserver(mutations => {
      if (isSyncingRef.current) return;
      updateAllContentOnPage(region);
      for (const mutation of mutations) {
        if (mutation.type !== 'childList' && mutation.type !== 'characterData') continue;
        const target = mutation.target;
        const el = target.nodeType === Node.TEXT_NODE ? target.parentElement : target;
        if (el && (el.getAttribute('role') === 'option' || el.closest('[role="listbox"]'))) continue;
        const text = target.textContent || "";
        if (text.includes('WhiteBIT EU Server') || text.includes('https://whitebit.eu') && text.includes('Server')) {
          if (el && el.tagName !== 'A' && !el.closest('.region-toggle-component')) {
            if (region !== 'eu') updateRegion('eu', 'observer');
          }
        } else if (text.includes('WhiteBIT Global Server') || text.includes('https://whitebit.com') && text.includes('Server')) {
          if (el && el.tagName !== 'A' && !el.closest('.region-toggle-component')) {
            if (region !== 'com') updateRegion('com', 'observer');
          }
        }
      }
    });
    observerRef.current.observe(document.body, {
      childList: true,
      subtree: true,
      characterData: true
    });
    if (typeof window !== 'undefined') {
      const current = localStorage.getItem("api-region-preference");
      if (current) attemptToUpdateNativeDropdown(current, 'init');
    }
    return () => {
      window.removeEventListener("storage", handleStorageChange);
      window.removeEventListener("regionChange", handleRegionChange);
      if (observerRef.current) observerRef.current.disconnect();
    };
  }, [region]);
  const apiBaseUrl = region === "eu" ? "https://whitebit.eu" : "https://whitebit.com";
  if (!mounted) return null;
  return <div className={`flex items-center gap-2 flex-wrap my-4 region-toggle-component ${className}`}>
            <span className="text-sm text-gray-500 dark:text-gray-400 font-mono">
                Base URL
            </span>
            <span className="text-sm text-gray-400">(</span>
            <div className="inline-flex bg-gray-100 dark:bg-gray-800 rounded-lg p-0.5 border border-gray-200 dark:border-gray-700">
                <button onClick={() => updateRegion("com", "user-click")} className={`px-2 py-0.5 text-xs font-medium rounded-md transition-all ${region === "com" ? "bg-white dark:bg-gray-700 text-gray-900 dark:text-gray-100 shadow-sm" : "text-gray-500 dark:text-gray-400 hover:text-gray-900 dark:hover:text-gray-200"}`}>
                    .com
                </button>
                <button onClick={() => updateRegion("eu", "user-click")} className={`px-2 py-0.5 text-xs font-medium rounded-md transition-all ${region === "eu" ? "bg-white dark:bg-gray-700 text-gray-900 dark:text-gray-100 shadow-sm" : "text-gray-500 dark:text-gray-400 hover:text-gray-900 dark:hover:text-gray-200"}`}>
                    .eu
                </button>
            </div>
            <span className="text-sm text-gray-400">)</span>
            {showBaseUrl && <>
                    <span className="text-sm text-gray-400">:</span>
                    <a href={apiBaseUrl} target="_blank" rel="noopener noreferrer" className="text-sm font-mono text-primary dark:text-primary-light hover:underline">
                        {apiBaseUrl}
                    </a>
                </>}
        </div>;
};

<RegionBaseUrl />

Programmatic access to 750+ [trading pairs](/concepts/markets) across 360+ crypto assets. The Spot Trading API supports 6 order types, bulk-limit orders (up to 20 orders per call), and a kill-switch that cancels all active orders after a configurable timeout.

## Capabilities

* **6 order types** — Market, Limit, Stop-Limit, Stop-Market, Stock-Market, Bulk-Limit ([details](/concepts/order-types))
* **Bulk orders** — Place up to 20 limit orders in a single API call ([endpoint](/api-reference/spot-trading/bulk-limit-order))
* **Kill-switch** — Emergency mechanism to cancel all active orders after a configurable timeout ([sync timer](/api-reference/spot-trading/sync-kill-switch-timer), [status](/api-reference/spot-trading/status-kill-switch-timer))
* **Order modification** — Modify existing orders in-place without canceling and recreating ([endpoint](/api-reference/spot-trading/modify-order))
* **Client Order ID** — Attach custom identifiers for order tracking and reconciliation
* **Self-Trade Prevention** — Prevent accidental self-crossing when quoting both sides ([details](/platform/self-trade-prevention))

## Who Uses This

* **Trading firms** — Automated execution across hundreds of pairs with bulk-limit orders, the kill-switch, and in-place order modification
* **Fintechs** — Embedded spot trading in consumer or business applications via the REST API
* **Brokers** — WhiteBIT liquidity offered to end users via the [Broker Program](/guides/broker-guide) (40% of the trading fee generated by referred users)
* **Market makers** — Liquidity provision through the [Market-Making Program](/guides/market-maker-guide) (maker rebates up to -0.012% for qualifying volume above \$100M/30 days)

## Common Integration Patterns

**Trading automation** — Combine the REST API for order placement with [WebSocket](/guides/websocket-quickstart) for real-time price data. Set the [kill-switch](/api-reference/spot-trading/sync-kill-switch-timer) timer so all active orders cancel automatically if the bot stops sending heartbeats. Existing integrations include Bitsgap and TradingView.

**Market making** — Use [bulk limit orders](/api-reference/spot-trading/bulk-limit-order) (up to 20 per call) alongside the real-time orderbook [depth WebSocket channel](/guides/websocket-quickstart). The [Market-Making Program](/guides/market-maker-guide) offers maker fee rebates up to -0.012% for qualifying volume (\$100M+/30 days). Pair with [colocation](/platform/colocation) for low-latency execution (3–5 ms) and [sub-accounts](/products/sub-accounts/overview) to run market-making and directional strategies on independent balances with separate API keys. Enable [Self-Trade Prevention](/platform/self-trade-prevention) to avoid accidental self-crossing.

**Multi-exchange arbitrage** — Subscribe to the `lastprice` WebSocket channel for real-time price monitoring across pairs. Use [colocation](/platform/colocation) (3–5 ms latency) for execution speed. Market orders provide immediate fills at best available price.

## Fee Structure

|                                   | Maker   | Taker  |
| --------------------------------- | ------- | ------ |
| Base rate                         | 0.1%    | 0.1%   |
| VIP (best tier)                   | -0.001% | 0.03%  |
| Market-Making Program (best tier) | -0.012% | 0.020% |

Full fee schedule with all VIP tier breakpoints: [trading fees page](https://whitebit.com/trading-data/trading-fees) and [VIP program](https://whitebit.com/vip-program). Query current fees per market via the [market fee endpoint](/api-reference/spot-trading/query-market-fee).

## Technical Overview

| Detail         | Value                                                     |
| -------------- | --------------------------------------------------------- |
| Endpoints      | 18 (all `POST`, all authenticated)                        |
| Authentication | HMAC-SHA512 ([guide](/api-reference/authentication))      |
| Rate limits    | Vary per endpoint ([details](/api-reference/rate-limits)) |
| Base URL       | `https://whitebit.com`                                    |

Endpoint categories:

* **Account** — Trade balance query (1 endpoint)
* **Order management** — Create, modify, cancel orders; bulk operations (9 endpoints)
* **Order queries** — Active orders, executed history, execution deals, order history (4 endpoints)
* **Market fees** — Per-market and all-market fee queries (2 endpoints)
* **Kill-switch** — Sync timer, status (2 endpoints)

For full endpoint documentation, see the [Spot Trading API Reference](/api-reference/spot-trading/overview).

For Go and PHP examples, see [SDKs](/sdks).

## What's Next

<CardGroup cols={3}>
  <Card title="Spot Quickstart" icon="rocket" href="/products/spot/quickstart">
    Place a first trade in 5 minutes.
  </Card>

  <Card title="API Reference" icon="square-terminal" href="/api-reference/spot-trading/overview">
    All 18 spot trading endpoints with parameters, signing, error codes, and rate limits.
  </Card>

  <Card title="Trading Bot Guide" icon="robot" href="/guides/building-a-trading-bot">
    Build a Python trading bot with signed REST orders, WebSocket fills, kill-switch heartbeat, and a grid-bot example.
  </Card>
</CardGroup>
