AI-Generated ERC-4626 Vaults Built From ERC-3643 Real-World Assets
Praxos is a complete system for tokenizing Real-World Assets (RWAs), managing them in yield-bearing vaults, and providing personalized vault suggestions to users via an AI agent.
The system supports both standard ERC-4626 vaults and compliant RWA Index Vaults that bridge ERC-4626 and ERC-3643 standards, enabling compliant investment products with full identity management, price oracles, and dividend distribution.
The system flow: Financial institutions (Bank A, B, C, etc.) issue financial products (bonds, real-estate funds, startup funds) on private Rayls nodes. These products are tokenized into ERC-3643 compliant tokens via a Tokenization Engine. The Praxos AI Engine then analyzes these tokenized RWAs, performs risk analysis and allocation optimization, and creates diversified ERC-4626 yield-bearing vaults. Finally, the Praxos AI Agent provides personalized vault suggestions to users based on their timeframe, risk tolerance, and investment amount.
These vaults act like "honey cells" in a honeycomb β modular financial building blocks that users can choose from depending on risk, duration, and diversification.
Banks running Rayls private nodes want:
- more liquidity across their financial products
- increased demand for their tokenized RWAs
- better distribution channels
- composable products for broader investors
Rayls benefits from:
- more private nodes onboarded
- increased RWA issuance
- deeper institutional adoption
- more activity on the network
Users want:
- diversified investment vaults
- simple abstraction over complex RWAs
- clear risk categories
- automated portfolio construction
Praxos satisfies all three.
For a detailed system flowchart, see docs/PraxosFlowchart.md.
Praxos supports two vault architectures:
- Standard Vaults (
PraxosVault): Simple ERC-4626 vaults for non-compliant or permissionless RWAs - Compliant Vaults (
PraxosVaultCompliant): Full RWA compliance architecture with:- ONCHAINID identity management
- Price oracle integration
- Dividend harvesting and distribution
- Compliant swap mechanisms
- Rewards module support
For detailed information on the compliant architecture, see:
- docs/COMPLIANT_VAULT_ARCHITECTURE.md - Complete architecture explanation
- docs/IMPLEMENTATION_GUIDE.md - Step-by-step deployment guide
- docs/VAULT_STORAGE_EXPLANATION.md - Vault data storage patterns
flowchart TD
subgraph Banks["Private Nodes - Financial Institutions"]
BankA["Bank A"]
BankB["Bank B"]
BankC["Bank C"]
end
subgraph RWA_A["Bank A RWAs<br/>Financial Products"]
BondA1["Bond 1"]
RealEstateA1["Realestate fund 1"]
StartupA1["Startup Fund 1"]
end
subgraph RWA_B["Bank B RWAs<br/>Financial Products"]
BondB2["Bond 2"]
RealEstateB2["Realestate fund 2"]
StartupB2["Startup Fund 2"]
end
subgraph RWA_C["Bank C RWAs<br/>Financial Products"]
BondC3["Bond 3"]
RealEstateC3["Realestate fund 3"]
StartupC3["Startup Fund 3"]
end
TokenEngine["Tokenization Engine<br/>ERC-3643 Token Creation"]
subgraph Tokenized["Tokenized RWAs<br/>ERC-3643 Tokens"]
TokenA1["Bond 1<br/>ERC-3643"]
TokenA2["Realestate fund 1<br/>ERC-3643"]
TokenA3["Startup Fund 1<br/>ERC-3643"]
TokenB1["Bond 2<br/>ERC-3643"]
TokenB2["Realestate fund 2<br/>ERC-3643"]
TokenB3["Startup Fund 2<br/>ERC-3643"]
TokenC1["Bond 3<br/>ERC-3643"]
TokenC2["Realestate fund 3<br/>ERC-3643"]
TokenC3["Startup Fund 3<br/>ERC-3643"]
end
AIEngine["Praxos AI Engine<br/>Risk Analysis & Allocation"]
subgraph Vaults["ERC-4626 Yield-Bearing Vaults"]
VaultA["Vault A<br/>β’ Bond 1 (Bank A)<br/>β’ Bond 2 (Bank B)<br/>β’ Startup Fund 3 (Bank C)"]
VaultB["Vault B<br/>β’ Realestate fund 2 (Bank B)<br/>β’ Realestate fund 3 (Bank C)<br/>β’ Bond 1 (Bank A)<br/>β’ Bond 2 (Bank B)"]
VaultC["Vault C<br/>β’ Startup Fund 2 (Bank B)<br/>β’ Startup Fund 3 (Bank C)"]
end
AIAgent["Praxos AI Agent<br/>Personalized Vault Suggestions<br/><br/>Based on:<br/>β’ Timeframe<br/>β’ Risk tolerance<br/>β’ Amount"]
Users["Users<br/>Get Personalized Vault Suggestions"]
BankA --> RWA_A
BankB --> RWA_B
BankC --> RWA_C
RWA_A --> TokenEngine
RWA_B --> TokenEngine
RWA_C --> TokenEngine
TokenEngine --> Tokenized
Tokenized --> AIEngine
AIEngine --> Vaults
Vaults <--> AIAgent
Users --> AIAgent
AIAgent --> Users
style AIEngine fill:#90EE90
style AIAgent fill:#90EE90
style TokenEngine fill:#87CEEB
style Vaults fill:#FFD700
Each participating bank (Bank A, Bank B, Bank C, etc.) runs a private Rayls node, issuing financial products such as:
- corporate bonds
- real-estate investment products
- startup investment funds
- revenue-sharing agreements
- credit risk pools
Each product includes identity gating, transfer restrictions, and compliance enforcement.
The Tokenization Engine converts financial products into ERC-3643 compliant tokens, enabling blockchain-based representation of real-world assets.
- Takes raw financial products from institutions
- Converts them to ERC-3643 standard tokens
- Example: "Financial product Bond 1" β "ERC-3643 Token Bond 1"
- Enables composability and interoperability on-chain
All financial products are tokenized as ERC-3643 tokens, creating a standardized on-chain representation of real-world assets from multiple institutions.
Praxos models each ERC-3643 tokenized product by simulating:
- yield curves
- credit/default risk
- volatility
- maturity and duration
- redemption/liquidity windows
- counterparty risk
Outputs a standardized risk signature per product.
The Praxos AI Engine processes tokenized RWAs and performs:
- Risk Analysis: Evaluates risk profiles for all tokenized assets
- Allocation Optimization: Constructs optimal vault strategies by considering:
- risk tiers
- duration buckets
- diversification needs
- regulatory constraints
- modeled performance scenarios
Produces a set of vault candidates with optimal asset allocations.
Each AI-created strategy is compiled into a deployable ERC-4626 Vault, ready for deposits.
These vaults are:
- compliant with ERC-4626 standard
- structured and diversified
- composed of multiple ERC-3643 RWAs
- dynamically generated by the AI
- optimized for risk-adjusted returns
Example vaults:
- Vault A: Bond 1 (Bank A), Bond 2 (Bank B), Startup Fund 3 (Bank C)
- Vault B: Realestate fund 2 (Bank B), Realestate fund 3 (Bank C), Bond 1 (Bank A), Bond 2 (Bank B)
- Vault C: Startup Fund 2 (Bank B), Startup Fund 3 (Bank C)
The Praxos AI Agent provides personalized vault suggestions to users based on:
- Timeframe: Investment duration preferences (short-term, medium-term, long-term)
- Risk tolerance: User's risk appetite (conservative to aggressive)
- Amount: Investment size and constraints
The AI Agent analyzes available vaults and matches them to user preferences, enabling informed investment decisions.
Users interact with Praxos through the web interface, where they can:
- View available vaults created by the AI
- Receive personalized recommendations from the Praxos AI Agent
- Deposit into vaults
- Monitor their investments
- Withdraw when needed
Each vault is represented as an ERC-4626 contract containing a diversified portfolio of ERC-3643 assets.
See docs/QUICKSTART.md for a 5-minute setup guide.
-
Install Node.js and npm:
# Install Node.js 18+ from https://nodejs.org/ node --version # Should be 18.0.0 or higher
-
Install Dependencies:
# Install Hardhat and dependencies make install # Or manually: npm install # Set up Python environment for offchain components cd offchain && python3 -m venv venv && source venv/bin/activate pip install -r requirements.txt cd ..
-
Set up environment variables:
# Copy the example file cp .env.example .env # Edit .env and add your private key (without 0x prefix) # Get your private key from MetaMask: Account Details > Export Private Key # WARNING: Never commit .env to git!
-
Get testnet tokens:
- See docs/FAUCET.md for detailed instructions
- Add Rayls Devnet to MetaMask (Chain ID: 123123)
- Request USDr tokens from the Rayls faucet
- You'll need ~20-50 USDr for deployment and testing
-
Deploy to Rayls Devnet:
# Deploy contracts make deploy # Or manually: npx hardhat run scripts/deploy.mjs --network rayls_devnet
See docs/SETUP.md for detailed setup instructions.
praxos/
βββ contracts/
β βββ interfaces/
β β βββ IERC3643.sol # ERC-3643 RWA token interface
β β βββ ICompliantStrategyAdapter.sol # Interface for compliance adapter
β β βββ IPriceOracle.sol # Interface for RWA price oracle
β β βββ IDividendDistributor.sol # Interface for dividend distribution
β β βββ IIdentity.sol # Interface for ONCHAINID identity
β βββ mocks/
β β βββ MockERC20.sol # Mock ERC20 token for testing
β β βββ MockERC3643.sol # Mock ERC-3643 RWA tokens for testing
β β βββ MockUSDC.sol # Mock USDC for deployment
β β βββ CompliantStrategyAdapter.sol # Mock compliance adapter implementation
β β βββ SimplePriceOracle.sol # Mock price oracle implementation
β β βββ SimpleDividendDistributor.sol # Mock dividend distributor implementation
β βββ PraxosVault.sol # ERC-4626 vault implementation (standard)
β βββ PraxosVaultCompliant.sol # ERC-4626 compliant vault with RWA support
β βββ PraxosVaultExtended.sol # Extended vault with APR and metadata
β βββ PraxosFactory.sol # Vault factory contract (standard)
β βββ PraxosFactoryCompliant.sol # Compliant vault factory with infrastructure
β βββ RewardsModule.sol # Rewards distribution module for dividends
βββ scripts/
β βββ deploy.mjs # Hardhat deployment script
β βββ abi/
β β βββ cleanAbi.mjs # Clean ABI directory utility
β β βββ saveAbi.mjs # Save contract ABIs utility
β βββ logs/
β β βββ console_logger.mjs # Console logging utilities
β β βββ data/
β β βββ data_logger.mjs # Deployment history logging
β βββ roles/
β βββ assignRoles.mjs # Role assignment utilities
βββ test/
β βββ Praxos.test.js # Hardhat/Mocha tests
βββ offchain/
β βββ simulation/
β β βββ risk_model.py # Risk simulation layer
β βββ ai_engine/
β β βββ allocation_engine.py # Praxos AI Engine (risk analysis & allocation)
β βββ ai_agent/
β β βββ suggestion_engine.py # Praxos AI Agent (personalized suggestions)
β βββ vault_generator.py # Main orchestrator
β βββ requirements.txt # Python dependencies
βββ praxos-app/ # Next.js frontend application
β βββ app/ # Next.js app directory
β βββ components/ # React components
β β βββ dashboard/ # Dashboard components
β β βββ ui/ # UI component library
β βββ lib/ # Utilities and hooks
β β βββ contracts.ts # Contract data loading utilities
β β βββ hooks/ # Wagmi hooks for contract interactions
β β βββ data/ # Contract deployment data (auto-generated)
β βββ package.json # Frontend dependencies
βββ frontend/ # Legacy frontend (deprecated)
β βββ index.html # Web interface
β βββ app.js # Frontend logic
βββ docs/
β βββ HACKATHON_RULES.md # Rayls hackathon rules
β βββ PraxosFlowchart.md # System architecture flowchart
β βββ QUICKSTART.md # Quick start guide
β βββ SETUP.md # Detailed setup guide
β βββ COMPLIANT_VAULT_ARCHITECTURE.md # Compliant RWA vault architecture
β βββ IMPLEMENTATION_GUIDE.md # Step-by-step implementation guide
β βββ VAULT_STORAGE_EXPLANATION.md # Vault data storage patterns
βββ abi/ # Generated contract ABIs (auto-generated)
βββ deployments/ # Deployment history logs (auto-generated)
βββ hardhat.config.js # Hardhat configuration
βββ package.json # Node.js dependencies
βββ Makefile # Build automation
βββ .env.example # Environment variables template
βββ README.md # This file
-
PraxosVault.sol: Standard ERC-4626 compliant vault that holds multiple ERC-3643 RWA tokens- Multi-asset allocation support
- Weight-based portfolio management
- Strategy and risk tier tracking
- Owner-controlled asset management
-
PraxosVaultCompliant.sol: Enhanced compliant vault with full RWA architecture- ONCHAINID identity support for compliance
- Price oracle integration for NAV calculation
- Dividend harvesting (push and pull scenarios)
- Auto-compound or rewards module support
- Compliant swap integration via strategy adapter
- See docs/COMPLIANT_VAULT_ARCHITECTURE.md for details
-
PraxosVaultExtended.sol: Extended vault with additional metadata storage- APR storage in basis points
- Description and metadata URI support
- Example of how to extend base vault functionality
-
PraxosFactory.sol: Standard factory for deployingPraxosVaultinstances- Creates vaults from AI-generated strategies
- Validates vault configurations
- Tracks all deployed vaults
-
PraxosFactoryCompliant.sol: Factory for deploying compliant vaults- Deploys
PraxosVaultCompliantwith compliance infrastructure - Integrates strategy adapter and price oracle
- Supports dividend distributor configuration
- Handles vault whitelisting during creation
- Deploys
RewardsModule.sol: Optional module for distributing raw dividends to vault shareholders- Similar to Synthetix StakingRewards pattern
- Users claim rewards based on vault share balance
- Used when auto-compounding is disabled
IERC3643.sol: Interface for ERC-3643 compliant RWA tokensICompliantStrategyAdapter.sol: Interface for compliance and whitelisting adapterIPriceOracle.sol: Interface for RWA token price feedsIDividendDistributor.sol: Interface for dividend claiming and distributionIIdentity.sol: Interface for ONCHAINID identity verification
MockERC3643.sol: Mock implementation of ERC-3643 for testing and demosMockERC20.sol: Mock ERC20 token for testingMockUSDC.sol: Mock USDC token for deployment scriptsCompliantStrategyAdapter.sol: Mock compliance adapter with whitelistingSimplePriceOracle.sol: Mock price oracle with configurable pricesSimpleDividendDistributor.sol: Mock dividend distributor for testing
- Tokenization Engine: Converts financial products into ERC-3643 compliant tokens (handled by institutions on private nodes)
- Risk Simulation Layer: Models risk profiles for RWA tokens (credit score, volatility, liquidity, etc.)
- Praxos AI Engine: Performs risk analysis and constructs optimal vault strategies based on risk signatures
- Vault Generator: Orchestrates the full pipeline from tokenized RWAs to deployable vault configs
- Praxos AI Agent: Provides personalized vault suggestions to users based on timeframe, risk tolerance, and investment amount
The frontend is a modern Next.js application with full smart contract integration:
- Dashboard: View all available vaults with real-time blockchain data
- Wallet Integration: RainbowKit + Wagmi for multi-wallet support
- Deposit/Withdraw: Full ERC-4626 deposit and withdrawal functionality
- USDC Approval Flow: Automatic two-step approval and deposit process
- Real-time Data: Fetches vault information directly from blockchain
- Mock Data Fallback: Falls back to mock data if contracts aren't deployed
- Contract Loading: Automatically loads contract addresses from deployment data
Key features:
- Loads vaults from
PraxosFactoryorPraxosFactoryCompliant - Displays vault strategy, risk tier, APR, and asset allocations
- Interactive deposit dialogs with amount input
- Transaction status tracking (pending, success, error)
- Responsive design with dark theme
make build
# Or: npx hardhat compilemake test
# Or: npx hardhat test# Deploy to Rayls Devnet
make deploy
# Or: npx hardhat run scripts/deploy.mjs --network rayls_devnet
# This will deploy:
# 1. Infrastructure Contracts:
# - CompliantStrategyAdapter (compliance and whitelisting)
# - SimplePriceOracle (RWA token price feeds)
# - SimpleDividendDistributor (dividend distribution)
# 2. Factory Contracts:
# - PraxosFactory (standard vault factory)
# - PraxosFactoryCompliant (compliant vault factory)
# 3. Base Assets:
# - MockUSDC (base asset for vaults)
# 4. RWA Tokens:
# - Corporate Bond Alpha (MockERC3643)
# - Real Estate Fund Beta (MockERC3643)
# - Startup Fund Gamma (MockERC3643)
# 5. Demo Vaults:
# - Balanced Diversified Vault (standard)
# - Compliant Balanced Diversified Vault (compliant)
# 6. Optional:
# - RewardsModule (for dividend distribution)
# After deployment:
# - Contract addresses saved to .env
# - Deployment data saved to deployments/
# - Contract data saved to frontend/lib/data/contracts_data.json
# - Contract data saved to praxos-app/lib/data/contracts_data.jsoncd offchain
python vault_generator.pycd praxos-app
npm install # or pnpm install
npm run dev # Start development server on http://localhost:3000The frontend automatically loads contract addresses from praxos-app/lib/data/contracts_data.json, which is populated by the deploy script.
Praxos is built for the Rayls ecosystem:
- Chain: Rayls Public Chain (EVM compatible)
- Devnet:
https://devnet-rpc.rayls.com(Chain ID: 123123) - Gas Token: USDgas (USDr)
- Explorer:
https://devnet-explorer.rayls.com
See docs/HACKATHON_RULES.md for hackathon requirements.
MIT