# Analytics # Market ## Get analytics for current market state **get** `/api/v1/analytics/market/state` Get analytics for current market state ### Returns - `data: object { assets, borrower_account_active, borrower_active, 3 more }` - `assets: array of object { asset, lend_interest_paid }` - `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` - `lend_interest_paid: string` - `borrower_account_active: number` - `borrower_active: number` - `flash_loan_volume_total: string` - `lender_active: number` - `loans_originated: object { breakdown, total_value }` Analytics for accumulated value of originated loans - `breakdown: array of object { asset, value }` - `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) - `value: string or number` - `string` - `number` - `total_value: string or number` - `string` - `number` - `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/analytics/market/state ``` #### Response ```json { "data": { "borrower_active": 1000, "borrower_account_active": 1200, "lender_active": 1300, "loans_originated": { "total_value": "8.04", "breakdown": [ { "asset": { "id": "native;inj", "group": "native", "group_key": "inj" }, "value": "8.04" } ] }, "flash_loan_volume_total": "13270.54", "assets": [ { "asset": { "id": "native;inj", "group": "native", "group_key": "inj" }, "lend_interest_paid": "1853.23" } ] }, "error": null, "status": 200, "status_text": "200 OK" } ``` # History ## Get cumulative lending value history independent of assets **get** `/api/v1/analytics/market/history/loans-originated` Get cumulative lending value history independent of 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) - `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: object { pagination, points, range }` Historical cumulative lend value for assets - `pagination: object { interval_count, next_offset }` Pagination parameters for the interval response - `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) - `points: array of object { t, v }` - `t: string` - `v: string or number` - `string` - `number` - `range: object { end, interval, start }` Interval window parameters - `end: string` - `interval: Interval` Interval period & size - `unit: IntervalUnit` - `"h"` - `"d"` - `"w"` - `"m"` - `"y"` - `value: number` - `start: 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/analytics/market/history/loans-originated ``` #### Response ```json { "data": { "range": { "start": 1775173209, "end": 1775778009, "interval": { "value": 1, "unit": "d" } }, "points": [ { "t": 1775173209, "v": "0.100" }, { "t": 1775259609, "v": "0.100" }, { "t": 1775346009, "v": "0.100" }, { "t": 1775432409, "v": "0.100" }, { "t": 1775518809, "v": "0.100" }, { "t": 1775605209, "v": "0.100" }, { "t": 1775691609, "v": "0.100" }, { "t": 1775778009, "v": "0.100" } ], "pagination": { "next_offset": 200, "interval_count": 221 } }, "error": null, "status": 200, "status_text": "200 OK" } ``` ## Get loans originated history **get** `/api/v1/analytics/market/history/loans-originated/by-asset` Get loans originated history ### 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: object { pagination, range, series }` Historical cumulative lend value 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 or number` - `string` - `number` - `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/analytics/market/history/loans-originated/by-asset ``` #### 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.100" }, { "t": 1775259609, "v": "0.100" }, { "t": 1775346009, "v": "0.100" }, { "t": 1775432409, "v": "0.100" }, { "t": 1775518809, "v": "0.100" }, { "t": 1775605209, "v": "0.100" }, { "t": 1775691609, "v": "0.100" }, { "t": 1775778009, "v": "0.100" } ] } ], "pagination": { "next_offset": 200, "interval_count": 221 } }, "error": null, "status": 200, "status_text": "200 OK" } ``` # Nept ## Get distribution analytics for NEPT unlocks **get** `/api/v1/analytics/nept/unlocks-distribution` Get distribution analytics for NEPT unlocks ### Query Parameters - `with_percent: optional boolean` Calculate and include proportional percentages, where applicable - `with_text: optional boolean` Include text variation fields - `with_value: optional boolean` Calculate and include USD values for amounts, where applicable ### Returns - `data: object { groups }` - `groups: array of NeptUnlockDistributionGroup` - `amount: string` The sum of all token distribution unlock amounts for this group. This value is immutable and does not change with regards to expiry/reclamation/lock states. - `amount_claimable: string` The amount currently claimable This takes into account: reclamation, lock state, expiry, and previously claimed. In other words, this is an accurate representation of what the user can currently claim. - `amount_claimed: string` The amount that has already been successfully claimed by the user - `amount_expired: string` The amount that has expired. This will be the remaining unclaimed amount (if any) once the time specified by the `expires_at` is past (if one is set). **NOTE:** Reclaimed amouts take priority. - If the remaining amount is reclaimed prior to a configured `expires_at`, this will remain at 0 and will not change even after the `expires_at` time is reached. - `amount_held: string` The total amount of NEPT currently held by the addresses in this group. - `amount_locked: string` The total amount of NEPT currently time-locked. **NOTE:** This does not factor in reclaimed or expired states. - For linear unlock schedules: - This represents how much NEPT is time-locked by the `begins_at` and the `ends_at` properties. - For lump sum unlocks: - This will be the full amount prior to the `begins_at` unlock property. - Once the time indicated by the `begins_at` property has been reached, this value will be 0. - `amount_reclaimed: string` The amount that has been reclaimed from the unlock arrangement admin This will be the amount of the remaining unclaimed and locked at the time the reclaim is issued. - `amount_staked: string` The total amount of NEPT current staked by the addresses in this group. - `amount_unlocked: string` The total amount of NEPT currently unlocked **NOTE:** This does not factor in reclaimed or expired states. - For linear unlock schedules: - This represents the "progress" of unlocked NEPT from the time range between the `begins_at` and the `ends_at` properties. - For lump sum unlocks: - This will be 0 at any given time prior to the timestamp provided by the `begins_at` unlock property. - Once the time indicated by the `begins_at` property has been reached, this value will be the full amount of the unlock. - `extra: object { percent, text, value }` - `percent: object { amount_claimable, amount_claimed, amount_expired, 4 more }` Percentages for unlock amounts. These do not factor in the `amount_staked` or `amount_held` values. Will not be null when query param `with_percent` is `true`. - `amount_claimable: string` - `amount_claimed: string` - `amount_expired: string` - `amount_locked: string` - `amount_reclaimed: string` - `amount_unlocked: string` - `extra: object { text }` - `text: object { amount_claimable, amount_claimed, amount_expired, 3 more }` Human-readable variants of percentages for unlock amounts. Will not be null when query params `with_text` and `with_percent` are `true`. - `amount_claimable: string` - `amount_claimed: string` - `amount_expired: string` - `amount_locked: string` - `amount_reclaimed: string` - `amount_unlocked: string` - `text: object { amount, amount_claimable, amount_claimed, 7 more }` Human-readable field variants. Will not be null when query param `with_text` is `true`. - `amount: string` - `amount_claimable: string` - `amount_claimed: string` - `amount_expired: string` - `amount_held: string` - `amount_locked: string` - `amount_reclaimed: string` - `amount_staked: string` - `amount_unlocked: string` - `member_class: string` - `value: object { amount, amount_claimable, amount_claimed, 8 more }` USD values for the corresponding amounts above. Will not be null when query param `with_value` is `true`. ### Note This variant group contains an additional `price` field (set to the number used in value calculation). The embedded text group will contain the text variant if `with_text` was specified as well. - `amount: string` - `amount_claimable: string` - `amount_claimed: string` - `amount_expired: string` - `amount_held: string` - `amount_locked: string` - `amount_reclaimed: string` - `amount_staked: string` - `amount_unlocked: string` - `extra: object { text }` - `text: object { amount, amount_claimable, amount_claimed, 7 more }` Human-readable variants of USD values. Will not be null when query params `with_text` and `with_value` are `true`. - `amount: string` - `amount_claimable: string` - `amount_claimed: string` - `amount_expired: string` - `amount_held: string` - `amount_locked: string` - `amount_reclaimed: string` - `amount_staked: string` - `amount_unlocked: string` - `price: string` Text representation of price - `price: string` Price used in value calculations - `member_class: "team" or "advisor" or "investor"` The group category - `"team"` - `"advisor"` - `"investor"` - `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/analytics/nept/unlocks-distribution ``` #### Response ```json { "data": { "groups": [ { "member_class": "team", "amount": "4000000000000", "amount_claimed": "1284964220023", "amount_claimable": "258879821935", "amount_unlocked": "1543844041957", "amount_locked": "2456155958043", "amount_reclaimed": "0", "amount_expired": "0", "amount_staked": "705873408356", "amount_held": "630912490948", "extra": { "text": { "amount_expired": "0.0000 NEPT", "amount_held": "630,912.4909 NEPT", "amount_claimable": "258,879.8219 NEPT", "amount_locked": "2,456,155.9580 NEPT", "amount_reclaimed": "0.0000 NEPT", "amount_unlocked": "1,543,844.0419 NEPT", "amount_claimed": "1,284,964.2200 NEPT", "amount": "4,000,000.0000 NEPT", "member_class": "Team", "amount_staked": "705,873.4083 NEPT" }, "percent": { "amount_claimable": "0.06471995548375", "amount_claimed": "0.32124105500575", "amount_reclaimed": "0", "amount_unlocked": "0.38596101048925", "amount_expired": "0", "amount_locked": "0.61403898951075", "extra": { "text": { "amount_expired": "0.00%", "amount_claimable": "6.47%", "amount_locked": "61.40%", "amount_claimed": "32.12%", "amount_unlocked": "38.59%", "amount_reclaimed": "0.00%" } } }, "value": { "amount_claimed": "41871.533695594570455504", "amount_held": "20558.762035590247713798", "amount_reclaimed": "0", "price": "0.032585758453916404", "amount_unlocked": "50307.329041728784267946", "amount": "130343.033815665616", "amount_expired": "0", "amount_staked": "23001.420383731313048179", "amount_claimable": "8435.795346166799570895", "amount_locked": "80035.704773936831732053", "extra": { "text": { "amount_locked": "$80,035.70", "amount_unlocked": "$50,307.32", "amount_expired": "$0.00", "price": "$0.03", "amount_claimed": "$41,871.53", "amount_claimable": "$8,435.79", "amount_reclaimed": "$0.00", "amount_staked": "$23,001.42", "amount": "$130,343.03", "amount_held": "$20,558.76" } } } } }, { "member_class": "advisor", "amount": "4000000000000", "amount_claimed": "1284964220023", "amount_claimable": "258879821935", "amount_unlocked": "1543844041957", "amount_locked": "2456155958043", "amount_reclaimed": "0", "amount_expired": "0", "amount_staked": "705873408356", "amount_held": "630912490948", "extra": { "text": { "amount_expired": "0.0000 NEPT", "amount_held": "630,912.4909 NEPT", "amount_claimable": "258,879.8219 NEPT", "amount_locked": "2,456,155.9580 NEPT", "amount_reclaimed": "0.0000 NEPT", "amount_unlocked": "1,543,844.0419 NEPT", "amount_claimed": "1,284,964.2200 NEPT", "amount": "4,000,000.0000 NEPT", "member_class": "Advisor", "amount_staked": "705,873.4083 NEPT" }, "percent": { "amount_claimable": "0.06471995548375", "amount_claimed": "0.32124105500575", "amount_reclaimed": "0", "amount_unlocked": "0.38596101048925", "amount_expired": "0", "amount_locked": "0.61403898951075", "extra": { "text": { "amount_expired": "0.00%", "amount_claimable": "6.47%", "amount_locked": "61.40%", "amount_claimed": "32.12%", "amount_unlocked": "38.59%", "amount_reclaimed": "0.00%" } } }, "value": { "amount_claimed": "41871.533695594570455504", "amount_held": "20558.762035590247713798", "amount_reclaimed": "0", "price": "0.032585758453916404", "amount_unlocked": "50307.329041728784267946", "amount": "130343.033815665616", "amount_expired": "0", "amount_staked": "23001.420383731313048179", "amount_claimable": "8435.795346166799570895", "amount_locked": "80035.704773936831732053", "extra": { "text": { "amount_locked": "$80,035.70", "amount_unlocked": "$50,307.32", "amount_expired": "$0.00", "price": "$0.03", "amount_claimed": "$41,871.53", "amount_claimable": "$8,435.79", "amount_reclaimed": "$0.00", "amount_staked": "$23,001.42", "amount": "$130,343.03", "amount_held": "$20,558.76" } } } } }, { "member_class": "investor", "amount": "4000000000000", "amount_claimed": "1284964220023", "amount_claimable": "258879821935", "amount_unlocked": "1543844041957", "amount_locked": "2456155958043", "amount_reclaimed": "0", "amount_expired": "0", "amount_staked": "705873408356", "amount_held": "630912490948", "extra": { "text": { "amount_expired": "0.0000 NEPT", "amount_held": "630,912.4909 NEPT", "amount_claimable": "258,879.8219 NEPT", "amount_locked": "2,456,155.9580 NEPT", "amount_reclaimed": "0.0000 NEPT", "amount_unlocked": "1,543,844.0419 NEPT", "amount_claimed": "1,284,964.2200 NEPT", "amount": "4,000,000.0000 NEPT", "member_class": "Investor", "amount_staked": "705,873.4083 NEPT" }, "percent": { "amount_claimable": "0.06471995548375", "amount_claimed": "0.32124105500575", "amount_reclaimed": "0", "amount_unlocked": "0.38596101048925", "amount_expired": "0", "amount_locked": "0.61403898951075", "extra": { "text": { "amount_expired": "0.00%", "amount_claimable": "6.47%", "amount_locked": "61.40%", "amount_claimed": "32.12%", "amount_unlocked": "38.59%", "amount_reclaimed": "0.00%" } } }, "value": { "amount_claimed": "41871.533695594570455504", "amount_held": "20558.762035590247713798", "amount_reclaimed": "0", "price": "0.032585758453916404", "amount_unlocked": "50307.329041728784267946", "amount": "130343.033815665616", "amount_expired": "0", "amount_staked": "23001.420383731313048179", "amount_claimable": "8435.795346166799570895", "amount_locked": "80035.704773936831732053", "extra": { "text": { "amount_locked": "$80,035.70", "amount_unlocked": "$50,307.32", "amount_expired": "$0.00", "price": "$0.03", "amount_claimed": "$41,871.53", "amount_claimable": "$8,435.79", "amount_reclaimed": "$0.00", "amount_staked": "$23,001.42", "amount": "$130,343.03", "amount_held": "$20,558.76" } } } } } ] }, "error": null, "status": 200, "status_text": "200 OK" } ```