Optim Finance
  • INTRODUCTION
    • Introduction
    • Roadmap
  • OADA
    • Overview
    • OADA 🟣 and sOADA 🟢
    • Flow of Funds
    • User Guides
      • Passive yield with sOADA
      • Epoch Stake Auction
    • AMOs
      • Splash DEX AMO
      • Stake Auction AMO
      • Staking AMO
    • UNHCR Donation Module
      • Automated Yield Donation Protocol
      • NFT Impact Certificate
      • Integration with the OADA Ecosystem
      • Humanitarian Partnership
      • Future Extensions
    • Governance
    • Resources
  • OTOKEN Framework
    • Introduction
      • Key Benefits
      • Who is it for?
      • Inspirations & Applications
    • Framework
      • Key Concepts
      • Use Cases
      • OTOKENs
    • Core Concepts
      • OTOKEN and sOTOKEN
      • Algorithmic Market Operations (AMOs)
      • Balancing Stability, Yield, and Adaptability
    • System Architecture
      • OTOKEN Policy
      • Staking AMO
      • Collateral Management AMO
    • Extensions & Other Modules
      • DEX AMO (Liquidity & Peg Stability)
      • Stake Auction AMO
      • Borrowing & Lending AMOs
      • Other AMOs & Opportunities
    • Multiple OTOKEN Deployments
      • Ecosystem Synergy
      • Not Just Synthetic Assets
    • Vision
      • Key Pillars of the OToken Framework
      • Future Directions & Opportunities
      • An Invitation to Innovate
    • Bug Bounty Program
  • LIQUIDITY BONDS
    • Overview
    • Bond App FAQ
    • Use Cases
      • ISPO Bonds
      • SPO Bonds
    • Bond Architecture
      • Validators
      • High Level Workflow
      • Scripts Technical
      • Transaction Flow
      • Pooled Loans
    • Guides for SPOs
      • Bond Creation
      • Bond Sales
      • SPO Bond Issue Summary
      • Bond Verification
    • Liquidity Bonds Audit
  • OUSD
    • OUSD Reserves
      • Reserve Criteria
        • Stability and Reputation
        • Compliance
        • Smart Contract Security
    • Ongoing Reserves Management
      • Reserve Asset Valuation Calculation
      • Dynamic Reserve Asset Adjustment Metrics
        • Dynamic Reserves Adjustment
    • Yield, Staking, and Flow of Funds
      • Yield Modules
        • OUSD DEX AMO
        • Future Modules (v2)
      • Staking AMO
      • sOUSD Redemption Mechanism
    • Peg Protection
      • Market Depth and Liquidity
    • Governance and Risk Framework
      • Risk Capital Requirements
      • First-Loss Capital Structure
      • Asset Allocation Framework
        • Static Governance Parameters
        • Dynamic Allocation System
    • Financial Engineering Audit
  • Leviathan
    • System Architecture
      • Background
      • Concurrency Limitations
      • Complexity in Transaction and Contract Management
    • Core Concepts
      • Deterministic Transaction
        • Guaranteed Transaction
      • Instant Finality
        • Liveness and Safety
        • Probabilistic Finality vs Instant Finality
      • Account Abstraction
        • Concept of Account Abstraction
        • Technical Implementation
        • Security and Operational Implications
      • Intent Based Transactions
        • The Infrastructure and Process of IBTs
        • Declarative Constraints in IBTs
      • Layer 2
        • Types of Layer 2 Solutions
      • Sequencers
        • Core Functions of Sequencers
        • Role in Layer 2 Rollups
        • Challenges
    • System Components
      • Understanding the System Components
      • Optim-Account (Intents to enable tx chain)
        • User Interaction and Intent Submission
        • Intent Structuring and Authentication
        • Smart Contract Functionalities and Operational Parameters
        • The Necessity of an Account-Based Framework
        • Account Abstraction and Its Role in Leviathan
      • Leviathan Sequencer System (tx chain building)
        • The Role of the Leviathan Sequencer System in Conjunction with The Optim Account
        • Sequencing and Ordering of Transactions
        • The Role of Time in the System
        • The Pragmatic Leviathan: Dealing with Potential Changes
      • The Role of OADA in the Leviathan System
        • Operational Simplification of Staking Mechanisms via OADA Integration
        • Facilitating Time Dilation and Composability
    • Processes
      • Entering Leviathan
      • Transaction Execution
      • Leaving Leviathan
    • High Level Overview
      • System Design
        • Account Abstraction Functionality
        • Guaranteed Transactions
        • Instant Finality
        • Unbreakable Transaction Chaining
        • Layer 2 Execution Environment
        • Future Sequencer Network
      • System Context
        • Limitations of current transactions chaining paradigm
        • Limitations of current inter dApp composability issues
        • Explanation of basic design and non-custodial asset inputs
        • Intent Based Transactions
        • Account Base vs eUTxO model app architecture
      • Theoretical Applications
  • GOVERNANCE
    • Governance Overview
      • Proposal Temp Check
      • Governance Proposal
        • On/Off Chain Mechanics
      • ODAO
    • Tokenomics
      • Categories
      • Vesting
    • Optim DAO Wallets
    • Protocol Profits
  • GUIDES
    • Transaction Chaining
      • Background
      • Overview
      • Pool Transaction Chaining
    • OPTIMiz Conversion
  • ODAO Stack
    • Introduction
    • Design Principles
    • Why Optim DAO Stack?
      • Current Limitations
      • ODAO Solutions
    • Key Features
      • Snapshot Voting
      • Treasury Management
      • Proposal Execution
    • System Architecture
      • Modular Framework
      • On-Chain Logic
      • Off-Chain Operations
      • User Interfaces
    • Core Modules
      • Snapshot Voting Module
      • Treasury Management Module
      • Proposal Execution Module
    • Future Roadmap
      • Potential Future Enhancements
      • Long Term Vision
  • OADA UI
    • Setup
      • Installation
      • Development Workflow
      • Troubleshooting
      • Development Tips
      • Open Source Contributions
      • FAQ
    • Key Functionalities
      • Wallet Integration
      • Dashboard
      • Transaction Management
        • UTxO Management
        • Transaction Creation and Conversion
        • Transaction Monitoring
      • Real-time Updates
        • Portfolio Value Tracking
        • Transaction Status Monitoring
    • OADA Smart Contract API
      • Minting OADA
      • Staking OADA
      • Unstaking sOADA
      • Epoch Stake Auction
        • Bid Calculation Functions
        • Auction Actions
        • Bid Form Component
        • Auction Dashboard
    • Tutorials
      • Environment Setup and Installation
      • Understanding the Project Structure
      • Basic Configuration and Customization
      • Working with Components
      • State Management and Data Flow
      • Wallet Integration and State Management
      • Smart Contract Integration
      • Advanced UI Customization
      • Testing and Quality Assurance
