AsyncAPI spec

Default content type: application/json

Single-connection WebSocket that merges control messages (subscribe etc.) for public market data streams with optional session authentication via Ed25519 keys to unlock user data streams.

Servers

lambdaplex-ws Server

  • URL: wss://api.lambdaplex.io/api/v1/ws

  • Protocol: wss

Single endpoint for public and authenticated data streams.

Operations

JSON request/response and public+private streams in a unified connection.


PUB / Operation

Client-to-server control messages.

Accepts one of the following messages:

Message: SubscribeReqMsg

  • Content type: application/json

  • Correlation ID: $message.payload#/id — correlates requests and responses via payload.id

Payload

Name
Type
Description
Constraints
Notes

(root)

object

-

additional properties are allowed

id

oneOf

Request/response correlation id

required, additional properties are allowed

id.0 (oneOf item)

string

-

-

id.1 (oneOf item)

integer

-

-

method

string

-

const ("subscribe") — required

params

array

-

non-empty — required

params (single item)

string

Stream name; either a market data stream (currently only depth diffs): <symbol>@depth[@100ms] Or a user data stream (requires session authentication): userData

-

Examples of payload (generated)

subscribe.json
{
  "id": "string",
  "method": "subscribe",
  "params": [
    "string"
  ]
}

Message: UnsubscribeReqMsg

  • Content type: application/json

  • Correlation ID: $message.payload#/id — correlates requests and responses via payload.id

Payload

Name
Type
Description
Constraints
Notes

(root)

object

-

additional properties are allowed

id

oneOf

Request/response correlation id

required, additional properties are allowed

id.0 (oneOf item)

string

-

-

id.1 (oneOf item)

integer

-

-

method

string

-

const ("unsubscribe") — required

params

array

-

non-empty — required

params (single item)

string

Stream name; either a market data stream (currently only depth diffs): <symbol>@depth[@100ms] Or a user data stream (requires session authentication): userData

-

Examples of payload (generated)

unsubscribe.json
{
  "id": "string",
  "method": "unsubscribe",
  "params": [
    "string"
  ]
}

Message: SessionLogonReqMsg

  • Content type: application/json

  • Correlation ID: $message.payload#/id — correlates requests and responses via payload.id

Payload

Name
Type
Description
Constraints
Notes

(root)

object

-

additional properties are allowed

id

oneOf

Request/response correlation id

required, additional properties are allowed

id.0 (oneOf item)

string

-

-

id.1 (oneOf item)

integer

-

-

method

string

-

const ("session.logon") — required

params

object

-

required, additional properties are allowed

params.apiKey

string

-

required

params.timestamp

integer

-

required

params.recvWindow

number

ms; up to 3 decimal places; max 60000

-

params.signature

string

Base64 Ed25519 signature over the alphabetically sorted param string.

required

Examples of payload (generated)

session.logon.json
{
  "id": "string",
  "method": "session.logon",
  "params": {
    "apiKey": "string",
    "timestamp": 0,
    "recvWindow": 0,
    "signature": "string"
  }
}

Message: SessionLogoutReqMsg

  • Content type: application/json

  • Correlation ID: $message.payload#/id — correlates requests and responses via payload.id

Payload

Name
Type
Description
Constraints
Notes

(root)

object

-

additional properties are allowed

id

oneOf

Request/response correlation id

required, additional properties are allowed

id.0 (oneOf item)

string

-

-

id.1 (oneOf item)

integer

-

-

method

string

-

const ("session.logout") — required

Examples of payload (generated)

session.logout.json
{
  "id": "string",
  "method": "session.logout"
}

Message: SessionSubscribeReqMsg

  • Content type: application/json

  • Correlation ID: $message.payload#/id — correlates requests and responses via payload.id

Payload

Name
Type
Description
Constraints
Notes

(root)

object

-

additional properties are allowed

id

oneOf

Request/response correlation id

required, additional properties are allowed

