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§
Structs§
- Competition
Engagement Snapshot - Competition
Fill Recorder - Consumes the engine fill stream and records competition fills.
- Competition
Record - A persisted competition row.
- Competition
Service - Competition
Update Input - Input for updating an existing competition (all fields optional).
- Competition
Upsert Input - Input for creating a new competition.
- Fill
- A profile trade-history fill row, validated from the persistence layer.
- Leaderboard
Entry - Leaderboard
Query - Leaderboard
Result - Platform
Metric Medals - Realized
PnlBy Symbol
Enums§
- Competition
Error - Typed error for the competition domain.
- Competition
State - Competition
WinCondition - Leaderboard
Sort By - Sort
Order
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.