GET: /otoken

The oToken service retrieves information about an oToken. You can use this API to find out the values of interest rates.

OTokenRequest

The request to the oToken API can specify a number filters, such as which tokens to retrieve information about or moment in time. The following shows an example set of request parameters in JSON:

{
  "addresses": [] // returns all tokens if empty or not included
}
TypeKeyDescription

repeated string

addresses

List of token addresses to filter on, e.g.: ["0x...", ,"0x..."]

OTokenResponse

The oToken API returns an overall picture of oTokens matching the filter.

{
    "status": true,
    "data": {
        "xcnRate": "755208333333333520000",
        "dailyXcn": "4350000000000001075200000",
        "markets": [
            {
                "address": "0x714bd93ab6ab2f0bcfd2aeaf46a46719991d0d79",
                "symbol": "oETH",
                "name": "Onyx ETH",
                "underlyingAddress": null,
                "underlyingName": "ETH",
                "underlyingSymbol": "ETH",
                "xcnSpeeds": "0",
                "borrowerDailyXcn": "250000000000000128000000",
                "supplierDailyXcn": "250000000000000128000000",
                "xcnBorrowIndex": "101563446326140875638831300206417315703149",
                "xcnSupplyIndex": "12532288825800014126933188668761818197120128330832",
                "borrowRatePerBlock": "59881606925",
                "supplyRatePerBlock": "22546375746",
                "exchangeRate": "214836930735054681502184596",
                "underlyingPrice": "1659515600000000000000",
                "totalBorrows": "387561505267644545154",
                "totalBorrows2": "387.561505267644545154",
                "totalBorrowsUsd": "643164.363951138297937967",
                "totalSupply": "3832080662993",
                "totalSupply2": "38320.80662993",
                "totalSupplyUsd": "1366233.470450710467814039",
                "cash": "450403105212363562806",
                "totalReserves": "14662467902350476667",
                "reserveFactor": "200000000000000000",
                "collateralFactor": "800000000000000000",
                "borrowApy": "13.374750871510309211",
                "supplyApy": "4.840353471504475547",
                "borrowXcnApy": "12.756653694026939461",
                "supplyXcnApy": "5.815295060669746236",
                "liquidity": "747450.979388358645348136",
                "tokenPrice": "1659.5156",
                "totalDistributed": "21716087",
                "totalDistributed2": "21716087557387345448583890",
                "lastCalculatedBlockNumber": 18938839,
                "borrowerCount": 7,
                "supplierCount": 33,
                "mintGuardianPaused": false,
                "xcnSupplySpeeds": "43402777777777800000",
                "xcnBorrowSpeeds": "43402777777777800000",
                "underlyingDecimal": 18,
                "exchangeRate2": "46.54693197200993211181",
                "supplyCap": "0",
                "borrowCap": "0",
                "marketVolumeLog": {
                    "id": "ddfd509d-f789-4de9-b5a2-8ebe13309491",
                    "address": "0x714bd93ab6ab2f0bcfd2aeaf46a46719991d0d79",
                    "totalSupplyUsd": "1366229.250964562897913568",
                    "totalBorrowsUsd": "643159.089593453835562377",
                    "totalSupplyUsd24h": "16039.065784827014266023",
                    "totalBorrowsUsd24h": "7376.878055510907736948",
                    "blockNumber": 17948973,
                    "createdAt": "2023-08-19T13:00:00.000Z",
                    "updatedAt": "2023-08-19T13:00:00.000Z"
                }
            }
        ],
        "reserves": "69407.420914498200482794",
        "request": {
            "addresses": [
                "0x714bd93ab6ab2f0bcfd2aeaf46a46719991d0d79"
            ]
        },
        "marketVolumeLog": {
            "id": "1263a79f-fc22-423b-9ba4-bbc65d48f6ed",
            "address": null,
            "totalSupplyUsd": "10218660.24659954546743954",
            "totalBorrowsUsd": "6591584.210050754293459327",
            "totalSupplyUsd24h": "39847.341215374385430699",
            "totalBorrowsUsd24h": "8028.947397970366342879",
            "blockNumber": 17948973,
            "createdAt": "2023-08-19T13:00:00.000Z",
            "updatedAt": "2023-08-19T13:00:00.000Z"
        },
        "borrowerCount": 90,
        "supplierCount": 216,
        "offset": 0,
        "limit": 100,
        "total": 1
    }
}
TypeKeyDescription

