Skip to content
Get started

Get analytics for current market state

analytics.market.get_current_state() -> MarketGetCurrentStateResponse
GET/api/v1/analytics/market/state

Get analytics for current market state

ReturnsExpand Collapse
class MarketGetCurrentStateResponse:
data: Data
assets: List[DataAsset]
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: str
group: Literal["native", "token"]
One of the following:
"native"
"token"
group_key: str
lend_interest_paid: str
borrower_account_active: int
formatuint64
minimum0
borrower_active: int
formatuint64
minimum0
flash_loan_volume_total: str
lender_active: int
formatuint64
minimum0
loans_originated: DataLoansOriginated

Analytics for accumulated value of originated loans

breakdown: List[DataLoansOriginatedBreakdown]
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: str
group: Literal["native", "token"]
One of the following:
"native"
"token"
group_key: str
value: Union[str, float]
One of the following:
str
float
total_value: Union[str, float]
One of the following:
str
float
error: None

Error data. Guaranteed null for successful response.

status: int

HTTP status. Successful responses are guaranteed to be < 400. Conversely, error responses are guaranteed to be >= 400.

formatuint16
minimum0
maximum65535
status_text: str

HTTP status text

Get analytics for current market state

from neptune_api_v2 import NeptuneAPIV2

client = NeptuneAPIV2()
response = client.analytics.market.get_current_state()
print(response.data)
{
  "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"
}
{
  "data": null,
  "error": {
    "kind": "internal",
    "scope": "server",
    "message": "An unexpected error occurred"
  },
  "status": 500,
  "status_text": "500 Internal Server Error"
}
Returns Examples
{
  "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"
}
{
  "data": null,
  "error": {
    "kind": "internal",
    "scope": "server",
    "message": "An unexpected error occurred"
  },
  "status": 500,
  "status_text": "500 Internal Server Error"
}