id.0 (oneOf item)

string

-

-

id.1 (oneOf item)

integer

-

-

method

string

-

const ("session.subscribe") — required

Examples of payload (generated)

session.subscribe.json
{
  "id": "string",
  "method": "session.subscribe"
}

Message: SessionUnsubscribeReqMsg

  • Content type: application/json

  • Correlation ID: $message.payload#/id — correlates requests and responses via payload.id

Payload

Name
Type
Description
Constraints
Notes

(root)

object

-

additional properties are allowed

id

oneOf

Request/response correlation id

required, additional properties are allowed

id.0 (oneOf item)

string

-

-

id.1 (oneOf item)

integer

-

-

method

string

-

const ("session.unsubscribe") — required

Examples of payload (generated)

session.unsubscribe.json
{
  "id": "string",
  "method": "session.unsubscribe"
}

Message: ListSubsReqMsg

  • Content type: application/json

  • Correlation ID: $message.payload#/id — correlates requests and responses via payload.id

Payload

Name
Type
Description
Constraints
Notes

(root)

object

-

additional properties are allowed

id

oneOf

Request/response correlation id

required, additional properties are allowed

id.0 (oneOf item)

string

-

-

id.1 (oneOf item)

integer

-

-

method

string

-

const ("subscriptions") — required

Examples of payload (generated)

subscriptions.json
{
  "id": "string",
  "method": "subscriptions"
}

SUB / Operation

Server-to-client responses to requests and events.

Accepts one of the following messages:

Message: SuccessResMsg

  • Content type: application/json

  • Correlation ID: $message.payload#/id — correlates requests and responses via payload.id

A successful acknowledgment with no further result data.

Payload

Name
Type
Description
Constraints
Notes

(root)

object

-

additional properties are allowed

id

oneOf

Request/response correlation id

required, additional properties are allowed

id.0 (oneOf item)

string

-

-

id.1 (oneOf item)

integer

-

-

status

integer

-

allowed (200) — required

result

null

-

required

Examples of payload (generated)

success.json
{
  "id": "string",
  "status": 200,
  "result": null
}

Message: ErrorResMsg

  • Content type: application/json

  • Correlation ID: $message.payload#/id — correlates requests and responses via payload.id

An error acknowledgment with details in the error field.

Payload

Name
Type
Description
Constraints
Notes

(root)

object

-

additional properties are allowed

id

oneOf

Request/response correlation id

required, additional properties are allowed

id.0 (oneOf item)

string

-

-

id.1 (oneOf item)

integer

-

-

status

integer

HTTP-style status code indicating the result of the request: 2xx, 4xx, 5xx. See allowed values below.

allowed (200, 400, 403, 409, 418, 429, 500) — required

500 responses have unknown execution status; the request may have succeeded.

error

object

Error object

required, additional properties are allowed

error.msg

string

-

required

Status codes described:

  • 200 — Successful response

  • 400 — Request failed, check error field for reason

  • 403 — Blocked by Web Application Firewall

  • 409 — Partial success/failure, check error field for details

  • 418 — Auto-banned for repeated rate limit violations

  • 429 — Rate limit exceeded, slow down requests

  • 500 — Internal error (unknown execution status)

Examples of payload (generated)

error.json
{
  "id": "string",
  "status": 200,
  "error": {
    "msg": "string"
  }
}

Message: ListSubsResMsg

  • Content type: application/json

  • Correlation ID: $message.payload#/id — correlates requests and responses via payload.id

Payload

Name
Type
Description
Constraints
Notes

(root)

object

-

additional properties are allowed

result

array

-

required

result (single item)

string

Stream name; either a market data stream (currently only depth diffs): <symbol>@depth[@100ms] Or a user data stream (requires session authentication): userData

-

id

oneOf

Request/response correlation id

required, additional properties are allowed

id.0 (oneOf item)

string

-

-

id.1 (oneOf item)

integer

-

-

