Skip to content

Latest commit

History

37 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

ArbiYield - Dynamic Yield-Bearing Stablecoin Protocol

LicenseArbitrumStylusSolidity

A next-generation overcollateralized stablecoin with dynamic peg stability and auto-compounding yields, built on Arbitrum Orbit chain.

ArbiYield introduces the first stablecoin protocol with AI-adjusted collateral ratios that respond to market volatility in real-time, powered by Arbitrum Stylus for gas-efficient liquidations and deployed on a custom Orbit chain for maximum scalability.


🎯 Problem Statement

Current stablecoin solutions face critical limitations:

  1. Algorithmic Stablecoins: Prone to death spirals during high volatility (Terra/Luna collapse)
  2. Centralized Stablecoins: No native yield, counterparty risk, regulatory vulnerabilities
  3. Overcollateralized Stablecoins: Static collateral ratios waste capital during stable markets
  4. DeFi Yields: Fragmented across protocols, require manual management, high gas costs

Market Gap: No stablecoin exists that combines:

  • Provable stability through overcollateralization
  • Dynamic risk management that adapts to market conditions
  • Auto-compounding yields without manual intervention
  • Capital efficiency during bull markets, safety during volatility

💡 Solution Overview

ArbiYield is a hybrid stablecoin protocol that maintains $1 peg through:

Core Innovations

  1. Dynamic Collateral Ratios (DCR)

    • Real-time adjustment based on market volatility indices
    • Range: 130% (low volatility) → 200% (extreme volatility)
    • Automated rebalancing without governance delays
  2. Multi-Asset Collateral Basket

    • ETH, ARB, USDC weighted portfolio
    • Chainlink price feeds + on-chain volatility oracles
    • Cross-collateralization benefits
  3. Stylus-Powered Liquidation Engine

    • 10-100x faster than Solidity equivalents
    • Sub-second liquidation execution
    • Higher capital efficiency = lower collateral requirements
  4. Auto-Compounding Yield Layer

    • Deposits idle collateral into Arbitrum One DeFi protocols (Aave, GMX, Pendle)
    • Automated yield harvesting and reinvestment
    • Yields passed to AYD stablecoin holders
  5. Custom Arbitrum Orbit Chain

    • Ultra-low gas fees for frequent rebalancing operations
    • Custom gas token (paid in AYD or ETH)
    • Optimized block times for liquidation speed

🏗️ Architecture

System Overview

┌─────────────────────────────────────────────────────────────────┐
│ ARBITRUM ORBIT CHAIN │
│ ┌──────────────────────────────────────────────────────────┐ │
│ │ Core Protocol Contracts │ │
│ │ │ │
│ │ ┌─────────────┐ ┌──────────────┐ ┌──────────────┐ │ │
│ │ │ Vault │───▶│ Collateral │◀──│ Oracle │ │ │
│ │ │ Manager │ │ Manager │ │ Aggregator │ │ │
│ │ └─────────────┘ └──────────────┘ └──────────────┘ │ │
│ │ │ │ │ │ │
│ │ ▼ ▼ ▼ │ │
│ │ ┌─────────────┐ ┌──────────────┐ ┌──────────────┐ │ │
│ │ │ AYD │ │ Dynamic │ │ Volatility │ │ │
│ │ │ Stablecoin │ │ Collat. │ │ Oracle │ │ │
│ │ │ (ERC20) │ │ Ratio │ │ (Chainlink)│ │ │
│ │ └─────────────┘ └──────────────┘ └──────────────┘ │ │
│ │ │ │ │ │
│ │ ▼ ▼ │ │
│ │ ┌─────────────────────────────────────────────────────┐ │ │
│ │ │ STYLUS LIQUIDATION ENGINE (RUST) │ │ │
│ │ │ - Health Factor Monitoring │ │ │
│ │ │ - Liquidation Execution │ │ │
│ │ │ - Gas-Optimized Position Management │ │ │
│ │ └─────────────────────────────────────────────────────┘ │ │
│ └──────────────────────────────────────────────────────────┘ │
│ │ │
│ ▼ │
│ ┌──────────────────────────────────────────────────────────┐ │
│ │ Yield Generation Layer │ │
│ │ ┌────────────┐ ┌────────────┐ ┌────────────┐ │ │
│ │ │ Aave V3 │ │ GMX V2 │ │ Pendle │ │ │
│ │ │ Lending │ │ Perps │ │ Yield │ │ │
│ │ └────────────┘ └────────────┘ └────────────┘ │ │
│ └──────────────────────────────────────────────────────────┘ │
└─────────────────────────────────────────────────────────────────┘
│
▼
┌────────────────────┐
│ ARBITRUM ONE │
│ - Bridge Contracts│
│ - DeFi Integrations│
│ - Liquidity Pools │
└────────────────────┘

