Skip to main content

Connect

Open wss://api-stream.myfundedperpetuals.com/v1/market-data. Market data is public: no API key, cookie, or authentication frame is required. Use this dedicated endpoint for developer integrations. Never send your trading API key to this socket. Live and sandbox trading use the same market feed. Send one JSON object per WebSocket text frame. Enable permessage-deflate compression in your WebSocket client: books, trades, and candles are several times smaller compressed. Keep one long-lived connection and multiplex your subscriptions on it; do not reconnect to poll for a fresh snapshot. This stream carries market observations; submit orders through the REST API. Market prices do not guarantee the price or size of a simulated fill.
This minimal example shows framing. Add the reconnection and recovery handling below before using it in a long-running client.

Market identity and filters

Use the exact coin and provider returned for your selected market by GET /v1/markets or GET /v1/markets/{market_id} in the REST API. Pass coin in the subscription’s symbols array. REST’s symbol is a display label: for Binance BTC, symbol is BTC and coin is BTCUSDT, so subscribe to symbols: ["BTCUSDT"] with providers: ["binance"]. Provider values are hyperliquid, binance, bybit, veranta, ostium, lighter, fpx, and synthetic. FX uses veranta (for example EURUSD and USDJPY). The retiring Hyperliquid EUR/USD and USD/JPY markets (xyz:EUR and xyz:JPY) keep publishing while positions remain on them. The historical fpx and lighter identities are retired and no longer publish market data. Every market subscription requires symbols with 1 to 32 exact symbols. providers is optional, but specify it to avoid mixing venue prices. Omitting it uses the compatibility provider set, so explicitly name new providers. status accepts only providers and needs no symbols. For candles, request explicit intervals such as intervals: ["1m"]. Accepted interval names are 1s, 1m, 3m, 5m, 15m, 30m, 1h, 2h, 4h, 8h, 12h, 1d, 3d, 1w, and 1M. Availability depends on the provider. historyLimit: 0 skips retained candle replay; a positive value limits it. Omitting it replays the retained backlog. Use candles.history for a specific historical window.

Frames and subscription lifecycle

Allocate positive integer IDs, unique among active requests and subscriptions on a connection. Keep them within JavaScript’s safe integer range. Do not reuse an ID until its prior operation finishes. Treat the server’s sub string as opaque: equivalent filters share it, and event frames use it instead of your request ID. Send {"op":"unsub","id":1} to cancel a subscription or in-flight request. Cancellation is idempotent. Ignore unknown server operations for forward compatibility.

Event fields

Prices and quantities in ticks, trades, candles, and books are decimal strings. Use decimal arithmetic when calculating with them. Market statistics use JSON numbers or null. Numeric time, openTime, and closeTime fields are Unix milliseconds; receivedAt is a timestamp string. Books are complete snapshots, with bids descending and asks ascending. Replace your previous book; do not apply them as deltas. Each book subscription receives at most one snapshot per market every 150 ms, always the newest; a snapshot superseded within that window is not sent. Candles replace the existing bar identified by provider, symbol, interval, and openTime. Trade IDs are unique within a provider and symbol; deduplicate retained replay accordingly. Tick kinds represent different price observations, so do not overwrite a mark with a midpoint without an explicit pricing policy. Market statistics are patches. Omitted fields preserve the previous value; null explicitly clears it. Fields include markPx, change24hPct, fundingHourly, fundingRate, fundingIntervalHours, nextFundingTime, openInterestUsd, and dayNtlVlm. Optional fundingSnapshot contains an atomic funding observation: decimal strings fundingRate and fundingPrice, numeric fundingIntervalHours, nextFundingTime, and observedAt, and fundingPriceKind (mark or oracle). It may also be null.

Historical candles and heartbeat

result is an array of candle events. Optional startTime and endTime select a millisecond window; priceKind is trade (default) or mark. History is bounded by provider availability and retention; an empty or short result is possible. A HistoryFetchFailed error includes provider and message; source: "transport" can be retried with backoff. Provider failures may require a different window or interval. Send {"op":"req","id":3,"method":"ping"} for an application heartbeat. The response result is the stream server’s current Unix time in milliseconds. Measure round-trip latency using your own monotonic clock. Servers also send WebSocket protocol pings every 30 seconds; your WebSocket library must process and answer these. Connections with no inbound frames or pongs for 75 seconds are closed. Browser WebSocket implementations answer protocol pings for you. A ping response may also include upstreamReadAgeMs beside result. This is elapsed milliseconds since the upstream market-data connection received a frame, including protocol heartbeats; a negative value means that connection is unavailable. The field is optional: absence means unknown upstream health. It helps distinguish a quiet market from an unresponsive feed connection, but a small value does not prove that an individual market’s prices are fresh. Continue checking event timestamps, and tolerate additional response fields. status.get is also available as a one-shot request with no payload. Prefer a status subscription for continuous monitoring instead of polling it.

Recovery and limits

There is no durable replay cursor or exactly-once guarantee. On disconnect, clear connection-local IDs and mappings, reconnect with exponential backoff and jitter, and re-establish subscriptions. Restore books and prices from the new snapshot, backfill missing candles with candles.history, and reconcile account trading state through the trading API. A market trade tape cannot be used as your account fill ledger. A slow client can lose superseded state or be disconnected; always monitor freshness. On draining, connect a replacement, subscribe, wait for its initial snapshot boundaries, and then close the old socket. Deduplicate overlapping events. If the replacement fails, keep reading the old socket until it ends and retry with backoff. Avoid unlimited reconnect loops on permanent filter errors. These budgets belong to the developer stream and are separate from the website feed. The service also limits simultaneous history work and one-shot status requests; prefer a status subscription and back off when capacity is exhausted. Keep one multiplexed socket per client, unsubscribe unused views, cache closed candles, and avoid polling REST quotes for every price update. Market streaming adds no REST quota usage. Account balances, positions, orders, and fills are available through REST. Private account streaming is not available.