5.1 Open Lifecycle
Describes the complete process of creating a new leveraged position, including validation, account provisioning, capital allocation, execution, and confirmation before the position becomes active.- 5.1.1 Quote and Eligibility: Determines whether the user qualifies for leverage by evaluating buying power, market conditions, leverage limits, fees, and protocol risk policies.
- 5.1.2 Preconditions: Verifies all required conditions, including user authentication, wallet availability, sufficient margin, account provisioning, and vault reservation before execution begins.
- 5.1.3 Provisioning: Creates all records and infrastructure needed for the leveraged trade, including execution wallets, escrow records, vault reservations, and lifecycle tracking.
- 5.1.4 Funding: Moves user margin into escrow, draws liquidity from the vault, and funds the dedicated execution account with trading capital.
- 5.1.5 Execution: Submits the opening order to the prediction market while supporting both live execution and testing environments.
- 5.1.6 Fill Confirmation: Confirms that the order has actually been filled before officially marking the leveraged position as OPEN.
5.2 Close, Refund, Liquidation, and Default Lifecycle
Explains how leveraged positions are closed under normal, exceptional, or adverse conditions while ensuring proper settlement and repayment of borrowed capital.- 5.2.1 Manual Close: Describes the standard closing process, including exit execution, settlement, vault repayment, fee deduction, and release of remaining user funds.
- 5.2.2 Timeout Refund: Handles positions that fail to execute within the allowed time by cancelling orders, recovering funds, repaying the vault, and refunding user capital.
- 5.2.3 Liquidation and Forced Close: Explains how the protocol manages risk by forcibly closing positions that exceed predefined safety thresholds.
- 5.2.4 Bad Debt and Default: Records situations where position proceeds are insufficient to fully repay borrowed capital, ensuring losses are explicitly recognized.
- 5.2.5 Recipient Selection and Residual Release: Ensures that any remaining user funds are transferred to the correct recipient after all obligations have been settled.
5.3 State Machines
Defines the operational states that govern both leveraged positions and their associated capital throughout the protocol.- 5.3.1 Position Status: Specifies the lifecycle states of a leveraged position, from creation and funding to opening, closing, liquidation, default, or failed execution.
- 5.3.2 Capital Status: Tracks the movement of capital through every financial stage, including margin deposits, vault funding, settlement, repayments, payouts, and final release of funds.