Powered by GitBook
On this page
  1. OADA UI
  2. OADA Smart Contract API

Minting OADA

The minting feature allows users to convert ADA to OADA tokens at a 1:1 ratio. This is implemented through the buyOada action in the OADA protocol.

The BuyOadaRequest type defines the structure for minting requests:

// src/oada/actions.ts
// Type definition for OADA minting requests
// Specifies the amount of ADA to convert to OADA tokens
type BuyOadaRequest = {
  amount: bigint;
};

The buyOada action handles the minting process:

// src/oada/actions.ts
// Async thunk for minting OADA tokens from ADA
// Handles the complete minting process including transaction creation, signing, and submission
export const buyOada = createAsyncThunk<
  BasicResponse<string>,
  BuyOadaRequest,
  {
    dispatch: AppDispatch;
    state: RootState;
    extra: Services;
    rejectValue: FailResponse;
  }
>("buyOada", async (request: BuyOadaRequest, thunkApi) => {
  // Implementation details for minting OADA tokens
  const requestOptions = {
    method: "POST",
    headers: {
      Accept: "application/json",
      "Content-Type": "application/json;charset=UTF-8",
    },
    body: Json.stringify(request),
  };

  const rawResponse = await fetch(
    `${oadaEndpointsUrl}/buy-oada`,
    requestOptions
  );

  const wallet = thunkApi.getState().wallet.wallet!;
  const [utxos, changeAddress] = await getWalletUtxos(wallet);

  const addFee = (recipe: TxRecipe) => {
    oadaFeeAddress &&
      oadaMintFee &&
      recipe.txOuts.push({
        address: oadaFeeAddress,
        value: { lovelace: oadaMintFee },
        datum: null,
        refScript: null,
      });
    return recipe;
  };
  const signedTxResponse = await getRecipeBuildSendTx(
    utxos,
    changeAddress,
    rawResponse,
    addFee
  );

  return signedTxResponse;
});

Key features of the minting process:

  • 1:1 conversion ratio from ADA to OADA

  • Transaction fee handling

  • UTxO management for Cardano blockchain

  • Secure transaction signing and submission

PreviousOADA Smart Contract APINextStaking OADA

Last updated 1 month ago