System Design & Smart Contracts
Tharwa’s architecture is modular, extensible, and designed to manage real-world capital at scale. The system splits responsibilities across multiple smart contracts and execution layers, each with a clear domain: stablecoin logic, yield vaults, governance, staking, and rebalancing.
This separation of concerns allows the protocol to upgrade safely, deploy new features, and manage billions in assets without central points of failure.
Core Design Principles
Modularity Each product component (e.g., thUSD, vaults, governance, staking) is deployed as a standalone contract or system of contracts.
Upgradeability Where Needed Critical infrastructure like thUSD remains immutable after deployment. Peripheral logic (like vaults, rewards, or rebalancing) is upgradable through governance-controlled proxies.
Minimized Governance Reliance Wherever possible, the protocol uses autonomous automation (like the Confluence Engine) instead of requiring DAO votes for operations.
Security-First Defaults Vault withdrawals, stablecoin minting, and rebalancing are guarded by multi-layered checks, including circuit breakers, oracle verifications, and whitelisting logic.
Key Contract Groups
thUSD Contracts
ERC-20/OFT implementation with built-in peg logic
Mint/redeem enabled only through whitelisted vaults or custodians
No admin backdoors; minting limits governed by protocol logic
LayerZero-compatible for cross-chain bridging (OFT standard)
Vault Contracts (ERC-1155)
Each Risk-On Vault is a distinct ERC-1155 class
Represents fixed-term positions with maturity dates and yield logic
Transferable and tradable via OTC Marketplace (coming soon)
Vault logic includes principal protection rules and redemption windows
Confluence Engine Interface
Smart contract receives weight updates from the off-chain engine
Threshold triggers initiate vault allocation changes or rebalance events
Can be set to advisory mode (manual execution) or autonomous mode (automated allocation)
Governance (TRWA)
Token-based governance over protocol upgrades and treasury settings
Includes quorum thresholds, execution delay, and proposal review system
sTRWA staking contract used for long-term alignment and voting power
Peg Defense Module
Maintains peg using liquidity buffers, OTC matching, and smart redemption logic
Capable of drawing from reserve vaults in response to volatility
Designed to be callable by approved bots or automated monitors
Rewards & Staking (sthUSD / sTRWA)
Yield distribution contract streams real yield to sthUSD holders
sTRWA staking pool receives protocol revenue from vault fees, OTC spreads, etc.
Includes claim-vesting, lockups, and reward halving logic
Security Infrastructure
Multi-sig-controlled safes for treasury and admin functions
Oracle feeds used for asset pricing and vault maturity validation
Circuit breakers on critical functions (e.g., mint, redeem, rebalance)
Audit-ready modularity: each contract audited independently, with dependency checks between components
Last updated