Contract Architecture

contracts/
├── core/
│ ├── AYDStablecoin.sol # Main ERC20 stablecoin
│ ├── VaultManager.sol # Vault creation & management
│ ├── CollateralManager.sol # Multi-asset collateral handling
│ └── DynamicCollateralRatio.sol # DCR calculation engine
│
├── liquidation/
│ ├── liquidation_engine.rs # Stylus liquidation core
│ ├── health_monitor.rs # Position health tracking
│ └── auction_manager.rs # Dutch auction liquidations
│
├── oracles/
│ ├── OracleAggregator.sol # Multi-oracle aggregation
│ ├── VolatilityOracle.sol # On-chain volatility calculations
│ └── ChainlinkAdapter.sol # Chainlink price feed adapter
│
├── yield/
│ ├── YieldRouter.sol # Yield strategy router
│ ├── AaveStrategy.sol # Aave V3 integration
│ ├── GMXStrategy.sol # GMX perpetuals strategy
│ └── PendleStrategy.sol # Pendle yield tokenization
│
├── governance/
│ ├── ProtocolGovernance.sol # Parameter adjustments
│ ├── EmergencyModule.sol # Circuit breakers & pauses
│ └── TreasuryManager.sol # Protocol fee management
│
└── bridges/
├── ArbitrumBridge.sol # Orbit <-> Arbitrum One
└── CCIPIntegration.sol # Chainlink CCIP for cross-chain

🔧 Technical Components

1. Dynamic Collateral Ratio (DCR) Engine

Algorithm:

function calculateDCR() publicviewreturns (uint256) {
uint256 volatilityIndex = volatilityOracle.get30DayVolatility();
// Base ratio: 150%// Volatility adjustment: +0.5% per 1% volatility increase// Caps: min 130%, max 200%if (volatilityIndex <20) {
return130e16; // 130% in low volatility
} elseif (volatilityIndex >100) {
return200e16; // 200% in extreme volatility
} else {
// Linear interpolationreturn130e16+ ((volatilityIndex -20) *875e12);
}
}

Inputs:

  • 30-day realized volatility (Chainlink + on-chain TWAP)
  • Black Swan event detector (rapid price drops)
  • Correlation matrix between collateral assets

Outputs:

  • Current required collateralization ratio
  • Rebalancing recommendations for existing vaults
  • Liquidation thresholds

2. Stylus Liquidation Engine

Why Stylus:

  • Liquidations require intensive computation (health factor checks across 1000s of positions)
  • Solidity gas costs make frequent checks prohibitively expensive
  • Stylus (Rust) provides 10-100x gas efficiency

Core Logic (Rust):

#[storage]pubstructLiquidationEngine{positions:StorageMap<Address,Position>,oracle_prices:StorageMap<Address,U256>,liquidation_threshold:StorageU256,}implLiquidationEngine{pubfncheck_and_liquidate(&mutself,user:Address) -> Result<(),Error>{let position = self.positions.get(user);let health_factor = self.calculate_health_factor(position)?;if health_factor < self.liquidation_threshold.get(){self.execute_liquidation(user, position)?;}Ok(())}fncalculate_health_factor(&self,position:Position) -> Result<U256,Error>{let collateral_value = self.get_collateral_usd_value(position)?;let debt_value = position.debt_amount;let required_ratio = self.get_current_dcr()?;// Health factor = (collateral_value / debt_value) / required_ratioOk((collateral_value *PRECISION) / (debt_value * required_ratio))}}

Performance Comparison:

OperationSolidity GasStylus GasImprovement
Health Factor Check (1000 positions)~2.5M~25K100x
Liquidation Execution~500K~15K33x
Batch Oracle Update~1.2M~40K30x

3. Yield Generation Strategies

Aave V3 Strategy

  • Deposit idle ETH/USDC into Aave lending pools
  • Auto-compound interest rewards
  • Emergency withdraw on high utilization (>90%)

