KAGURA 神楽

KAGURA is a continuous-time DeFi primitive on Solana. Two on-chain Anchor programs: a tick-attestation registry, and a USDC funding vault that compounds yield every block instead of every hour.

contact: hello@kagura.network
神楽KAGURA/ docs
v0.1.0 · pre-deployment← back to sitegithub →
introduction·overview

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.

quickstartclone, build, deploy to devnet, and watch a vault tick in under 10 minutes.conceptswhat continuous-time finance means, why it needs solana, and how tick attestation works.programsevery instruction, account, error, and event of both anchor programs.integrationrust cpi, typescript clients, recipe patterns for plugging your protocol into KAGURA.operationsrunning a ticker bot, treasury top-up cadence, monitoring, alerting.securityaudit status, threat model, what happens when a tick is missed.

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.

kagura-vault/src/instructions/tick_funding.rsrust
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.

programidsize
kagura-coreDbHae1rzcf5U8Jbrp5X9NFTcZfk4z12R2qMNgesmXNnC242 kb
kagura-vaultHQYVFcbezorwCqPK69keUAoe4p1zgPzCVDfJq4XWymk8397 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.