Onyx Protocol
  • πŸ“–Onyx Documentation
  • β˜•Getting Started
    • πŸ”¬Networks
    • πŸ“’Protocol Math
      • oToken and Underlying Decimals
      • Interpreting Exchange Rates
      • Calculating Accrued Interest
      • Calculating the APY Using Rate Per Block
    • πŸ’ΉGas Costs
  • πŸ§‘β€πŸ’»OTokens
    • Mint
    • Redeem
    • Redeem Underlying
    • Borrow
    • Repay Borrow
    • Repay Borrow Behalf
    • Transfer
    • Liquidate Borrow
    • Key Events
    • Error Codes
    • Failure Info
    • Exchange Rate
    • Get Cash
    • Total Borrow
    • Borrow Balance
    • Borrow Rate
    • Total Supply
    • Underlying Balance
    • Supply Rate
    • Total Reserves
    • Reserve Factor
  • βš™οΈComptroller
    • Enter Markets
    • Exit Market
    • Get Assets In
    • Collateral Factor
    • Get Account Liquidity
    • Close Factor
    • Liquidation Incentive
    • Key Events
    • Error Codes
    • Failure Info
    • XCN Distribution Speeds
    • Claim XCN
    • Market Metadata
  • πŸ‘¨β€πŸ‘©β€πŸ‘¦Governance
    • Governor Alpha
    • Quorum Votes
    • Proposal Threshold
    • Proposal Max Operations
    • Voting Delay
    • Voting Period
    • Propose
    • Queue
    • Execute
    • Cancel
    • Get Actions
    • Get Receipt
    • State
    • Cast Vote
    • Cast Vote By Signature
    • Timelock
    • Pause Guardian
  • πŸ”‘API
    • Basic API
      • GET: /otoken
      • GET: /market_history/graph
      • GET: /user/history
      • GET: /get_liquidators
      • GET: /get_liquidator:account
      • GET: /get_liquidator_detail:account
      • GET: /liquidator
    • GraphQL API
      • oTokens Subgraph
      • History Subgraph
      • Governance Subgraph
    • Governance API
      • GET: /proposal
      • GET: /proposal/:proposalId
      • GET: /voter/:proposalId
      • GET: /voter/accounts
      • GET: /voter/history/:address
    • Shared Data Types
  • πŸ“–Onyx.js
    • Onyx Constructor
    • API Methods
      • Account
      • oToken
      • Market History
      • Governance
    • oToken Methods
      • Supply
      • Redeem
      • Borrow
      • Repay Borrow
    • XCN Methods
      • To Checksum Address
      • Get XCN Balance
      • Get XCN Accrued
      • Claim XCN
      • Delegate
      • Delegate By Sig
      • Create Delegate Signature
    • Comptroller Methods
      • Enter Markets
      • Exit Market
    • Ethereum Methods
      • Read
      • Trx
      • Get Balance
    • Governance Methods
      • Cast Vote
      • Cast Vote By Sig
      • Create Vote Signature
    • Price Feed Methods
      • Get Price
    • Utility Methods
      • Get Address
      • Get ABI
      • Get Network Name With Chain ID
  • πŸ”’Security
    • Bug Bounty Program
  • πŸ“„Terms of Service
Powered by GitBook
On this page
  • How do oTokens earn interest?
  • Can you walk me through an example?
  • How do I view my oTokens?
  • Can I transfer oTokens?

OTokens

PreviousGas CostsNextMint

Last updated 1 year ago

Each asset supported by the Onyx Protocol is integrated through a oToken contract, which is an compliant representation of balances supplied to the protocol. By minting oTokens, users (1) earn interest through the oToken's exchange rate, which increases in value relative to the underlying asset, and (2) gain the ability to use oTokens as collateral.

oTokens are the primary means of interacting with the Onyx Protocol; when a user mints, redeems, borrows, repays a borrow, liquidates a borrow, or transfers oTokens, she will do so using the oToken contract.

There are currently two types of oTokens: OErc20 and OEther. Though both types expose the EIP-20 interface, OErc20 wraps an underlying ERC-20 asset, while OEther simply wraps Ether itself. As such, the core functions which involve transferring an asset into the protocol have slightly different interfaces depending on the type, each of which is shown below.

How do oTokens earn interest?

Each has its own Supply interest rate (APR). Interest isn't distributed; instead, simply by holding oTokens, you'll earn interest.

oTokens accumulate interest through their exchange rate β€” over time, each oToken becomes convertible into an increasing amount of its underlying asset, even while the number of oTokens in your wallet stays the same.

Can you walk me through an example?

Let’s say you supply 1,000 USDC to the Onyx protocol, when the exchange rate is 0.020070; you would receive 49,825.61 oUSDC (1,000/0.020070).

A few months later, you decide it’s time to withdraw your USDC from the protocol; the exchange rate is now 0.021591:

  • Your 49,825.61 oUSDC is now equal to 1,075.78 USDC (49,825.61 * 0.021591)

  • You could withdraw 1,075.78 USDC, which would redeem all 49,825.61 oUSDC

  • Or, you could withdraw a portion, such as your original 1,000 USDC, which would redeem 46,315.59 oUSDC (keeping 3,510.01 oUSDC in your wallet)

How do I view my oTokens?

Each oToken is visible on , and you should be able to view them in the list of tokens associated with your address

Can I transfer oTokens?

Yes, but exercise caution! By transferring oTokens, you’re transferring your balance of the underlying asset inside the Onyx protocol. If you send a oToken to your friend, your balance (viewable in the Onyx Interface) will decline, and your friend will see their balance increase.

oToken balances have been integrated into and MetaMask; other wallets may add oToken support

A oToken transfer will fail if the account has that oToken market and the transfer would have put the account into a state of negative .

πŸ§‘β€πŸ’»
EIP-20
market
Etherscan
Coinbase Wallet
entered
liquidity