Skip to main content

Crate hypercall_types

Crate hypercall_types 

Source
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§

AcceptRfqRequest
Request to accept an RFQ quote.
ApiResponse
Generic API response wrapper.
ApproveAgentRequest
Request to approve an agent wallet.
ApproveAgentResponse
Response for approving an agent.
AuthorizedAgentsResponse
Response listing authorized agents.
BulkCancelOrderRequest
Bulk cancel request.
BulkCancelOrderResponse
Response from bulk cancel operation.
BulkOrderResult
Result for a single order in a bulk operation.
BulkPlaceOrderRequest
Bulk order placement request.
BulkPlaceOrderResponse
Response from bulk order placement.
CancelOrderByClientIdRequest
Request to cancel an order by client ID.
CancelOrderByCloidRequest
Request to cancel an order by client ID through the public cloid endpoint.
CancelOrderRequest
Request to cancel an order.
CompetitionAccountPnl
Competition account PnL response payload.
CompetitionAccountResponse
Competition account response.
CompetitionConnectedUserRank
Connected wallet summary on a competition leaderboard response.
CompetitionLeaderboardResponse
Competition leaderboard response.
CompetitionLeaderboardRow
Competition leaderboard row.
CompetitionPnlStanding
Competition PnL standing for a single wallet.
CompetitionPnlSummary
Competition PnL summary for a wallet.
CompetitionPnlSummaryResponse
Competition summary response.
DecimalConversionError
Error type for decimal to f64 conversion failures.
ExpiryTime
A UTC time of day at which instruments expire.
ExpiryTimes
Process-wide expiry time policy: a default plus per-underlying overrides.
ExpiryTimesInstallError
Error returned when installing the process-wide expiry times fails.
Fill
Fill (trade execution) information.
HistoricalPnlPoint
A single historical equity point.
HistoricalPnlResponse
Historical equity response for a wallet and interval.
HistoricalTheoPoint
A single historical theoretical-price point.
HistoricalTheoResponse
Historical theo response for an instrument and interval.
IndexPriceEntry
Instrument
Server-canonical representation of a tradable option instrument.
InstrumentResponse
Instrument information response.
InstrumentSpecResponse
Canonical instrument specification for discovery, quoting, and lifecycle consumers.
JsonRpcError
JSON-RPC error information.
JsonRpcResponse
JSON-RPC style response.
L2Message
L2 message (orderbook delta).
L2Update
L2 update (price level change).
MarginSummary
Unified margin summary that works for both Standard and Portfolio modes.
Market
Market information.
MarketInfo
Summary of a single expiry’s market data for one underlying.
MarketResponse
Simple market response (for create/delete).
MarketUpdateMessage
Market update message.
MarketsResponse
Response containing all available markets.
OptionGreeks
OptionSummary
Option summary (for fetching underlying price).
OptionTokenDeployment
Explicit Create2 deployment parameters for option-token derivation.
OrderBookGreeks
Option Greeks for order book.
OrderBookResponse
Orderbook response.
OrderBookStats
Order book statistics.
OrderInfo
Order information.
OrderMessage
Order message (response from order placement).
OrderUpdateMessage
Order update message.
OrderbookUpdate
Orderbook snapshot.
OrdersResponse
Orders list response.
Pagination
Pagination info for list responses.
PlaceOrderRequest
Request body for placing an order.
PortfolioPosition
Position information in portfolio response.
PortfolioResponse
Portfolio response from the API.
QuoteProviderResponse
Quote provider info (admin response).
RegisterQuoteProviderRequest
Admin request to register or update a quote provider.
ReplaceOrderRequest
Request to atomically cancel an existing order and place a new one.
RevokeAgentRequest
Request to revoke an agent wallet.
RevokeAgentResponse
Response for revoking an agent.
RfqAcceptResponse
Response after accepting an RFQ quote.
RfqHistoryResponse
RFQ history response.
RfqLegRequest
A single leg in an RFQ request.
RfqLegResponse
RFQ leg in status response.
RfqQuoteLegResponse
Response for an RFQ quote leg.
RfqQuoteResponse
A single quote from a QP.
RfqStatusResponse
Full RFQ status response.
SetMarginModeRequest
Request to set margin mode.
SubmitRfqRequest
Request to submit an RFQ.
TickSizeStep
Tick size step for instrument pricing.
TradeMessage
Trade message.
TradingModes
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.
WalletAddress
Canonical representation of an Ethereum wallet address for Hypercall.
WsCandleUpdate
WsCompetitionFinalStanding
WsCompetitionFinalStats
WsCompetitionGapUpdate
WsCompetitionPnlStanding
WsCompetitionPnlSummary
WsCompetitionRankChange
WsCompetitionUpdate
WsFillUpdate
WsFullLiquidationState
WsIndexPriceUpdate
WsIndicativeMarketData
WsLiquidationStateChange
WsOrderMessage
WsOrderRequest
WsOrderResult
WsOrderbookUpdate
WsPartialLiquidationState
WsPositionExpired
WsRfqLegRequest
WsRfqQuoteEntry
WsRfqQuotes
WsRfqStatusUpdate
WsTradeUpdate

Enums§

CandleResolution
ExpiryDateConversionError
Error returned when converting a YYYYMMDD expiry code to a Unix timestamp.
ExpiryTimeParseError
Error returned when parsing an expiry time string.
FillSource
Source of a fill (orderbook matching or RFQ execution).
HistoricalPnlInterval
Historical equity interval identifier.
HistoricalTheoInterval
Historical theo interval identifier.
MarketAction
Market action (create, delete, or expire).
MarketUpdateStatus
Market update status.
OptionTokenDerivationError
Error returned when deriving an option token address.
OptionType
Option type (call or put).
OrderAction
Order action (create, cancel, or replace).
OrderStatus
Order status in the order lifecycle.
OrderUpdateStatus
Order update status (used in order update messages).
PortfolioUpdate
QpStatus
Quote provider status.
QpTier
Quote provider tier.
RfqStatus
RFQ lifecycle status.
ShortStringEncodingError
Error returned when encoding a canonical ShortString-backed bytes32.
Side
Order side (buy or sell).
StrikeScaleError
Error returned when scaling a strike to exact 1e8 integer precision.
TimeInForce
Time in force for orders.
TradeSide
Trade side for trade messages.
TransactionStatus
Transaction status for on-chain transactions.
WsMarketUpdate
WsMessage
WsOptionsChainUpdate

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 ShortStrings bytes32 layout.
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.