Kernel State and Schedule
The ACTUS kernel stores the executable contract as three normalized payload classes:
NormalizedActusTermsInitialKernelStateExecutionScheduleEntry[]
Normalized Terms
NormalizedActusTerms MUST contain the immutable or quasi-immutable contract
configuration required by the kernel, including:
- Contract Type ID;
- Denomination asset ID and Settlement asset ID;
- Total units;
- Notional Principal;
- Initial Exchange Amount and Date;
- Maturity Date;
- Day-Count Convention ID;
- Rate Reset parameters;
- Dynamic-principal-redemption flags;
- Fixed-point scale.
Initial kernel state
InitialKernelState MUST capture the pre-IED kernel state snapshot uploaded
with contract_config. It defines:
- Status Date \( [SD] \);
- Starting event cursor;
- Outstanding principal;
- Interest calculation base;
- Current nominal rate;
- Accrued interest;
- Next principal redemption;
- Cumulative interest and principal indices.
Execution schedule
The normalized ACTUS execution schedule is an array of ExecutionScheduleEntrys.
Execution schedule entry
Each ExecutionScheduleEntry MUST contain:
- A contiguous
event_id; - An ACTUS
event_type; scheduled_time;- Precomputed accrual factors;
- The next normalized rate and principal state;
- Entry flags.
Entry flags are stored as a bitfield integer and MUST comply with the following bit positions:
| Flag | Bit Position | Decimal Value | Meaning |
|---|---|---|---|
CASH_EVENT | 1 << 0 | 1 | Event produces cash flows (requires contract funds) |
NON_CASH_EVENT | 1 << 1 | 2 | Event updates state without cash flows |
OBSERVED_EVENT | 1 << 2 | 4 | Event requires external observation (e.g., rate reset) |
INITIAL_PRF | 1 << 3 | 8 | Event is the initial performance flag update |
The schedule MUST satisfy the following invariants:
Schedule invariants
event_id = 0MUST beIED;- Event IDs MUST be contiguous across all pages;
- Schedule entries MUST be ordered by nondecreasing
scheduled_time; - Page size MUST NOT exceed
16entries in the current kernel; - The last uploaded page MUST finalize
schedule_entry_countand move the contract toSTATUS_PENDING_IED.
A normalized ACTUS schedule page MUST be identified with a key of the form:
[S#||<0-based page index>]
Where || denotes concatenation.
ACTUS cycles
ACTUS cycles are an off-chain schedule-generation concept. They define recurring periods before normalization resolves them into concrete timestamps.
The D-ASA SDK models ACTUS cycles with the syntax:
<count><unit>[+|-]
where:
countis a positive integer;unitis one ofD,W,M,Q,H,Y;+and-are optional ACTUS stub markers.
Examples:
90D3M1Q1H2Y3M+1Q-
Cycles are used together with ACTUS anchors in ContractAttributes, such as:
interest_payment_anchor+interest_payment_cycleprincipal_redemption_anchor+principal_redemption_cyclerate_reset_anchor+rate_reset_cycle
The normalization process MUST resolve those cycles into explicit schedule entries before the contract is uploaded to the AVM.
As a result, the on-chain kernel does not store raw ACTUS cycles. It stores only the normalized timestamps and state transitions that were derived from those cycles.
Contract status machine
The kernel uses the following status identifiers:
| Status | ID | Meaning |
|---|---|---|
INACTIVE | 0 | Terms and schedule not fully configured |
PENDING_IED | 50 | Schedule uploaded; issuance not yet activated |
ACTIVE | 100 | IED executed; contract lifecycle is live |
ENDED | 200 | Terminal state reached |
stateDiagram-v2 [*] --> INACTIVE: Contract create INACTIVE --> PENDING_IED: Upload schedule PENDING_IED --> ACTIVE: Execute IED ACTIVE --> ACTIVE: Execute events ACTIVE --> ENDED: Terminal state ENDED --> [*] state "INACTIVE (0)<br/>Terms and schedule<br/>not fully configured" as INACTIVE state "PENDING_IED (50)<br/>Schedule uploaded<br/>Issuance not activated" as PENDING_IED state "ACTIVE (100)<br/>IED executed<br/>Contract lifecycle live" as ACTIVE state "ENDED (200)<br/>Terminal state reached" as ENDED
Performance default flag
Kernel lifecycle status and contract performance are distinct concepts.
Outside the kernel normalized state, the reference implementation stores a boolean
RBAC-managed global-state flag, defaulted, to record manual contract default
performance.
An active Trustee MAY update this flag by calling rbac_contract_default
with a boolean defaulted argument.
defaulted is not part of InitialKernelState and is not returned by contract_get_state.
Clients that need it MUST read the dedicated global-state key.
Due-event execution
The kernel advances the schedule through explicit ABI calls:
contract_execute_iedapplies the first dueIED;apply_non_cash_eventapplies the next due non-cash event afterIED;fund_due_cashflowsprocesses due cash events and advances the cursor;contract_get_next_due_eventreturns the next due entry, or a zero sentinel after end.
This split is the normative execution model for D-ASA.