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. Compression is optional. Multiplex your subscriptions on one connection. 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.

SDK price streams

All six MyFundedPerps SDKs provide a PriceStream client for the ticks channel. The SDKs are maintained in the project repository and are not yet published to public package registries. Python streaming uses the optional streaming extra; PHP requires Composer dependencies. TypeScript uses native WebSocket support in browsers, Bun, or Node 22+. Each session subscribes to 1–32 exact symbols on one connection. Prices remain decimal strings. Specify providers to avoid mixing prices from different venues. No API key is accepted or sent by these streaming clients.
The examples print ticks. Applications should also handle lifecycle notices: Rust names these variants Subscribed, SnapshotEnd, and Draining. Snapshot events can repeat observations; do not assume exactly-once delivery. mark, mid, and last ticks are distinct price observations. The SDKs expose session failures rather than reconnecting automatically. Transport failures and server-end frames produce a stream error with retryable = true. Use a bounded retry policy with exponential backoff and jitter. Subscription rejections preserve the server’s error details and are not marked retryable. Fix rejected filters before retrying. Continue to check tick timestamps for market freshness even while the socket is connected. Keep one reader per session. Always close the stream when finished. TypeScript accepts an AbortSignal; Go follows the dial context; Python and Java allow another thread to close a blocked reader; Rust provides a close_handle(); PHP accepts an Amp\Cancellation. Receive buffering is bounded. Pull transports apply backpressure; TypeScript and Java fail with slow_consumer if more than 16 complete messages await the reader. Messages over 1 MiB fail the session. No client silently truncates a batch or rounds a decimal price. Other market channels remain available through the wire protocol below; the SDK wrapper currently covers price ticks.

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, lighter, fpx, and synthetic. FX uses lighter for both EUR/USD and USD/JPY. The historical fpx identity is retired and no longer publishes 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. 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. 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.