Djed Protocol is an algorithmic stablecoin protocol that maintains price stability through a dual-coin system. This repository contains the modern web interface built with Next.js, React, and TypeScript for interacting with the Djed smart contracts.
Djed is a stablecoin protocol that uses a dual-coin system to maintain price stability:
- StableCoin (SC): The stablecoin that maintains a peg to a target price (e.g., $1 USD)
- ReserveCoin (RC): The reserve asset that backs the stablecoin and absorbs price volatility
- BaseCoin (BC): The underlying asset (e.g., ETH) used for trading and reserves
- Algorithmic Stability: Maintains price stability through automated market mechanisms
- Over-Collateralized: Reserve coins provide backing for stablecoins
- Oracle Integration: Uses external price feeds for accurate market data
- Decentralized: No single point of failure, fully transparent smart contracts
- Multi-Chain Support: Deployed across multiple blockchain networks
- Modern Web Interface: Built with Next.js, React, and TypeScript
- Buy StableCoins: Exchange BaseCoins for StableCoins at the current price
- Sell StableCoins: Exchange StableCoins back to BaseCoins
- Buy ReserveCoins: Purchase ReserveCoins to participate in protocol governance
- Sell ReserveCoins: Sell ReserveCoins back to BaseCoins
- Reserve Ratio: Maintains a minimum and maximum reserve ratio for stability
- Dynamic Pricing: Prices adjust based on supply, demand, and reserve levels
- Fee Structure: Trading fees support protocol operations and treasury
- Oracle Integration: Real-time price feeds ensure accurate valuations
- Frontend: Next.js 15, React 19, TypeScript
- Styling: Tailwind CSS, Framer Motion
- Web3: Wagmi, Viem, RainbowKit
- UI Components: Radix UI, Lucide React
- Charts: Recharts, TradingView Widget
- Smart Contracts: Solidity ^0.8.0
- Node.js 18+
- npm or yarn
- Git
-
Clone the repository
git clone https://github.com/your-username/djed-webui.git cd djed-webui -
Install dependencies
npm install # or yarn install -
Set up environment variables
cp .env.example .env.local
Configure the following variables in
.env.local:NEXT_PUBLIC_ALCHEMY_API_KEY=your_alchemy_api_key NEXT_PUBLIC_WALLETCONNECT_PROJECT_ID=your_walletconnect_project_id NEXT_PUBLIC_DJED_CONTRACT_ADDRESS=0x... NEXT_PUBLIC_ORACLE_CONTRACT_ADDRESS=0x...
-
Run the development server
npm run dev # or yarn dev -
Open your browser Navigate to http://localhost:3000
The protocol consists of several smart contracts:
- Djed.sol: Main protocol contract handling stablecoin operations
- Coin.sol: ERC20 token implementation for StableCoin and ReserveCoin
- IOracle.sol: Interface for price oracle integration
buyStableCoins(): Purchase stablecoins with basecoinssellStableCoins(): Sell stablecoins for basecoinsbuyReserveCoins(): Purchase reserve coinssellReserveCoins(): Sell reserve coinssellBothCoins(): Sell both stablecoins and reserve coins
scPrice(): Get current stablecoin pricercTargetPrice(): Get target reserve coin priceratio(): Get current reserve ratioR(): Get current reserve amountL(): Get current liabilities
The interface supports multiple wallet connections through RainbowKit:
- Click the "Connect Wallet" button
- Select your preferred wallet (MetaMask, WalletConnect, etc.)
- Approve the connection in your wallet
-
Buy StableCoins:
- Enter the amount of BaseCoins you want to spend
- Review the estimated StableCoins you'll receive
- Click "Buy StableCoins" and confirm the transaction
-
Sell StableCoins:
- Enter the amount of StableCoins you want to sell
- Review the estimated BaseCoins you'll receive
- Click "Sell StableCoins" and confirm the transaction
The dashboard displays real-time metrics:
- Total Value Locked (TVL)
- Reserve Ratio
- StableCoin Price
- Daily Transaction Volume
- Protocol Fees
We welcome contributions! Please follow these steps:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
- Follow the existing code style and conventions
- Write meaningful commit messages
- Add tests for new features
- Update documentation as needed
- Ensure all tests pass before submitting PR
This project is licensed under the MIT License - see the LICENSE file for details.
- Documentation: [Link to docs]
- Discord: [Discord invite]
- Twitter: [@DjedProtocol]
- Issues: GitHub Issues
- Multi-chain deployment
- Advanced trading features
- Mobile app
- Governance interface
- Analytics dashboard
- API integration