API Reference bourse v#0.1.0

Copy Markdown View Source

Modules

Unified cryptocurrency exchange client library.

Unified auto-deleveraging (ADL) rank data.

Unified exchange account data.

Alpaca exchange client (alpaca).

OTP Application for Bourse.

Unified account balance across currencies.

Binance exchange client (binance).

Binance COIN-M exchange client (binancecoinm).

Binance USDⓈ-M exchange client (binanceusdm).

Unified borrow interest data.

Unified borrow rate data.

Bybit exchange client (bybit).

Per-exchange circuit breakers using the :fuse Erlang library.

Unified currency conversion data.

API credentials for exchange authentication.

Unified currency data.

Centralized default configuration values for bourse.

Unified deposit address data.

Unified deposit/withdraw fee data.

Deribit exchange client (deribit).

derive exchange client (derive).

Shared request dispatcher for generated exchange endpoint functions.

Runtime emulation dispatch for Bourse unified methods.

Unified error types for exchange operations.

Exchange configuration struct and constructor.

Records and replays fixture-signed requests whose live equivalents exchanges accepted.

Compile-time generator for every supported exchange module.

Reads explicit emulated-method declarations from the owned runtime specs.

Generates JSON loading boilerplate with :persistent_term caching.

Fee information attached to trades and orders.

Unified funding payment history data.

Unified funding rate data.

Unified funding rate history entry.

Unified options greeks data.

HTTP client for exchange API requests.

Classifies HTTP and body-level exchange responses into Bourse.Error structs.

Hyperliquid exchange client (hyperliquid).

Per-instrument Greeks joined to option identity with explicit conventions.

Strict JSON document decoding shared by compile-time loaders.

Unified last price data.

Unified ledger entry data.

Unified leverage settings data.

Unified leverage tier data.

Lighter exchange client (lighter).

Unified liquidation event data.

Scheduled, read-only verification of provider response contracts.

Starts the dependency applications and supervised processes used by live drift reads.

Compares live wire shapes with consumed paths from a committed recording.

Sanitized failure contract persisted by the live drift lane.

Unified long/short ratio data.

MCP tool definitions for the Bourse API.

Unified margin loan data.

Unified margin mode data.

Unified margin modification data.

Unified market/instrument metadata.

Parallel fetch operations across multiple exchanges.

Candlestick (OHLCV) bar data.

OKX exchange client (okx).

Unified open interest data.

Unified options contract data.

Discovered option market identity plus available quote fields.

Mechanical option-proposal preflight and spot/perp hedge sizing.

Pure spot/perp hedge quantity calculation for a caller-chosen target delta.

Venue-local margin evidence and supported candidate-plan comparison.

Venue-owned margin simulation adapters.

Exact bounded optimization for caller-approved option-risk instruments.

Pure post-trade exposure projection for caller-supplied option legs.

Non-mutating option-proposal preflight outcome.

Executable four-venue option readiness matrix (task 402).

Acceptance rules for option-readiness baseline reports.

One timestamped evidence cell in the option readiness matrix.

Mechanical, reproducible evidence collection for one option-readiness venue.

Credential and environment resolution for the four option readiness venues.

Durable option-readiness matrix report.

One venue's readiness row: environment, cells, derived status and judgment.

Compile-time vocabulary shared across the option-readiness modules.

Observable, caller-held execution saga for approved option plans.

Executes one saga command against caller-supplied exchange configurations.

Caller-held execution journal for one approved option plan.

Formats reality-oracle labels for recordings and accepted requests.

Derives and compares binary oracle provenance from committed reality evidence.

Derives binary oracle provenance from committed venue-reality evidence.

Unified order data.

Fluent builder for unified order creation.

Pre-submit order validation against market metadata.

Unified order book (market depth) data.

Public response parser facade.

Builds point-in-time portfolio risk across venue/account domains.

Pure exposure math for portfolio-risk snapshots.

Point-in-time portfolio risk assembled across venue/account domains.

Unified derivatives position data.

Money-exact decimal string arithmetic for response normalization.

Records and replays provider-accepted public request branches.

Per-credential weighted rate limiter for exchange API requests.

Parses rate limit status headers from exchange API responses.

Rate limit status information parsed from exchange response headers.

Shapes endpoint rate-limit descriptors into Bourse.RateLimiter checks and updates rate-limit state from response headers.

ETS-backed store for rate limit status across exchanges.

Capture support and replay-exchange construction for committed reality evidence.

Live capture profiles for the committed real-response corpus.

Shared Lighter market-id resolution for the recording and acceptance fixtures.

Evidence classification for list-returning private recorded fixtures.

Compile-time exchange lookup registry.

Applies v4 normalization field maps to exchange responses.

Response shape normalization applied before field-mapping extraction.

Safe accessors and coercions used by response normalization.