GMX V2 Strategy

  • Delta-neutral positions using GM pools
  • Earn trading fees + esGMX rewards
  • Automated hedging to maintain neutrality

Pendle Strategy

  • Split yield-bearing tokens (stETH) into PT + YT
  • Harvest YT yields while holding PT for principal
  • Auto-roll at maturity

Yield Distribution:

Protocol Revenue Flow:
├── 80% → AYD Holders (auto-rebasing)
├── 15% → Protocol Treasury
└── 5% → Liquidators/Keepers

4. Oracle System

Three-Layer Oracle Design:

  1. Primary: Chainlink Price Feeds (ETH/USD, ARB/USD, USDC/USD)
  2. Secondary: Uniswap V3 TWAP (30-min window)
  3. Fallback: Manual governance override (emergency only)

Volatility Oracle:

  • Calculates on-chain realized volatility using exponential moving average
  • Samples: every 4 hours over 30-day window
  • Formula: σ = sqrt(Σ(returns²) / n)

Circuit Breakers:

  • 20% price deviation between oracles → pause minting

  • 50% volatility spike → increase DCR by 10%

  • Oracle staleness (>2 hours) → use fallback

📋 Smart Contract Specifications

Core Contracts

AYDStablecoin.sol

contractAYDStablecoinisERC20Rebasing, AccessControl {
// Rebasing token that auto-compounds yields// 1 AYD always redeemable for $1 of collateralmapping(address=>uint256) public shares;
uint256public totalShares;
uint256public totalYield;
function rebase() external {
// Called by YieldRouter after harvest// Increases token supply proportionally to yield
}
function mint(addressto, uint256amount) external onlyVaultManager;
function burn(addressfrom, uint256amount) external onlyVaultManager;
}

VaultManager.sol

contractVaultManager {
struct Vault {
address owner;
uint256 collateralETH;
uint256 collateralARB;
uint256 collateralUSDC;
uint256 debtAYD;
uint256 lastUpdateBlock;
}
mapping(uint256=> Vault) public vaults;
function openVault(
uint256ethAmount,
uint256arbAmount,
uint256usdcAmount,
uint256mintAmount
) externalreturns (uint256vaultId);
function addCollateral(uint256vaultId, uint256amount) external;
function withdrawCollateral(uint256vaultId, uint256amount) external;
function mintAYD(uint256vaultId, uint256amount) external;
function burnAYD(uint256vaultId, uint256amount) external;
function closeVault(uint256vaultId) external;
}

DynamicCollateralRatio.sol

contractDynamicCollateralRatio {
IVolatilityOracle public volatilityOracle;
uint256public constant MIN_RATIO =130e16; // 130%uint256public constant MAX_RATIO =200e16; // 200%uint256public constant BASE_RATIO =150e16; // 150%function getCurrentRatio() externalviewreturns (uint256);
function getVaultHealth(uint256vaultId) externalviewreturns (uint256);
function isVaultHealthy(uint256vaultId) externalviewreturns (bool);
}

Stylus Contracts

liquidation_engine.rs

#[external]implLiquidationEngine{// Public functions callable from EVMpubfnliquidate(&mutself,vault_id:U256) -> Result<(),Vec<u8>>;pubfnbatch_check_health(&self,vault_ids:Vec<U256>) -> Vec<U256>;pubfnget_liquidation_price(&self,vault_id:U256) -> U256;}#[internal]implLiquidationEngine{// Internal Rust-only functionsfncalculate_liquidation_bonus(&self,health_factor:U256) -> U256;fnexecute_dutch_auction(&mutself,vault_id:U256) -> Result<(),Error>;fndistribute_liquidation_rewards(&mutself,liquidator:Address,amount:U256);}

🎯 Key Features

For Users

Stable Yield: Earn 5-12% APY on your stablecoins automatically
$1 Peg Guarantee: Always redeemable for $1 of collateral
Capital Efficient: Minimum 130% collateral in stable markets
Gasless Transactions: Subsidized gas on Orbit chain
Cross-Chain: Bridge to Arbitrum One, Ethereum mainnet
No Lockups: Withdraw anytime (subject to collateral ratio)

For Liquidators

