Whitepaper
Technical whitepaper detailing Teranium's approach to deterministic yield infrastructure on Solana.
Teranium introduces a deterministic, oracle-priced yield infrastructure on Solana, enabling capital-efficient single-asset vaults. By replacing traditional AMM mechanics with oracle-based pricing and implementing adaptive yield routing, Teranium provides institutional-grade execution quality while maintaining complete non-custodial guarantees.
The protocol combines three core innovations: isolated single-asset vaults with PDA-enforced security, oracle-priced swap execution using Pyth Network feeds, and an adaptive yield routing engine that optimizes capital allocation across DeFi primitives while maintaining strict solvency constraints.
1. Problem Statement
1.1 AMM Slippage
Traditional automated market makers introduce price impact proportional to trade size, creating unpredictable execution costs. Large trades suffer disproportionate slippage, making institutional participation economically inefficient.
1.2 LP Impermanent Loss
Liquidity providers in constant function market makers face systematic losses when asset prices diverge. Users seeking simple yield exposure must accept dual-asset risk and path-dependent returns.
1.3 Unpredictable Yield
Current DeFi yield sources exhibit high variance and require active management. Users lack tools to efficiently capture yield across multiple protocols without fragmented positions and manual rebalancing overhead.
2. Solution
2.1 Oracle-Based Pricing
Replace bonding curve slippage with deterministic oracle pricing. Pyth Network's high-frequency feeds provide accurate, manipulation-resistant prices that enable predictable execution regardless of trade size. On-chain validation ensures staleness bounds and confidence intervals meet quality thresholds.
2.2 Vault Isolation
Single-asset vaults eliminate LP token exposure and impermanent loss risk. Users deposit one token and receive the same token back plus yield. PDA-enforced vault authorities ensure true non-custodial operation with cryptographic proof of ownership via position PDAs.
2.3 Adaptive Yield Routing
A hybrid on-chain/off-chain routing engine dynamically allocates vault capital across yield sources. Off-chain computation optimizes risk-adjusted returns while on-chain enforcement maintains solvency guarantees and validates allocation constraints. This provides efficient yield capture without manual user intervention.
3. Protocol Design
Each vault is a Program Derived Address with deterministic seeds ["vault", mint]. Vaults hold SPL tokens for a single asset type with immutable mint binding. A separate vault authority PDA ["vault_authority", vault] serves as the only authorized signer for token movements.
User positions are tracked via individual PDAs ["position", vault, user] that record share balances and accrued yield. Share-based accounting ensures proportional yield distribution and enables fair withdrawals at any time.
An abstraction layer interfaces with Pyth Network price feeds while allowing future multi-oracle support. Each price query validates timestamp staleness (max 60s) and confidence interval (max 2%). Failed validation causes transaction rejection.
Oracle prices flow through a unified interface providing value, confidence, timestamp, and exponent. This standardization enables swap execution logic to remain oracle-agnostic.
Swap execution follows a deterministic four-step process: user intent specification with slippage tolerance, oracle price fetch and validation, slippage bounds verification, and atomic token exchange at the validated price.
This model eliminates path-dependent execution and MEV front-running opportunities. Users receive predictable pricing based on real-time market data rather than pool ratios.
Routing strategies are computed off-chain considering risk-adjusted yields, protocol security, and liquidity depth. Proposed allocations are submitted to the on-chain program which validates solvency constraints, allocation limits, and protocol whitelists.
The on-chain program maintains total_allocated and ensures it never exceeds vault_balance minus safety_reserve. This guarantees users can withdraw proportional shares even during adverse market conditions.
4. Security Model
4.1 PDA-Enforced Authorities
All vault funds are controlled exclusively by Program Derived Addresses with no external signing keys. This architectural choice eliminates entire classes of admin key compromise and rug pull vulnerabilities present in protocols with multisig or admin-controlled treasuries.
4.2 No Admin Custody
The protocol contains no privileged admin functions that can seize user funds. All state transitions follow deterministic rules encoded in the program logic. Protocol upgrades would require full code redeployment rather than admin parameter changes.
4.3 Deterministic Execution
Every program instruction follows predictable state transition rules. Users can simulate transaction outcomes before execution and independently verify all protocol behavior through on-chain transaction history. No oracle manipulation or admin intervention can alter deterministic execution paths.
5. Future Work
5.1 Multi-Oracle Aggregation
Extend the oracle adapter to aggregate prices from multiple sources (Pyth, Switchboard, Chainlink). Implement outlier detection and median pricing to improve manipulation resistance.
5.2 Permissionless Yield Strategies
Enable community-submitted yield strategies with on-chain risk scoring. Allow users to opt into specific strategy sets based on risk tolerance and return objectives.
5.3 Cross-Vault Composability
Develop vault-to-vault routing primitives that enable complex yield strategies spanning multiple asset types. Implement flash-loan-like mechanisms for capital-efficient arbitrage and rebalancing.
Teranium represents a fundamental rethinking of DeFi yield infrastructure. By replacing AMM mechanics with oracle pricing, isolating assets in single-token vaults, and implementing adaptive routing with on-chain enforcement, the protocol delivers institutional-grade execution quality while maintaining complete non-custodial guarantees. Solana's architecture provides the performance characteristics necessary to make this vision practical and economically viable for all users.