🐋
Moby
  • Let’s Get Started
    • 🐋 About Moby
    • ⚡ Our Vision
    • 🤓 Your Guidebook
      • Get Setup
        • Connect Wallet
        • Trade Options
        • 0DTE Options
        • Provide Liquidity
      • Fees & Instruments
        • Fee Generation
        • Fee Distribution
        • Instruments
      • Testnet
  • How it’s Built
    • 🚀 Synchronized Liquidity Engine (SLE)
    • 🧮 Options Pricing Model
      • Mark Price
        • Futures Index
        • Implied Volatility
      • Risk Premium
        • Deriving Greeks
        • Risk Premium Calculation
        • Risk Managing Mechanism
    • 🤖 Architecture
      • Liquidity Provision Mechanism
      • Options Listing Standard
      • How to Open / Close / Settle Position
      • Synchronized Liquidity Engine (SLE)
      • Options Position Tokens
      • Tools to Maximize Capital Efficiency
    • ⚙️ Key Features
      • High Leverage & Limited Risk with No Liquidation
      • Narrow Spread with Dynamic Risk Premium
      • Guaranteed Settlement
      • Capital Efficiency Improvements with Combo Options
      • Even Higher Capital Efficiency with Clearing House
      • Abundant Liquidity for All Options
      • Composable Options for Structured Products
      • High Profitability for LPs
      • Real-Time Automatically Hedged OLP
      • Upcoming Features
    • ⛓ DeFi Options Vault
      • 🐻 Berachain DeFi Options Vault
        • 🔒 Architecture
        • 📈 Options Strategy
  • How it’s Driven
    • 🛡️ Building the Safest DeFi Protocol
      • Safety Features
      • Smart Contract Audit & Real-Time Security Monitoring
    • 🏛 Backed by Decentralized Governance
      • Governance
    • 🌐 Led by the Best Partners & Community
      • Arbitrum X Moby
      • Engagement Programs
  • Need More Info?
    • 📚 Resource Library
      • Developer Resources & Educational Contents
      • Terms & Conditions
      • Glossary
      • FAQ
  • Developers
    • Moby Traders API
      • REST API
        • General
        • Account
        • Market
    • Trade Scripts
      • Prerequisites
      • Open Positions
      • Close Positions
    • Interfaces & ABI
      • PositionManager.sol
      • SettleManager.sol
      • RewardRouterV2.sol
      • OptionsMarket.sol
    • Appendix 1: Parameters for Open/Close Options
    • Appendix 2: the Diff between optionId and optionTokenId
    • Appendix 3: Sample Moby Contract Module for Developers
Powered by GitBook
On this page
  • State-Changing Functions
  • Events
  • ABI
  1. Developers
  2. Interfaces & ABI

RewardRouterV2.sol

Last Updated At 20th Jan, 2025

State-Changing Functions

handleRewards

function handleRewards(
    bool _shouldClaimReward, // will be always true
    bool _shouldConvertRewardToNat
) external
  • Processes pending rewards

  • To help users withdraw their rewards to NAT (only valid when reward token is wnat)

mintAndStakeOlp

function mintAndStakeOlp(
    address _token,
    uint256 _amount,
    uint256 _minUsdg,
    uint256 _minOlp
) external returns (uint256)
  • Mints OLP tokens using provided token

  • Automatically stakes the minted OLP

  • Returns amount of OLP minted and staked

mintAndStakeOlpTo

function mintAndStakeOlp(
    address _token,
    uint256 _amount,
    uint256 _minUsdg,
    uint256 _minOlp,
    address _receiver
) external returns (uint256)
  • Designate receiver, the logic is equivalant to mintAndStakeOlp()

mintAndStakeOlpNAT

function mintAndStakeOlpNAT(
    uint256 _minUsdg,
    uint256 _minOlp
) external payable returns (uint256)
  • Mints OLP tokens using native token

  • Automatically stakes the minted OLP

  • Returns amount of OLP minted and staked

unstakeAndRedeemOlp

function unstakeAndRedeemOlp(
    address _tokenOut,
    uint256 _olpAmount,
    uint256 _minOut,
    address _receiver
) external returns (uint256)
  • Unstakes OLP tokens and redeems them for specified token

  • Sends redeemed tokens to specified receiver

  • Returns amount of tokens received