Examples of payload (generated)

subscriptions.res.json
{
  "result": [
    "string"
  ],
  "id": "string"
}

Message: DepthDiffEventMsg

Payload

Name
Type
Description
Constraints
Notes

(root)

object

-

additional properties are allowed

e

string

-

const ("depthUpdate") — required

E

integer

Event time (ms)

required

s

string

Symbol

required

U

integer

First update ID in event

required

u

integer

Final update ID in event

required

b

array<tuple<string, string, ...optional>>

Bid updates

required

b (single item)

tuple<[price, quantity]>

[price, quantity] as strings to preserve precision

2 items; additional items are allowed

a

array<tuple<string, string, ...optional>>

Ask updates

required

a (single item)

tuple<[price, quantity]>

[price, quantity] as strings to preserve precision

2 items; additional items are allowed

Examples of payload

depthUpdate.json
{
  "e": "depthUpdate",
  "E": 1672515782136,
  "s": "PLEX-HBAR",
  "U": 157,
  "u": 160,
  "b": [
    [
      "0.0024",
      "10"
    ]
  ],
  "a": [
    [
      "0.0026",
      "100"
    ]
  ]
}

Message: BalanceChangeEventMsg

Sent any time the authenticated account's balances change, including locked amount.

Payload

Name
Type
Description
Constraints
Notes

(root)

object

-

additional properties are allowed

e

string

-

const ("balanceChange") — required

u

integer

-

required

E

integer

-

required

B

array

-

required

B.a

string

-

required

B.f

string

-

required

B.l

string

-

required

Examples of payload (generated)

balanceChange.json
{
  "e": "balanceChange",
  "u": 0,
  "E": 0,
  "B": [
    {
      "a": "string",
      "f": "string",
      "l": "string"
    }
  ]
}

Message: OrderUpdateEventMsg

Payload

Name
Type
Description
Constraints
Notes

(root)

object

-

additional properties are allowed

e

string

-

const ("orderUpdate") — required

E

integer

-

required

s

string

-

required

c

string

-

required

S

string

-

required

o

string

Type of order

allowed ("LIMIT", "MARKET", "STOP_LIMIT", "STOP_MARKET") — required

f

string

Type of order

allowed ("GTC", "IOC", "FOK") — required

q

string

-

required

p

string | null

-

required

P

string | null

-

required

C

string | null

-

required

x

string

An action taken on an order

allowed ("ACCEPT", "CANCEL", "TRADE", "REJECT", "EXPIRE") — required

X

string

Current status of an order

allowed ("OPEN", "CANCELLED", "FILLED", "EXPIRED", "FAILED", "ACTIVE") — required

r

string

An action taken on the order

allowed ("NONE", "BAD_PRICE", "INSUFFICIENT_BALANCE", "STOP_PRICE_WOULD_TRIGGER_IMMEDIATELY") — required

i

string

-

required

l

string

-

required

z

string

-

required

L

string | null

-

required

n

string | null

-

required

N

string | null

-

required

T

integer

-

required

t

integer | null

-

required

I

string | null

-

required

w

boolean

-

required

m

boolean | null

-

required

O

integer

-

required

Z

string

-

required

Y

string | null

-

required

W

integer | null

-

required

Examples of payload (generated)

orderUpdate.json
{
  "e": "orderUpdate",
  "E": 0,
  "s": "string",
  "c": "string",
  "S": "string",
  "o": "LIMIT",
  "f": "GTC",
  "q": "string",
  "p": "string",
  "P": "string",
  "C": "string",
  "x": "ACCEPT",
  "X": "OPEN",
  "r": "NONE",
  "i": "string",
  "l": "string",
  "z": "string",
  "L": "string",
  "n": "string",
  "N": "string",
  "T": 0,
  "t": 0,
  "I": "string",
  "w": true,
  "m": true,
  "O": 0,
  "Z": "string",
  "Y": "string",
  "W": 0
}