Skip to main content

Crate noviscia_asset_engine_sdk

Crate noviscia_asset_engine_sdk 

Source
Expand description

§Noviscia Asset Engine SDK

Instruction builders + PDA derivation for the noviscia-asset-engine on-chain program — the multi-asset token register & pool layout.

Three standardized SPL profiles share one engine: SOL arrives as wSOL (Same decimals as native SOL, handled identically to any SPL asset), USDC, and the NVSC project token. Each asset owns a segregated AssetPool with its own capacity ceiling, premium baseline, and vault pair.

Flagship builders:

  • build_allocate_asset_capacity_ix — single-slot JIT allocation that verifies Merkle KYC, opens/rolls the 24h floating window, and atomically CPIs the principal (the micro-premium is accrued, taxi-meter style).
  • build_settle_daily_ix — daily Clearing House settlement: the desk treasury returns the exact native asset and the ledger resets.
  • build_recredit_asset_capacity_ix — releases unused slot capital back into the pool.
  • build_register_asset_ix — onboards a mint into the token register.

Modules§

economics
Quantified Risk Pack & Economics — Module 1 of the TVV risk engine
velocity
Total Value Velocity (TVV) Specification Sheet — Module 2 of the TVV

Structs§

AssetEngineRegistry
Global asset engine configuration — stores the three-tier Layered Governance multi-sig keys (Squads PDAs) that gate every authority path.
AssetParams
Per-asset plan used by asset_register.
AssetPool
Per-mint pool profile: liquidity, premium params, and capacity ceiling.
DeskPosition
Per-desk borrow mirror for one mint — principal out + settled premiums.
InstitutionalCreditLine
Aggregate institutional multi-asset credit ceiling + 24h floating window.

Enums§

WindowPosture
Deterministic posture of the desk’s 24h floating window at current_slot.

Constants§

NVSC_PROFILE
Standard NVSC project-token profile (9 decimals, VAULT-scale tokens, no min premium).
USDC_PROFILE
Standard USDC profile (6 decimals, fast-cash pool, tighter ceiling).
WSOL_PROFILE
Standard wSOL profile (9 decimals, native-interop).

Functions§

anchor_discriminator
First 8 bytes of sha256("global:<name>") — Solana’s built-in SHA-256.
asset_authority_pda
asset_fee_vault_pda
asset_lp_mint_pda
ERC-4626 share-mint per pool: [asset-lp-mint, mint] (nUSDC / nSOL / nNVSC).
asset_lp_position_pda
Per-(pool, LP) share-position ledger: [asset-lp-position, mint, lp].
asset_pool_pda
asset_register_default
asset_vault_pda
build_allocate_asset_capacity_ix
Build asset_allocate_capacity — the Multi-Asset JIT Allocation core.
build_deposit_asset_liquidity_ix
Build asset_deposit_liquidity — LP seeds a pool vault in native asset and receives freshly minted ERC-4626 share tokens (nUSDC / nSOL / nNVSC).
build_initialize_credit_line_ix
Build asset_initialize_credit_line — registers an institution’s aggregate multi-asset credit ceiling (Tier 2: Risk Committee, 3-of-5, post-KYB).
build_initialize_ix
Build initialize — pins the platform mints + guard authority.
build_recredit_asset_capacity_ix
Build asset_recredit_capacity — releases unused slot capital.
build_register_asset_ix
Build asset_register — onboards a mint (Tier 3: Core Ecosystem Council, 5-of-7 Squads, 72h timelock).
build_set_asset_support_ix
Build asset_set_support — toggles an asset’s registration latch (Tier 2: Risk Committee, 3-of-5 Squads).
build_set_credit_frozen_ix
Build asset_set_credit_frozen — freezes an institution’s credit line (Tier 1: Emergency Risk Guard “The Breaker”, 1-of-3 Squads).
build_set_kyc_root_ix
Build asset_set_kyc_root — posts a desk’s provider-agnostic Merkle root. Build asset_set_kyc_root — provider-agnostic Merkle KYC root for a desk (Tier 2: Risk Committee, 3-of-5 Squads).
build_set_paused_ix
Build asset_set_paused — engine-level allocation pause (Tier 1: Emergency Risk Guard “The Breaker”, 1-of-3 Squads).
build_settle_daily_ix
Build asset_settle_daily — Phase 3 daily clearing house settlement.
build_update_asset_params_ix
Build asset_update_params — adjusts a registered asset’s parameters (Tier 2: Risk Committee, 3-of-5 Squads).
build_update_credit_limit_ix
Build asset_update_credit_limit — adjusts the aggregate ceiling (Tier 2: Risk Committee, 3-of-5 Squads).
build_withdraw_asset_fees_ix
Build asset_withdraw_fees — sweeps a per-asset fee vault. Build asset_withdraw_fees — sweeps a per-asset fee vault (Tier 3: Core Ecosystem Council, 5-of-7 Squads, 72h timelock — treasury allocation).
build_withdraw_asset_liquidity_ix
Build asset_withdraw_liquidity — an LP burns share tokens and redeems a proportional slice of the pool vault, subject to the desk-solvency floor (idle − shares_value ≥ active credit utilization).
compute_deposit_shares
ERC-4626 deposit: shares minted for deposit at the current share price. Mirrors AssetPool::compute_deposit_shares on-chain; 1:1 on first deposit.
compute_late_fee
Per-block default-interest meter for the 2h grace phase (mirrors the on-chain formula exactly). overdue_blocks counts slots past the 24h maturity; zero once the window is still open.
compute_lp_share_price
Scaled per-share price (×1_000_000) — the auto-compounding readout.
compute_lp_withdraw_value
ERC-4626 redeem: native assets returned for shares at the current price. Mirrors AssetPool::compute_lp_withdraw_value on-chain (caps at assets).
compute_premium
Compute the on-chain micro-premium for an allocation.
credit_line_pda
desk_position_pda
Per-mint desk borrow mirror: [desk-position, institution, mint].
register_wsol_default
One-shot pointer to the wSOL-mint profile (native-interop).
registry_pda
window_posture