Expand description
Hypercall Types - Shared types for the Hypercall trading platform
This crate provides the core types used across hypercall components:
WalletAddress: Canonical Ethereum wallet address representation- Trading enums:
Side,TimeInForce,OptionType,OrderStatus - Request/response types for the API
- EIP-712 signature types and verification
Re-exports§
pub use balance_update::BalanceUpdate;pub use balance_update::BalanceUpdateReason;pub use margin_mode::MarginMode;pub use margin_mode::ParseMarginModeError;pub use fill_accounting::FillAccounting;pub use greeks::Greeks;pub use hypercore_position::HypercorePositionUpdate;pub use settlement_events::PositionExpiredMessage;pub use settlement_events::SettlementEconomics;pub use symbol::perp_underlying;pub use symbol::ParsedOptionSymbol;pub use hypercall_sdk_types as sdk;pub use engine_messages::*;
Modules§
- api_
models - Canonical API response types for the Hypercall REST API.
- balance_
update - directives
- EIP-712 directive structs, domains, and signer recovery helpers.
- engine_
messages - Engine message types for the event bus.
- enums
- Core enums used throughout Hypercall.
- expiry_
times - Per-underlying expiry time-of-day configuration.
- fill_
accounting - greeks
- hypercore_
position - liquidation_
state - Liquidation state data types.
- margin_
mode - Margin mode enum shared across the persistence and engine layers.
- observability
- option_
token_ address - Pure option-token Create2 derivation helpers.
- portfolio_
greeks - position_
metrics - qp_
protocol - Quote Provider WebSocket protocol for
/ws/quotes. - requests
- API request types.
- responses
- API response types.
- routes
- Shared HTTP route constants for the Hypercall API.
- settlement_
events - symbol
- topics
- utils
- Utility functions and constants.
- validator_
rsm - wallet_
address - Canonical Ethereum wallet address type for Hypercall.
- ws_
protocol
Macros§
- test_
wallet - Macro for creating test wallet addresses.
Structs§
- Accept
RfqRequest - Request to accept an RFQ quote.
- ApiResponse
- Generic API response wrapper.
- Approve
Agent Request - Request to approve an agent wallet.
- Approve
Agent Response - Response for approving an agent.
- Authorized
Agents Response - Response listing authorized agents.
- Bulk
Cancel Order Request - Bulk cancel request.
- Bulk
Cancel Order Response - Response from bulk cancel operation.
- Bulk
Order Result - Result for a single order in a bulk operation.
- Bulk
Place Order Request - Bulk order placement request.
- Bulk
Place Order Response - Response from bulk order placement.
- Cancel
Order ByClient IdRequest - Request to cancel an order by client ID.
- Cancel
Order ByCloid Request - Request to cancel an order by client ID through the public cloid endpoint.
- Cancel
Order Request - Request to cancel an order.
- Competition
Account Pnl - Competition account PnL response payload.
- Competition
Account Response - Competition account response.
- Competition
Connected User Rank - Connected wallet summary on a competition leaderboard response.
- Competition
Leaderboard Response - Competition leaderboard response.
- Competition
Leaderboard Row - Competition leaderboard row.
- Competition
PnlStanding - Competition PnL standing for a single wallet.
- Competition
PnlSummary - Competition PnL summary for a wallet.
- Competition
PnlSummary Response - Competition summary response.
- Decimal
Conversion Error - Error type for decimal to f64 conversion failures.
- Expiry
Time - A UTC time of day at which instruments expire.
- Expiry
Times - Process-wide expiry time policy: a default plus per-underlying overrides.
- Expiry
Times Install Error - Error returned when installing the process-wide expiry times fails.
- Fill
- Fill (trade execution) information.
- Historical
PnlPoint - A single historical equity point.
- Historical
PnlResponse - Historical equity response for a wallet and interval.
- Historical
Theo Point - A single historical theoretical-price point.
- Historical
Theo Response - Historical theo response for an instrument and interval.
- Index
Price Entry - Instrument
- Server-canonical representation of a tradable option instrument.
- Instrument
Response - Instrument information response.
- Instrument
Spec Response - Canonical instrument specification for discovery, quoting, and lifecycle consumers.
- Json
RpcError - JSON-RPC error information.
- Json
RpcResponse - JSON-RPC style response.
- L2Message
- L2 message (orderbook delta).
- L2Update
- L2 update (price level change).
- Margin
Summary - Unified margin summary that works for both Standard and Portfolio modes.
- Market
- Market information.
- Market
Info - Summary of a single expiry’s market data for one underlying.
- Market
Response - Simple market response (for create/delete).
- Market
Update Message - Market update message.
- Markets
Response - Response containing all available markets.
- Option
Greeks - Option
Summary - Option summary (for fetching underlying price).
- Option
Token Deployment - Explicit Create2 deployment parameters for option-token derivation.
- Order
Book Greeks - Option Greeks for order book.
- Order
Book Response - Orderbook response.
- Order
Book Stats - Order book statistics.
- Order
Info - Order information.
- Order
Message - Order message (response from order placement).
- Order
Update Message - Order update message.
- Orderbook
Update - Orderbook snapshot.
- Orders
Response - Orders list response.
- Pagination
- Pagination info for list responses.
- Place
Order Request - Request body for placing an order.
- Portfolio
Position - Position information in portfolio response.
- Portfolio
Response - Portfolio response from the API.
- Quote
Provider Response - Quote provider info (admin response).
- Register
Quote Provider Request - Admin request to register or update a quote provider.
- Replace
Order Request - Request to atomically cancel an existing order and place a new one.
- Revoke
Agent Request - Request to revoke an agent wallet.
- Revoke
Agent Response - Response for revoking an agent.
- RfqAccept
Response - Response after accepting an RFQ quote.
- RfqHistory
Response - RFQ history response.
- RfqLeg
Request - A single leg in an RFQ request.
- RfqLeg
Response - RFQ leg in status response.
- RfqQuote
LegResponse - Response for an RFQ quote leg.
- RfqQuote
Response - A single quote from a QP.
- RfqStatus
Response - Full RFQ status response.
- SetMargin
Mode Request - Request to set margin mode.
- Submit
RfqRequest - Request to submit an RFQ.
- Tick
Size Step - Tick size step for instrument pricing.
- Trade
Message - Trade message.
- Trading
Modes - Set of trading modes enabled for an instrument. Empty means the instrument is fully disabled. New variants can be added without the combinatorial explosion of an enum.
- Wallet
Address - Canonical representation of an Ethereum wallet address for Hypercall.
- WsCandle
Update - WsCompetition
Final Standing - WsCompetition
Final Stats - WsCompetition
GapUpdate - WsCompetition
PnlStanding - WsCompetition
PnlSummary - WsCompetition
Rank Change - WsCompetition
Update - WsFill
Update - WsFull
Liquidation State - WsIndex
Price Update - WsIndicative
Market Data - WsLiquidation
State Change - WsOrder
Message - WsOrder
Request - WsOrder
Result - WsOrderbook
Update - WsPartial
Liquidation State - WsPosition
Expired - WsRfq
LegRequest - WsRfq
Quote Entry - WsRfq
Quotes - WsRfq
Status Update - WsTrade
Update
Enums§
- Candle
Resolution - Expiry
Date Conversion Error - Error returned when converting a YYYYMMDD expiry code to a Unix timestamp.
- Expiry
Time Parse Error - Error returned when parsing an expiry time string.
- Fill
Source - Source of a fill (orderbook matching or RFQ execution).
- Historical
PnlInterval - Historical equity interval identifier.
- Historical
Theo Interval - Historical theo interval identifier.
- Market
Action - Market action (create, delete, or expire).
- Market
Update Status - Market update status.
- Option
Token Derivation Error - Error returned when deriving an option token address.
- Option
Type - Option type (call or put).
- Order
Action - Order action (create, cancel, or replace).
- Order
Status - Order status in the order lifecycle.
- Order
Update Status - Order update status (used in order update messages).
- Portfolio
Update - QpStatus
- Quote provider status.
- QpTier
- Quote provider tier.
- RfqStatus
- RFQ lifecycle status.
- Short
String Encoding Error - Error returned when encoding a canonical ShortString-backed
bytes32. - Side
- Order side (buy or sell).
- Strike
Scale Error - Error returned when scaling a strike to exact 1e8 integer precision.
- Time
InForce - Time in force for orders.
- Trade
Side - Trade side for trade messages.
- Transaction
Status - Transaction status for on-chain transactions.
- WsMarket
Update - WsMessage
- WsOptions
Chain Update
Constants§
- API_
ROUTE_ APPROVE_ AGENT - API_
ROUTE_ BULK_ ORDER - API_
ROUTE_ BULK_ ORDER_ CLOID - API_
ROUTE_ MARGIN_ MODE - API_
ROUTE_ NOTIFICATIONS_ MARK_ ALL_ READ - API_
ROUTE_ NOTIFICATIONS_ MARK_ READ - API_
ROUTE_ ORDER - API_
ROUTE_ ORDERBOOK - API_
ROUTE_ ORDERS - API_
ROUTE_ ORDER_ CLOID - API_
ROUTE_ PROFILE_ IMAGE - API_
ROUTE_ PUSH_ PREFERENCES - API_
ROUTE_ PUSH_ SUBSCRIBE - API_
ROUTE_ PUSH_ UNSUBSCRIBE - API_
ROUTE_ REVOKE_ AGENT - API_
ROUTE_ RFQ_ ACCEPT - API_
ROUTE_ RFQ_ REQUEST - API_
ROUTE_ SETTLEMENT_ PAYOUTS - API_
ROUTE_ SETTLEMENT_ PAYOUTS_ SEEN - API_
ROUTE_ USERNAME - CONTRACT_
UNIT_ MULTIPLIER - Constant for contract unit conversion (6 decimal places).
- CONTRACT_
UNIT_ MULTIPLIER_ DECIMAL - Decimal constant for contract unit conversion (6 decimal places).
- DEFAULT_
EXPIRY_ TIME - Default expiry time of day: 08:00 UTC (Deribit convention).
- HISTORICAL_
PNL_ INTERVAL_ 1D_ MS - Supported historical equity snapshot intervals.
- HISTORICAL_
PNL_ INTERVAL_ 1H_ MS - Supported historical equity snapshot intervals.
- HISTORICAL_
PNL_ INTERVAL_ 5M_ MS - Supported historical equity snapshot intervals.
- HISTORICAL_
THEO_ INTERVAL_ 1D_ MS - Supported historical theo snapshot intervals.
- HISTORICAL_
THEO_ INTERVAL_ 1H_ MS - Supported historical theo snapshot intervals.
- HISTORICAL_
THEO_ INTERVAL_ 5M_ MS - Supported historical theo snapshot intervals.
- MAX_
PRICE_ SIGNIFICANT_ FIGURES - Maximum significant figures allowed for prices.
- RFQ_
SELF_ TRADE_ REJECTION_ REASON - STRIKE_
SCALE_ 1E8 - Decimal scaling factor used by option strikes in on-chain contracts.
- STRIKE_
SCALE_ 1E8_ DECIMAL - Decimal representation of
STRIKE_SCALE_1E8.
Functions§
- count_
significant_ figures - Count significant figures in a price string.
- decimal_
to_ f64_ checked - Convert Decimal to f64 for calculations, returning error on failure.
- derive_
option_ token_ address - Derive an option token address from a normalized option-type string.
- derive_
option_ token_ address_ for_ type - Derive an option token address from explicit deployment parameters and parsed option type.
- encode_
short_ string_ bytes32 - Encode a UTF-8 string into the canonical OpenZeppelin
ShortStringsbytes32layout. - expiry_
date_ to_ timestamp - Convert expiry date (YYYYMMDD format) to Unix timestamp.
- expiry_
date_ to_ timestamp_ at_ time_ checked - Convert a YYYYMMDD expiry code to a Unix timestamp at an explicit UTC time of day.
- expiry_
date_ to_ timestamp_ checked - Convert a YYYYMMDD expiry code to a Unix timestamp using the underlying’s configured expiry time of day (default 08:00 UTC).
- expiry_
times - The active expiry time policy: the installed configuration, or the all-defaults policy (08:00 UTC) if none was installed.
- install_
expiry_ times - Install the process-wide expiry time policy. Call once at startup, before any component derives expiry timestamps.
- round_
to_ sig_ figs - Round a value to a specified number of significant figures.
- strike_
to_ e8 - Convert a strike to an exact 1e8-scaled integer.
- test_
wallet - Creates a deterministic test wallet address from an ID.
- to_
contract_ units - Convert human-readable size to contract units.
- to_
contract_ units_ decimal - Convert human-readable size (Decimal) to contract units (Decimal).
- to_
human_ readable - Convert contract units to human-readable size.
- to_
human_ readable_ decimal - Convert contract units (Decimal) to human-readable size (Decimal).
- validate_
price_ precision - Validate that a price has at most the specified number of significant figures.