Orbitlending OTokens
In Orbit Protocol's published lending-contract design on Blast, OTokens are ERC-20 lending-pool shares for underlying assets such as USDB or ETH. Deposits mint shares at an exchange rate. Redemption burns shares for underlying assets, subject to the controller's account checks and the market's available cash.
Deposits and Share Issuance
The underlying asset and its OToken have different roles: USDB is the deposited asset, while oUSDB represents a share in its lending pool. Contract interaction requires a Blast-compatible wallet and enough ETH for gas. SpaceStation requires a listed market with minting unpaused before permitting a deposit.
The
OToken minting implementation
accrues interest before calculating the share conversion. Its calculation uses
actualMintAmount
, the underlying amount the transfer handler reports as received. In normalized token units,
shares minted = underlying received / exchange rate
.
Successful minting increases the supplier's OToken balance and total OToken supply. The
Mint
event records the received underlying amount and minted share quantity separately.
Share Balances and Underlying Value
An OToken count and its underlying-asset value use different units. The exchange rate expresses how much underlying each share represents, so lending interest can change the underlying value of a holding without increasing its share count.
- Share Balance
-
balanceOfreturns the account's OToken quantity. - Underlying Balance
-
balanceOfUnderlyingvalues those shares using the exchange rate. When executed as a transaction, it accrues interest before calculating the balance; it does not withdraw assets. - Stored and Accrued Rates
-
exchangeRateStoreduses stored accounting without first accruing additional interest.exchangeRateCurrentruns interest accrual before returning the rate.
The contract uses integer quantities and fixed-point scaling. Human-readable conversions require the market's token decimals and rate scaling to be accounted for. A calculated underlying balance does not establish how much cash is immediately available for redemption.
Redemption Inputs and Cash Limits
Redemption has two input forms in the published OToken implementation. Both accrue interest before the shared redemption calculation.
- OToken Quantity
-
The share-denominated path fixes how many shares to burn:
underlying returned = shares redeemed * exchange rate, with amounts expressed in normalized token units. - Underlying Amount
-
The underlying-denominated path fixes the asset amount to return:
shares burned = underlying requested / exchange rate, with the same unit normalization.
SpaceStation requires the redemption market to be listed. If the holder has entered that market, its account liquidity check rejects a redemption which would leave a collateral shortfall. If the holder has not entered the market, this branch skips that account liquidity calculation. The market's cash requirement still applies.
After controller permission and the accrual freshness check, OToken compares available underlying cash with the amount due. Insufficient cash produces
RedeemTransferOutNotPossible
. A successful redemption reduces the holder's shares and total share supply, transfers underlying to the redeemer, and emits a
Redeem
event containing both quantities.
Worked Example: A Redemption Blocked by Cash
Every amount, the exchange rate, and all account and market states in this example are hypothetical. Assume a listed USDB market, a Blast-compatible wallet with enough ETH for gas, an account holding 2,346 oUSDB, and successful controller and freshness checks. Available market cash is 57.16 USDB, which is insufficient for the intended redemption.
Share quantity: 2,346 oUSDB. Exchange rate: 0.025 USDB per oUSDB, after decimal normalization. The conversion is
2,346 * 0.025 = 58.65
USDB. A request to redeem 2,346 oUSDB and a request to receive 58.65 USDB therefore each require 58.65 USDB of market cash at this rate.
The cash shortfall is
58.65 - 57.16 = 1.49
USDB. Either request reaches
RedeemTransferOutNotPossible
; the reverted transaction leaves no underlying payout or share burn.
Now suppose a later state check finds 61.66 USDB of available cash, the exchange rate remains 0.025 USDB per oUSDB, and controller and freshness checks still pass. Either request passes the cash check. If the remaining balance checks and underlying transfer succeed, redemption returns 58.65 USDB and burns 2,346 oUSDB. The account then has no oUSDB remaining, and market cash is
61.66 - 58.65 = 3.01
USDB.
A changed exchange rate would alter the output of the share-denominated request or the share cost of the underlying-denominated request, so those conversions must be recalculated before a retry.
Share Transfers
An ERC-20 transfer moves OTokens between accounts without redeeming underlying assets. The published transfer path checks balances and applicable allowances, rejects self-transfers, and calls SpaceStation. Transfers must be unpaused, and the sender must pass the same redemption-permission check for the transferred share quantity. That check retains the market-membership distinction described above; transferring collateral can therefore be restricted even when the shares are present in the account.