Alchemy Guild is a DeFi yield generation platform that combines NFT staking with automated Uniswap V3 liquidity provision. Mint elemental NFTs, stake them in the Yield Vault, and earn USDC from trading fees.
- ๐ฎ Elemental NFTs: Three rarity tiers (Fire, Water, Earth) with different staking weights
- ๐ฐ Automated Yield: Earn USDC from Uniswap V3 trading fees
- โก Instant Claims: 20% USDC reserve ensures immediate reward payouts
- ๐จ Beautiful UI: Alchemical-themed interface with stunning animations
- ๐ค 24/7 Bot: Autonomous bot generates volume and manages liquidity
| Metric | Value |
|---|---|
| Status | โ Production Ready |
| Efficiency | ~60% (USDC fees only) |
| Network | Ethereum Sepolia Testnet |
| Rebalance Success Rate | 100% |
| Active Positions | #223170 |
graph TD
A[User] -->|Mint NFT| B[ElementNFT Contract]
B -->|Stake| C[YieldVault Contract]
C -->|Provide Liquidity| D[Uniswap V3 WETH/USDC Pool]
D -->|Trading Fees| C
C -->|Distribute USDC| A
E[Volume Bot] -->|Rebalance| C
E -->|Generate Volume| D
C -->|10% Tax| F[Treasury]
| Component | Description |
|---|---|
| ElementNFT | ERC-721 collection with 3 tiers and evolution mechanics |
| YieldVault | Automated Uniswap V3 LP manager & yield distributor |
| Alchemist | NFT crafting & evolution system |
| Treasury | Receives 10% protocol tax |
| Volume Bot | Generates trading volume & triggers rebalances |
- Node.js 18+
- Foundry (for contracts)
- MetaMask wallet
- Sepolia ETH & USDC
# Clone the repository
git clone https://github.com/tmalone1250/alchemy-guild.git
cd alchemy-guild
# Install dependencies
npm install
# Copy environment file
cp .env.example .env
# Add your PRIVATE_KEY and VITE_INFURA_RPC_URL
# Start development server
npm run dev# Ensure .env is configured
npx tsx volume-bot.ts| Contract | Address | Verified |
|---|---|---|
| ElementNFT | 0xF15e4954AE325d68BFF9c990F26269D9c024caF0 |
โ |
| YieldVault | 0xFff8e4da589f15453e73004b65c61Da341B9075C |
โ |
| Alchemist | 0x8f392ccee00369d6623e18E6DDF120E988f3a513 |
โ |
| Treasury | 0x09b6E39f11C4c26022D10DE50d63C0541ad40227 |
โ |
- WETH:
0xfFf9976782d46CC05630D1f6eBAb18b2324d6B14 - USDC:
0x1c7D4B196Cb0C7B01d743Fbc6116a902379C7238 - Uniswap V3 Pool:
0x6Ce0896eAE6D4BD668fDe41BB784548fb8F59b50
Alchemy Guild features 18 unique elements across three tiers, each with distinct staking power and yield potential.
| Tier | Classification | Reward Weight | Elements | Border Color |
|---|---|---|---|---|
| Tier 1 | ๏ฟฝ Lead (Base Elements) | 10 | 6 elements | Bronze |
| Tier 2 | โช Silver (Advanced Synthesis) | 30 | 6 elements | Silver |
| Tier 3 | ๐ก Gold (Transcendent) | 100 | 6 elements | Gold |
| Tier 1 (Lead) | Tier 2 (Silver) | Tier 3 (Gold) |
|---|---|---|
|
๐ Earth |
โ๏ธ Plasma |
โจ Holy |
Transform lower-tier NFTs into higher-tier ones through alchemical fusion. All crafting requires a 0.002 ETH transmutation cost.
Combine 3 Tier 1 NFTs to create 1 Tier 2 NFT.
Example Recipes:
- ๐ง๐ง๐จ Water + Water + Wind โ ๐ Tsunami
- ๐จโ๏ธโ๏ธ Wind + Ice + Ice โ ๐จ๏ธ Blizzard
- ๐๐๐ฅ Earth + Earth + Fire โ ๐๏ธ Quake
- ๐งโกโก Water + Lightning + Lightning โ โ๏ธ Plasma
Combine 3 Tier 2 NFTs to create 1 Tier 3 NFT.
Example Recipes:
- ๐๐จ๏ธ๐จ๏ธ Tsunami + Blizzard + Blizzard โ โฐ Time
- ๐๐๐ฅ Inferno + Inferno + Fire โ ๐ป Spirit
- ๐ช๏ธ๐ช๏ธโก Tornado + Tornado + Lightning โ โจ Holy
function craft(uint256[3] tokenIds) external payable {
require(msg.value >= 0.002 ether, "Transmutation fee required");
// Burns 3 NFTs โ Mints 1 higher-tier NFT
}Key Features:
- โ 3-to-1 Ratio: Burn 3 lower-tier โ Create 1 higher-tier
- โ Deflationary: Reduces total supply with each craft
- โ Specific Recipes: Each Tier 2/3 element requires exact ingredient combinations
- โ Protocol Fee: 0.002 ETH per transmutation
Yields are distributed pro-rata based on each NFT's staking weight:
Where:
-
$Weight_{user}$ = Sum of all staked NFT weights for the user -
$\sum Weight_{total}$ = Total weight of all staked NFTs in the vault -
$Fees_{harvested}$ = USDC fees collected from Uniswap trading
| Tier | Weight | Relative Earning Power |
|---|---|---|
| Tier 1 | 10 | 1x baseline |
| Tier 2 | 30 | 3x more than Tier 1 |
| Tier 3 | 100 | 10x more than Tier 1 |
Vault State:
- User A: 1ร Tier 3 (Gold) NFT = 100 weight
- User B: 3ร Tier 2 (Silver) NFTs = 90 weight
- User C: 10ร Tier 1 (Lead) NFTs = 100 weight
- Total Weight: 290
Fees Collected: 100 USDC (after 10% tax to Treasury)
Distribution:
- User A:
$(100/290) \times 100 = 34.48$ USDC - User B:
$(90/290) \times 100 = 31.03$ USDC - User C:
$(100/290) \times 100 = 34.48$ USDC
Key Insight: User A earns the same as User C, but with 1 NFT vs 10 NFTs!
Every crafting operation burns 3 NFTs to create 1:
- Total supply decreases by 2 NFTs per craft
- Higher-tier NFTs become increasingly scarce
- Remaining stakers capture more yield per NFT over time
This creates a flywheel effect:
- Users craft to increase individual weight
- Total NFT supply decreases
- Yield per NFT increases for all stakers
- Higher-tier scarcity drives value
-
Mint an NFT
- Connect wallet
- Approve USDC
- Select tier (1/2/3)
- Mint NFT
-
Stake NFT
- Navigate to Vault page
- Click "Stake" on your NFT
- Confirm transaction
-
Claim Yields
- Wait for rebalances (~5 min cycles)
- View pending rewards
- Click "Claim" to receive USDC
cd alchemy-vault
forge build
forge script script/DeployAlchemy.s.sol \
--rpc-url $VITE_INFURA_RPC_URL \
--broadcast \
--private-key $PRIVATE_KEYnpx tsx manual-seed.ts| Script | Purpose |
|---|---|
wrap-eth.ts |
Convert ETH โ WETH |
swap-weth-usdc.ts |
Swap WETH โ USDC |
check-rewards.ts |
View reward accumulation |
test-rebalance.ts |
Test rebalance function |
diagnose-rebalance.ts |
Full diagnostic |
- Solidity 0.8.26
- Foundry (Forge, Cast, Anvil)
- OpenZeppelin Contracts
- Uniswap V3 Core & Periphery
- React 18 + TypeScript
- Vite 5.x
- Ethers.js 6.x
- RainbowKit + Wagmi
- TailwindCSS
- Lucide Icons
- Infura (RPC)
- Etherscan (Verification)
- IPFS (Metadata)
| Issue | Impact | Status | Workaround |
|---|---|---|---|
| WETHโUSDC swap fails in rebalance | 40% lower yield | ๐ Investigating | Try-catch wrapper prevents crashes |
| WETH fees accumulate | Not distributed | โณ Planned | Manual swap available |
| Testnet liquidity | Low fees | โน๏ธ Expected | Normal for Sepolia |
Click to expand debugging history
- Issue: WETH and USDC reversed in Uniswap calls
- Fix: Corrected to USDC=token0, WETH=token1
- Issue: Wrong Sepolia addresses in deployment
- Fix: Updated Position Manager and Swap Router
- Issue: Three bugs in fee distribution
- Fix: Aligned all variables with token0/token1 ordering
- Issue: Swap reverts during rebalance
- Fix: Try-catch wrapper, accumulates WETH safely
- Issue: USDC locked in Uniswap position
- Fix: 20% USDC reserve + balance cap
- Issue: Bot using wrong contract address
- Fix: Updated to correct YieldVault address
- Fix WETH swap in rebalance context
- Increase vault liquidity for higher yields
- Gas optimization
- Enhanced event logging
- Mainnet Deployment - Real USDC yields
- Multi-Pool Support - ETH/DAI, WBTC/ETH
- NFT Marketplace - Trade staked positions
- Governance DAO - Community parameter control
- Advanced Crafting - Complex evolution recipes
Contributions are welcome! Please:
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Uniswap V3 - Decentralized trading protocol
- OpenZeppelin - Secure smart contract library
- Foundry - Blazing fast Ethereum toolkit
- RainbowKit - Best wallet connection UX
Project Maintainer: @tmalone1250
Bot Wallet: 0xd83B5031506039893BF1C827b0A79aDDee71E1fE