MEV Opportunities: Fast liquidations with 5-10% bonus
Dutch Auction: Fair price discovery for liquidated collateral
Keeper Rewards: Earn fees for calling rebalance functions

For Developers

Composable: ERC20-compatible, integrate with any DeFi protocol
Open Source: MIT licensed, fork-friendly
Well-Documented: Extensive NatSpec comments
Upgradeable: Transparent proxy pattern for emergency fixes


🛠️ Technology Stack

Smart Contracts

  • Solidity: 0.8.24 (Core protocol logic)
  • Rust: 1.75+ (Stylus liquidation engine)
  • Stylus SDK: 0.5.0 (Arbitrum Rust integration)
  • OpenZeppelin: 5.0.0 (Security primitives)
  • Foundry: Testing and deployment

Blockchain Infrastructure

  • Arbitrum Orbit: Custom app-chain deployment
  • Arbitrum One: DeFi integrations and liquidity
  • Chainlink: Price feeds and CCIP bridge
  • The Graph: Event indexing and queries

Frontend

  • TypeScript: 5.3+
  • React: 18.2+ with Next.js 14
  • Wagmi: 2.0+ (Wallet connections)
  • Viem: 2.0+ (Ethereum interactions)
  • TailwindCSS: 3.4+ (Styling)
  • Recharts: Position analytics and yield tracking

Backend & DevOps

  • Node.js: 20+ (Scripts and automation)
  • Hardhat: Contract compilation and testing
  • Docker: Orbit chain node deployment
  • GitHub Actions: CI/CD pipelines

Oracles & Data

  • Chainlink Price Feeds: ETH, ARB, USDC prices
  • Chainlink Automation: Keeper network for rebalancing
  • Custom Volatility Oracle: On-chain volatility calculations

📁 Project Structure

arbiyield/
├── contracts/
│ ├── src/
│ │ ├── core/
│ │ │ ├── AYDStablecoin.sol
│ │ │ ├── VaultManager.sol
│ │ │ ├── CollateralManager.sol
│ │ │ └── DynamicCollateralRatio.sol
│ │ ├── liquidation/
│ │ │ ├── liquidation_engine.rs
│ │ │ ├── health_monitor.rs
│ │ │ └── auction_manager.rs
│ │ ├── oracles/
│ │ │ ├── OracleAggregator.sol
│ │ │ ├── VolatilityOracle.sol
│ │ │ └── ChainlinkAdapter.sol
│ │ ├── yield/
│ │ │ ├── YieldRouter.sol
│ │ │ ├── AaveStrategy.sol
│ │ │ ├── GMXStrategy.sol
│ │ │ └── PendleStrategy.sol
│ │ ├── governance/
│ │ │ ├── ProtocolGovernance.sol
│ │ │ ├── EmergencyModule.sol
│ │ │ └── TreasuryManager.sol
│ │ └── bridges/
│ │ ├── ArbitrumBridge.sol
│ │ └── CCIPIntegration.sol
│ ├── test/
│ │ ├── unit/
│ │ │ ├── AYDStablecoin.t.sol
│ │ │ ├── VaultManager.t.sol
│ │ │ └── DynamicCollateralRatio.t.sol
│ │ ├── integration/
│ │ │ ├── YieldGeneration.t.sol
│ │ │ ├── Liquidation.t.sol
│ │ │ └── CrossChainBridge.t.sol
│ │ └── fuzzing/
│ │ ├── VaultFuzzing.t.sol
│ │ └── OracleFuzzing.t.sol
│ ├── script/
│ │ ├── Deploy.s.sol
│ │ ├── SetupOrbit.s.sol
│ │ └── ConfigureYield.s.sol
│ ├── foundry.toml
│ └── package.json
│
├── stylus/
│ ├── liquidation-engine/
│ │ ├── src/
│ │ │ ├── lib.rs
│ │ │ ├── engine.rs
│ │ │ ├── health.rs
│ │ │ └── auction.rs
│ │ ├── Cargo.toml
│ │ └── README.md
│ └── scripts/
│ ├── build.sh
│ └── deploy.sh
│
├── frontend/
│ ├── src/
│ │ ├── app/
│ │ │ ├── page.tsx
│ │ │ ├── vaults/
│ │ │ ├── analytics/
│ │ │ └── governance/
│ │ ├── components/
│ │ │ ├── VaultCard.tsx
│ │ │ ├── CollateralManager.tsx
│ │ │ ├── YieldDashboard.tsx
│ │ │ └── HealthMonitor.tsx
│ │ ├── hooks/
│ │ │ ├── useVault.ts
│ │ │ ├── useOracle.ts
│ │ │ └── useYield.ts
│ │ ├── lib/
│ │ │ ├── contracts.ts
│ │ │ ├── abis/
│ │ │ └── constants.ts
│ │ └── utils/
│ │ ├── formatting.ts
│ │ └── calculations.ts
│ ├── public/
│ ├── package.json
│ └── next.config.js
│
├── orbit-config/
│ ├── chain-config.json
│ ├── genesis.json
│ ├── validators.json
│ └── docker-compose.yml
│
├── scripts/
│ ├── deploy-orbit.ts
│ ├── setup-oracles.ts
│ ├── fund-strategies.ts
│ └── monitor-health.ts
│
├── docs/
│ ├── ARCHITECTURE.md
│ ├── SECURITY.md
│ ├── INTEGRATION.md
│ └── API.md
│
├── .github/
│ └── workflows/
│ ├── test.yml
│ ├── deploy-testnet.yml
│ └── security-audit.yml
│
├── README.md
├── LICENSE
└── package.json

