GET: /market_history/graph

The market history service retrieves historical information about a market. You can use this API to find out the values of interest rates at a certain point in time. Its especially useful for making charts and graphs of the time-series values.

MarketHistoryGraphRequest

The market history graph API returns information about a market between two timestamps. The requestor can choose the asset and number of buckets to return within the range. For example:

{
 "asset": "0x714bd93ab6ab2f0bcfd2aeaf46a46719991d0d79",
 "type": "1day",
 "offset": 0,
 "limit": 100
}
Type
Key
Description

bytes

asset

The requested asset

string

type

Graph log interval. Enum["1day", "1hr"]

uint32

offset

Offset of pagination. Default: 0

uint32

limit

Limit of pagination. Max: 365

MarketHistoryGraphResponse

The market history graph API response contains the rates for both suppliers and borrowers, as well as the sequence of total supply and borrows for the given market.

Type
Key
Description

bool

status

If set false, indicates an error returning data

Struct

data

Market history graph data. See MarketHistoryGraphData

MarketHistoryGraphData

Type
Key
Description

uint32

limit

Limit of pagination

uint32

total

Total count of data

repeated MarketHistoryGraph

result

The list of MarketHistoryGraph

MarketHistoryGraph

Type
Key
Description

string

id

Unique id of History record

string

asset

Asset address

uint32

blockNumber

Block number of graph history

uint32

blockTimestamp

Unix block timestamp

string

borrowApy

Borrow APY

string

supplyApy

Supply APY

string

borrowXcnApy

Borrow XCN APY

string

supplyXcnApy

Supply XCN APY

string

exchangeRate

Exchange rate

string

priceUSD

USD price of asset

string

totalBorrow

Total borrow amount

string

totalSupply

Total supply amount

Timestamp

createdAt

Created timestamp

Timestamp

updatedAt

Updated timestamp

Last updated