Decentralized liquid staking protocol for QRL Zond. Deposit QRL, receive stQRL, earn validator rewards automatically.
QuantaPool enables QRL holders to participate in Proof-of-Stake validation without running their own validator nodes. Users deposit QRL and receive stQRL, a fixed-balance token where balanceOf() returns stable shares and getQRLValue() returns the current QRL equivalent (which grows with rewards).
- Liquid Staking: Receive stQRL tokens that can be transferred while underlying QRL earns rewards
- Fixed-Balance Token: Share balance stays constant (tax-friendly), QRL value grows with rewards
- Slashing-Safe: Fixed-balance design handles slashing by proportionally reducing all holders' QRL value
- Trustless Sync: No oracle needed - rewards detected via EIP-4895 balance increases
- Post-Quantum Secure: Built on QRL's Dilithium ML-DSA-87 signature scheme
- Production Infrastructure: Terraform + Ansible for automated validator deployment
- Monitoring Stack: Prometheus, Grafana dashboards, and Alertmanager with Discord/Telegram alerts
┌─────────────────────────────────────────────────────────────┐
│ User │
└───────────────────────────┬─────────────────────────────────┘
│ deposit() / requestWithdrawal()
▼
┌─────────────────────────────────────────────────────────────┐
│ DepositPool-v2.sol │
│ - Accepts deposits, mints stQRL shares │
│ - Queues and processes withdrawals │
│ - Trustless reward sync via balance checking │
│ - Funds validators via beacon deposit contract │
└───────────────────────────┬─────────────────────────────────┘
│ mintShares() / burnShares()
▼
┌─────────────────────────────────────────────────────────────┐
│ stQRL-v2.sol │
│ - Fixed-balance QRC-20 token │
│ - Shares-based accounting (wstETH-style) │
│ - balanceOf = shares, getQRLValue = QRL equivalent │
└─────────────────────────────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────┐
│ ValidatorManager.sol │
│ - Tracks validator states (pending → active → exited) │
│ - Stores Dilithium pubkeys (2,592 bytes) │
│ - MVP: single trusted operator model │
└───────────────────────────┬─────────────────────────────────┘
│
┌─────────────┴─────────────┐
▼ ▼
┌──────────────────────┐ ┌──────────────────────────────┐
│ Infrastructure │ │ Monitoring │
│ Terraform + Ansible │ │ Prometheus + Grafana │
│ gzond, qrysm nodes │ │ Contract exporter + alerts │
└──────────────────────┘ └──────────────────────────────┘
QuantaPool/
├── contracts/solidity/ # Solidity smart contracts (source of truth)
│ ├── stQRL-v2.sol # Fixed-balance liquid staking token
│ ├── DepositPool-v2.sol # Deposits, withdrawals, reward sync
│ └── ValidatorManager.sol # Validator lifecycle tracking
├── hyperion/ # Hyperion language port (.hyp mirrors)
│ ├── contracts/ # Auto-synced from Solidity sources
│ └── test/
├── test/ # Foundry test suite (178 tests)
│ ├── stQRL-v2.t.sol # 55 core token tests
│ ├── DepositPool-v2.t.sol # 68 deposit/withdrawal tests
│ └── ValidatorManager.t.sol# 55 validator lifecycle tests
├── infrastructure/ # Production validator deployment
│ ├── terraform/ # Hetzner Cloud provisioning
│ ├── ansible/ # Node configuration (gzond, qrysm)
│ ├── scripts/ # deploy.sh, failover.sh, health-check.sh
│ └── docs/ # Runbooks and deployment guides
├── monitoring/ # Observability stack
│ ├── prometheus/ # Scrape config + alert rules
│ ├── grafana/ # Dashboards (validator, contract, system)
│ ├── alertmanager/ # Discord/Telegram routing by severity
│ └── contract-exporter/ # Custom Node.js exporter for on-chain metrics
├── key-management/ # Validator key lifecycle scripts
├── scripts/ # Build & deployment automation
├── config/ # Network deployment configs
└── docs/ # Architecture docs
| Contract | LOC | Purpose |
|---|---|---|
stQRL-v2.sol |
496 | Fixed-balance liquid staking token (shares-based) |
DepositPool-v2.sol |
773 | User entry point, deposits/withdrawals, trustless reward sync |
ValidatorManager.sol |
349 | Validator lifecycle: Pending → Active → Exiting → Exited |
Solidity sources are maintained under contracts/solidity/. Hyperion mirrors live separately under hyperion/contracts/ so the .hyp port does not get mixed into the Foundry tree.
- User deposits 100 QRL when pool has 1000 QRL and 1000 shares
- User receives 100 shares,
balanceOf()= 100 shares - Validators earn 50 QRL rewards (pool now has 1050 QRL)
- User's
balanceOf()still = 100 shares (unchanged, tax-friendly) - User's
getQRLValue()= 100 × 1050 / 1000 = 105 QRL
If slashing occurs (pool drops to 950 QRL):
- User's
balanceOf()still = 100 shares - User's
getQRLValue()= 100 × 950 / 1000 = 95 QRL - Loss distributed proportionally to all holders
Production-ready validator infrastructure using Terraform and Ansible.
Components provisioned:
- Primary validator node — gzond (execution) + qrysm-beacon + qrysm-validator
- Backup validator node — hot standby with failover script
- Monitoring server — Prometheus, Grafana, Alertmanager
Key management scripts handle the full Dilithium key lifecycle: generation, encryption, backup, restore, and import to the validator client.
See infrastructure/docs/DEPLOYMENT.md for the step-by-step deployment guide and infrastructure/docs/runbooks/ for operational procedures.
Docker Compose stack providing full observability:
- Prometheus: Scrapes metrics from gzond, qrysm-beacon, qrysm-validator, and the custom contract exporter
- Grafana: Three dashboards — Validator Overview, Contract State, System Resources
- Alertmanager: Routes alerts by severity (Critical/Warning/Info) to Discord and Telegram
- Contract Exporter: Custom Node.js service exposing on-chain metrics (stQRL exchange rate, TVL, deposit queue, validator count)
See monitoring/README.md for setup and configuration.
- Foundry
hypcfor Hyperion compilation/deployment
forge buildforge testforge test -vvvnpm run sync:hyperion
npm run compile:hyperion
npm run deploy:hyperionSee hyperion/README.md for the dedicated Hyperion layout and deploy config.
GitHub Actions runs forge fmt --check, forge build --sizes, and forge test -vvv on every push and pull request.
- 178 tests passing (55 stQRL-v2 + 68 DepositPool-v2 + 55 ValidatorManager)
- Share/QRL conversion math, multi-user rewards, slashing scenarios
- Withdrawal flow with 128-block delay enforcement
- Validator lifecycle (registration, activation, exit, slashing)
- Virtual shares to prevent first-depositor attacks
- Access control, pause functionality, and reentrancy protection
- Fuzz testing for edge cases
v2 contracts ready — infrastructure and monitoring built, awaiting Zond testnet deployment.
- v2 fixed-balance contracts with audit remediations
- Validator infrastructure (Terraform + Ansible)
- Monitoring and alerting stack
- Key management tooling
- Deploy v2 contracts to Zond testnet
- Integrate staking UI into qrlwallet.com
- Slither static analysis completed (0 critical/high findings)
- Virtual shares (1e3) to prevent first-depositor/inflation attacks
- See
slither-report.txtfor full analysis results
- Lido and Rocket Pool for pioneering liquid staking designs
- The QRL Core Team for building post-quantum secure blockchain infrastructure
- Robyer for community feedback on the fixed-balance token model (tax implications of rebasing)
GPL-3.0