1. Smart Contracts

The RAI protocol is powered by a modular suite of smart contracts that coordinate all on-chain operations. These contracts ensure transparency, automation, and trustless interaction across the RAI ecosystem. Below is an overview of the core smart contracts:


Core Smart Contracts in the RAI Protocol

  1. Treasury Contract

    • Manages reserve assets (stablecoins, RWA tokens).

    • Holds Risk-Free Value (RFV) to back RAI token supply.

    • Interacts with bonding and staking contracts to mint and redeem RAI.

  2. Sales Contract

    • Handles direct RAI token purchases.

    • Applies dynamic pricing rules and transaction fee logic (e.g., 0% buy, 5% sell).

    • Integrated with community-driven DAO voting for tax rate updates.

  3. Bonding Contract

    • Enables users to purchase discounted RAI by contributing assets (e.g., stablecoins, tokenized RWA).

    • Calculates bond discount rates and vesting schedules.

    • Dynamically interacts with Treasury to update reserve ratios.

  4. Staking Contract

    • Allows users to lock RAI tokens and earn APY.

    • Calculates and distributes staking rewards based on protocol-defined formulas.

    • Supports flexible or fixed-term staking options in future upgrades.

  5. Reward Distribution Contract

    • Distributes staking rewards and bonding incentives.

    • AI-assisted to adjust emission rates based on market conditions and DAO policies.

  6. Buyback and Burn Contract

    • Executes periodic buybacks of RAI tokens using a portion of fees or surplus treasury.

    • Burns tokens to reduce circulating supply, thereby increasing scarcity and value.

    • Triggered automatically or through DAO proposals.

  7. Contribution Value Algorithm Contract

    • Calculates each wallet’s contribution score based on:

      • Amount staked

      • Duration of staking

      • Bonding volume

      • Participation in DAO governance

    • Used to determine reward weighting, vesting speed, or premium status within the ecosystem.

Last updated