A revolutionary DeFi protocol built on Aptos that combines multi-token liquidity provision with automated lending mechanisms. Users can deposit various tokens (APT, USDC, SUI) into a unified vault, receive rLP tokens, and use them as collateral for automated loans with yield-based repayment.
- Multi-Token Liquidity Pool: Deposit APT, USDC, and SUI into a unified vault
- Proportional LP Token Minting: Receive rLP tokens based on your contribution to the pool
- Automated Lending: Use rLP tokens as collateral to borrow USDC
- Yield-Based Auto-Repayment: Loans automatically repay using generated yield
- Real-Time Price Oracle: Dynamic pricing for accurate LTV calculations
- Token Whitelisting: Secure token management with admin controls
revolv_vault- Main liquidity vault managing multi-token depositsauto_loan_vault- Automated lending protocol with collateral managementoracle- Price feed system for token valuationsmessage_board- Communication layer for protocol updates
0x18ba7f5a68dc720fd3833fa9c2402e22ab899301424c87d41461fa7aa2415a5e
- Users deposit tokens (APT/USDC/SUI) into the vault
- Vault calculates proportional rLP tokens based on current pool value
- rLP tokens represent ownership share in the multi-token pool
- Pool generates yield from various DeFi activities
- Users deposit rLP tokens as collateral
- Oracle provides real-time rLP pricing
- Protocol enforces 50% Loan-to-Value (LTV) ratio
- Users can borrow up to 50% of their collateral value in USDC
- Yield generated from the liquidity pool accumulates
- Users can trigger
harvest_and_repayfunction - Yield automatically reduces outstanding debt
- Collateral remains locked until debt is fully repaid
- Node.js 18+
- npm or yarn
- Aptos CLI
- Wallet with testnet APT
- Clone the repository
git clone <repository-url>
cd revolv-project- Install dependencies
npm install- Set up environment variables
Create a
.envfile in the root directory:
VITE_MODULE_ADDRESS=0x18ba7f5a68dc720fd3833fa9c2402e22ab899301424c87d41461fa7aa2415a5e
VITE_MODULE_PUBLISHER_ACCOUNT_ADDRESS=0x18ba7f5a68dc720fd3833fa9c2402e22ab899301424c87d41461fa7aa2415a5e
VITE_MODULE_PUBLISHER_ACCOUNT_PRIVATE_KEY=your_private_key_here
VITE_APP_NETWORK=testnet
VITE_APTOS_API_KEY=your_api_key_here- Run the development server
npm run dev- Open your browser
Navigate to
http://localhost:5173
- Compile the contracts
npm run move:compile- Publish to Aptos testnet
npm run move:publish- Initialize the modules
- Connect your wallet to the frontend
- Navigate to the Liquidity page
- Click "Initialize Modules" to set up the vault and oracle
- Build the project
npm run build- Deploy to Vercel
npm run deploy- Connect your wallet to the application
- Navigate to "Provide Liquidity" page
- Select token from dropdown (APT/USDC/SUI)
- Enter deposit amount
- Click "Deposit to Vault"
- Receive rLP tokens representing your pool share
- Navigate to "Auto-Loan" page
- Enter rLP collateral amount (must own rLP tokens)
- Enter USDC borrow amount (max 50% of collateral value)
- Click "Deposit Collateral & Borrow USDC"
- Monitor your loan status in real-time
- Wait for yield to accumulate in the vault
- Click "Harvest & Repay" button
- Yield automatically reduces your outstanding debt
- Withdraw collateral once debt reaches zero
deposit_apt(account, amount)- Deposit APT and receive rLP tokensdeposit_usdc(account, amount)- Deposit USDC and receive rLP tokensdeposit_sui(account, amount)- Deposit SUI and receive rLP tokensget_pending_yield(collateral_amount)- Calculate yield for given collateral
get_total_value()- Returns total value locked in vaultget_rlp_supply()- Returns total rLP tokens in circulationget_apt_balance()- Returns APT balance in vaultget_usdc_balance()- Returns USDC balance in vaultget_sui_balance()- Returns SUI balance in vault
deposit_and_borrow(account, rlp_amount, borrow_amount)- Lock rLP as collateral and borrow USDCharvest_and_repay(account)- Use yield to repay outstanding debtwithdraw(account, rlp_amount)- Withdraw collateral after debt repayment
get_user_debt(user_address)- Returns user's current debt amountget_user_collateral(user_address)- Returns user's locked collateralget_user_stored_collateral(user_address)- Returns stored collateral amountget_total_debt()- Returns total debt across all usersget_total_collateral()- Returns total collateral locked
initialize(account)- Initialize the oracle moduleget_price(coin_type)- Get price for specified token type
- Token Whitelisting: Only approved tokens can be deposited
- LTV Enforcement: Maximum 50% loan-to-value ratio
- Admin Controls: Secure token management functions
- Input Validation: Comprehensive parameter validation
- State Management: Proper resource initialization checks
- Real-Time Updates: Live data synchronization across pages
- Transaction Tracking: Clickable transaction hashes to Aptos explorer
- Responsive Design: Modern, mobile-friendly interface
- Dark Theme: Sleek web3 aesthetic with glassmorphism effects
- Error Handling: Comprehensive error messages and validation
- Cross-Page Sync: Automatic data refresh between liquidity and loan pages
- Move Language: Aptos native smart contract language
- Aptos Framework: Core blockchain functionality
- Table Storage: Efficient data management
- React 18: Modern React with hooks
- TypeScript: Type-safe development
- Tailwind CSS: Utility-first styling
- Vite: Fast build tool and dev server
- Aptos Wallet Adapter: Wallet integration
- Aptos CLI: Contract compilation and deployment
- ESLint: Code quality and consistency
- Prettier: Code formatting
- Module Name Clash: Occurs when trying to update existing modules (requires new deployment)
- Token Transfer Simulation: Current implementation simulates token locking (production would need proper coin store management)
- Oracle Price Feed: Currently uses hardcoded prices (production would integrate with real price feeds)
- State Synchronization: Occasional delays in cross-page data updates
- Transaction Timing: Some transactions may require manual refresh to show updated balances
- Error Messages: Generic error messages from wallet adapter (working on more specific error handling)
- Network Dependency: Requires stable Aptos testnet connection
- Wallet Compatibility: Limited to Aptos-compatible wallets
- Gas Estimation: No gas estimation for transactions (users see actual gas costs after execution)
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the Apache-2.0 License - see the LICENSE file for details.
- Aptos Labs for the excellent blockchain infrastructure
- Move language community for documentation and examples
- React and TypeScript communities for the robust frontend ecosystem
Built with ❤️ for the Aptos ecosystem
For questions or support, please open an issue or contact the development team.