Skip to content

HappyBerrysBoy/magic-millstone

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

173 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Magic Millstone Logo Magic Millstone

Korea Stablecoin Hackathon - Kaia-Native USDT DeFi Track Participant

A cutting-edge DeFi yield optimization platform built on the Kaia blockchain, featuring automated yield generation via cross-chain deployment strategies. Magic Millstone enables users to earn passive income on their USDT holdings while maintaining liquidity through innovative NFT-based withdrawal mechanics.

🌈 Overview

Magic Millstone is a comprehensive DeFi ecosystem that bridges traditional yield farming with innovative user experience design. By leveraging Kaia's native USDT and integrating with LINE Messenger MiniDapp, we provide mainstream users with seamless access to DeFi yield generation.

Key Innovation

  • Automated Yield Generation: Automated fund deployment to lending protocols via the magicTime() function
  • NFT Withdrawal System: A novel withdrawal management system powered by dynamic SVG metadata
  • Cross-Chain Bridge Integration: Seamless capital deployment across multiple chains for maximum yield
  • LINE MiniDapp Integration: Native mobile experience within LINE Messenger ecosystem

πŸ—οΈ Architecture

The platform consists of four main components:

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   Frontend      β”‚    β”‚    Backend      β”‚    β”‚     Smart       β”‚
β”‚   (Next.js)     │◄──►│   (NestJS)      │◄──►│   Contracts     β”‚
β”‚   MiniDapp      β”‚    β”‚   API Server    β”‚    β”‚   (Solidity)    β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                                      β–²
                                                      β”‚
                                                      β–Ό
                                              β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                                              β”‚   Cross-Chain   β”‚
                                              β”‚   Bridge        β”‚
                                              β”‚   Contracts     β”‚
                                              β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Components

  1. Frontend (/frontend): Next.js MiniDapp with LINE integration
  2. Backend (/backend): NestJS API server for data analytics and user management
  3. Kaia Contracts (/contract-kaia): Kaia Contracts (/contract-kaia): Core DeFi logic on the Kaia blockchain
  4. DEX Contracts (/contract-dex): Infrastructure for cross-chain deployment

πŸš€ Quick Start

For detailed deployment and execution instructions for each component, please refer to the individual README files in each folder:

  • Frontend Setup & Deployment: See /frontend/README.md
  • Backend API Server: See /backend/README.md
  • Kaia Smart Contracts: See /contract-kaia/README.md
  • DEX Contracts: See /contract-dex/README.md

Each component has its own specific setup requirements, environment variables, and deployment scripts. Make sure to follow the instructions in the respective README files for proper installation and configuration.

✨ Features

Preview

user flow

For Users

  • Simple Deposits: Simple Deposits: Stake USDT and start earning
  • Dynamic Yields: Automated yield generation across multiple protocols
  • Flexible Withdrawals: NFT-based withdrawal system with real-time status tracking
  • Real-time Analytics: Comprehensive portfolio tracking and performance metrics
  • Mobile First: Native LINE Messenger integration for seamless mobile experience

For Developers

  • Upgradeable Contracts: UUPS proxy pattern for contract evolution
  • Comprehensive APIs: RESTful backend services with Swagger documentation
  • Security First: Role-based access control and emergency pause functionality
  • Testing Suite: Comprehensive test coverage across all components

πŸ“± LINE MiniDapp Integration

Magic Millstone is designed as a LINE Messenger MiniDapp, providing a native mobile-first DeFi experience:

Supported Features

  • Vault Deposits: Users deposit USDT and receive mmUSDT (Magic Millstone USDT) tokens
  • Cross-Chain Yield Generation: Deposited USDT is bridged to other chains and deployed to lending protocols
  • Liquid Receipt Tokens: mmUSDT tokens represent your vault share while maintaining liquidity
  • Automated Yield Optimization: Automatically find and deploy to highest-yield lending protocols
  • Portfolio Tracking: Real-time monitoring of vault performance and your holdings

MiniDapp Guidelines Compliance

  • Case 3 Implementation: DApp Portal Wallet connection to external DeFi services
  • Seamless integration with LINE ecosystem

πŸ“Š Technical Specifications

Smart Contracts

  • Language: Solidity ^0.8.20
  • Framework: Hardhat with TypeScript
  • Standards: KIP-7 (mmUSDT), KIP-17 (WithdrawNFT)
  • Upgradability: Implemented with the UUPS Proxy Pattern
  • Security: OpenZeppelin contracts with custom extensions

Frontend

  • Framework: Next.js 14 with TypeScript
  • UI Library: Custom components with Tailwind CSS
  • Web3 Integration: dapp-portal-sdk
  • Mobile Integration: LIFF (LINE Front-end Framework)

Backend

  • Framework: NestJS with TypeScript
  • Database: MySQL with Sequelize ORM
  • APIs: RESTful endpoints with Swagger documentation

πŸ”’ Security

Audit Status

  • Internal security review completed
  • External audit scheduled for mainnet deployment

Security Features

  • Role-based access control (RBAC)
  • Emergency pause mechanisms
  • Reentrancy protection
  • Input validation and sanitization

πŸ“ˆ Roadmap

Phase 1 (Completed) βœ…

  • Core DeFi contracts development
  • Frontend MiniDapp integration
  • Backend API services
  • Testnet deployment and testing

Phase 2 (In Progress) πŸ”„

  • Mainnet deployment
  • External security audit
  • Advanced yield deployment strategies
  • Cross-chain bridge integrations

Phase 3 (Planned) πŸ“‹

  • Additional yield strategies
  • Integration with more DeFi protocols

🀝 Contributing

We welcome contributions from the community!

Development Setup

# Fork and clone the repository
git clone https://github.com/your-username/magic-millstone.git

# Create a new branch
git checkout -b feature/amazing-feature

# Implement your changes and commit
git commit -m 'Add amazing feature'

# Push and create a Pull Request
git push origin feature/amazing-feature

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ”— Links

πŸ™ Acknowledgments

Special thanks to:

  • Korea Stablecoin Hackathon organizers
  • Kaia Foundation for blockchain infrastructure
  • LINE NEXT for MiniDapp platform
  • Tether for USDT integration support
  • Open Source Community for amazing tools and libraries

Magic Millstone - Transforming DeFi accessibility through innovative yield optimization and seamless mobile integration 🌟

About

Stable Yield Strategy Platform

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors