序welcome to KAGURA
continuous-time defi primitive on solana. usdc accrues funding every block, on-chain. composable tick attestation any anchor program can plug into.
KAGURA (神楽) is two anchor programs that together turn solana into a continuous-time financial substrate. kagura-core is a tick attestation registry — any program registers itself with a tick interval (50ms to 60s) and gets a verifiable on-chain stream of elapsed_ms deltas via cpi. kagura-vault is the showcase that proves it: a usdc deposit vault whose share price advances every block instead of every hour.
This documentation walks you through the math, the on-chain accounts, the cpi pattern, the operational surface, and the integration recipes. If you're here to read code, jump to programs/kagura-core. If you're here to ship, start with quickstart.
the 30-second version
Solana's clock advances every block (≈400ms). Most defi protocols treat this clock as discrete: funding rates settle every hour, options expire at fixed timestamps, vesting unlocks once a day. KAGURA flips the assumption.
1let tick = kagura_core::cpi::record_tick(cpi_ctx)?.get();2let elapsed_ms = tick.elapsed_ms as u64;3 4let accrued = principal5 .checked_mul(rate_bps as u128)?6 .checked_mul(elapsed_ms as u128)?7 .checked_div(10_000 * 31_536_000_000)?;8 9token::transfer(treasury_to_principal, accrued)?;10emit!(FundingTicked { tick, accrued });That's the entire mechanism. kagura-core attests the elapsed wall-clock delta. The vault multiplies it by principal × rate, divides by milliseconds-per-year, and moves the result from a treasury reserve into the principal account. Share price reflects the live yield as a side effect because the vault holds usdc directly.
status
KAGURA is pre-deployment. The keypairs below were generated by anchor build locally and become the canonical program ids the moment a funded key hits devnet. No mainnet address is published until audit. See security/audit for the disclosure timeline.
| program | id | size |
|---|---|---|
kagura-core | DbHae1rzcf5U8Jbrp5X9NFTcZfk4z12R2qMNgesmXNnC | 242 kb |
kagura-vault | HQYVFcbezorwCqPK69keUAoe4p1zgPzCVDfJq4XWymk8 | 397 kb |
who this is for
- protocol devs who want to add continuous-time semantics to their own anchor program — jump here.
- operators running ticker bots, monitoring vault health, or managing the treasury reserve — jump here.
- users / lps evaluating whether the vault math is correct and whether the treasury can sustain the advertised apr — share math and treasury model.
- auditors / researchers reading the on-chain accounts directly — programs reference.