Signing pattern library for exchange authentication.

API key and secret header authentication without an HMAC signature.

Behaviour for signing pattern implementations.

Shared low-level crypto primitives for the custom DEX signing modules (Bourse.Signing.Hyperliquid, Bourse.Signing.Derive).

Deribit-style HMAC-SHA256 signing with custom Authorization header.

First-party signing for Derive (Lyra v2, on Optimism).

Minimal EIP-712 typed-data encoder for the custom DEX signing modules (Bourse.Signing.Hyperliquid).

Generic HMAC signer driven by v4 auth.sign_recipe data.

HMAC-SHA256 headers signing pattern (Bybit-style).

HMAC-SHA256 with ISO timestamp and passphrase (OKX-style).

HMAC-SHA256 query string signing pattern (Binance-style).

First-party signing for Hyperliquid.

Lighter zk-Schnorr signing through an isolated official Go helper.

Versioned framed protocol for the isolated Lighter signing helper.

Supervises isolated, temporary Lighter signer owners.

The unsigned request handed to a signing pattern.

The signed, transport-ready request a signing pattern returns.

Compile-time JSON spec loader for exchange specifications.

Builds and gates complete owned-spec candidates from pinned CCXT references.

Evidence-report contract for owned-spec promotion.

Promotion failure with a stable code and actionable context.

Validation contract for complete, hand-owned runtime specifications.

Bidirectional symbol normalization between unified and exchange-specific formats.

Error raised when symbol conversion fails.

Typed components of a unified extended symbol from Bourse.Symbol.parse_extended/1.

Centralized telemetry contract for Bourse.

ETS-backed credential registry for integration testing.

Unified market ticker data.

Timestamp formatting helpers shared across request signing and response parsing.

Unified trade execution data.

Unified trading fee schedule data.

Unified deposit/withdrawal transaction data.

Unified internal transfer data.

Authored unified-method descriptors for Descripex api() hints.

Derives unified struct field sets from authored normalization.field_maps.

Reads authored per-venue option-Greek unit conventions.

Converts option quantities between unified base exposure and venue wire units.

Coherent option discovery and instrument-Greeks surface for option venues.

Compile-time mapping of unified method names to endpoint configs.

Unified historical volatility (DVOL) entry.

WebSocket entry point. Thin wrapper around ZenWebsocket.Client that binds a %Bourse.Exchange{} to a connection so subscribe/3 can pick the correct exchange-native frame builder.

Layer-3 WebSocket adapter GenServer.

WebSocket authentication pattern dispatcher.

Behaviour for WebSocket authentication pattern implementations.

Direct HMAC Expiry auth pattern — bybit, bitmex, and htx/huobi families.

Pure helpers for computing auth session expiry timing.

Inline Subscribe auth pattern — coinbaseexchange.

ISO Passphrase auth pattern — okx family, kucoin family, bitget.

JSON-RPC Linebreak auth pattern — deribit.

Listen Key auth pattern — binance family, aster.

REST Token auth pattern — kraken.

SHA384 Nonce auth pattern — bitfinex.

SHA512 Newline auth pattern — gate, gateio.

Registry-backed fan-out for routed WS adapter messages.

Spec-driven WebSocket channel formatting from websocket.subscribe.channels.

Per-exchange WebSocket configuration.

Spec-driven channel → handler resolution from websocket.dispatch.entries.

Builds WS message envelope config for routing inbound frames.

Subscription handle returned by unified watch_* functions.

Maps Bourse Pro handle* method names to unified watch_* family atoms.

Pure helpers for WS URL resolution.

Routes decoded WS frames to payload families using envelope extraction.

OHLCV cache driven by websocket.ohlcv_semantics.

Orderbook snapshot/delta state driven by websocket.orderbook_semantics.

Trades cache driven by websocket.trades_semantics.

Merges v4.1.0 websocket.* spec slices with hand-maintained WS overrides.

WebSocket subscription pattern dispatcher.

Behaviour for WebSocket subscription pattern implementations.

Escape hatch for exchanges whose subscribe frames don't fit any named pattern. The module dispatches on config[:custom_type]

Gate/Bitfinex/Bitget-style subscribe frame keyed on an "event" field.

Deribit-style JSON-RPC 2.0 subscribe frame.

Kraken v2 / Crypto.com / Derive-style subscribe frame.

Binance/XT/Aster-style subscribe frame.

Hyperliquid-style subscribe frame.

Bybit/Bitmex-style subscribe frame.

OKX-style subscribe frame with object-valued args.

HTX/Huobi-style subscribe frame.

KuCoin/Coinbase-style subscribe frame keyed on a "type" field.

Pure URL resolution for WebSocket endpoints.

Mix Tasks

Builds the official Lighter Go C-shared library and its generated header, then links the isolated Port helper for the current release target.