OADA Smart Contract API

This guide provides a comprehensive overview of the core functionalities in the OADA UI project, helping developers understand the system's logic and architecture.

System Overview

OADA UI is a decentralized finance (DeFi) application built on the Cardano blockchain that enables users to:

  • Mint and manage OADA tokens

  • Stake OADA tokens to earn yields

  • Participate in epoch-based stake auctions

  • Lock tokens for enhanced rewards

  • Track portfolio performance and TVL

Core System Components

graph TD
    A[User Interface] --> B[Wallet Integration]
    A --> C[Token Management]
    A --> D[Auction System]
    A --> E[Lock System]

    C --> G[OADA Token]
    C --> H[sOADA Token]
    C --> I[OPTIMiz Token]

    D --> J[Epoch Management]
    D --> K[APY Calculation]

    E --> L[Lock Periods]
    E --> M[Reward Calculation]

System Flow

  1. Token Lifecycle

    • Users mint OADA tokens using ADA

    • OADA tokens can be staked to receive sOADA

    • sOADA tokens can be unstaked back to OADA

    • OADA tokens can be locked to receive OPTIMiz

    • OPTIMiz tokens can be converted to OPTIM

  2. Staking Mechanism

    • Users stake OADA tokens

    • Receive sOADA tokens representing their stake

    • Earn yields based on protocol performance

    • Can unstake at any time (subject to cooldown)

  3. Auction System

    • Runs on epoch basis (5 days)

    • Users submit bids with desired APY

    • System calculates clearing rate

    • Successful bidders receive rewards

    • Unsuccessful bids are returned

  4. Lock System

    • Users lock OADA tokens for fixed periods

    • Receive OPTIMiz tokens as receipt

    • Earn enhanced rewards based on lock duration

    • Early withdrawal available with penalties

Key Technical Concepts

  1. Tokens

    • OADA: Synthetic ADA stable token

    • sOADA: Staking receipt token

    • OPTIMiz: Lock receipt token

    • O: Governance token (migrated from OPTIM)

  2. Smart Contract Architecture

    • Policy IDs for token minting

    • Staking contract for yield distribution

    • Auction contract for bid management

    • Lock contract for time-locked tokens

  3. State Management

    • Redux for UI state

    • Blockchain state for on-chain data

    • Local storage for user preferences

    • WebSocket for real-time updates

  4. Security Model

    • Wallet-based authentication

    • Transaction signing

    • Rate limiting

    • Input validation

    • Error handling

System Interactions

System Architecture

Last updated