🚀 Getting Started

Prerequisites

# Required installations
- Node.js >= 20.0.0
- Rust >= 1.75.0
- Foundry (forge, cast, anvil)
- Docker & Docker Compose
- Git

Installation

# Clone the repository
git clone https://github.com/yourusername/arbiyield.git
cd arbiyield
# Install dependencies
npm install
# Install Foundry dependenciescd contracts && forge install
# Build Stylus contractscd ../stylus/liquidation-engine
cargo build --release --target wasm32-unknown-unknown
# Compile Solidity contractscd ../../contracts
forge build

Environment Setup

# Create .env file
cp .env.example .env
# Required environment variables
PRIVATE_KEY=your_private_key_here
ARBITRUM_RPC_URL=https://arb1.arbitrum.io/rpc
ORBIT_RPC_URL=http://localhost:8547
CHAINLINK_API_KEY=your_chainlink_key
ETHERSCAN_API_KEY=your_etherscan_key

Running Tests

# Solidity unit tests
forge test# Solidity integration tests
forge test --match-contract Integration
# Stylus testscd stylus/liquidation-engine
cargo test# Frontend testscd frontend
npm run test# Gas benchmarks
forge test --gas-report

Local Development

# Terminal 1: Start local Orbit chaincd orbit-config
docker-compose up
# Terminal 2: Deploy contractscd contracts
forge script script/Deploy.s.sol --rpc-url $ORBIT_RPC_URL --broadcast
# Terminal 3: Start frontendcd frontend
npm run dev

Deployment

# Deploy to Arbitrum Sepolia testnet
forge script script/Deploy.s.sol \
--rpc-url $ARBITRUM_SEPOLIA_RPC \
--broadcast \
--verify
# Deploy Stylus contractscd stylus/liquidation-engine
cargo stylus deploy \
--private-key=$PRIVATE_KEY \
--endpoint=$ARBITRUM_SEPOLIA_RPC# Deploy Orbit chain (requires validator setup)
npm run deploy:orbit

🎮 Usage Examples

Opening a Vault