unstakeAndRedeemOlpNAT

function unstakeAndRedeemOlpETH(
    uint256 _olpAmount,
    uint256 _minOut,
    address payable _receiver
) external returns (uint256)
  • Unstakes OLP tokens and redeems them for native token

  • Sends native token to specified receiver

  • Returns amount of native token received

Events

StakeOlp

event StakeOlp(
    address indexed account,
    uint256 amount
)
  • Emitted when OLP tokens are staked

  • Records the staking account and amount

UnstakeOlp

event UnstakeOlp(
    address indexed account,
    uint256 amount
)
  • Emitted when OLP tokens are unstaked

  • Records the unstaking account and amount

ABI

[
  {
    "type": "receive",
    "stateMutability": "payable"
  },
  {
    "type": "function",
    "name": "__AuthorityUtil_init__",
    "inputs": [
      {
        "name": "_authority",
        "type": "address",
        "internalType": "contract IOptionsAuthority"
      }
    ],
    "outputs": [],
    "stateMutability": "nonpayable"
  },
  {
    "type": "function",
    "name": "authority",
    "inputs": [],
    "outputs": [
      {
        "name": "",
        "type": "address",
        "internalType": "contract IOptionsAuthority"
      }
    ],
    "stateMutability": "view"
  },
  {
    "type": "function",
    "name": "handleRewards",
    "inputs": [
      {
        "name": "_shouldClaimReward",
        "type": "bool",
        "internalType": "bool"
      },
      {
        "name": "_shouldConvertRewardToNAT",
        "type": "bool",
        "internalType": "bool"
      }
    ],
    "outputs": [],
    "stateMutability": "nonpayable"
  },
  {
    "type": "function",
    "name": "initialize",
    "inputs": [
      {
        "name": "_wnat",
        "type": "address",
        "internalType": "address"
      },
      {
        "name": "_olp",
        "type": "address",
        "internalType": "address"
      },
      {
        "name": "_feeOlpTracker",
        "type": "address",
        "internalType": "address"
      },
      {
        "name": "_olpManager",
        "type": "address",
        "internalType": "address"
      },
      {
        "name": "_authority",
        "type": "address",
        "internalType": "contract IOptionsAuthority"
      },
      {
        "name": "_controller",
        "type": "address",
        "internalType": "address"
      }
    ],
    "outputs": [],
    "stateMutability": "nonpayable"
  },
  {
    "type": "function",
    "name": "mintAndStakeOlp",
    "inputs": [
      {
        "name": "_token",
        "type": "address",
        "internalType": "address"
      },
      {
        "name": "_amount",
        "type": "uint256",
        "internalType": "uint256"
      },
      {
        "name": "_minUsdg",
        "type": "uint256",
        "internalType": "uint256"
      },
      {
        "name": "_minOlp",
        "type": "uint256",
        "internalType": "uint256"
      }
    ],
    "outputs": [
      {
        "name": "",
        "type": "uint256",
        "internalType": "uint256"
      }
    ],
    "stateMutability": "nonpayable"
  },
  {
    "type": "function",
    "name": "mintAndStakeOlpNAT",
    "inputs": [
      {
        "name": "_minUsdg",
        "type": "uint256",
        "internalType": "uint256"
      },
      {
        "name": "_minOlp",
        "type": "uint256",
        "internalType": "uint256"
      }
    ],
    "outputs": [
      {
        "name": "",
        "type": "uint256",
        "internalType": "uint256"
      }
    ],
    "stateMutability": "payable"
  },
  {
    "type": "function",
    "name": "mintAndStakeOlpTo",
    "inputs": [
      {
        "name": "_token",
        "type": "address",
        "internalType": "address"
      },
      {
        "name": "_amount",
        "type": "uint256",
        "internalType": "uint256"
      },
      {
        "name": "_minUsdg",
        "type": "uint256",
        "internalType": "uint256"
      },
      {
        "name": "_minOlp",
        "type": "uint256",
        "internalType": "uint256"
      },
      {
        "name": "_receiver",
        "type": "address",
        "internalType": "address"
      }
    ],
    "outputs": [
      {
        "name": "",
        "type": "uint256",
        "internalType": "uint256"
      }
    ],
    "stateMutability": "nonpayable"
  },
  {
    "type": "function",
    "name": "olp",
    "inputs": [],
    "outputs": [
      {
        "name": "",
        "type": "address",
        "internalType": "address"
      }
    ],
    "stateMutability": "view"
  },
  {
    "type": "function",
    "name": "olpManager",
    "inputs": [],
    "outputs": [
      {
        "name": "",
        "type": "address",
        "internalType": "address"
      }
    ],
    "stateMutability": "view"
  },
  {
    "type": "function",
    "name": "owner",
    "inputs": [],
    "outputs": [
      {
        "name": "",
        "type": "address",
        "internalType": "address"
      }
    ],
    "stateMutability": "view"
  },
  {
    "type": "function",
    "name": "unstakeAndRedeemOlp",
    "inputs": [
      {
        "name": "_tokenOut",
        "type": "address",
        "internalType": "address"
      },
      {
        "name": "_olpAmount",
        "type": "uint256",
        "internalType": "uint256"
      },
      {
        "name": "_minOut",
        "type": "uint256",
        "internalType": "uint256"
      },
      {
        "name": "_receiver",
        "type": "address",
        "internalType": "address"
      }
    ],
    "outputs": [
      {
        "name": "",
        "type": "uint256",
        "internalType": "uint256"
      }
    ],
    "stateMutability": "nonpayable"
  },
  {
    "type": "function",
    "name": "unstakeAndRedeemOlpNAT",
    "inputs": [
      {
        "name": "_olpAmount",
        "type": "uint256",
        "internalType": "uint256"
      },
      {
        "name": "_minOut",
        "type": "uint256",
        "internalType": "uint256"
      },
      {
        "name": "_receiver",
        "type": "address",
        "internalType": "address payable"
      }
    ],
    "outputs": [
      {
        "name": "",
        "type": "uint256",
        "internalType": "uint256"
      }
    ],
    "stateMutability": "nonpayable"
  },
  {
    "type": "function",
    "name": "withdrawToken",
    "inputs": [
      {
        "name": "_token",
        "type": "address",
        "internalType": "address"
      },
      {
        "name": "_account",
        "type": "address",
        "internalType": "address"
      },
      {
        "name": "_amount",
        "type": "uint256",
        "internalType": "uint256"
      }
    ],
    "outputs": [],
    "stateMutability": "nonpayable"
  },
  {
    "type": "function",
    "name": "wnat",
    "inputs": [],
    "outputs": [
      {
        "name": "",
        "type": "address",
        "internalType": "address"
      }
    ],
    "stateMutability": "view"
  },
  {
    "type": "event",
    "name": "AuthorityUpdated",
    "inputs": [
      {
        "name": "authority",
        "type": "address",
        "indexed": true,
        "internalType": "contract IOptionsAuthority"
      }
    ],
    "anonymous": false
  },
  {
    "type": "event",
    "name": "OwnershipTransferred",
    "inputs": [
      {
        "name": "previousOwner",
        "type": "address",
        "indexed": true,
        "internalType": "address"
      },
      {
        "name": "newOwner",
        "type": "address",
        "indexed": true,
        "internalType": "address"
      }
    ],
    "anonymous": false
  },
  {
    "type": "event",
    "name": "SetController",
    "inputs": [
      {
        "name": "controller",
        "type": "address",
        "indexed": true,
        "internalType": "address"
      }
    ],
    "anonymous": false
  },
  {
    "type": "event",
    "name": "StakeOlp",
    "inputs": [
      {
        "name": "account",
        "type": "address",
        "indexed": true,
        "internalType": "address"
      },
      {
        "name": "amount",
        "type": "uint256",
        "indexed": false,
        "internalType": "uint256"
      }
    ],
    "anonymous": false
  },
  {
    "type": "event",
    "name": "UnstakeOlp",
    "inputs": [
      {
        "name": "account",
        "type": "address",
        "indexed": true,
        "internalType": "address"
      },
      {
        "name": "amount",
        "type": "uint256",
        "indexed": false,
        "internalType": "uint256"
      }
    ],
    "anonymous": false
  }
]

PreviousSettleManager.solNextOptionsMarket.sol

Last updated 4 months ago