WebsockexNova.Examples.ClientDeribit (WebsockexNova v0.1.0)

View Source

Deribit-specific client API, wrapping WebsockexNova.Client with the Deribit adapter.

Provides a user-friendly, domain-specific interface for connecting, authenticating, and subscribing to Deribit WebSocket channels.

Summary

Functions

Authenticate using client credentials (from opts or environment).

Connect to Deribit WebSocket API with sensible defaults. User-supplied opts override defaults.

Send a custom JSON-RPC payload to Deribit.

Subscribe to a Deribit ticker channel for a given instrument (e.g., "BTC-PERPETUAL").

Subscribe to a Deribit trades channel for a given instrument (e.g., "BTC-PERPETUAL").

Functions

authenticate(conn, credentials \\ %{}, opts \\ nil)

Authenticate using client credentials (from opts or environment).

connect(opts \\ %{})

Connect to Deribit WebSocket API with sensible defaults. User-supplied opts override defaults.

send_json(conn, payload, opts \\ nil)

Send a custom JSON-RPC payload to Deribit.

subscribe_to_ticker(conn, instrument, opts \\ nil)

Subscribe to a Deribit ticker channel for a given instrument (e.g., "BTC-PERPETUAL").

subscribe_to_trades(conn, instrument, opts \\ nil)

Subscribe to a Deribit trades channel for a given instrument (e.g., "BTC-PERPETUAL").