import{useVault}from'@/hooks/useVault';functionOpenVault(){const{ openVault }=useVault();consthandleOpen=async()=>{consttx=awaitopenVault({ethCollateral: parseEther('1'),// 1 ETHarbCollateral: parseEther('100'),// 100 ARBusdcCollateral: parseUnits('500',6),// 500 USDCmintAmount: parseEther('2000')// Mint 2000 AYD});awaittx.wait();};return<buttononClick={handleOpen}>OpenVault</button>;}

Checking Vault Health

import{useOracle}from'@/hooks/useOracle';functionVaultHealth({ vaultId }){const{ getHealthFactor, getCurrentDCR }=useOracle();consthealthFactor=getHealthFactor(vaultId);constrequiredRatio=getCurrentDCR();return(<div><p>HealthFactor: {healthFactor.toString()}</p><p>RequiredCollateral: {requiredRatio/1e16}%</p><p>Status: {healthFactor>1 ? '✅ Healthy' : '⚠️ At Risk'}</p></div>);}

Liquidating Undercollateralized Vault

import{useLiquidation}from'@/hooks/useLiquidation';functionLiquidate({ vaultId }){const{ liquidate, getLiquidationBonus }=useLiquidation();constbonus=getLiquidationBonus(vaultId);consthandleLiquidate=async()=>{consttx=awaitliquidate(vaultId);awaittx.wait();// Liquidator receives collateral + bonus};return(<div><p>LiquidationBonus: {bonus}%</p><buttononClick={handleLiquidate}>Liquidate</button></div>);}

📊 Economics & Tokenomics

Collateral Requirements

Market ConditionVolatility IndexRequired RatioExample
Bull Market<20%130%Mint 1000 AYD with $1300 collateral
Normal20-50%150%Mint 1000 AYD with $1500 collateral
High Volatility50-80%175%Mint 1000 AYD with $1750 collateral
Extreme Crisis>80%200%Mint 1000 AYD with $2000 collateral

Yield Distribution

Annual Yield Estimates (subject to market conditions):

  • Aave Lending: 3-5% APY
  • GMX LP Fees: 8-15% APY
  • Pendle Yield Trading: 10-20% APY
  • Blended Average: 7-12% APY

Fee Structure:

  • Minting Fee: 0.5% (one-time)
  • Redemption Fee: 0.25% (one-time)
  • Performance Fee: 15% of yields (continuous)
  • Liquidation Penalty: 5-10% (depends on health factor)

Protocol Revenue Model

Monthly Revenue (at $10M TVL):
├── Minting Fees ($500K monthly volume): $2,500
├── Performance Fees (8% avg APY, 15% cut): $10,000
├── Liquidation Fees (assuming 2% monthly): $2,000
└── Total Monthly: ~$14,500
Annual Revenue Projection: ~$174,000

🔒 Security Considerations

Audit Scope

Critical Components:

  1. ✅ VaultManager.sol - Collateral accounting
  2. ✅ DynamicCollateralRatio.sol - DCR calculations
  3. ✅ Liquidation Engine (Rust) - Position liquidations
  4. ✅ OracleAggregator.sol - Price feed integrity
  5. ✅ YieldRouter.sol - Strategy fund movements

Known Risks & Mitigations

RiskSeverityMitigation
Oracle ManipulationHigh3-layer oracle system, 30-min TWAP
Smart Contract BugsHighMulti-stage audits, bug bounty program
Yield Strategy FailureMediumDiversified strategies, emergency withdraw
Extreme VolatilityMediumDCR auto-adjustment, circuit breakers
Orbit Chain DowntimeLowFallback to Arbitrum One, state snapshots

Security Best Practices

// Example: Reentrancy protectioncontractVaultManagerisReentrancyGuard {
function withdrawCollateral(uint256amount) external nonReentrant whenNotPaused {
require(getHealthFactor(msg.sender) >1.2e18, "Unhealthy");
// ... withdrawal logic
}
}

Emergency Procedures

  1. Circuit Breaker: Governance can pause minting/redemptions
  2. Oracle Fallback: Manual price updates if Chainlink fails
  3. Yield Strategy Pause: Stop deposits to compromised protocols
  4. Liquidation Halt: Prevent cascading liquidations in flash crashes

🧪 Testing Strategy

Test Coverage Goals

  • Unit Tests: >95% coverage for Solidity contracts
  • Integration Tests: All cross-contract interactions
  • Fuzzing: Vault operations with random inputs (Foundry)
  • Stylus Tests: Rust property-based testing (proptest)
  • Fork Tests: Mainnet fork testing against live DeFi protocols

Critical Test Cases

// Test: DCR adjusts correctly during volatility spikefunction testDCRAdjustmentHighVolatility() public {
// Set volatility to 80%
volatilityOracle.setVolatility(80e16);
uint256 ratio = dcrContract.getCurrentRatio();
assertEq(ratio, 182.5e16); // Should be ~182.5%
}
// Test: Liquidation triggers at correct health factorfunction testLiquidationExecution() public {
// Create vault at 150% collateraluint256 vaultId =openVault(1 ether, 1500e18);
// Drop ETH price by 30%
oracle.setPrice(address(weth), 700e18);
// Health factor should be < 1assertTrue(getHealthFactor(vaultId) <1e18);
// Liquidation should succeed
liquidationEngine.liquidate(vaultId);
}

🌐 Integration Examples

Integrating AYD into Your DeFi Protocol

// Example: Using AYD as collateral in lending protocolimport"@arbiyield/contracts/interfaces/IAYDStablecoin.sol";
contractLendingPool {
IAYDStablecoin publicimmutable ayd;
function depositAYD(uint256amount) external {
ayd.transferFrom(msg.sender, address(this), amount);
// Issue lending pool shares
}
function borrowAgainstAYD(uint256collateralAmount) external {
require(ayd.balanceOf(msg.sender) >= collateralAmount);
// Lending logic
}
}

Frontend Integration (React)

// Install packagenpminstall @arbiyield/sdk// Usageimport{ArbiYieldSDK}from'@arbiyield/sdk';constsdk=newArbiYieldSDK({chainId: 42161,// Arbitrum OnerpcUrl: process.env.NEXT_PUBLIC_RPC_URL});// Get vault infoconstvault=awaitsdk.getVault(vaultId);console.log(`Collateral: ${vault.collateralValue} USD`);console.log(`Debt: ${vault.debtAmount} AYD`);console.log(`Health: ${vault.healthFactor}`);

🛣️ Roadmap

Phase 1: Testnet Launch (Month 1-2)

  • ✅ Deploy core contracts to Arbitrum Sepolia
  • ✅ Launch Orbit chain testnet
  • ✅ Integrate Chainlink price feeds
  • ✅ Build MVP frontend

Phase 2: Security & Audits (Month 3)

  • 🔄 Complete smart contract audits (2 firms)
  • 🔄 Implement audit recommendations
  • 🔄 Launch bug bounty program ($50K)
  • 🔄 Stress test with simulated market conditions

Phase 3: Mainnet Alpha (Month 4)

  • ⏳ Deploy to Arbitrum Orbit mainnet
  • ⏳ Cap initial TVL at $1M
  • ⏳ Enable ETH + USDC collateral only
  • ⏳ Launch with conservative 170% DCR

Phase 4: Full Launch (Month 5-6)

  • ⏳ Remove TVL cap
  • ⏳ Add ARB collateral support
  • ⏳ Activate dynamic DCR algorithm
  • ⏳ Integrate additional yield strategies

Phase 5: Expansion (Month 7+)

  • ⏳ Cross-chain bridges (Ethereum, Base, Optimism)
  • ⏳ Mobile app (iOS + Android)
  • ⏳ Governance token launch
  • ⏳ Institutional custody partnerships

🤝 Contributing

We welcome contributions! Please see CONTRIBUTING.md for guidelines.

Development Workflow

# Create feature branch
git checkout -b feature/your-feature-name
# Make changes and test
forge test
npm run lint
# Commit with conventional commits
git commit -m "feat: add new liquidation strategy"# Push and create PR
git push origin feature/your-feature-name

Code Style

  • Solidity: Follow Solidity Style Guide
  • Rust: Use cargo fmt and cargo clippy
  • TypeScript: Prettier + ESLint (config included)

📜 License

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


📞 Contact & Support

Team

  • Devil - Lead Blockchain Engineer & Architect
  • Talha Ansari - Smart Contract Developer
  • Akash Singh - Frontend Engineer

🙏 Acknowledgments

Special thanks to:

  • Arbitrum Foundation for Orbit chain infrastructure
  • Chainlink Labs for reliable oracle solutions
  • OpenZeppelin for security primitives
  • Foundry Team for best-in-class dev tools

📈 Live Metrics (Testnet)

Current TVL: $0 (Pre-launch)
Total AYD Minted: 0
Active Vaults: 0
Average APY: TBD
Liquidations (24h): 0
Arbitrum Sepolia Testnet:
- AYD Token: 0x... (TBD)
- VaultManager: 0x... (TBD)
- LiquidationEngine: 0x... (TBD)

⚠️ Disclaimer

IMPORTANT: ArbiYield is experimental DeFi software currently in development.

  • Not Audited: Contracts have not undergone professional security audits
  • Use at Own Risk: Do not deposit funds you cannot afford to lose
  • Testnet Only: Currently deployed on test networks only
  • No Investment Advice: This is not financial advice

Always conduct your own research before interacting with any DeFi protocol.


Built with ❤️ for Arbitrum Open House NYC

WebsiteDocsTwitterDiscord

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages