📘
ZenStake Docs
  • Overview
  • Getting Started
    • How to Set Up a Wallet
    • Funding Your Wallet
    • How to Stake
      • Claim and Unstake
      • Cooldown Period in ZenStake
  • ZenStake Ecosystem
    • Introduction to Zenstake
    • ZenStake Protocol
  • Fee Batch
  • $ZEN Token
    • Token Swap
  • Products
    • ZenStake Vaults
  • Staking Strategy
  • ZenStake Referral Program
  • Security
    • Risk Assessment Framework
  • Security Framework
  • For Developers
    • Fee Batch Mechanism
    • Token Swap Mechanism
    • Stablecoins Staking Strategy
  • Concentrated Liquidity Management (CLM) Strategy
  • Blue Chip Staking Strategy
  • Links
    • Website
    • Twitter
  • Telegram
Powered by GitBook
On this page
  • Key Features
  • How It Works
  • Technical Details
  • Fee Allocation
  1. For Developers

Fee Batch Mechanism

The Fee Batch is a core component of ZenStake, designed to optimize gas efficiency and streamline fee distribution across the ecosystem. It aggregates fees from various vaults and distributes them to staking participants and the treasury in a cost-effective manner.

Key Features

  • Gas Efficiency: Reduces transaction costs by batching multiple operations.

  • Automated Distribution: Automatically allocates fees to staking incentives and the treasury.

  • Cross-Chain Support: Works seamlessly across multiple blockchains.

How It Works

  1. Fee Aggregation Fees from vaults are collected and batched to minimize gas costs.

function aggregateFees(address[] calldata vaults) external {  
    for (uint i = 0; i < vaults.length; i++) {  
        uint256 fee = IVault(vaults[i]).collectFees();  
        totalFees += fee;  
    }  
}  
  1. Multicall Execution A single transaction processes multiple operations, such as swapping fees to stablecoins and distributing rewards.

function executeMulticall(bytes[] calldata calls) external {  
    for (uint i = 0; i < calls.length; i++) {  
        (bool success, ) = address(this).call(calls[i]);  
        require(success, "Multicall failed");  
    }  
}  
  1. Fee Distribution Fees are split between staking incentives and the treasury. Staking rewards may require token conversion.

function distributeFees(uint256 stakingShare, uint256 treasuryShare) external {  
    IERC20(stablecoin).transfer(stakingPool, stakingShare);  
    IERC20(stablecoin).transfer(treasury, treasuryShare);  
}  
  1. Cross-Chain Fee Management Each blockchain uses a Revenue Bridge to aggregate fees before transferring them to the Fee Batch.

function bridgeFees(uint256 amount, uint256 chainId) external {  
    IERC20(token).approve(bridge, amount);  
    IBridge(bridge).transferCrossChain(amount, chainId);  
}  

Technical Details

  • Gas Optimization: Batching reduces gas costs by up to 30% compared to individual transactions.

  • Token Conversion: Fees are converted to stablecoins using decentralized exchanges (e.g., 1inch) to minimize slippage.

  • Security: Regular audits of Fee Batch smart contracts. Withdrawal limits and cooldown periods to prevent exploits.

Fee Allocation

  • Staking Incentives: 70% of fees are distributed to staking participants.

  • Treasury: 30% of fees are allocated to the ZenStake treasury for ecosystem development.

PreviousSecurity FrameworkNextToken Swap Mechanism

Last updated 2 months ago