continuous-time finance · solana

神楽
a balance that
ticks every block.

usdc deposits accrue funding every solana block, on-chain. composable tick-attestation primitive any defi protocol can plug into for sub-second time signals.

tick #00000·Δ +0.000000 usdc per tick·22.00% apr target
see it tick →read the source
01 / now
written from solana mainnet · pyth

the chain we live on
is moving while you read this.

a new block lands every ≈400ms, carrying transactions on its back.(kagura accrues in that window.)

sol trades at on the pyth oracle. that price was attested moments ago.

loading current network state…

02 / vault
a deposit, in time

ten thousand dollars,
compounding mid-sentence.

a hypothetical $10,000 deposit, accruing the same way the on-chain anchor program will accrue, at the 22% apr target. nothing here is settled — it's the math you'd see at this exact moment.

$10,000.000000

+0.00006971 per second. continuously.

04 / what
two anchor programs

one is the clock. one is the vault.

primitivekagura-core

a tick-attestation registry. any solana program registers itself with a tick interval (50ms to 60s) and gets an on-chain stream of elapsed_ms deltas via cpi. nothing fancy. just verifiable time.

instructions4
stateKaguraConfig + ProtocolRegistration
eventsTickEmitted
program size242 kb
showcasekagura-vault

usdc deposit, share-mint, treasury, accumulator. every tick the vault calls principal × rate × elapsed_ms / (10000 × ms_per_year) and moves usdc from treasury → principal. erc-4626 share math, all-on-chain.

instructions7
stateVault + 3 token accounts
eventsDeposited / Withdrawn / FundingTicked
program size397 kb
05 / architecture
on-chain anatomy

the cpi cycle, drawn.

every tick is one transaction. it touches kagura-core, the vault, and three token accounts. the lines below are the actual cpi + transfer flow.

ARCHITECTURE / CPI FLOWv0.1.0usersignerticker botoff-chain · 1.5skagura-vaultanchor programkagura-coretick attestation registryusdc mintspl-tokenprincipalvault pdatreasuryvault pdashare mintvault pdaprotocolkagura-core pdadeposit(amount)deposit(amount)spl::transferspl::transferspl::mint_tospl::mint_totick_funding()tick_funding()cpi: record_tickcpi: record_tickupdate last_tick_msupdate last_tick_msaccruedaccrued↓ withdraw laterUSER FLOWTICK CYCLEPDA REFERENCE
06 / accrual
the only formula that matters

principal × rate × elapsed.

accrued
=principal
×rate
×elapsed
÷one year
principal
usdc held by the vault. read directly on every tick.
rate
22% target. capped at 300%. changeable on-chain.
elapsed
wall-clock delta since the last tick, attested by kagura-core.
one year
constant. all math in milliseconds. no float, no drift.

no funky curves. no “dynamic apr based on tvl.” no oracle gymnastics. one formula, ticked at the block level. share price reflects the live yield as a side effect, because the vault holds usdc directly.

08 / builders
for anchor devs

plug your protocol into the tick stream.

kagura is a primitive. register your protocol once, and every block you get a verifiable wall-clock delta. three patterns unlock from the same primitive.

01
register
declare your protocol with kagura-core, pick a tick interval, get a pda.
02
cpi
from any of your instructions, call kagura-core. one struct in, one tick attestation back.
03
compute
multiply by your protocol's rate × elapsed_ms. the rest of your math runs unchanged.
04
emit
emit your own event. indexers see both the kagura tick and your domain event.
continuous funding
capture funding rate every block instead of every hour. no settlement spikes. lps don't front-run the cron.
9,000× faster than 1h cron
real-time options
premium decays every block instead of jumping at midnight UTC. no discrete-time gamma cliff at expiry.
≈400ms decay floor
sub-block liquidation
watch margin health every tick. settle deleverage before the cex even sees the wick.
≈400ms detect-to-settle
read the integration guide →source on github
09 / spec
specifications

no roadmap. just the spec.

ticksettlement cycleevery solana block (~400 ms)
vs discrete-time defi (1h cron)9,000× faster
ms per year (constant)31,536,000,000
ratefunding rate target22% apr
funding rate ceiling (on-chain)300% apr
sizekagura-core program size242 kb
kagura-vault program size397 kb
testse2e tests10/10
math unit tests7/7
stackshare-token standardspl-token, erc-4626 share math
anchor0.31.1
agave / solana cli3.1.13