bool

status

If set false, indicates an error returning data

Struct

data

The result matching the requested filter. See OTokenResponseData

OTokenResponseData

TypeKeyDescription

string

xcnRate

XCN speed per block

string

dailyXcn

Daily xcn distribution amount

uint32

borrowerCount

Borrower count

uint32

supplierCount

Supplier count

string

reserves

Total reserves in treasury in USD

Struct

request

The request parameters are echoed in the response. See OTokenRequest

Struct

marketVolumeLog

Market volume data. See MarketVolumeData

repeated Market

markets

The list of Market (see Market) matching the requested filter

Market

This includes a list of oTokens contextualized to the full market.

TypeKeyDescription

bytes

address

The public Ethereum address of the oToken

string

symbol

The symbol of the oToken

string

name

The name of the oToken

bytes

underlyingAddress

The address of the underlying token

string

underlyingName

The name of the underlying token

string

underlyingSymbol

The symbol of the underlying token

string

xcnSpeeds

XCN speed per block

string

borrowerDailyXcn

Borrower daily XCN

string

supplierDailyXcn

Supplier daily XCN

string

xcnBorrowIndex

XCN borrow index

string

xcnSupplyIndex

XCN supply index

string

borrowRatePerBlock

The floating borrow interest rate

string

supplyRatePerBlock

The floating supply interest rate

string

exchangeRate

The oToken / underlying exchange rate. This rate increases over time as supply interest accrues.

string

underlyingPrice

The price of the underlying token in ETH

string

totalBorrows

The amount of underlying tokens borrowed from the oToken

string

totalBorrows2

The amount of underlying tokens borrowed from the oToken handled by decimals

string

totalBorrowsUsd

The USD amount of underlying tokens borrowed from the oToken

string

totalSupply

The number of oTokens in existence

string

totalSupply2

The number of oTokens in existence handled by decimals

string

totalSupplyUsd

The USD amount of oTokens in existence

string

cash

The current liquidity of the oToken

string

totalReserves

Total reserves

string

reserveFactor

Reserve factor

string

collateralFactor

The amount of the value of the underlying token that will count as collateral. eg. oEth with collataral factor 0.75 means 1 ETH of supply allows 0.75 ETH of borrowing

string

borrowApy

Borrow APY

string

supplyApy

Supply APY

string

borrowXcnApy

The floating XCN APY for borrowing this token

string

supplyXcnApy

The floating XCN APY for supplying this token

string

liquidity

Liquidity amount

string

tokenPrice

oToken price

string

totalDistributed

Total distributed XCN amount

string

totalDistributed2

Total distributed XCN amount handled by decimals

uint32

lastCalculatedBlockNumber

Last block number to update market data

uint32

borrowerCount

The number of accounts with outstanding borrows

uint32

supplierCount

The number of accounts holding this oToken

bool

mintGuardianPaused

Is mint guardian paused

string

xcnSupplySpeeds

XCN supply speeds

string

xcnBorrowSpeeds

XCN borrow speeds

uint32

underlyingDecimal

Decimal places for underlying token

string

exchangeRate2

Exchange rate handled by decimals

string

supplyCap

Maximum possible supply

string

borrowCap

Maximum possible borrow

MarketVolumeData

marketVolumeLog

Market volume data

MarketVolumeData

TypeKeyDescription

string

id

Unique id of MarketVolumeData

string

address

The public Ethereum address of the oToken

string

totalSupplyUsd

Total supply USD

string

totalBorrowsUsd

Total borrows USD

string

totalSupplyUsd24h

24hr change of total supply USD

string

totalBorrowsUsd24h

24hr change of total borrow USD

uint32

blockNumber

Last calculated block number

Timestamp

createdAt

Created timestamp

Timestamp

updatedAt

Updated timestamp

Last updated