I. Core Staking Mechanisms and Technical Architecture

I. Core Staking Mechanisms and Technical Architecture
LiquiSynth Protocol’s staking system is built on the Arbitrum Nitro stack, utilizing a modular smart contract design divided into the following core modules:
Staking Module
Function: Handles user asset staking, liquidity staking token (LSP-LP) generation, and reward distribution.
Technical Principles:
Tokenization of Staked Assets: Users stake assets (e.g., ARB) to mint 1:1 pegged liquidity staking tokens (e.g.,
stARB
), compliant with the ERC-4626 standard (Tokenized Vaults).Auto-Compounding: Staking rewards are automatically reinvested into protocols like GMX and Radiant via a Yield Aggregator, combining off-chain calculations and on-chain validation.
Key Code:
// stARB Contract (ERC-4626 Implementation) contract StakedARB is ERC4626 { using SafeERC20 for IERC20; IERC20 public immutable asset; // ARB token contract address public yieldAggregator; // Yield aggregator address constructor(IERC20 _asset) ERC4626(_asset, "Staked ARB", "stARB") { asset = _asset; } // Stake ARB to mint stARB function deposit(uint256 assets, address receiver) public override returns (uint256 shares) { shares = super.deposit(assets, receiver); _reinvestToYieldAggregator(assets); // Auto-compounding } // Reward reinvestment logic function _reinvestToYieldAggregator(uint256 amount) internal { asset.safeTransfer(yieldAggregator, amount); IYieldAggregator(yieldAggregator).deposit(amount); } }
LP Staking and Synthetic Asset Minting Module
Function: Users stake LSP-ETH LP tokens to gain synthetic asset minting privileges.
Technical Principles:
LP Token Validation: Uses Uniswap V3 LP NFTs or Balancer weighted pool LP tokens, with liquidity value verified by oracles.
Over-Collateralization: Requires 150% collateralization (dynamic ratio) of LP value for synthetic asset minting, with real-time pricing via Chainlink oracles.
Key Code:
// Synthetic Asset Minting Contract contract SyntheticMinter { using SafeMath for uint256; IChainlinkOracle public oracle; // Chainlink price oracle IERC20 public collateralToken; // LSP-ETH LP token ISyntheticToken public synthUSD; // LSP-USD synthetic token // Collateral ratio = collateral value / synthetic value ≥ 150% uint256 public constant MIN_COLLATERAL_RATIO = 150; // Mint synthetic assets function mintSynth(uint256 collateralAmount, uint256 synthAmount) external { uint256 collateralValue = oracle.getPrice(collateralToken) * collateralAmount; uint256 synthValue = oracle.getPrice(synthUSD) * synthAmount; require( collateralValue >= synthValue * MIN_COLLATERAL_RATIO / 100, "Insufficient collateral" ); collateralToken.safeTransferFrom(msg.sender, address(this), collateralAmount); synthUSD.mint(msg.sender, synthAmount); } }
最后更新于