## Get historical borrowing rates for assets **get** `/api/v1/markets/borrow/rate-history` Get historical borrowing rates for assets ### Query Parameters - `end: number` End timestamp for interval range (inclusive) Must be provided as unix timestamp (in seconds) - `period: IntervalUnit` Interval period Values: - `h`: Hourly - `d`: Daily (accounts for offsets introduced by DST) - `w`: Weekly (provided for convenience, equivalent to 7d) - `m`: Monthly (accounts for varying \# of days per month) - `y`: Yearly (accounts for varying \# of days per year) E.g. for interval buckets of 2h `interval=2&period=h` - `"h"` - `"d"` - `"w"` - `"m"` - `"y"` - `start: number` Start timestamp for interval range (inclusive) Must be provided as unix timestamp (in seconds) - `asset_ids: optional string` Optional comma-separated list of asset IDs to filter for. If excluded, values will be returned for all assets. - `interval: optional number` Interval value E.g. for interval buckets of 2h: `interval=2&period=h` - `limit: optional number` Maximum number of time buckets/intervals to return. For responses with multiple series, this limit is applied to each series individually rather than accumulating across series. This is a limit of returned *interval sections*, it is **not** a limit of returned *points*. In other words, `limit=200` will provide 200 time points for a single series. For multi-series responses, each series will also see the exact same set of 200 time points. - `offset: optional number` Time series bucket offset ### Returns - `data: AssetRateHistory` Historical rates for assets - `pagination: object { interval_count, next_offset }` Values used for paginating the time series data - `interval_count: number` The total number of intervals/buckets for the provided interval parameters (size, period, start, end) - `next_offset: number` The offset a client should use to fetch the next page of intervals (so long as limit remains unchanged) - `range: object { end, interval, start }` Provides values for the requested range in it's entire width, regardless of page/limit. - `end: string` - `interval: Interval` Interval period & size - `unit: IntervalUnit` - `"h"` - `"d"` - `"w"` - `"m"` - `"y"` - `value: number` - `start: string` - `series: array of object { asset, points }` - `asset: AssetSpec` Provides a unique identifier for an asset for use throughout the Neptune API. IDs are unique across asset domains (contract tokens, native denoms, etc) - `id: string` - `group: "native" or "token"` - `"native"` - `"token"` - `group_key: string` - `points: array of object { t, v }` - `t: string` - `v: string` - `error: unknown` Error data. Guaranteed `null` for successful response. - `status: number` HTTP status. Successful responses are guaranteed to be < `400`. Conversely, error responses are guaranteed to be >= `400`. - `status_text: string` HTTP status text ### Example ```http curl https://api-v2.nept.finance/api/v1/markets/borrow/rate-history ``` #### Response ```json { "data": { "range": { "start": 1775173209, "end": 1775778009, "interval": { "value": 1, "unit": "d" } }, "series": [ { "asset": { "id": "native;inj", "group": "native", "group_key": "inj" }, "points": [ { "t": 1775173209, "v": "0.1" }, { "t": 1775259609, "v": "0.1" }, { "t": 1775346009, "v": "0.1" }, { "t": 1775432409, "v": "0.1" }, { "t": 1775518809, "v": "0.1" }, { "t": 1775605209, "v": "0.1" }, { "t": 1775691609, "v": "0.1" }, { "t": 1775778009, "v": "0.1" } ] } ], "pagination": { "next_offset": 200, "interval_count": 221 } }, "error": null, "status": 200, "status_text": "200 OK" } ```