# Markets ## Get market overview `markets.get_overview(MarketGetOverviewParams**kwargs) -> MarketGetOverviewResponse` **get** `/api/v1/markets` Get market overview ### Parameters - `with_text: Optional[bool]` Include text variation fields - `with_value: Optional[bool]` Calculate and include USD values for amounts, where applicable ### Returns - `class MarketGetOverviewResponse: …` - `data: Data` - `borrow: BorrowMarketOverview` Borrow market overview - `collaterals: List[BorrowCollateralMarket]` Borrowing collateral markets - `asset_info: AssetInfo` Asset identifiers with associated metadata - `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"]` - `"native"` - `"token"` - `group_key: str` - `classification: AssetClassification` The asset's classification metadata. Assets are classfied to provide context on their usage throughout the Neptune API (e.g. regular assets, neptune receipt tokens, LSTs, etc.) Each asset belongs to only a single classification type. This object contains metadata pertaining to the given classification. While some fields may be common among the distinct classifcations, each classification is distinct and subject to independent change. - `class Regular: …` - `kind: Literal["regular"]` - `"regular"` - `neptune_receipt_asset: Optional[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) - `class NeptuneReceiptToken: …` - `kind: Literal["neptune_receipt_token"]` - `"neptune_receipt_token"` - `origin_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) - `class LiquidStakingToken: …` - `kind: Literal["liquid_staking_token"]` - `"liquid_staking_token"` - `origin_asset: Optional[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) - `metadata: AssetMetadata` Additional metadata for assets - `decimals_denom: int` Denom exponent, or num. of decimal places that shift between denom/standard amounts (e.g. `18` for `INJ`) - `decimals_display: int` Number of decimals used when displaying amounts of this asset (this is subjective and used for generating text representations) - `name: str` Full name of the asset - `symbol: str` Symbol of the asset, e.g.: `NEPT` `INJ` - `symbol_denom: str` Denom symbol for the asset (e.g. `inj` for `INJ`, `sat` for `BTC`) - `config: BorrowCollateralConfig` Collateral configuration parameters - `allowable_ltv: str` The loan to value ratio at which we allow collateral withdrawals or borrows. - `collateral_cap: Optional[str]` The optional, global/shared maximum deposit limit for this collateral. - `enabled: bool` Collateral enabled state - `extra: Extra` - `text: Optional[ExtraText]` Human-readable field variants. Will not be null when query param `with_text` is `true`. - `allowable_ltv: str` - `collateral_cap: str` - `liquidation_ltv: str` - `max_discount: str` - `min_discount: str` - `value: Optional[ExtraValue]` 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. - `collateral_cap: Optional[str]` - `extra: ExtraValueExtra` - `text: Optional[ExtraValueExtraText]` Human-readable variants of USD values. Will not be null when query params `with_text` and `with_value` are `true`. - `collateral_cap: Optional[str]` - `price: Optional[str]` Text representation of price - `price: str` Price used in value calculations - `liquidation_ltv: str` The loan to value ratio at which the collateral can be liquidated. - `max_discount: str` The maximum dynamic discount - `min_discount: str` The minimum dynamic discount. - `state: BorrowCollateralState` Current collateral state - `balance: str` - `collateral_sum: str` Total amount of this asset which is actively collateralized - `extra: Extra` - `text: Optional[ExtraText]` Human-readable field variants. Will not be null when query param `with_text` is `true`. - `collateral_sum: str` - `value: Optional[ExtraValue]` 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. - `collateral_sum: str` - `extra: ExtraValueExtra` - `text: Optional[ExtraValueExtraText]` Human-readable variants of USD values. Will not be null when query params `with_text` and `with_value` are `true`. - `collateral_sum: str` - `price: str` Text representation of price - `price: str` Price used in value calculations - `debts: List[BorrowDebtMarket]` Borrowing debt markets - `asset_info: AssetInfo` Asset identifiers with associated metadata - `config: BorrowDebtConfig` Debt market configuration parameters - `borrow_cap: Optional[str]` The global max amount which can be borrowed - `borrow_halt_utilization: str` The maximum utilization ratio at which new borrow positions can be opened. - `enabled: bool` Market enabled state - `extra: Extra` - `text: Optional[ExtraText]` Human-readable field variants. Will not be null when query param `with_text` is `true`. - `borrow_cap: str` - `borrow_halt_utilization: str` - `interest_fee: str` - `value: Optional[ExtraValue]` 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. - `borrow_cap: Optional[str]` - `extra: ExtraValueExtra` - `text: Optional[ExtraValueExtraText]` Human-readable variants of USD values. Will not be null when query params `with_text` and `with_value` are `true`. - `borrow_cap: Optional[str]` - `price: Optional[str]` Text representation of price - `price: str` Price used in value calculations - `interest_fee: str` The protocol (base) interest rate that is charged to borrowers. - `rate: MarketRate` Market rates - `apr: str` Market rate in APR standard as a decimal percentage - `apy: str` Market rate in APY standard as a decimal percentage - `extra: Extra` - `text: Optional[ExtraText]` Human-readable field variants. Will not be null when query param `with_text` is `true`. - `apr: str` - `apy: str` - `state: BorrowDebtState` Current debt market state - `balance_sum: str` - `extra: Extra` - `text: Optional[ExtraText]` Human-readable field variants. Will not be null when query param `with_text` is `true`. - `balance_sum: str` - `principal_sum: str` - `time_last_distributed_interest: str` - `value: Optional[ExtraValue]` 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. - `balance_sum: str` - `extra: ExtraValueExtra` - `text: Optional[ExtraValueExtraText]` Human-readable variants of USD values. Will not be null when query params `with_text` and `with_value` are `true`. - `balance_sum: str` - `price: str` Text representation of price - `principal_sum: str` - `price: str` Price used in value calculations - `principal_sum: str` - `principal_sum: str` - `time_last_distributed_interest: datetime` Timestamp used to keep track of the last time interest was distributed. - `utilization_accumulator: str` Asset utilization tracker. - `global_config: GlobalMarketConfig` Market runtime parameters - `dynamic_discount_width: str` The required change in account health below 1.0 to achieve the maximum discount. should be ~= 0.02 must be <= 1.0 - `extra: Extra` - `text: Optional[ExtraText]` Human-readable field variants. Will not be null when query param `with_text` is `true`. - `flash_loan_fee: str` - `liquidation_fee: str` - `stake_collateral_ratio: str` - `stake_flash_loan_ratio: str` - `staking_health_modifier: str` - `time_window_nanos: str` - `flash_loan_fee: str` The coefficient used to calculate the flash loan fee. should be ~= 0.01 must be <= 1.0 - `flash_loans_enabled: bool` Whether flash loans are enabled or not - `hinj: 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) - `liquidation_fee: str` The coefficient use to calculate the liquidation protocol fee. should be ~= 0.01 must be <= 1.0 - `nept: 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) - `partial_liquidation_threshold: str` Minimum account value to avoid complete liquidation. - `stake_collateral_ratio: str` The required ratio of weighted staked NEPT to collateral value to obtain the maximum staking health modifier. should be ~= 0.1 must be <= 1.0 - `stake_flash_loan_ratio: str` The required ratio of weighted staked NEPT to flash loan value should be ~= 0.05 must be <= 1.0 - `staking_health_modifier: str` The maximum health increase provided by staking. should be ~= 0.05 and must be <= 1.0 - `target_liquidation_health: str` The account health target for a liquidation. should be ~= 1.02 must be >= 1.0 - `time_window_nanos: int` Number of nanoseconds that an oracle price is valid for. - `lend: List[LendMarket]` Current lending markets - `asset_info: AssetInfo` Asset identifiers with associated metadata - `rate: MarketRate` Lending market rates - `state: LendMarketState` Current lending market state - `extra: Extra` - `text: Optional[ExtraText]` Human-readable field variants. Will not be null when query param `with_text` is `true`. - `principal_sum: str` - `receipt_total_supply: str` - `redemption_ratio: str` - `value: Optional[ExtraValue]` 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. - `extra: ExtraValueExtra` - `text: Optional[ExtraValueExtraText]` Human-readable variants of USD values. Will not be null when query params `with_text` and `with_value` are `true`. - `price: str` Text representation of price - `principal_sum: str` - `price: str` Price used in value calculations - `principal_sum: str` - `principal_sum: str` The total amount of the asset deposited for lending in the market. - `receipt_total_supply: str` - `redemption_ratio: str` - `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`. - `status_text: str` HTTP status text ### Example ```python from neptune_api_v2 import NeptuneAPIV2 client = NeptuneAPIV2() response = client.markets.get_overview() print(response.data) ``` #### Response ```json { "data": { "borrow": { "collaterals": [ { "asset_info": { "asset": { "id": "native;inj", "group": "native", "group_key": "inj" }, "metadata": { "name": "Injective", "symbol": "INJ", "symbol_denom": "inj", "decimals_denom": 18, "decimals_display": 4 }, "classification": { "kind": "regular", "neptune_receipt_asset": { "id": "token;inj1rmzufd7h09sqfrre5dtvu5d09ta7c0t4jzkr2f", "group": "token", "group_key": "inj1rmzufd7h09sqfrre5dtvu5d09ta7c0t4jzkr2f" } } }, "config": { "enabled": true, "collateral_cap": null, "allowable_ltv": "0.1", "liquidation_ltv": "0.7", "min_discount": "0.14", "max_discount": "0.16", "extra": { "text": { "min_discount": "14.00%", "allowable_ltv": "10.00%", "collateral_cap": "", "liquidation_ltv": "70.00%", "max_discount": "16.00%" }, "value": { "collateral_cap": null, "price": "2.99835", "extra": { "text": { "collateral_cap": null, "price": "$2.99" } } } } }, "state": { "collateral_sum": "6180241490831", "balance": "9382050415759", "extra": { "text": { "collateral_sum": "0.0000 INJ" }, "value": { "collateral_sum": "0.000018530527074033", "price": "2.99835", "extra": { "text": { "collateral_sum": "$0.00", "price": "$2.99" } } } } } } ], "debts": [ { "asset_info": { "asset": { "id": "native;inj", "group": "native", "group_key": "inj" }, "metadata": { "name": "Injective", "symbol": "INJ", "symbol_denom": "inj", "decimals_denom": 18, "decimals_display": 4 }, "classification": { "kind": "regular", "neptune_receipt_asset": { "id": "token;inj1rmzufd7h09sqfrre5dtvu5d09ta7c0t4jzkr2f", "group": "token", "group_key": "inj1rmzufd7h09sqfrre5dtvu5d09ta7c0t4jzkr2f" } } }, "rate": { "apr": "0.14518382", "apy": "0.15625209", "extra": { "text": { "apy": "15.62%", "apr": "14.51%" } } }, "config": { "enabled": true, "borrow_cap": null, "interest_fee": "0.01", "borrow_halt_utilization": "0.9", "extra": { "text": { "borrow_halt_utilization": "90.00%", "borrow_cap": "", "interest_fee": "1.00%" }, "value": { "price": "2.99835", "borrow_cap": null, "extra": { "text": { "price": "$2.99", "borrow_cap": null } } } } }, "state": { "principal_sum": "2190668192100", "balance_sum": "9480370588217", "utilization_accumulator": "14477.460769891826922505", "time_last_distributed_interest": "2026-04-09T22:40:09.135634100Z", "extra": { "text": { "time_last_distributed_interest": "2026-04-09 10:40:09 PM +00:00", "principal_sum": "0.0000 INJ", "balance_sum": "0.0000 INJ" }, "value": { "principal_sum": "0.000006568389973783", "balance_sum": "0.00002842546915318", "price": "2.99835", "extra": { "text": { "price": "$2.99", "principal_sum": "$0.00", "balance_sum": "$0.00" } } } } } } ] }, "lend": [ { "asset_info": { "asset": { "id": "native;inj", "group": "native", "group_key": "inj" }, "metadata": { "name": "Injective", "symbol": "INJ", "symbol_denom": "inj", "decimals_denom": 18, "decimals_display": 4 }, "classification": { "kind": "regular", "neptune_receipt_asset": { "id": "token;inj1rmzufd7h09sqfrre5dtvu5d09ta7c0t4jzkr2f", "group": "token", "group_key": "inj1rmzufd7h09sqfrre5dtvu5d09ta7c0t4jzkr2f" } } }, "rate": { "apr": "0.09464221", "apy": "0.09926548", "extra": { "text": { "apy": "9.92%", "apr": "9.46%" } } }, "state": { "principal_sum": "425740748412504991838699", "receipt_total_supply": "396952939907783847231686", "redemption_ratio": "1.072521968249961422", "extra": { "text": { "redemption_ratio": "1.0725", "receipt_total_supply": "396,952.9399 nINJ", "principal_sum": "425,740.7484 INJ" }, "value": { "price": "2.99835", "principal_sum": "1276519.773002634342279563", "extra": { "text": { "price": "$2.99", "principal_sum": "$1,276,519.77" } } } } } } ], "global_config": { "time_window_nanos": 3600000000000, "partial_liquidation_threshold": "1000000000000000000000", "target_liquidation_health": "1.03", "liquidation_fee": "0", "flash_loans_enabled": true, "flash_loan_fee": "0", "staking_health_modifier": "0.03", "stake_collateral_ratio": "0.1", "stake_flash_loan_ratio": "0.1", "dynamic_discount_width": "0.01", "hinj": { "id": "token;inj18luqttqyckgpddndh8hvaq25d5nfwjc78m56lc", "group": "token", "group_key": "inj18luqttqyckgpddndh8hvaq25d5nfwjc78m56lc" }, "nept": { "id": "native;factory/inj1v3a4zznudwpukpr8y987pu5gnh4xuf7v36jhva/nept", "group": "native", "group_key": "factory/inj1v3a4zznudwpukpr8y987pu5gnh4xuf7v36jhva/nept" }, "extra": { "text": { "time_window_nanos": "1 hour", "flash_loan_fee": "0%", "staking_health_modifier": "3%", "stake_flash_loan_ratio": "10%", "stake_collateral_ratio": "10%", "liquidation_fee": "0%" } } } }, "error": null, "status": 200, "status_text": "200 OK" } ``` ## Get market params `markets.get_params(MarketGetParamsParams**kwargs) -> MarketGetParamsResponse` **get** `/api/v1/markets/config` Get market params ### Parameters - `with_text: Optional[bool]` Include text variation fields ### Returns - `class MarketGetParamsResponse: …` - `data: GlobalMarketConfig` - `dynamic_discount_width: str` The required change in account health below 1.0 to achieve the maximum discount. should be ~= 0.02 must be <= 1.0 - `extra: Extra` - `text: Optional[ExtraText]` Human-readable field variants. Will not be null when query param `with_text` is `true`. - `flash_loan_fee: str` - `liquidation_fee: str` - `stake_collateral_ratio: str` - `stake_flash_loan_ratio: str` - `staking_health_modifier: str` - `time_window_nanos: str` - `flash_loan_fee: str` The coefficient used to calculate the flash loan fee. should be ~= 0.01 must be <= 1.0 - `flash_loans_enabled: bool` Whether flash loans are enabled or not - `hinj: 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"]` - `"native"` - `"token"` - `group_key: str` - `liquidation_fee: str` The coefficient use to calculate the liquidation protocol fee. should be ~= 0.01 must be <= 1.0 - `nept: 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) - `partial_liquidation_threshold: str` Minimum account value to avoid complete liquidation. - `stake_collateral_ratio: str` The required ratio of weighted staked NEPT to collateral value to obtain the maximum staking health modifier. should be ~= 0.1 must be <= 1.0 - `stake_flash_loan_ratio: str` The required ratio of weighted staked NEPT to flash loan value should be ~= 0.05 must be <= 1.0 - `staking_health_modifier: str` The maximum health increase provided by staking. should be ~= 0.05 and must be <= 1.0 - `target_liquidation_health: str` The account health target for a liquidation. should be ~= 1.02 must be >= 1.0 - `time_window_nanos: int` Number of nanoseconds that an oracle price is valid for. - `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`. - `status_text: str` HTTP status text ### Example ```python from neptune_api_v2 import NeptuneAPIV2 client = NeptuneAPIV2() response = client.markets.get_params() print(response.data) ``` #### Response ```json { "data": { "time_window_nanos": 3600000000000, "partial_liquidation_threshold": "1000000000000000000000", "target_liquidation_health": "1.03", "liquidation_fee": "0", "flash_loans_enabled": true, "flash_loan_fee": "0", "staking_health_modifier": "0.03", "stake_collateral_ratio": "0.1", "stake_flash_loan_ratio": "0.1", "dynamic_discount_width": "0.01", "hinj": { "id": "token;inj18luqttqyckgpddndh8hvaq25d5nfwjc78m56lc", "group": "token", "group_key": "inj18luqttqyckgpddndh8hvaq25d5nfwjc78m56lc" }, "nept": { "id": "native;factory/inj1v3a4zznudwpukpr8y987pu5gnh4xuf7v36jhva/nept", "group": "native", "group_key": "factory/inj1v3a4zznudwpukpr8y987pu5gnh4xuf7v36jhva/nept" }, "extra": { "text": { "time_window_nanos": "1 hour", "flash_loan_fee": "0%", "staking_health_modifier": "3%", "stake_flash_loan_ratio": "10%", "stake_collateral_ratio": "10%", "liquidation_fee": "0%" } } }, "error": null, "status": 200, "status_text": "200 OK" } ``` ## Get lend/collateral/debt grouped by asset `markets.get_merged(MarketGetMergedParams**kwargs) -> MarketGetMergedResponse` **get** `/api/v1/markets/merged` Get lend/collateral/debt grouped by asset ### Parameters - `with_text: Optional[bool]` Include text variation fields - `with_value: Optional[bool]` Calculate and include USD values for amounts, where applicable ### Returns - `class MarketGetMergedResponse: …` - `count: int` Total number of objects irrespective of any pagination parameters. - `data: List[MergedMarket]` - `asset_info: AssetInfo` Asset identifiers with associated metadata - `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"]` - `"native"` - `"token"` - `group_key: str` - `classification: AssetClassification` The asset's classification metadata. Assets are classfied to provide context on their usage throughout the Neptune API (e.g. regular assets, neptune receipt tokens, LSTs, etc.) Each asset belongs to only a single classification type. This object contains metadata pertaining to the given classification. While some fields may be common among the distinct classifcations, each classification is distinct and subject to independent change. - `class Regular: …` - `kind: Literal["regular"]` - `"regular"` - `neptune_receipt_asset: Optional[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) - `class NeptuneReceiptToken: …` - `kind: Literal["neptune_receipt_token"]` - `"neptune_receipt_token"` - `origin_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) - `class LiquidStakingToken: …` - `kind: Literal["liquid_staking_token"]` - `"liquid_staking_token"` - `origin_asset: Optional[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) - `metadata: AssetMetadata` Additional metadata for assets - `decimals_denom: int` Denom exponent, or num. of decimal places that shift between denom/standard amounts (e.g. `18` for `INJ`) - `decimals_display: int` Number of decimals used when displaying amounts of this asset (this is subjective and used for generating text representations) - `name: str` Full name of the asset - `symbol: str` Symbol of the asset, e.g.: `NEPT` `INJ` - `symbol_denom: str` Denom symbol for the asset (e.g. `inj` for `INJ`, `sat` for `BTC`) - `borrow_collateral: Optional[BorrowCollateralMarketData]` Info for asset as collateral for borrow market, if one exists - `config: BorrowCollateralConfig` Collateral configuration parameters - `allowable_ltv: str` The loan to value ratio at which we allow collateral withdrawals or borrows. - `collateral_cap: Optional[str]` The optional, global/shared maximum deposit limit for this collateral. - `enabled: bool` Collateral enabled state - `extra: Extra` - `text: Optional[ExtraText]` Human-readable field variants. Will not be null when query param `with_text` is `true`. - `allowable_ltv: str` - `collateral_cap: str` - `liquidation_ltv: str` - `max_discount: str` - `min_discount: str` - `value: Optional[ExtraValue]` 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. - `collateral_cap: Optional[str]` - `extra: ExtraValueExtra` - `text: Optional[ExtraValueExtraText]` Human-readable variants of USD values. Will not be null when query params `with_text` and `with_value` are `true`. - `collateral_cap: Optional[str]` - `price: Optional[str]` Text representation of price - `price: str` Price used in value calculations - `liquidation_ltv: str` The loan to value ratio at which the collateral can be liquidated. - `max_discount: str` The maximum dynamic discount - `min_discount: str` The minimum dynamic discount. - `state: BorrowCollateralState` Current collateral state - `balance: str` - `collateral_sum: str` Total amount of this asset which is actively collateralized - `extra: Extra` - `text: Optional[ExtraText]` Human-readable field variants. Will not be null when query param `with_text` is `true`. - `collateral_sum: str` - `value: Optional[ExtraValue]` 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. - `collateral_sum: str` - `extra: ExtraValueExtra` - `text: Optional[ExtraValueExtraText]` Human-readable variants of USD values. Will not be null when query params `with_text` and `with_value` are `true`. - `collateral_sum: str` - `price: str` Text representation of price - `price: str` Price used in value calculations - `borrow_debt: Optional[BorrowDebtMarketData]` Info for asset as debt for borrow market, if one exists - `config: BorrowDebtConfig` Debt market configuration parameters - `borrow_cap: Optional[str]` The global max amount which can be borrowed - `borrow_halt_utilization: str` The maximum utilization ratio at which new borrow positions can be opened. - `enabled: bool` Market enabled state - `extra: Extra` - `text: Optional[ExtraText]` Human-readable field variants. Will not be null when query param `with_text` is `true`. - `borrow_cap: str` - `borrow_halt_utilization: str` - `interest_fee: str` - `value: Optional[ExtraValue]` 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. - `borrow_cap: Optional[str]` - `extra: ExtraValueExtra` - `text: Optional[ExtraValueExtraText]` Human-readable variants of USD values. Will not be null when query params `with_text` and `with_value` are `true`. - `borrow_cap: Optional[str]` - `price: Optional[str]` Text representation of price - `price: str` Price used in value calculations - `interest_fee: str` The protocol (base) interest rate that is charged to borrowers. - `rate: MarketRate` Market rates - `apr: str` Market rate in APR standard as a decimal percentage - `apy: str` Market rate in APY standard as a decimal percentage - `extra: Extra` - `text: Optional[ExtraText]` Human-readable field variants. Will not be null when query param `with_text` is `true`. - `apr: str` - `apy: str` - `state: BorrowDebtState` Current debt market state - `balance_sum: str` - `extra: Extra` - `text: Optional[ExtraText]` Human-readable field variants. Will not be null when query param `with_text` is `true`. - `balance_sum: str` - `principal_sum: str` - `time_last_distributed_interest: str` - `value: Optional[ExtraValue]` 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. - `balance_sum: str` - `extra: ExtraValueExtra` - `text: Optional[ExtraValueExtraText]` Human-readable variants of USD values. Will not be null when query params `with_text` and `with_value` are `true`. - `balance_sum: str` - `price: str` Text representation of price - `principal_sum: str` - `price: str` Price used in value calculations - `principal_sum: str` - `principal_sum: str` - `time_last_distributed_interest: datetime` Timestamp used to keep track of the last time interest was distributed. - `utilization_accumulator: str` Asset utilization tracker. - `lend: Optional[LendMarketData]` Info for asset's lending market, if one exists - `rate: MarketRate` Lending market rates - `state: LendMarketState` Current lending market state - `extra: Extra` - `text: Optional[ExtraText]` Human-readable field variants. Will not be null when query param `with_text` is `true`. - `principal_sum: str` - `receipt_total_supply: str` - `redemption_ratio: str` - `value: Optional[ExtraValue]` 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. - `extra: ExtraValueExtra` - `text: Optional[ExtraValueExtraText]` Human-readable variants of USD values. Will not be null when query params `with_text` and `with_value` are `true`. - `price: str` Text representation of price - `principal_sum: str` - `price: str` Price used in value calculations - `principal_sum: str` - `principal_sum: str` The total amount of the asset deposited for lending in the market. - `receipt_total_supply: str` - `redemption_ratio: str` - `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`. - `status_text: str` HTTP status text ### Example ```python from neptune_api_v2 import NeptuneAPIV2 client = NeptuneAPIV2() response = client.markets.get_merged() print(response.count) ``` #### Response ```json { "data": [ { "asset_info": { "asset": { "id": "native;inj", "group": "native", "group_key": "inj" }, "metadata": { "name": "Injective", "symbol": "INJ", "symbol_denom": "inj", "decimals_denom": 18, "decimals_display": 4 }, "classification": { "kind": "regular", "neptune_receipt_asset": { "id": "token;inj1rmzufd7h09sqfrre5dtvu5d09ta7c0t4jzkr2f", "group": "token", "group_key": "inj1rmzufd7h09sqfrre5dtvu5d09ta7c0t4jzkr2f" } } }, "lend": { "rate": { "apr": "0.06862234", "apy": "0.07103165", "extra": { "text": { "apy": "7.10%", "apr": "6.86%" } } }, "state": { "principal_sum": "425740748412504991838699", "receipt_total_supply": "396952939907783847231686", "redemption_ratio": "1.072521968249961422", "extra": { "text": { "redemption_ratio": "1.0725", "receipt_total_supply": "396,952.9399 nINJ", "principal_sum": "425,740.7484 INJ" }, "value": { "price": "2.99835", "principal_sum": "1276519.773002634342279563", "extra": { "text": { "price": "$2.99", "principal_sum": "$1,276,519.77" } } } } } }, "borrow_collateral": { "config": { "enabled": true, "collateral_cap": null, "allowable_ltv": "0.1", "liquidation_ltv": "0.7", "min_discount": "0.14", "max_discount": "0.16", "extra": { "text": { "min_discount": "14.00%", "allowable_ltv": "10.00%", "collateral_cap": "", "liquidation_ltv": "70.00%", "max_discount": "16.00%" }, "value": { "collateral_cap": null, "price": "2.99835", "extra": { "text": { "collateral_cap": null, "price": "$2.99" } } } } }, "state": { "collateral_sum": "7596263598527", "balance": "4255523766851", "extra": { "text": { "collateral_sum": "0.0000 INJ" }, "value": { "collateral_sum": "0.000022776256960643", "price": "2.99835", "extra": { "text": { "collateral_sum": "$0.00", "price": "$2.99" } } } } } }, "borrow_debt": { "rate": { "apr": "0.12867137", "apy": "0.13731631", "extra": { "text": { "apy": "13.73%", "apr": "12.86%" } } }, "config": { "enabled": true, "borrow_cap": null, "interest_fee": "0.01", "borrow_halt_utilization": "0.9", "extra": { "text": { "borrow_halt_utilization": "90.00%", "borrow_cap": "", "interest_fee": "1.00%" }, "value": { "price": "2.99835", "borrow_cap": null, "extra": { "text": { "price": "$2.99", "borrow_cap": null } } } } }, "state": { "principal_sum": "856896759772", "balance_sum": "6223567085599", "utilization_accumulator": "72507.562733515586636759", "time_last_distributed_interest": "2026-04-09T22:40:09.136032784Z", "extra": { "text": { "time_last_distributed_interest": "2026-04-09 10:40:09 PM +00:00", "principal_sum": "0.0000 INJ", "balance_sum": "0.0000 INJ" }, "value": { "principal_sum": "0.000002569276399662", "balance_sum": "0.000018660432371105", "price": "2.99835", "extra": { "text": { "price": "$2.99", "principal_sum": "$0.00", "balance_sum": "$0.00" } } } } } } } ], "count": 1, "error": null, "status": 200, "status_text": "200 OK" } ``` ## Lookup merged market data by asset `markets.get_merged_by_asset(MarketGetMergedByAssetParams**kwargs) -> MarketGetMergedByAssetResponse` **get** `/api/v1/markets/merged/lookup` Lookup merged market data by asset ### Parameters - `asset_id: str` Asset ID for lookup - `with_text: Optional[bool]` Include text variation fields - `with_value: Optional[bool]` Calculate and include USD values for amounts, where applicable ### Returns - `class MarketGetMergedByAssetResponse: …` - `data: MergedMarket` Data for all of an assets markets - `asset_info: AssetInfo` Asset identifiers with associated metadata - `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"]` - `"native"` - `"token"` - `group_key: str` - `classification: AssetClassification` The asset's classification metadata. Assets are classfied to provide context on their usage throughout the Neptune API (e.g. regular assets, neptune receipt tokens, LSTs, etc.) Each asset belongs to only a single classification type. This object contains metadata pertaining to the given classification. While some fields may be common among the distinct classifcations, each classification is distinct and subject to independent change. - `class Regular: …` - `kind: Literal["regular"]` - `"regular"` - `neptune_receipt_asset: Optional[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) - `class NeptuneReceiptToken: …` - `kind: Literal["neptune_receipt_token"]` - `"neptune_receipt_token"` - `origin_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) - `class LiquidStakingToken: …` - `kind: Literal["liquid_staking_token"]` - `"liquid_staking_token"` - `origin_asset: Optional[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) - `metadata: AssetMetadata` Additional metadata for assets - `decimals_denom: int` Denom exponent, or num. of decimal places that shift between denom/standard amounts (e.g. `18` for `INJ`) - `decimals_display: int` Number of decimals used when displaying amounts of this asset (this is subjective and used for generating text representations) - `name: str` Full name of the asset - `symbol: str` Symbol of the asset, e.g.: `NEPT` `INJ` - `symbol_denom: str` Denom symbol for the asset (e.g. `inj` for `INJ`, `sat` for `BTC`) - `borrow_collateral: Optional[BorrowCollateralMarketData]` Info for asset as collateral for borrow market, if one exists - `config: BorrowCollateralConfig` Collateral configuration parameters - `allowable_ltv: str` The loan to value ratio at which we allow collateral withdrawals or borrows. - `collateral_cap: Optional[str]` The optional, global/shared maximum deposit limit for this collateral. - `enabled: bool` Collateral enabled state - `extra: Extra` - `text: Optional[ExtraText]` Human-readable field variants. Will not be null when query param `with_text` is `true`. - `allowable_ltv: str` - `collateral_cap: str` - `liquidation_ltv: str` - `max_discount: str` - `min_discount: str` - `value: Optional[ExtraValue]` 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. - `collateral_cap: Optional[str]` - `extra: ExtraValueExtra` - `text: Optional[ExtraValueExtraText]` Human-readable variants of USD values. Will not be null when query params `with_text` and `with_value` are `true`. - `collateral_cap: Optional[str]` - `price: Optional[str]` Text representation of price - `price: str` Price used in value calculations - `liquidation_ltv: str` The loan to value ratio at which the collateral can be liquidated. - `max_discount: str` The maximum dynamic discount - `min_discount: str` The minimum dynamic discount. - `state: BorrowCollateralState` Current collateral state - `balance: str` - `collateral_sum: str` Total amount of this asset which is actively collateralized - `extra: Extra` - `text: Optional[ExtraText]` Human-readable field variants. Will not be null when query param `with_text` is `true`. - `collateral_sum: str` - `value: Optional[ExtraValue]` 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. - `collateral_sum: str` - `extra: ExtraValueExtra` - `text: Optional[ExtraValueExtraText]` Human-readable variants of USD values. Will not be null when query params `with_text` and `with_value` are `true`. - `collateral_sum: str` - `price: str` Text representation of price - `price: str` Price used in value calculations - `borrow_debt: Optional[BorrowDebtMarketData]` Info for asset as debt for borrow market, if one exists - `config: BorrowDebtConfig` Debt market configuration parameters - `borrow_cap: Optional[str]` The global max amount which can be borrowed - `borrow_halt_utilization: str` The maximum utilization ratio at which new borrow positions can be opened. - `enabled: bool` Market enabled state - `extra: Extra` - `text: Optional[ExtraText]` Human-readable field variants. Will not be null when query param `with_text` is `true`. - `borrow_cap: str` - `borrow_halt_utilization: str` - `interest_fee: str` - `value: Optional[ExtraValue]` 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. - `borrow_cap: Optional[str]` - `extra: ExtraValueExtra` - `text: Optional[ExtraValueExtraText]` Human-readable variants of USD values. Will not be null when query params `with_text` and `with_value` are `true`. - `borrow_cap: Optional[str]` - `price: Optional[str]` Text representation of price - `price: str` Price used in value calculations - `interest_fee: str` The protocol (base) interest rate that is charged to borrowers. - `rate: MarketRate` Market rates - `apr: str` Market rate in APR standard as a decimal percentage - `apy: str` Market rate in APY standard as a decimal percentage - `extra: Extra` - `text: Optional[ExtraText]` Human-readable field variants. Will not be null when query param `with_text` is `true`. - `apr: str` - `apy: str` - `state: BorrowDebtState` Current debt market state - `balance_sum: str` - `extra: Extra` - `text: Optional[ExtraText]` Human-readable field variants. Will not be null when query param `with_text` is `true`. - `balance_sum: str` - `principal_sum: str` - `time_last_distributed_interest: str` - `value: Optional[ExtraValue]` 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. - `balance_sum: str` - `extra: ExtraValueExtra` - `text: Optional[ExtraValueExtraText]` Human-readable variants of USD values. Will not be null when query params `with_text` and `with_value` are `true`. - `balance_sum: str` - `price: str` Text representation of price - `principal_sum: str` - `price: str` Price used in value calculations - `principal_sum: str` - `principal_sum: str` - `time_last_distributed_interest: datetime` Timestamp used to keep track of the last time interest was distributed. - `utilization_accumulator: str` Asset utilization tracker. - `lend: Optional[LendMarketData]` Info for asset's lending market, if one exists - `rate: MarketRate` Lending market rates - `state: LendMarketState` Current lending market state - `extra: Extra` - `text: Optional[ExtraText]` Human-readable field variants. Will not be null when query param `with_text` is `true`. - `principal_sum: str` - `receipt_total_supply: str` - `redemption_ratio: str` - `value: Optional[ExtraValue]` 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. - `extra: ExtraValueExtra` - `text: Optional[ExtraValueExtraText]` Human-readable variants of USD values. Will not be null when query params `with_text` and `with_value` are `true`. - `price: str` Text representation of price - `principal_sum: str` - `price: str` Price used in value calculations - `principal_sum: str` - `principal_sum: str` The total amount of the asset deposited for lending in the market. - `receipt_total_supply: str` - `redemption_ratio: str` - `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`. - `status_text: str` HTTP status text ### Example ```python from neptune_api_v2 import NeptuneAPIV2 client = NeptuneAPIV2() response = client.markets.get_merged_by_asset( asset_id="token;-K-//-//3-", ) print(response.data) ``` #### Response ```json { "data": { "asset_info": { "asset": { "id": "native;inj", "group": "native", "group_key": "inj" }, "metadata": { "name": "Injective", "symbol": "INJ", "symbol_denom": "inj", "decimals_denom": 18, "decimals_display": 4 }, "classification": { "kind": "regular", "neptune_receipt_asset": { "id": "token;inj1rmzufd7h09sqfrre5dtvu5d09ta7c0t4jzkr2f", "group": "token", "group_key": "inj1rmzufd7h09sqfrre5dtvu5d09ta7c0t4jzkr2f" } } }, "lend": { "rate": { "apr": "0.05674109", "apy": "0.05838175", "extra": { "text": { "apy": "5.83%", "apr": "5.67%" } } }, "state": { "principal_sum": "425740748412504991838699", "receipt_total_supply": "396952939907783847231686", "redemption_ratio": "1.072521968249961422", "extra": { "text": { "redemption_ratio": "1.0725", "receipt_total_supply": "396,952.9399 nINJ", "principal_sum": "425,740.7484 INJ" }, "value": { "price": "2.99835", "principal_sum": "1276519.773002634342279563", "extra": { "text": { "price": "$2.99", "principal_sum": "$1,276,519.77" } } } } } }, "borrow_collateral": { "config": { "enabled": true, "collateral_cap": null, "allowable_ltv": "0.1", "liquidation_ltv": "0.7", "min_discount": "0.14", "max_discount": "0.16", "extra": { "text": { "min_discount": "14.00%", "allowable_ltv": "10.00%", "collateral_cap": "", "liquidation_ltv": "70.00%", "max_discount": "16.00%" }, "value": { "collateral_cap": null, "price": "2.99835", "extra": { "text": { "collateral_cap": null, "price": "$2.99" } } } } }, "state": { "collateral_sum": "9121720851143", "balance": "3383942239892", "extra": { "text": { "collateral_sum": "0.0000 INJ" }, "value": { "collateral_sum": "0.000027350111714024", "price": "2.99835", "extra": { "text": { "collateral_sum": "$0.00", "price": "$2.99" } } } } } }, "borrow_debt": { "rate": { "apr": "0.18675966", "apy": "0.20533756", "extra": { "text": { "apy": "20.53%", "apr": "18.67%" } } }, "config": { "enabled": true, "borrow_cap": null, "interest_fee": "0.01", "borrow_halt_utilization": "0.9", "extra": { "text": { "borrow_halt_utilization": "90.00%", "borrow_cap": "", "interest_fee": "1.00%" }, "value": { "price": "2.99835", "borrow_cap": null, "extra": { "text": { "price": "$2.99", "borrow_cap": null } } } } }, "state": { "principal_sum": "8937703110477", "balance_sum": "18275459071570", "utilization_accumulator": "27026.311276894544332545", "time_last_distributed_interest": "2026-04-09T22:40:09.137784316Z", "extra": { "text": { "time_last_distributed_interest": "2026-04-09 10:40:09 PM +00:00", "principal_sum": "0.0000 INJ", "balance_sum": "0.0000 INJ" }, "value": { "principal_sum": "0.000026798362121298", "balance_sum": "0.000054796222707241", "price": "2.99835", "extra": { "text": { "price": "$2.99", "principal_sum": "$0.00", "balance_sum": "$0.00" } } } } } } }, "error": null, "status": 200, "status_text": "200 OK" } ``` ## Domain Types ### Global Market Config - `class GlobalMarketConfig: …` - `dynamic_discount_width: str` The required change in account health below 1.0 to achieve the maximum discount. should be ~= 0.02 must be <= 1.0 - `extra: Extra` - `text: Optional[ExtraText]` Human-readable field variants. Will not be null when query param `with_text` is `true`. - `flash_loan_fee: str` - `liquidation_fee: str` - `stake_collateral_ratio: str` - `stake_flash_loan_ratio: str` - `staking_health_modifier: str` - `time_window_nanos: str` - `flash_loan_fee: str` The coefficient used to calculate the flash loan fee. should be ~= 0.01 must be <= 1.0 - `flash_loans_enabled: bool` Whether flash loans are enabled or not - `hinj: 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"]` - `"native"` - `"token"` - `group_key: str` - `liquidation_fee: str` The coefficient use to calculate the liquidation protocol fee. should be ~= 0.01 must be <= 1.0 - `nept: 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) - `partial_liquidation_threshold: str` Minimum account value to avoid complete liquidation. - `stake_collateral_ratio: str` The required ratio of weighted staked NEPT to collateral value to obtain the maximum staking health modifier. should be ~= 0.1 must be <= 1.0 - `stake_flash_loan_ratio: str` The required ratio of weighted staked NEPT to flash loan value should be ~= 0.05 must be <= 1.0 - `staking_health_modifier: str` The maximum health increase provided by staking. should be ~= 0.05 and must be <= 1.0 - `target_liquidation_health: str` The account health target for a liquidation. should be ~= 1.02 must be >= 1.0 - `time_window_nanos: int` Number of nanoseconds that an oracle price is valid for. ### Market Rate - `class MarketRate: …` - `apr: str` Market rate in APR standard as a decimal percentage - `apy: str` Market rate in APY standard as a decimal percentage - `extra: Extra` - `text: Optional[ExtraText]` Human-readable field variants. Will not be null when query param `with_text` is `true`. - `apr: str` - `apy: str` ### Merged Market - `class MergedMarket: …` Data for all of an assets markets - `asset_info: AssetInfo` Asset identifiers with associated metadata - `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"]` - `"native"` - `"token"` - `group_key: str` - `classification: AssetClassification` The asset's classification metadata. Assets are classfied to provide context on their usage throughout the Neptune API (e.g. regular assets, neptune receipt tokens, LSTs, etc.) Each asset belongs to only a single classification type. This object contains metadata pertaining to the given classification. While some fields may be common among the distinct classifcations, each classification is distinct and subject to independent change. - `class Regular: …` - `kind: Literal["regular"]` - `"regular"` - `neptune_receipt_asset: Optional[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) - `class NeptuneReceiptToken: …` - `kind: Literal["neptune_receipt_token"]` - `"neptune_receipt_token"` - `origin_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) - `class LiquidStakingToken: …` - `kind: Literal["liquid_staking_token"]` - `"liquid_staking_token"` - `origin_asset: Optional[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) - `metadata: AssetMetadata` Additional metadata for assets - `decimals_denom: int` Denom exponent, or num. of decimal places that shift between denom/standard amounts (e.g. `18` for `INJ`) - `decimals_display: int` Number of decimals used when displaying amounts of this asset (this is subjective and used for generating text representations) - `name: str` Full name of the asset - `symbol: str` Symbol of the asset, e.g.: `NEPT` `INJ` - `symbol_denom: str` Denom symbol for the asset (e.g. `inj` for `INJ`, `sat` for `BTC`) - `borrow_collateral: Optional[BorrowCollateralMarketData]` Info for asset as collateral for borrow market, if one exists - `config: BorrowCollateralConfig` Collateral configuration parameters - `allowable_ltv: str` The loan to value ratio at which we allow collateral withdrawals or borrows. - `collateral_cap: Optional[str]` The optional, global/shared maximum deposit limit for this collateral. - `enabled: bool` Collateral enabled state - `extra: Extra` - `text: Optional[ExtraText]` Human-readable field variants. Will not be null when query param `with_text` is `true`. - `allowable_ltv: str` - `collateral_cap: str` - `liquidation_ltv: str` - `max_discount: str` - `min_discount: str` - `value: Optional[ExtraValue]` 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. - `collateral_cap: Optional[str]` - `extra: ExtraValueExtra` - `text: Optional[ExtraValueExtraText]` Human-readable variants of USD values. Will not be null when query params `with_text` and `with_value` are `true`. - `collateral_cap: Optional[str]` - `price: Optional[str]` Text representation of price - `price: str` Price used in value calculations - `liquidation_ltv: str` The loan to value ratio at which the collateral can be liquidated. - `max_discount: str` The maximum dynamic discount - `min_discount: str` The minimum dynamic discount. - `state: BorrowCollateralState` Current collateral state - `balance: str` - `collateral_sum: str` Total amount of this asset which is actively collateralized - `extra: Extra` - `text: Optional[ExtraText]` Human-readable field variants. Will not be null when query param `with_text` is `true`. - `collateral_sum: str` - `value: Optional[ExtraValue]` 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. - `collateral_sum: str` - `extra: ExtraValueExtra` - `text: Optional[ExtraValueExtraText]` Human-readable variants of USD values. Will not be null when query params `with_text` and `with_value` are `true`. - `collateral_sum: str` - `price: str` Text representation of price - `price: str` Price used in value calculations - `borrow_debt: Optional[BorrowDebtMarketData]` Info for asset as debt for borrow market, if one exists - `config: BorrowDebtConfig` Debt market configuration parameters - `borrow_cap: Optional[str]` The global max amount which can be borrowed - `borrow_halt_utilization: str` The maximum utilization ratio at which new borrow positions can be opened. - `enabled: bool` Market enabled state - `extra: Extra` - `text: Optional[ExtraText]` Human-readable field variants. Will not be null when query param `with_text` is `true`. - `borrow_cap: str` - `borrow_halt_utilization: str` - `interest_fee: str` - `value: Optional[ExtraValue]` 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. - `borrow_cap: Optional[str]` - `extra: ExtraValueExtra` - `text: Optional[ExtraValueExtraText]` Human-readable variants of USD values. Will not be null when query params `with_text` and `with_value` are `true`. - `borrow_cap: Optional[str]` - `price: Optional[str]` Text representation of price - `price: str` Price used in value calculations - `interest_fee: str` The protocol (base) interest rate that is charged to borrowers. - `rate: MarketRate` Market rates - `apr: str` Market rate in APR standard as a decimal percentage - `apy: str` Market rate in APY standard as a decimal percentage - `extra: Extra` - `text: Optional[ExtraText]` Human-readable field variants. Will not be null when query param `with_text` is `true`. - `apr: str` - `apy: str` - `state: BorrowDebtState` Current debt market state - `balance_sum: str` - `extra: Extra` - `text: Optional[ExtraText]` Human-readable field variants. Will not be null when query param `with_text` is `true`. - `balance_sum: str` - `principal_sum: str` - `time_last_distributed_interest: str` - `value: Optional[ExtraValue]` 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. - `balance_sum: str` - `extra: ExtraValueExtra` - `text: Optional[ExtraValueExtraText]` Human-readable variants of USD values. Will not be null when query params `with_text` and `with_value` are `true`. - `balance_sum: str` - `price: str` Text representation of price - `principal_sum: str` - `price: str` Price used in value calculations - `principal_sum: str` - `principal_sum: str` - `time_last_distributed_interest: datetime` Timestamp used to keep track of the last time interest was distributed. - `utilization_accumulator: str` Asset utilization tracker. - `lend: Optional[LendMarketData]` Info for asset's lending market, if one exists - `rate: MarketRate` Lending market rates - `state: LendMarketState` Current lending market state - `extra: Extra` - `text: Optional[ExtraText]` Human-readable field variants. Will not be null when query param `with_text` is `true`. - `principal_sum: str` - `receipt_total_supply: str` - `redemption_ratio: str` - `value: Optional[ExtraValue]` 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. - `extra: ExtraValueExtra` - `text: Optional[ExtraValueExtraText]` Human-readable variants of USD values. Will not be null when query params `with_text` and `with_value` are `true`. - `price: str` Text representation of price - `principal_sum: str` - `price: str` Price used in value calculations - `principal_sum: str` - `principal_sum: str` The total amount of the asset deposited for lending in the market. - `receipt_total_supply: str` - `redemption_ratio: str` # Lend ## Get lending markets `markets.lend.list(LendListParams**kwargs) -> LendListResponse` **get** `/api/v1/markets/lend` Get lending markets ### Parameters - `with_text: Optional[bool]` Include text variation fields - `with_value: Optional[bool]` Calculate and include USD values for amounts, where applicable ### Returns - `class LendListResponse: …` - `count: int` Total number of objects irrespective of any pagination parameters. - `data: List[LendMarket]` - `asset_info: AssetInfo` Asset identifiers with associated metadata - `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"]` - `"native"` - `"token"` - `group_key: str` - `classification: AssetClassification` The asset's classification metadata. Assets are classfied to provide context on their usage throughout the Neptune API (e.g. regular assets, neptune receipt tokens, LSTs, etc.) Each asset belongs to only a single classification type. This object contains metadata pertaining to the given classification. While some fields may be common among the distinct classifcations, each classification is distinct and subject to independent change. - `class Regular: …` - `kind: Literal["regular"]` - `"regular"` - `neptune_receipt_asset: Optional[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) - `class NeptuneReceiptToken: …` - `kind: Literal["neptune_receipt_token"]` - `"neptune_receipt_token"` - `origin_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) - `class LiquidStakingToken: …` - `kind: Literal["liquid_staking_token"]` - `"liquid_staking_token"` - `origin_asset: Optional[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) - `metadata: AssetMetadata` Additional metadata for assets - `decimals_denom: int` Denom exponent, or num. of decimal places that shift between denom/standard amounts (e.g. `18` for `INJ`) - `decimals_display: int` Number of decimals used when displaying amounts of this asset (this is subjective and used for generating text representations) - `name: str` Full name of the asset - `symbol: str` Symbol of the asset, e.g.: `NEPT` `INJ` - `symbol_denom: str` Denom symbol for the asset (e.g. `inj` for `INJ`, `sat` for `BTC`) - `rate: MarketRate` Lending market rates - `apr: str` Market rate in APR standard as a decimal percentage - `apy: str` Market rate in APY standard as a decimal percentage - `extra: Extra` - `text: Optional[ExtraText]` Human-readable field variants. Will not be null when query param `with_text` is `true`. - `apr: str` - `apy: str` - `state: LendMarketState` Current lending market state - `extra: Extra` - `text: Optional[ExtraText]` Human-readable field variants. Will not be null when query param `with_text` is `true`. - `principal_sum: str` - `receipt_total_supply: str` - `redemption_ratio: str` - `value: Optional[ExtraValue]` 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. - `extra: ExtraValueExtra` - `text: Optional[ExtraValueExtraText]` Human-readable variants of USD values. Will not be null when query params `with_text` and `with_value` are `true`. - `price: str` Text representation of price - `principal_sum: str` - `price: str` Price used in value calculations - `principal_sum: str` - `principal_sum: str` The total amount of the asset deposited for lending in the market. - `receipt_total_supply: str` - `redemption_ratio: str` - `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`. - `status_text: str` HTTP status text ### Example ```python from neptune_api_v2 import NeptuneAPIV2 client = NeptuneAPIV2() lends = client.markets.lend.list() print(lends.count) ``` #### Response ```json { "data": [ { "asset_info": { "asset": { "id": "native;inj", "group": "native", "group_key": "inj" }, "metadata": { "name": "Injective", "symbol": "INJ", "symbol_denom": "inj", "decimals_denom": 18, "decimals_display": 4 }, "classification": { "kind": "regular", "neptune_receipt_asset": { "id": "token;inj1rmzufd7h09sqfrre5dtvu5d09ta7c0t4jzkr2f", "group": "token", "group_key": "inj1rmzufd7h09sqfrre5dtvu5d09ta7c0t4jzkr2f" } } }, "rate": { "apr": "0.29995825", "apy": "0.34980245", "extra": { "text": { "apy": "34.98%", "apr": "29.99%" } } }, "state": { "principal_sum": "425740748412504991838699", "receipt_total_supply": "396952939907783847231686", "redemption_ratio": "1.072521968249961422", "extra": { "text": { "redemption_ratio": "1.0725", "receipt_total_supply": "396,952.9399 nINJ", "principal_sum": "425,740.7484 INJ" }, "value": { "price": "2.99835", "principal_sum": "1276519.773002634342279563", "extra": { "text": { "price": "$2.99", "principal_sum": "$1,276,519.77" } } } } } } ], "count": 1, "error": null, "status": 200, "status_text": "200 OK" } ``` ## Lookup lending market by asset `markets.lend.get_by_asset(LendGetByAssetParams**kwargs) -> LendGetByAssetResponse` **get** `/api/v1/markets/lend/lookup` Lookup lending market by asset ### Parameters - `asset_id: str` Asset ID for lookup - `with_text: Optional[bool]` Include text variation fields - `with_value: Optional[bool]` Calculate and include USD values for amounts, where applicable ### Returns - `class LendGetByAssetResponse: …` - `data: LendMarket` Lending market overview - `asset_info: AssetInfo` Asset identifiers with associated metadata - `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"]` - `"native"` - `"token"` - `group_key: str` - `classification: AssetClassification` The asset's classification metadata. Assets are classfied to provide context on their usage throughout the Neptune API (e.g. regular assets, neptune receipt tokens, LSTs, etc.) Each asset belongs to only a single classification type. This object contains metadata pertaining to the given classification. While some fields may be common among the distinct classifcations, each classification is distinct and subject to independent change. - `class Regular: …` - `kind: Literal["regular"]` - `"regular"` - `neptune_receipt_asset: Optional[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) - `class NeptuneReceiptToken: …` - `kind: Literal["neptune_receipt_token"]` - `"neptune_receipt_token"` - `origin_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) - `class LiquidStakingToken: …` - `kind: Literal["liquid_staking_token"]` - `"liquid_staking_token"` - `origin_asset: Optional[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) - `metadata: AssetMetadata` Additional metadata for assets - `decimals_denom: int` Denom exponent, or num. of decimal places that shift between denom/standard amounts (e.g. `18` for `INJ`) - `decimals_display: int` Number of decimals used when displaying amounts of this asset (this is subjective and used for generating text representations) - `name: str` Full name of the asset - `symbol: str` Symbol of the asset, e.g.: `NEPT` `INJ` - `symbol_denom: str` Denom symbol for the asset (e.g. `inj` for `INJ`, `sat` for `BTC`) - `rate: MarketRate` Lending market rates - `apr: str` Market rate in APR standard as a decimal percentage - `apy: str` Market rate in APY standard as a decimal percentage - `extra: Extra` - `text: Optional[ExtraText]` Human-readable field variants. Will not be null when query param `with_text` is `true`. - `apr: str` - `apy: str` - `state: LendMarketState` Current lending market state - `extra: Extra` - `text: Optional[ExtraText]` Human-readable field variants. Will not be null when query param `with_text` is `true`. - `principal_sum: str` - `receipt_total_supply: str` - `redemption_ratio: str` - `value: Optional[ExtraValue]` 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. - `extra: ExtraValueExtra` - `text: Optional[ExtraValueExtraText]` Human-readable variants of USD values. Will not be null when query params `with_text` and `with_value` are `true`. - `price: str` Text representation of price - `principal_sum: str` - `price: str` Price used in value calculations - `principal_sum: str` - `principal_sum: str` The total amount of the asset deposited for lending in the market. - `receipt_total_supply: str` - `redemption_ratio: str` - `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`. - `status_text: str` HTTP status text ### Example ```python from neptune_api_v2 import NeptuneAPIV2 client = NeptuneAPIV2() response = client.markets.lend.get_by_asset( asset_id="token;-K-//-//3-", ) print(response.data) ``` #### Response ```json { "data": { "asset_info": { "asset": { "id": "native;inj", "group": "native", "group_key": "inj" }, "metadata": { "name": "Injective", "symbol": "INJ", "symbol_denom": "inj", "decimals_denom": 18, "decimals_display": 4 }, "classification": { "kind": "regular", "neptune_receipt_asset": { "id": "token;inj1rmzufd7h09sqfrre5dtvu5d09ta7c0t4jzkr2f", "group": "token", "group_key": "inj1rmzufd7h09sqfrre5dtvu5d09ta7c0t4jzkr2f" } } }, "rate": { "apr": "0.21150951", "apy": "0.23554172", "extra": { "text": { "apy": "23.55%", "apr": "21.15%" } } }, "state": { "principal_sum": "425740748412504991838699", "receipt_total_supply": "396952939907783847231686", "redemption_ratio": "1.072521968249961422", "extra": { "text": { "redemption_ratio": "1.0725", "receipt_total_supply": "396,952.9399 nINJ", "principal_sum": "425,740.7484 INJ" }, "value": { "price": "2.99835", "principal_sum": "1276519.773002634342279563", "extra": { "text": { "price": "$2.99", "principal_sum": "$1,276,519.77" } } } } } }, "error": null, "status": 200, "status_text": "200 OK" } ``` ## Get historical lending rates for assets `markets.lend.get_rate_history(LendGetRateHistoryParams**kwargs) -> LendGetRateHistoryResponse` **get** `/api/v1/markets/lend/rate-history` Get historical lending rates for assets ### Parameters - `end: int` 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: int` Start timestamp for interval range (inclusive) Must be provided as unix timestamp (in seconds) - `asset_ids: Optional[str]` Optional comma-separated list of asset IDs to filter for. If excluded, values will be returned for all assets. - `interval: Optional[int]` Interval value E.g. for interval buckets of 2h: `interval=2&period=h` - `limit: Optional[int]` 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[int]` Time series bucket offset ### Returns - `class LendGetRateHistoryResponse: …` - `data: AssetRateHistory` Historical rates for assets - `pagination: Pagination` Values used for paginating the time series data - `interval_count: int` The total number of intervals/buckets for the provided interval parameters (size, period, start, end) - `next_offset: Optional[int]` The offset a client should use to fetch the next page of intervals (so long as limit remains unchanged) - `range: Range` Provides values for the requested range in it's entire width, regardless of page/limit. - `end: datetime` - `interval: Interval` Interval period & size - `unit: IntervalUnit` - `"h"` - `"d"` - `"w"` - `"m"` - `"y"` - `value: int` - `start: datetime` - `series: List[Series]` - `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"]` - `"native"` - `"token"` - `group_key: str` - `points: List[SeriesPoint]` - `t: datetime` - `v: Optional[str]` - `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`. - `status_text: str` HTTP status text ### Example ```python from neptune_api_v2 import NeptuneAPIV2 client = NeptuneAPIV2() response = client.markets.lend.get_rate_history( end=0, period="h", start=0, ) print(response.data) ``` #### 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" } ``` ## Domain Types ### Lend Market - `class LendMarket: …` Lending market overview - `asset_info: AssetInfo` Asset identifiers with associated metadata - `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"]` - `"native"` - `"token"` - `group_key: str` - `classification: AssetClassification` The asset's classification metadata. Assets are classfied to provide context on their usage throughout the Neptune API (e.g. regular assets, neptune receipt tokens, LSTs, etc.) Each asset belongs to only a single classification type. This object contains metadata pertaining to the given classification. While some fields may be common among the distinct classifcations, each classification is distinct and subject to independent change. - `class Regular: …` - `kind: Literal["regular"]` - `"regular"` - `neptune_receipt_asset: Optional[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) - `class NeptuneReceiptToken: …` - `kind: Literal["neptune_receipt_token"]` - `"neptune_receipt_token"` - `origin_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) - `class LiquidStakingToken: …` - `kind: Literal["liquid_staking_token"]` - `"liquid_staking_token"` - `origin_asset: Optional[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) - `metadata: AssetMetadata` Additional metadata for assets - `decimals_denom: int` Denom exponent, or num. of decimal places that shift between denom/standard amounts (e.g. `18` for `INJ`) - `decimals_display: int` Number of decimals used when displaying amounts of this asset (this is subjective and used for generating text representations) - `name: str` Full name of the asset - `symbol: str` Symbol of the asset, e.g.: `NEPT` `INJ` - `symbol_denom: str` Denom symbol for the asset (e.g. `inj` for `INJ`, `sat` for `BTC`) - `rate: MarketRate` Lending market rates - `apr: str` Market rate in APR standard as a decimal percentage - `apy: str` Market rate in APY standard as a decimal percentage - `extra: Extra` - `text: Optional[ExtraText]` Human-readable field variants. Will not be null when query param `with_text` is `true`. - `apr: str` - `apy: str` - `state: LendMarketState` Current lending market state - `extra: Extra` - `text: Optional[ExtraText]` Human-readable field variants. Will not be null when query param `with_text` is `true`. - `principal_sum: str` - `receipt_total_supply: str` - `redemption_ratio: str` - `value: Optional[ExtraValue]` 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. - `extra: ExtraValueExtra` - `text: Optional[ExtraValueExtraText]` Human-readable variants of USD values. Will not be null when query params `with_text` and `with_value` are `true`. - `price: str` Text representation of price - `principal_sum: str` - `price: str` Price used in value calculations - `principal_sum: str` - `principal_sum: str` The total amount of the asset deposited for lending in the market. - `receipt_total_supply: str` - `redemption_ratio: str` ### Lend Market Data - `class LendMarketData: …` - `rate: MarketRate` Lending market rates - `apr: str` Market rate in APR standard as a decimal percentage - `apy: str` Market rate in APY standard as a decimal percentage - `extra: Extra` - `text: Optional[ExtraText]` Human-readable field variants. Will not be null when query param `with_text` is `true`. - `apr: str` - `apy: str` - `state: LendMarketState` Current lending market state - `extra: Extra` - `text: Optional[ExtraText]` Human-readable field variants. Will not be null when query param `with_text` is `true`. - `principal_sum: str` - `receipt_total_supply: str` - `redemption_ratio: str` - `value: Optional[ExtraValue]` 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. - `extra: ExtraValueExtra` - `text: Optional[ExtraValueExtraText]` Human-readable variants of USD values. Will not be null when query params `with_text` and `with_value` are `true`. - `price: str` Text representation of price - `principal_sum: str` - `price: str` Price used in value calculations - `principal_sum: str` - `principal_sum: str` The total amount of the asset deposited for lending in the market. - `receipt_total_supply: str` - `redemption_ratio: str` ### Lend Market State - `class LendMarketState: …` - `extra: Extra` - `text: Optional[ExtraText]` Human-readable field variants. Will not be null when query param `with_text` is `true`. - `principal_sum: str` - `receipt_total_supply: str` - `redemption_ratio: str` - `value: Optional[ExtraValue]` 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. - `extra: ExtraValueExtra` - `text: Optional[ExtraValueExtraText]` Human-readable variants of USD values. Will not be null when query params `with_text` and `with_value` are `true`. - `price: str` Text representation of price - `principal_sum: str` - `price: str` Price used in value calculations - `principal_sum: str` - `principal_sum: str` The total amount of the asset deposited for lending in the market. - `receipt_total_supply: str` - `redemption_ratio: str` # Borrow ## Get borrowing market overview `markets.borrow.get_overview(BorrowGetOverviewParams**kwargs) -> BorrowGetOverviewResponse` **get** `/api/v1/markets/borrow` Get borrowing market overview ### Parameters - `with_text: Optional[bool]` Include text variation fields - `with_value: Optional[bool]` Calculate and include USD values for amounts, where applicable ### Returns - `class BorrowGetOverviewResponse: …` - `data: BorrowMarketOverview` - `collaterals: List[BorrowCollateralMarket]` Borrowing collateral markets - `asset_info: AssetInfo` Asset identifiers with associated metadata - `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"]` - `"native"` - `"token"` - `group_key: str` - `classification: AssetClassification` The asset's classification metadata. Assets are classfied to provide context on their usage throughout the Neptune API (e.g. regular assets, neptune receipt tokens, LSTs, etc.) Each asset belongs to only a single classification type. This object contains metadata pertaining to the given classification. While some fields may be common among the distinct classifcations, each classification is distinct and subject to independent change. - `class Regular: …` - `kind: Literal["regular"]` - `"regular"` - `neptune_receipt_asset: Optional[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) - `class NeptuneReceiptToken: …` - `kind: Literal["neptune_receipt_token"]` - `"neptune_receipt_token"` - `origin_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) - `class LiquidStakingToken: …` - `kind: Literal["liquid_staking_token"]` - `"liquid_staking_token"` - `origin_asset: Optional[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) - `metadata: AssetMetadata` Additional metadata for assets - `decimals_denom: int` Denom exponent, or num. of decimal places that shift between denom/standard amounts (e.g. `18` for `INJ`) - `decimals_display: int` Number of decimals used when displaying amounts of this asset (this is subjective and used for generating text representations) - `name: str` Full name of the asset - `symbol: str` Symbol of the asset, e.g.: `NEPT` `INJ` - `symbol_denom: str` Denom symbol for the asset (e.g. `inj` for `INJ`, `sat` for `BTC`) - `config: BorrowCollateralConfig` Collateral configuration parameters - `allowable_ltv: str` The loan to value ratio at which we allow collateral withdrawals or borrows. - `collateral_cap: Optional[str]` The optional, global/shared maximum deposit limit for this collateral. - `enabled: bool` Collateral enabled state - `extra: Extra` - `text: Optional[ExtraText]` Human-readable field variants. Will not be null when query param `with_text` is `true`. - `allowable_ltv: str` - `collateral_cap: str` - `liquidation_ltv: str` - `max_discount: str` - `min_discount: str` - `value: Optional[ExtraValue]` 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. - `collateral_cap: Optional[str]` - `extra: ExtraValueExtra` - `text: Optional[ExtraValueExtraText]` Human-readable variants of USD values. Will not be null when query params `with_text` and `with_value` are `true`. - `collateral_cap: Optional[str]` - `price: Optional[str]` Text representation of price - `price: str` Price used in value calculations - `liquidation_ltv: str` The loan to value ratio at which the collateral can be liquidated. - `max_discount: str` The maximum dynamic discount - `min_discount: str` The minimum dynamic discount. - `state: BorrowCollateralState` Current collateral state - `balance: str` - `collateral_sum: str` Total amount of this asset which is actively collateralized - `extra: Extra` - `text: Optional[ExtraText]` Human-readable field variants. Will not be null when query param `with_text` is `true`. - `collateral_sum: str` - `value: Optional[ExtraValue]` 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. - `collateral_sum: str` - `extra: ExtraValueExtra` - `text: Optional[ExtraValueExtraText]` Human-readable variants of USD values. Will not be null when query params `with_text` and `with_value` are `true`. - `collateral_sum: str` - `price: str` Text representation of price - `price: str` Price used in value calculations - `debts: List[BorrowDebtMarket]` Borrowing debt markets - `asset_info: AssetInfo` Asset identifiers with associated metadata - `config: BorrowDebtConfig` Debt market configuration parameters - `borrow_cap: Optional[str]` The global max amount which can be borrowed - `borrow_halt_utilization: str` The maximum utilization ratio at which new borrow positions can be opened. - `enabled: bool` Market enabled state - `extra: Extra` - `text: Optional[ExtraText]` Human-readable field variants. Will not be null when query param `with_text` is `true`. - `borrow_cap: str` - `borrow_halt_utilization: str` - `interest_fee: str` - `value: Optional[ExtraValue]` 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. - `borrow_cap: Optional[str]` - `extra: ExtraValueExtra` - `text: Optional[ExtraValueExtraText]` Human-readable variants of USD values. Will not be null when query params `with_text` and `with_value` are `true`. - `borrow_cap: Optional[str]` - `price: Optional[str]` Text representation of price - `price: str` Price used in value calculations - `interest_fee: str` The protocol (base) interest rate that is charged to borrowers. - `rate: MarketRate` Market rates - `apr: str` Market rate in APR standard as a decimal percentage - `apy: str` Market rate in APY standard as a decimal percentage - `extra: Extra` - `text: Optional[ExtraText]` Human-readable field variants. Will not be null when query param `with_text` is `true`. - `apr: str` - `apy: str` - `state: BorrowDebtState` Current debt market state - `balance_sum: str` - `extra: Extra` - `text: Optional[ExtraText]` Human-readable field variants. Will not be null when query param `with_text` is `true`. - `balance_sum: str` - `principal_sum: str` - `time_last_distributed_interest: str` - `value: Optional[ExtraValue]` 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. - `balance_sum: str` - `extra: ExtraValueExtra` - `text: Optional[ExtraValueExtraText]` Human-readable variants of USD values. Will not be null when query params `with_text` and `with_value` are `true`. - `balance_sum: str` - `price: str` Text representation of price - `principal_sum: str` - `price: str` Price used in value calculations - `principal_sum: str` - `principal_sum: str` - `time_last_distributed_interest: datetime` Timestamp used to keep track of the last time interest was distributed. - `utilization_accumulator: str` Asset utilization tracker. - `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`. - `status_text: str` HTTP status text ### Example ```python from neptune_api_v2 import NeptuneAPIV2 client = NeptuneAPIV2() response = client.markets.borrow.get_overview() print(response.data) ``` #### Response ```json { "data": { "collaterals": [ { "asset_info": { "asset": { "id": "native;inj", "group": "native", "group_key": "inj" }, "metadata": { "name": "Injective", "symbol": "INJ", "symbol_denom": "inj", "decimals_denom": 18, "decimals_display": 4 }, "classification": { "kind": "regular", "neptune_receipt_asset": { "id": "token;inj1rmzufd7h09sqfrre5dtvu5d09ta7c0t4jzkr2f", "group": "token", "group_key": "inj1rmzufd7h09sqfrre5dtvu5d09ta7c0t4jzkr2f" } } }, "config": { "enabled": true, "collateral_cap": null, "allowable_ltv": "0.1", "liquidation_ltv": "0.7", "min_discount": "0.14", "max_discount": "0.16", "extra": { "text": { "min_discount": "14.00%", "allowable_ltv": "10.00%", "collateral_cap": "", "liquidation_ltv": "70.00%", "max_discount": "16.00%" }, "value": { "collateral_cap": null, "price": "2.99835", "extra": { "text": { "collateral_cap": null, "price": "$2.99" } } } } }, "state": { "collateral_sum": "1434197454977", "balance": "992132705578", "extra": { "text": { "collateral_sum": "0.0000 INJ" }, "value": { "collateral_sum": "0.00000430022593913", "price": "2.99835", "extra": { "text": { "collateral_sum": "$0.00", "price": "$2.99" } } } } } } ], "debts": [ { "asset_info": { "asset": { "id": "native;inj", "group": "native", "group_key": "inj" }, "metadata": { "name": "Injective", "symbol": "INJ", "symbol_denom": "inj", "decimals_denom": 18, "decimals_display": 4 }, "classification": { "kind": "regular", "neptune_receipt_asset": { "id": "token;inj1rmzufd7h09sqfrre5dtvu5d09ta7c0t4jzkr2f", "group": "token", "group_key": "inj1rmzufd7h09sqfrre5dtvu5d09ta7c0t4jzkr2f" } } }, "rate": { "apr": "0.28494725", "apy": "0.32969189", "extra": { "text": { "apy": "32.96%", "apr": "28.49%" } } }, "config": { "enabled": true, "borrow_cap": null, "interest_fee": "0.01", "borrow_halt_utilization": "0.9", "extra": { "text": { "borrow_halt_utilization": "90.00%", "borrow_cap": "", "interest_fee": "1.00%" }, "value": { "price": "2.99835", "borrow_cap": null, "extra": { "text": { "price": "$2.99", "borrow_cap": null } } } } }, "state": { "principal_sum": "1667143666263", "balance_sum": "11659168021630", "utilization_accumulator": "76241.882286236684092386", "time_last_distributed_interest": "2026-04-09T22:40:09.138417816Z", "extra": { "text": { "time_last_distributed_interest": "2026-04-09 10:40:09 PM +00:00", "principal_sum": "0.0000 INJ", "balance_sum": "0.0000 INJ" }, "value": { "principal_sum": "0.000004998680211739", "balance_sum": "0.000034958266437654", "price": "2.99835", "extra": { "text": { "price": "$2.99", "principal_sum": "$0.00", "balance_sum": "$0.00" } } } } } } ] }, "error": null, "status": 200, "status_text": "200 OK" } ``` ## Get historical borrowing rates for assets `markets.borrow.get_rate_history(BorrowGetRateHistoryParams**kwargs) -> BorrowGetRateHistoryResponse` **get** `/api/v1/markets/borrow/rate-history` Get historical borrowing rates for assets ### Parameters - `end: int` 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: int` Start timestamp for interval range (inclusive) Must be provided as unix timestamp (in seconds) - `asset_ids: Optional[str]` Optional comma-separated list of asset IDs to filter for. If excluded, values will be returned for all assets. - `interval: Optional[int]` Interval value E.g. for interval buckets of 2h: `interval=2&period=h` - `limit: Optional[int]` 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[int]` Time series bucket offset ### Returns - `class BorrowGetRateHistoryResponse: …` - `data: AssetRateHistory` Historical rates for assets - `pagination: Pagination` Values used for paginating the time series data - `interval_count: int` The total number of intervals/buckets for the provided interval parameters (size, period, start, end) - `next_offset: Optional[int]` The offset a client should use to fetch the next page of intervals (so long as limit remains unchanged) - `range: Range` Provides values for the requested range in it's entire width, regardless of page/limit. - `end: datetime` - `interval: Interval` Interval period & size - `unit: IntervalUnit` - `"h"` - `"d"` - `"w"` - `"m"` - `"y"` - `value: int` - `start: datetime` - `series: List[Series]` - `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"]` - `"native"` - `"token"` - `group_key: str` - `points: List[SeriesPoint]` - `t: datetime` - `v: Optional[str]` - `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`. - `status_text: str` HTTP status text ### Example ```python from neptune_api_v2 import NeptuneAPIV2 client = NeptuneAPIV2() response = client.markets.borrow.get_rate_history( end=0, period="h", start=0, ) print(response.data) ``` #### 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" } ``` ## Domain Types ### Borrow Market Overview - `class BorrowMarketOverview: …` - `collaterals: List[BorrowCollateralMarket]` Borrowing collateral markets - `asset_info: AssetInfo` Asset identifiers with associated metadata - `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"]` - `"native"` - `"token"` - `group_key: str` - `classification: AssetClassification` The asset's classification metadata. Assets are classfied to provide context on their usage throughout the Neptune API (e.g. regular assets, neptune receipt tokens, LSTs, etc.) Each asset belongs to only a single classification type. This object contains metadata pertaining to the given classification. While some fields may be common among the distinct classifcations, each classification is distinct and subject to independent change. - `class Regular: …` - `kind: Literal["regular"]` - `"regular"` - `neptune_receipt_asset: Optional[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) - `class NeptuneReceiptToken: …` - `kind: Literal["neptune_receipt_token"]` - `"neptune_receipt_token"` - `origin_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) - `class LiquidStakingToken: …` - `kind: Literal["liquid_staking_token"]` - `"liquid_staking_token"` - `origin_asset: Optional[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) - `metadata: AssetMetadata` Additional metadata for assets - `decimals_denom: int` Denom exponent, or num. of decimal places that shift between denom/standard amounts (e.g. `18` for `INJ`) - `decimals_display: int` Number of decimals used when displaying amounts of this asset (this is subjective and used for generating text representations) - `name: str` Full name of the asset - `symbol: str` Symbol of the asset, e.g.: `NEPT` `INJ` - `symbol_denom: str` Denom symbol for the asset (e.g. `inj` for `INJ`, `sat` for `BTC`) - `config: BorrowCollateralConfig` Collateral configuration parameters - `allowable_ltv: str` The loan to value ratio at which we allow collateral withdrawals or borrows. - `collateral_cap: Optional[str]` The optional, global/shared maximum deposit limit for this collateral. - `enabled: bool` Collateral enabled state - `extra: Extra` - `text: Optional[ExtraText]` Human-readable field variants. Will not be null when query param `with_text` is `true`. - `allowable_ltv: str` - `collateral_cap: str` - `liquidation_ltv: str` - `max_discount: str` - `min_discount: str` - `value: Optional[ExtraValue]` 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. - `collateral_cap: Optional[str]` - `extra: ExtraValueExtra` - `text: Optional[ExtraValueExtraText]` Human-readable variants of USD values. Will not be null when query params `with_text` and `with_value` are `true`. - `collateral_cap: Optional[str]` - `price: Optional[str]` Text representation of price - `price: str` Price used in value calculations - `liquidation_ltv: str` The loan to value ratio at which the collateral can be liquidated. - `max_discount: str` The maximum dynamic discount - `min_discount: str` The minimum dynamic discount. - `state: BorrowCollateralState` Current collateral state - `balance: str` - `collateral_sum: str` Total amount of this asset which is actively collateralized - `extra: Extra` - `text: Optional[ExtraText]` Human-readable field variants. Will not be null when query param `with_text` is `true`. - `collateral_sum: str` - `value: Optional[ExtraValue]` 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. - `collateral_sum: str` - `extra: ExtraValueExtra` - `text: Optional[ExtraValueExtraText]` Human-readable variants of USD values. Will not be null when query params `with_text` and `with_value` are `true`. - `collateral_sum: str` - `price: str` Text representation of price - `price: str` Price used in value calculations - `debts: List[BorrowDebtMarket]` Borrowing debt markets - `asset_info: AssetInfo` Asset identifiers with associated metadata - `config: BorrowDebtConfig` Debt market configuration parameters - `borrow_cap: Optional[str]` The global max amount which can be borrowed - `borrow_halt_utilization: str` The maximum utilization ratio at which new borrow positions can be opened. - `enabled: bool` Market enabled state - `extra: Extra` - `text: Optional[ExtraText]` Human-readable field variants. Will not be null when query param `with_text` is `true`. - `borrow_cap: str` - `borrow_halt_utilization: str` - `interest_fee: str` - `value: Optional[ExtraValue]` 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. - `borrow_cap: Optional[str]` - `extra: ExtraValueExtra` - `text: Optional[ExtraValueExtraText]` Human-readable variants of USD values. Will not be null when query params `with_text` and `with_value` are `true`. - `borrow_cap: Optional[str]` - `price: Optional[str]` Text representation of price - `price: str` Price used in value calculations - `interest_fee: str` The protocol (base) interest rate that is charged to borrowers. - `rate: MarketRate` Market rates - `apr: str` Market rate in APR standard as a decimal percentage - `apy: str` Market rate in APY standard as a decimal percentage - `extra: Extra` - `text: Optional[ExtraText]` Human-readable field variants. Will not be null when query param `with_text` is `true`. - `apr: str` - `apy: str` - `state: BorrowDebtState` Current debt market state - `balance_sum: str` - `extra: Extra` - `text: Optional[ExtraText]` Human-readable field variants. Will not be null when query param `with_text` is `true`. - `balance_sum: str` - `principal_sum: str` - `time_last_distributed_interest: str` - `value: Optional[ExtraValue]` 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. - `balance_sum: str` - `extra: ExtraValueExtra` - `text: Optional[ExtraValueExtraText]` Human-readable variants of USD values. Will not be null when query params `with_text` and `with_value` are `true`. - `balance_sum: str` - `price: str` Text representation of price - `principal_sum: str` - `price: str` Price used in value calculations - `principal_sum: str` - `principal_sum: str` - `time_last_distributed_interest: datetime` Timestamp used to keep track of the last time interest was distributed. - `utilization_accumulator: str` Asset utilization tracker. # Collaterals ## Get borrowing collateral markets `markets.borrow.collaterals.list(CollateralListParams**kwargs) -> CollateralListResponse` **get** `/api/v1/markets/borrow/collaterals` Get borrowing collateral markets ### Parameters - `with_text: Optional[bool]` Include text variation fields - `with_value: Optional[bool]` Calculate and include USD values for amounts, where applicable ### Returns - `class CollateralListResponse: …` - `count: int` Total number of objects irrespective of any pagination parameters. - `data: List[BorrowCollateralMarket]` - `asset_info: AssetInfo` Asset identifiers with associated metadata - `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"]` - `"native"` - `"token"` - `group_key: str` - `classification: AssetClassification` The asset's classification metadata. Assets are classfied to provide context on their usage throughout the Neptune API (e.g. regular assets, neptune receipt tokens, LSTs, etc.) Each asset belongs to only a single classification type. This object contains metadata pertaining to the given classification. While some fields may be common among the distinct classifcations, each classification is distinct and subject to independent change. - `class Regular: …` - `kind: Literal["regular"]` - `"regular"` - `neptune_receipt_asset: Optional[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) - `class NeptuneReceiptToken: …` - `kind: Literal["neptune_receipt_token"]` - `"neptune_receipt_token"` - `origin_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) - `class LiquidStakingToken: …` - `kind: Literal["liquid_staking_token"]` - `"liquid_staking_token"` - `origin_asset: Optional[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) - `metadata: AssetMetadata` Additional metadata for assets - `decimals_denom: int` Denom exponent, or num. of decimal places that shift between denom/standard amounts (e.g. `18` for `INJ`) - `decimals_display: int` Number of decimals used when displaying amounts of this asset (this is subjective and used for generating text representations) - `name: str` Full name of the asset - `symbol: str` Symbol of the asset, e.g.: `NEPT` `INJ` - `symbol_denom: str` Denom symbol for the asset (e.g. `inj` for `INJ`, `sat` for `BTC`) - `config: BorrowCollateralConfig` Collateral configuration parameters - `allowable_ltv: str` The loan to value ratio at which we allow collateral withdrawals or borrows. - `collateral_cap: Optional[str]` The optional, global/shared maximum deposit limit for this collateral. - `enabled: bool` Collateral enabled state - `extra: Extra` - `text: Optional[ExtraText]` Human-readable field variants. Will not be null when query param `with_text` is `true`. - `allowable_ltv: str` - `collateral_cap: str` - `liquidation_ltv: str` - `max_discount: str` - `min_discount: str` - `value: Optional[ExtraValue]` 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. - `collateral_cap: Optional[str]` - `extra: ExtraValueExtra` - `text: Optional[ExtraValueExtraText]` Human-readable variants of USD values. Will not be null when query params `with_text` and `with_value` are `true`. - `collateral_cap: Optional[str]` - `price: Optional[str]` Text representation of price - `price: str` Price used in value calculations - `liquidation_ltv: str` The loan to value ratio at which the collateral can be liquidated. - `max_discount: str` The maximum dynamic discount - `min_discount: str` The minimum dynamic discount. - `state: BorrowCollateralState` Current collateral state - `balance: str` - `collateral_sum: str` Total amount of this asset which is actively collateralized - `extra: Extra` - `text: Optional[ExtraText]` Human-readable field variants. Will not be null when query param `with_text` is `true`. - `collateral_sum: str` - `value: Optional[ExtraValue]` 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. - `collateral_sum: str` - `extra: ExtraValueExtra` - `text: Optional[ExtraValueExtraText]` Human-readable variants of USD values. Will not be null when query params `with_text` and `with_value` are `true`. - `collateral_sum: str` - `price: str` Text representation of price - `price: str` Price used in value calculations - `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`. - `status_text: str` HTTP status text ### Example ```python from neptune_api_v2 import NeptuneAPIV2 client = NeptuneAPIV2() collaterals = client.markets.borrow.collaterals.list() print(collaterals.count) ``` #### Response ```json { "data": [ { "asset_info": { "asset": { "id": "native;inj", "group": "native", "group_key": "inj" }, "metadata": { "name": "Injective", "symbol": "INJ", "symbol_denom": "inj", "decimals_denom": 18, "decimals_display": 4 }, "classification": { "kind": "regular", "neptune_receipt_asset": { "id": "token;inj1rmzufd7h09sqfrre5dtvu5d09ta7c0t4jzkr2f", "group": "token", "group_key": "inj1rmzufd7h09sqfrre5dtvu5d09ta7c0t4jzkr2f" } } }, "config": { "enabled": true, "collateral_cap": null, "allowable_ltv": "0.1", "liquidation_ltv": "0.7", "min_discount": "0.14", "max_discount": "0.16", "extra": { "text": { "min_discount": "14.00%", "allowable_ltv": "10.00%", "collateral_cap": "", "liquidation_ltv": "70.00%", "max_discount": "16.00%" }, "value": { "collateral_cap": null, "price": "2.99835", "extra": { "text": { "collateral_cap": null, "price": "$2.99" } } } } }, "state": { "collateral_sum": "2781199183209", "balance": "2583466937372", "extra": { "text": { "collateral_sum": "0.0000 INJ" }, "value": { "collateral_sum": "0.000008339008570974", "price": "2.99835", "extra": { "text": { "collateral_sum": "$0.00", "price": "$2.99" } } } } } } ], "count": 1, "error": null, "status": 200, "status_text": "200 OK" } ``` ## Lookup borrowing market collateral by asset `markets.borrow.collaterals.get_by_asset(CollateralGetByAssetParams**kwargs) -> CollateralGetByAssetResponse` **get** `/api/v1/markets/borrow/collaterals/lookup` Lookup borrowing market collateral by asset ### Parameters - `asset_id: str` Asset ID for lookup - `with_text: Optional[bool]` Include text variation fields - `with_value: Optional[bool]` Calculate and include USD values for amounts, where applicable ### Returns - `class CollateralGetByAssetResponse: …` - `data: BorrowCollateralMarket` Borrowing market, collateral info - `asset_info: AssetInfo` Asset identifiers with associated metadata - `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"]` - `"native"` - `"token"` - `group_key: str` - `classification: AssetClassification` The asset's classification metadata. Assets are classfied to provide context on their usage throughout the Neptune API (e.g. regular assets, neptune receipt tokens, LSTs, etc.) Each asset belongs to only a single classification type. This object contains metadata pertaining to the given classification. While some fields may be common among the distinct classifcations, each classification is distinct and subject to independent change. - `class Regular: …` - `kind: Literal["regular"]` - `"regular"` - `neptune_receipt_asset: Optional[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) - `class NeptuneReceiptToken: …` - `kind: Literal["neptune_receipt_token"]` - `"neptune_receipt_token"` - `origin_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) - `class LiquidStakingToken: …` - `kind: Literal["liquid_staking_token"]` - `"liquid_staking_token"` - `origin_asset: Optional[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) - `metadata: AssetMetadata` Additional metadata for assets - `decimals_denom: int` Denom exponent, or num. of decimal places that shift between denom/standard amounts (e.g. `18` for `INJ`) - `decimals_display: int` Number of decimals used when displaying amounts of this asset (this is subjective and used for generating text representations) - `name: str` Full name of the asset - `symbol: str` Symbol of the asset, e.g.: `NEPT` `INJ` - `symbol_denom: str` Denom symbol for the asset (e.g. `inj` for `INJ`, `sat` for `BTC`) - `config: BorrowCollateralConfig` Collateral configuration parameters - `allowable_ltv: str` The loan to value ratio at which we allow collateral withdrawals or borrows. - `collateral_cap: Optional[str]` The optional, global/shared maximum deposit limit for this collateral. - `enabled: bool` Collateral enabled state - `extra: Extra` - `text: Optional[ExtraText]` Human-readable field variants. Will not be null when query param `with_text` is `true`. - `allowable_ltv: str` - `collateral_cap: str` - `liquidation_ltv: str` - `max_discount: str` - `min_discount: str` - `value: Optional[ExtraValue]` 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. - `collateral_cap: Optional[str]` - `extra: ExtraValueExtra` - `text: Optional[ExtraValueExtraText]` Human-readable variants of USD values. Will not be null when query params `with_text` and `with_value` are `true`. - `collateral_cap: Optional[str]` - `price: Optional[str]` Text representation of price - `price: str` Price used in value calculations - `liquidation_ltv: str` The loan to value ratio at which the collateral can be liquidated. - `max_discount: str` The maximum dynamic discount - `min_discount: str` The minimum dynamic discount. - `state: BorrowCollateralState` Current collateral state - `balance: str` - `collateral_sum: str` Total amount of this asset which is actively collateralized - `extra: Extra` - `text: Optional[ExtraText]` Human-readable field variants. Will not be null when query param `with_text` is `true`. - `collateral_sum: str` - `value: Optional[ExtraValue]` 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. - `collateral_sum: str` - `extra: ExtraValueExtra` - `text: Optional[ExtraValueExtraText]` Human-readable variants of USD values. Will not be null when query params `with_text` and `with_value` are `true`. - `collateral_sum: str` - `price: str` Text representation of price - `price: str` Price used in value calculations - `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`. - `status_text: str` HTTP status text ### Example ```python from neptune_api_v2 import NeptuneAPIV2 client = NeptuneAPIV2() response = client.markets.borrow.collaterals.get_by_asset( asset_id="token;-K-//-//3-", ) print(response.data) ``` #### Response ```json { "data": { "asset_info": { "asset": { "id": "native;inj", "group": "native", "group_key": "inj" }, "metadata": { "name": "Injective", "symbol": "INJ", "symbol_denom": "inj", "decimals_denom": 18, "decimals_display": 4 }, "classification": { "kind": "regular", "neptune_receipt_asset": { "id": "token;inj1rmzufd7h09sqfrre5dtvu5d09ta7c0t4jzkr2f", "group": "token", "group_key": "inj1rmzufd7h09sqfrre5dtvu5d09ta7c0t4jzkr2f" } } }, "config": { "enabled": true, "collateral_cap": null, "allowable_ltv": "0.1", "liquidation_ltv": "0.7", "min_discount": "0.14", "max_discount": "0.16", "extra": { "text": { "min_discount": "14.00%", "allowable_ltv": "10.00%", "collateral_cap": "", "liquidation_ltv": "70.00%", "max_discount": "16.00%" }, "value": { "collateral_cap": null, "price": "2.99835", "extra": { "text": { "collateral_cap": null, "price": "$2.99" } } } } }, "state": { "collateral_sum": "1875269228800", "balance": "7906957668394", "extra": { "text": { "collateral_sum": "0.0000 INJ" }, "value": { "collateral_sum": "0.000005622713492172", "price": "2.99835", "extra": { "text": { "collateral_sum": "$0.00", "price": "$2.99" } } } } } }, "error": null, "status": 200, "status_text": "200 OK" } ``` ## Domain Types ### Borrow Collateral Config - `class BorrowCollateralConfig: …` - `allowable_ltv: str` The loan to value ratio at which we allow collateral withdrawals or borrows. - `collateral_cap: Optional[str]` The optional, global/shared maximum deposit limit for this collateral. - `enabled: bool` Collateral enabled state - `extra: Extra` - `text: Optional[ExtraText]` Human-readable field variants. Will not be null when query param `with_text` is `true`. - `allowable_ltv: str` - `collateral_cap: str` - `liquidation_ltv: str` - `max_discount: str` - `min_discount: str` - `value: Optional[ExtraValue]` 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. - `collateral_cap: Optional[str]` - `extra: ExtraValueExtra` - `text: Optional[ExtraValueExtraText]` Human-readable variants of USD values. Will not be null when query params `with_text` and `with_value` are `true`. - `collateral_cap: Optional[str]` - `price: Optional[str]` Text representation of price - `price: str` Price used in value calculations - `liquidation_ltv: str` The loan to value ratio at which the collateral can be liquidated. - `max_discount: str` The maximum dynamic discount - `min_discount: str` The minimum dynamic discount. ### Borrow Collateral Market - `class BorrowCollateralMarket: …` Borrowing market, collateral info - `asset_info: AssetInfo` Asset identifiers with associated metadata - `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"]` - `"native"` - `"token"` - `group_key: str` - `classification: AssetClassification` The asset's classification metadata. Assets are classfied to provide context on their usage throughout the Neptune API (e.g. regular assets, neptune receipt tokens, LSTs, etc.) Each asset belongs to only a single classification type. This object contains metadata pertaining to the given classification. While some fields may be common among the distinct classifcations, each classification is distinct and subject to independent change. - `class Regular: …` - `kind: Literal["regular"]` - `"regular"` - `neptune_receipt_asset: Optional[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) - `class NeptuneReceiptToken: …` - `kind: Literal["neptune_receipt_token"]` - `"neptune_receipt_token"` - `origin_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) - `class LiquidStakingToken: …` - `kind: Literal["liquid_staking_token"]` - `"liquid_staking_token"` - `origin_asset: Optional[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) - `metadata: AssetMetadata` Additional metadata for assets - `decimals_denom: int` Denom exponent, or num. of decimal places that shift between denom/standard amounts (e.g. `18` for `INJ`) - `decimals_display: int` Number of decimals used when displaying amounts of this asset (this is subjective and used for generating text representations) - `name: str` Full name of the asset - `symbol: str` Symbol of the asset, e.g.: `NEPT` `INJ` - `symbol_denom: str` Denom symbol for the asset (e.g. `inj` for `INJ`, `sat` for `BTC`) - `config: BorrowCollateralConfig` Collateral configuration parameters - `allowable_ltv: str` The loan to value ratio at which we allow collateral withdrawals or borrows. - `collateral_cap: Optional[str]` The optional, global/shared maximum deposit limit for this collateral. - `enabled: bool` Collateral enabled state - `extra: Extra` - `text: Optional[ExtraText]` Human-readable field variants. Will not be null when query param `with_text` is `true`. - `allowable_ltv: str` - `collateral_cap: str` - `liquidation_ltv: str` - `max_discount: str` - `min_discount: str` - `value: Optional[ExtraValue]` 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. - `collateral_cap: Optional[str]` - `extra: ExtraValueExtra` - `text: Optional[ExtraValueExtraText]` Human-readable variants of USD values. Will not be null when query params `with_text` and `with_value` are `true`. - `collateral_cap: Optional[str]` - `price: Optional[str]` Text representation of price - `price: str` Price used in value calculations - `liquidation_ltv: str` The loan to value ratio at which the collateral can be liquidated. - `max_discount: str` The maximum dynamic discount - `min_discount: str` The minimum dynamic discount. - `state: BorrowCollateralState` Current collateral state - `balance: str` - `collateral_sum: str` Total amount of this asset which is actively collateralized - `extra: Extra` - `text: Optional[ExtraText]` Human-readable field variants. Will not be null when query param `with_text` is `true`. - `collateral_sum: str` - `value: Optional[ExtraValue]` 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. - `collateral_sum: str` - `extra: ExtraValueExtra` - `text: Optional[ExtraValueExtraText]` Human-readable variants of USD values. Will not be null when query params `with_text` and `with_value` are `true`. - `collateral_sum: str` - `price: str` Text representation of price - `price: str` Price used in value calculations ### Borrow Collateral Market Data - `class BorrowCollateralMarketData: …` - `config: BorrowCollateralConfig` Collateral configuration parameters - `allowable_ltv: str` The loan to value ratio at which we allow collateral withdrawals or borrows. - `collateral_cap: Optional[str]` The optional, global/shared maximum deposit limit for this collateral. - `enabled: bool` Collateral enabled state - `extra: Extra` - `text: Optional[ExtraText]` Human-readable field variants. Will not be null when query param `with_text` is `true`. - `allowable_ltv: str` - `collateral_cap: str` - `liquidation_ltv: str` - `max_discount: str` - `min_discount: str` - `value: Optional[ExtraValue]` 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. - `collateral_cap: Optional[str]` - `extra: ExtraValueExtra` - `text: Optional[ExtraValueExtraText]` Human-readable variants of USD values. Will not be null when query params `with_text` and `with_value` are `true`. - `collateral_cap: Optional[str]` - `price: Optional[str]` Text representation of price - `price: str` Price used in value calculations - `liquidation_ltv: str` The loan to value ratio at which the collateral can be liquidated. - `max_discount: str` The maximum dynamic discount - `min_discount: str` The minimum dynamic discount. - `state: BorrowCollateralState` Current collateral state - `balance: str` - `collateral_sum: str` Total amount of this asset which is actively collateralized - `extra: Extra` - `text: Optional[ExtraText]` Human-readable field variants. Will not be null when query param `with_text` is `true`. - `collateral_sum: str` - `value: Optional[ExtraValue]` 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. - `collateral_sum: str` - `extra: ExtraValueExtra` - `text: Optional[ExtraValueExtraText]` Human-readable variants of USD values. Will not be null when query params `with_text` and `with_value` are `true`. - `collateral_sum: str` - `price: str` Text representation of price - `price: str` Price used in value calculations ### Borrow Collateral State - `class BorrowCollateralState: …` - `balance: str` - `collateral_sum: str` Total amount of this asset which is actively collateralized - `extra: Extra` - `text: Optional[ExtraText]` Human-readable field variants. Will not be null when query param `with_text` is `true`. - `collateral_sum: str` - `value: Optional[ExtraValue]` 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. - `collateral_sum: str` - `extra: ExtraValueExtra` - `text: Optional[ExtraValueExtraText]` Human-readable variants of USD values. Will not be null when query params `with_text` and `with_value` are `true`. - `collateral_sum: str` - `price: str` Text representation of price - `price: str` Price used in value calculations # Debts ## Get borrowing debt markets `markets.borrow.debts.list(DebtListParams**kwargs) -> DebtListResponse` **get** `/api/v1/markets/borrow/debts` Get borrowing debt markets ### Parameters - `with_text: Optional[bool]` Include text variation fields - `with_value: Optional[bool]` Calculate and include USD values for amounts, where applicable ### Returns - `class DebtListResponse: …` - `count: int` Total number of objects irrespective of any pagination parameters. - `data: List[BorrowDebtMarket]` - `asset_info: AssetInfo` Asset identifiers with associated metadata - `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"]` - `"native"` - `"token"` - `group_key: str` - `classification: AssetClassification` The asset's classification metadata. Assets are classfied to provide context on their usage throughout the Neptune API (e.g. regular assets, neptune receipt tokens, LSTs, etc.) Each asset belongs to only a single classification type. This object contains metadata pertaining to the given classification. While some fields may be common among the distinct classifcations, each classification is distinct and subject to independent change. - `class Regular: …` - `kind: Literal["regular"]` - `"regular"` - `neptune_receipt_asset: Optional[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) - `class NeptuneReceiptToken: …` - `kind: Literal["neptune_receipt_token"]` - `"neptune_receipt_token"` - `origin_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) - `class LiquidStakingToken: …` - `kind: Literal["liquid_staking_token"]` - `"liquid_staking_token"` - `origin_asset: Optional[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) - `metadata: AssetMetadata` Additional metadata for assets - `decimals_denom: int` Denom exponent, or num. of decimal places that shift between denom/standard amounts (e.g. `18` for `INJ`) - `decimals_display: int` Number of decimals used when displaying amounts of this asset (this is subjective and used for generating text representations) - `name: str` Full name of the asset - `symbol: str` Symbol of the asset, e.g.: `NEPT` `INJ` - `symbol_denom: str` Denom symbol for the asset (e.g. `inj` for `INJ`, `sat` for `BTC`) - `config: BorrowDebtConfig` Debt market configuration parameters - `borrow_cap: Optional[str]` The global max amount which can be borrowed - `borrow_halt_utilization: str` The maximum utilization ratio at which new borrow positions can be opened. - `enabled: bool` Market enabled state - `extra: Extra` - `text: Optional[ExtraText]` Human-readable field variants. Will not be null when query param `with_text` is `true`. - `borrow_cap: str` - `borrow_halt_utilization: str` - `interest_fee: str` - `value: Optional[ExtraValue]` 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. - `borrow_cap: Optional[str]` - `extra: ExtraValueExtra` - `text: Optional[ExtraValueExtraText]` Human-readable variants of USD values. Will not be null when query params `with_text` and `with_value` are `true`. - `borrow_cap: Optional[str]` - `price: Optional[str]` Text representation of price - `price: str` Price used in value calculations - `interest_fee: str` The protocol (base) interest rate that is charged to borrowers. - `rate: MarketRate` Market rates - `apr: str` Market rate in APR standard as a decimal percentage - `apy: str` Market rate in APY standard as a decimal percentage - `extra: Extra` - `text: Optional[ExtraText]` Human-readable field variants. Will not be null when query param `with_text` is `true`. - `apr: str` - `apy: str` - `state: BorrowDebtState` Current debt market state - `balance_sum: str` - `extra: Extra` - `text: Optional[ExtraText]` Human-readable field variants. Will not be null when query param `with_text` is `true`. - `balance_sum: str` - `principal_sum: str` - `time_last_distributed_interest: str` - `value: Optional[ExtraValue]` 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. - `balance_sum: str` - `extra: ExtraValueExtra` - `text: Optional[ExtraValueExtraText]` Human-readable variants of USD values. Will not be null when query params `with_text` and `with_value` are `true`. - `balance_sum: str` - `price: str` Text representation of price - `principal_sum: str` - `price: str` Price used in value calculations - `principal_sum: str` - `principal_sum: str` - `time_last_distributed_interest: datetime` Timestamp used to keep track of the last time interest was distributed. - `utilization_accumulator: str` Asset utilization tracker. - `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`. - `status_text: str` HTTP status text ### Example ```python from neptune_api_v2 import NeptuneAPIV2 client = NeptuneAPIV2() debts = client.markets.borrow.debts.list() print(debts.count) ``` #### Response ```json { "data": [ { "asset_info": { "asset": { "id": "native;inj", "group": "native", "group_key": "inj" }, "metadata": { "name": "Injective", "symbol": "INJ", "symbol_denom": "inj", "decimals_denom": 18, "decimals_display": 4 }, "classification": { "kind": "regular", "neptune_receipt_asset": { "id": "token;inj1rmzufd7h09sqfrre5dtvu5d09ta7c0t4jzkr2f", "group": "token", "group_key": "inj1rmzufd7h09sqfrre5dtvu5d09ta7c0t4jzkr2f" } } }, "rate": { "apr": "0.22854341", "apy": "0.25676808", "extra": { "text": { "apy": "25.67%", "apr": "22.85%" } } }, "config": { "enabled": true, "borrow_cap": null, "interest_fee": "0.01", "borrow_halt_utilization": "0.9", "extra": { "text": { "borrow_halt_utilization": "90.00%", "borrow_cap": "", "interest_fee": "1.00%" }, "value": { "price": "2.99835", "borrow_cap": null, "extra": { "text": { "price": "$2.99", "borrow_cap": null } } } } }, "state": { "principal_sum": "8661303857191", "balance_sum": "11465109879047", "utilization_accumulator": "73866.085602375398217627", "time_last_distributed_interest": "2026-04-09T22:40:09.138851472Z", "extra": { "text": { "time_last_distributed_interest": "2026-04-09 10:40:09 PM +00:00", "principal_sum": "0.0000 INJ", "balance_sum": "0.0000 INJ" }, "value": { "principal_sum": "0.000025969620420208", "balance_sum": "0.00003437641220584", "price": "2.99835", "extra": { "text": { "price": "$2.99", "principal_sum": "$0.00", "balance_sum": "$0.00" } } } } } } ], "count": 1, "error": null, "status": 200, "status_text": "200 OK" } ``` ## Lookup borrowing debt market by asset `markets.borrow.debts.get_by_asset(DebtGetByAssetParams**kwargs) -> DebtGetByAssetResponse` **get** `/api/v1/markets/borrow/debts/lookup` Lookup borrowing debt market by asset ### Parameters - `asset_id: str` Asset ID for lookup - `with_text: Optional[bool]` Include text variation fields - `with_value: Optional[bool]` Calculate and include USD values for amounts, where applicable ### Returns - `class DebtGetByAssetResponse: …` - `data: BorrowDebtMarket` Borrowing market, debt info - `asset_info: AssetInfo` Asset identifiers with associated metadata - `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"]` - `"native"` - `"token"` - `group_key: str` - `classification: AssetClassification` The asset's classification metadata. Assets are classfied to provide context on their usage throughout the Neptune API (e.g. regular assets, neptune receipt tokens, LSTs, etc.) Each asset belongs to only a single classification type. This object contains metadata pertaining to the given classification. While some fields may be common among the distinct classifcations, each classification is distinct and subject to independent change. - `class Regular: …` - `kind: Literal["regular"]` - `"regular"` - `neptune_receipt_asset: Optional[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) - `class NeptuneReceiptToken: …` - `kind: Literal["neptune_receipt_token"]` - `"neptune_receipt_token"` - `origin_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) - `class LiquidStakingToken: …` - `kind: Literal["liquid_staking_token"]` - `"liquid_staking_token"` - `origin_asset: Optional[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) - `metadata: AssetMetadata` Additional metadata for assets - `decimals_denom: int` Denom exponent, or num. of decimal places that shift between denom/standard amounts (e.g. `18` for `INJ`) - `decimals_display: int` Number of decimals used when displaying amounts of this asset (this is subjective and used for generating text representations) - `name: str` Full name of the asset - `symbol: str` Symbol of the asset, e.g.: `NEPT` `INJ` - `symbol_denom: str` Denom symbol for the asset (e.g. `inj` for `INJ`, `sat` for `BTC`) - `config: BorrowDebtConfig` Debt market configuration parameters - `borrow_cap: Optional[str]` The global max amount which can be borrowed - `borrow_halt_utilization: str` The maximum utilization ratio at which new borrow positions can be opened. - `enabled: bool` Market enabled state - `extra: Extra` - `text: Optional[ExtraText]` Human-readable field variants. Will not be null when query param `with_text` is `true`. - `borrow_cap: str` - `borrow_halt_utilization: str` - `interest_fee: str` - `value: Optional[ExtraValue]` 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. - `borrow_cap: Optional[str]` - `extra: ExtraValueExtra` - `text: Optional[ExtraValueExtraText]` Human-readable variants of USD values. Will not be null when query params `with_text` and `with_value` are `true`. - `borrow_cap: Optional[str]` - `price: Optional[str]` Text representation of price - `price: str` Price used in value calculations - `interest_fee: str` The protocol (base) interest rate that is charged to borrowers. - `rate: MarketRate` Market rates - `apr: str` Market rate in APR standard as a decimal percentage - `apy: str` Market rate in APY standard as a decimal percentage - `extra: Extra` - `text: Optional[ExtraText]` Human-readable field variants. Will not be null when query param `with_text` is `true`. - `apr: str` - `apy: str` - `state: BorrowDebtState` Current debt market state - `balance_sum: str` - `extra: Extra` - `text: Optional[ExtraText]` Human-readable field variants. Will not be null when query param `with_text` is `true`. - `balance_sum: str` - `principal_sum: str` - `time_last_distributed_interest: str` - `value: Optional[ExtraValue]` 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. - `balance_sum: str` - `extra: ExtraValueExtra` - `text: Optional[ExtraValueExtraText]` Human-readable variants of USD values. Will not be null when query params `with_text` and `with_value` are `true`. - `balance_sum: str` - `price: str` Text representation of price - `principal_sum: str` - `price: str` Price used in value calculations - `principal_sum: str` - `principal_sum: str` - `time_last_distributed_interest: datetime` Timestamp used to keep track of the last time interest was distributed. - `utilization_accumulator: str` Asset utilization tracker. - `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`. - `status_text: str` HTTP status text ### Example ```python from neptune_api_v2 import NeptuneAPIV2 client = NeptuneAPIV2() response = client.markets.borrow.debts.get_by_asset( asset_id="token;-K-//-//3-", ) print(response.data) ``` #### Response ```json { "data": { "asset_info": { "asset": { "id": "native;inj", "group": "native", "group_key": "inj" }, "metadata": { "name": "Injective", "symbol": "INJ", "symbol_denom": "inj", "decimals_denom": 18, "decimals_display": 4 }, "classification": { "kind": "regular", "neptune_receipt_asset": { "id": "token;inj1rmzufd7h09sqfrre5dtvu5d09ta7c0t4jzkr2f", "group": "token", "group_key": "inj1rmzufd7h09sqfrre5dtvu5d09ta7c0t4jzkr2f" } } }, "rate": { "apr": "0.22303756", "apy": "0.24986752", "extra": { "text": { "apy": "24.98%", "apr": "22.30%" } } }, "config": { "enabled": true, "borrow_cap": null, "interest_fee": "0.01", "borrow_halt_utilization": "0.9", "extra": { "text": { "borrow_halt_utilization": "90.00%", "borrow_cap": "", "interest_fee": "1.00%" }, "value": { "price": "2.99835", "borrow_cap": null, "extra": { "text": { "price": "$2.99", "borrow_cap": null } } } } }, "state": { "principal_sum": "1239314105218", "balance_sum": "3107130417434", "utilization_accumulator": "74251.669294104254763179", "time_last_distributed_interest": "2026-04-09T22:40:09.139013372Z", "extra": { "text": { "time_last_distributed_interest": "2026-04-09 10:40:09 PM +00:00", "principal_sum": "0.0000 INJ", "balance_sum": "0.0000 INJ" }, "value": { "principal_sum": "0.00000371589744738", "balance_sum": "0.000009316264487113", "price": "2.99835", "extra": { "text": { "price": "$2.99", "principal_sum": "$0.00", "balance_sum": "$0.00" } } } } } }, "error": null, "status": 200, "status_text": "200 OK" } ``` ## Domain Types ### Borrow Debt Config - `class BorrowDebtConfig: …` - `borrow_cap: Optional[str]` The global max amount which can be borrowed - `borrow_halt_utilization: str` The maximum utilization ratio at which new borrow positions can be opened. - `enabled: bool` Market enabled state - `extra: Extra` - `text: Optional[ExtraText]` Human-readable field variants. Will not be null when query param `with_text` is `true`. - `borrow_cap: str` - `borrow_halt_utilization: str` - `interest_fee: str` - `value: Optional[ExtraValue]` 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. - `borrow_cap: Optional[str]` - `extra: ExtraValueExtra` - `text: Optional[ExtraValueExtraText]` Human-readable variants of USD values. Will not be null when query params `with_text` and `with_value` are `true`. - `borrow_cap: Optional[str]` - `price: Optional[str]` Text representation of price - `price: str` Price used in value calculations - `interest_fee: str` The protocol (base) interest rate that is charged to borrowers. ### Borrow Debt Market - `class BorrowDebtMarket: …` Borrowing market, debt info - `asset_info: AssetInfo` Asset identifiers with associated metadata - `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"]` - `"native"` - `"token"` - `group_key: str` - `classification: AssetClassification` The asset's classification metadata. Assets are classfied to provide context on their usage throughout the Neptune API (e.g. regular assets, neptune receipt tokens, LSTs, etc.) Each asset belongs to only a single classification type. This object contains metadata pertaining to the given classification. While some fields may be common among the distinct classifcations, each classification is distinct and subject to independent change. - `class Regular: …` - `kind: Literal["regular"]` - `"regular"` - `neptune_receipt_asset: Optional[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) - `class NeptuneReceiptToken: …` - `kind: Literal["neptune_receipt_token"]` - `"neptune_receipt_token"` - `origin_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) - `class LiquidStakingToken: …` - `kind: Literal["liquid_staking_token"]` - `"liquid_staking_token"` - `origin_asset: Optional[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) - `metadata: AssetMetadata` Additional metadata for assets - `decimals_denom: int` Denom exponent, or num. of decimal places that shift between denom/standard amounts (e.g. `18` for `INJ`) - `decimals_display: int` Number of decimals used when displaying amounts of this asset (this is subjective and used for generating text representations) - `name: str` Full name of the asset - `symbol: str` Symbol of the asset, e.g.: `NEPT` `INJ` - `symbol_denom: str` Denom symbol for the asset (e.g. `inj` for `INJ`, `sat` for `BTC`) - `config: BorrowDebtConfig` Debt market configuration parameters - `borrow_cap: Optional[str]` The global max amount which can be borrowed - `borrow_halt_utilization: str` The maximum utilization ratio at which new borrow positions can be opened. - `enabled: bool` Market enabled state - `extra: Extra` - `text: Optional[ExtraText]` Human-readable field variants. Will not be null when query param `with_text` is `true`. - `borrow_cap: str` - `borrow_halt_utilization: str` - `interest_fee: str` - `value: Optional[ExtraValue]` 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. - `borrow_cap: Optional[str]` - `extra: ExtraValueExtra` - `text: Optional[ExtraValueExtraText]` Human-readable variants of USD values. Will not be null when query params `with_text` and `with_value` are `true`. - `borrow_cap: Optional[str]` - `price: Optional[str]` Text representation of price - `price: str` Price used in value calculations - `interest_fee: str` The protocol (base) interest rate that is charged to borrowers. - `rate: MarketRate` Market rates - `apr: str` Market rate in APR standard as a decimal percentage - `apy: str` Market rate in APY standard as a decimal percentage - `extra: Extra` - `text: Optional[ExtraText]` Human-readable field variants. Will not be null when query param `with_text` is `true`. - `apr: str` - `apy: str` - `state: BorrowDebtState` Current debt market state - `balance_sum: str` - `extra: Extra` - `text: Optional[ExtraText]` Human-readable field variants. Will not be null when query param `with_text` is `true`. - `balance_sum: str` - `principal_sum: str` - `time_last_distributed_interest: str` - `value: Optional[ExtraValue]` 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. - `balance_sum: str` - `extra: ExtraValueExtra` - `text: Optional[ExtraValueExtraText]` Human-readable variants of USD values. Will not be null when query params `with_text` and `with_value` are `true`. - `balance_sum: str` - `price: str` Text representation of price - `principal_sum: str` - `price: str` Price used in value calculations - `principal_sum: str` - `principal_sum: str` - `time_last_distributed_interest: datetime` Timestamp used to keep track of the last time interest was distributed. - `utilization_accumulator: str` Asset utilization tracker. ### Borrow Debt Market Data - `class BorrowDebtMarketData: …` - `config: BorrowDebtConfig` Debt market configuration parameters - `borrow_cap: Optional[str]` The global max amount which can be borrowed - `borrow_halt_utilization: str` The maximum utilization ratio at which new borrow positions can be opened. - `enabled: bool` Market enabled state - `extra: Extra` - `text: Optional[ExtraText]` Human-readable field variants. Will not be null when query param `with_text` is `true`. - `borrow_cap: str` - `borrow_halt_utilization: str` - `interest_fee: str` - `value: Optional[ExtraValue]` 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. - `borrow_cap: Optional[str]` - `extra: ExtraValueExtra` - `text: Optional[ExtraValueExtraText]` Human-readable variants of USD values. Will not be null when query params `with_text` and `with_value` are `true`. - `borrow_cap: Optional[str]` - `price: Optional[str]` Text representation of price - `price: str` Price used in value calculations - `interest_fee: str` The protocol (base) interest rate that is charged to borrowers. - `rate: MarketRate` Market rates - `apr: str` Market rate in APR standard as a decimal percentage - `apy: str` Market rate in APY standard as a decimal percentage - `extra: Extra` - `text: Optional[ExtraText]` Human-readable field variants. Will not be null when query param `with_text` is `true`. - `apr: str` - `apy: str` - `state: BorrowDebtState` Current debt market state - `balance_sum: str` - `extra: Extra` - `text: Optional[ExtraText]` Human-readable field variants. Will not be null when query param `with_text` is `true`. - `balance_sum: str` - `principal_sum: str` - `time_last_distributed_interest: str` - `value: Optional[ExtraValue]` 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. - `balance_sum: str` - `extra: ExtraValueExtra` - `text: Optional[ExtraValueExtraText]` Human-readable variants of USD values. Will not be null when query params `with_text` and `with_value` are `true`. - `balance_sum: str` - `price: str` Text representation of price - `principal_sum: str` - `price: str` Price used in value calculations - `principal_sum: str` - `principal_sum: str` - `time_last_distributed_interest: datetime` Timestamp used to keep track of the last time interest was distributed. - `utilization_accumulator: str` Asset utilization tracker. ### Borrow Debt State - `class BorrowDebtState: …` - `balance_sum: str` - `extra: Extra` - `text: Optional[ExtraText]` Human-readable field variants. Will not be null when query param `with_text` is `true`. - `balance_sum: str` - `principal_sum: str` - `time_last_distributed_interest: str` - `value: Optional[ExtraValue]` 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. - `balance_sum: str` - `extra: ExtraValueExtra` - `text: Optional[ExtraValueExtraText]` Human-readable variants of USD values. Will not be null when query params `with_text` and `with_value` are `true`. - `balance_sum: str` - `price: str` Text representation of price - `principal_sum: str` - `price: str` Price used in value calculations - `principal_sum: str` - `principal_sum: str` - `time_last_distributed_interest: datetime` Timestamp used to keep track of the last time interest was distributed. - `utilization_accumulator: str` Asset utilization tracker.