Skip to main content

Crate hypercall_competition

Crate hypercall_competition 

Source
Expand description

Competition business logic (hypercall-competition crate).

Owns the competition domain: lifecycle validation (window/win-condition checks, post-competition immutability, pre-only deletion), leaderboard computation (FIFO lot PnL engine), profile stats, and the record-to-API mappers. Both HTTP crates depend on it: hypercall-api serves the public read routes and hypercall-admin serves the operator write routes, each holding an Arc<CompetitionService> directly. Persistence goes through the ORM-free hypercall_db::CompetitionWriter trait; market inputs come from the hypercall_runtime_api boundary ports.

Modules§

recorder 🔒
Downstream consumer that records completed fills into the competition tables.
service 🔒

Structs§

CompetitionEngagementSnapshot
CompetitionFillRecorder
Consumes the engine fill stream and records competition fills.
CompetitionRecord
A persisted competition row.
CompetitionService
CompetitionUpdateInput
Input for updating an existing competition (all fields optional).
CompetitionUpsertInput
Input for creating a new competition.
Fill
A profile trade-history fill row, validated from the persistence layer.
LeaderboardEntry
LeaderboardQuery
LeaderboardResult
PlatformMetricMedals
RealizedPnlBySymbol

Enums§

CompetitionError
Typed error for the competition domain.
CompetitionState
CompetitionWinCondition
LeaderboardSortBy
SortOrder

Constants§

DEFAULT_LIMIT
Default page size for competition listings.
MAX_LIMIT
Maximum page size for competition listings.

Functions§

clamp_limit
competition_state
Determine the competition state based on timestamps.
competition_to_api

Type Aliases§

Result
Result alias for competition operations.