# Market ## Get user market portfolio `user.market.get_portfolio(straddress, MarketGetPortfolioParams**kwargs) -> MarketGetPortfolioResponse` **get** `/api/v1/users/{address}/markets` Get user market portfolio ### Parameters - `address: str` The user account address - `with_text: Optional[bool]` Include text variation fields - `with_value: Optional[bool]` Calculate and include USD values for amounts, where applicable ### Returns - `class MarketGetPortfolioResponse: …` - `data: UserMarket` - `borrow: UserBorrowMarket` Overview of user borrowing portfolio - `accounts: List[UserBorrowMarketAccount]` Market sub-accounts for the user - `collaterals: List[UserCollateralAssetPool]` Account collateral allocations - `amount: str` Amount of this asset which is actively collateralized - `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`) - `extra: Extra` - `text: Optional[ExtraText]` Human-readable field variants. Will not be null when query param `with_text` is `true`. - `amount: 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. - `amount: 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`. - `amount: str` - `price: str` Text representation of price - `price: str` Price used in value calculations - `debts: List[UserDebtAssetPool]` Account debt allocations - `asset_info: AssetInfo` Asset identifiers with associated metadata - `extra: Extra` - `text: Optional[ExtraText]` Human-readable field variants. Will not be null when query param `with_text` is `true`. - `principal: str` - `shares: 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: str` - `shares: str` - `price: str` Price used in value calculations - `principal: str` - `shares: str` - `market_rate: MarketRate` Current market borrowing rate - `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` - `principal: str` Initial amount borrowed (of debts which have not yet been repaid) - `shares: str` - `debts_net_rate: MarketRate` Account debt net rate - `health: Optional[UserAccountHealth]` Health data for this account - `base: str` Account health value, before any added health boosts - `boost: str` Account health boost to be applied - `extra: Extra` - `text: Optional[ExtraText]` Human-readable field variants. Will not be null when query param `with_text` is `true`. - `base: str` - `boost: str` - `result: str` - `result: str` Account health, with boost - `index: int` Account index - `totals: UserBorrowMarketPools` Collateral/debt totals of all sub-accounts by asset - `collaterals: List[UserCollateralAssetPool]` Account collateral allocations - `amount: str` Amount of this asset which is actively collateralized - `asset_info: AssetInfo` Asset identifiers with associated metadata - `extra: Extra` - `debts: List[UserDebtAssetPool]` Account debt allocations - `asset_info: AssetInfo` Asset identifiers with associated metadata - `extra: Extra` - `market_rate: MarketRate` Current market borrowing rate - `principal: str` Initial amount borrowed (of debts which have not yet been repaid) - `shares: str` - `debts_net_rate: MarketRate` Account debt net rate - `lend: UserLendMarket` Overview of user lending portfolio - `asset_pools: List[UserLendAssetPool]` User lending allocations - `asset_info: AssetInfo` Asset identifiers with associated metadata - `market_rate: MarketRate` Current market lending rate - `origin_equivalent: UserLendOriginAmounts` The lending amounts converted into the equivalent for the receipt token's origin/source asset - `collateralized: str` Total equivalent amount of origin token collateralized across this user's borrowing portfolio **NOTE:** This is **not** the amount of the origin asset that the user holds, but the amount held in the receipt token rendered as the equivalent amount in the origin asset. Or, more formally: `origin_equivalent_collateralized = receipt_collateralized / receipt_redemption_ratio` - `extra: Extra` - `text: Optional[ExtraText]` Human-readable field variants. Will not be null when query param `with_text` is `true`. - `collateralized: str` - `held: str` - `total: str` - `held: str` Total equivalent amount of origin token held in address balance **NOTE:** This is **not** the amount of the origin asset that the user holds, but the amount held in the receipt token rendered as the equivalent amount in the origin asset. Or, more formally: `origin_equivalent_held = receipt_held / receipt_redemption_ratio` - `total: str` Total of held and collateralized equivalent for origin asset Or, more formally: `origin_equivalent_total = receipt_lent_total / receipt_redemption_ratio` - `receipt_amounts: UserLendReceiptAmounts` The lending amounts in the original receipt token amounts - `collateralized: str` Total amount of receipt token collateralized across this user's borrowing portfolio - `extra: Extra` - `text: Optional[ExtraText]` Human-readable field variants. Will not be null when query param `with_text` is `true`. - `collateralized: str` - `held: str` - `total: 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. - `collateralized: 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`. - `collateralized: str` - `held: str` - `price: str` Text representation of price - `total: str` - `held: str` - `price: str` Price used in value calculations - `total: str` - `held: str` Total amount of receipt token held in address balance - `total: str` Sum of receipt amount held and receipt amount collateralized - `net_rate: MarketRate` Account debt net rate - `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.user.market.get_portfolio( address="injvalcons1a03k0ztfyjnd70apawva003pkh0adqmau0a9q0", ) print(response.data) ``` #### Response ```json { "data": { "borrow": { "accounts": [ { "index": 0, "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" } } }, "amount": "920380558505833997007", "extra": { "text": { "amount": "920.3805 INJ" }, "value": { "price": "2.99835", "amount": "2759.623047595967364925", "extra": { "text": { "amount": "$2,759.62", "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" } } }, "market_rate": { "apr": "0.10742845", "apy": "0.11341119", "extra": { "text": { "apy": "11.34%", "apr": "10.74%" } } }, "principal": "444725506597269050309", "shares": "444725506597269050309", "extra": { "text": { "principal": "444.7255 INJ", "shares": "444.7255 INJ" }, "value": { "shares": "1333.442722705921656993", "price": "2.99835", "principal": "1333.442722705921656993", "extra": { "text": { "shares": "$1,333.44", "price": "$2.99", "principal": "$1,333.44" } } } } } ], "debts_net_rate": { "apr": "0.107428449999999999", "apy": "0.113411189999999999", "extra": { "text": { "apy": "11.34%", "apr": "10.74%" } } }, "health": { "base": "3.56", "boost": "1", "result": "3.56", "extra": { "text": { "base": "3.56", "boost": "0.00%", "result": "3.56" } } } } ], "totals": { "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" } } }, "amount": "920380558505833997007", "extra": { "text": { "amount": "920.3805 INJ" }, "value": { "price": "2.99835", "amount": "2759.623047595967364925", "extra": { "text": { "amount": "$2,759.62", "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" } } }, "market_rate": { "apr": "0.10742845", "apy": "0.11341119", "extra": { "text": { "apy": "11.34%", "apr": "10.74%" } } }, "principal": "444725506597269050309", "shares": "444725506597269050309", "extra": { "text": { "principal": "444.7255 INJ", "shares": "444.7255 INJ" }, "value": { "shares": "1333.442722705921656993", "price": "2.99835", "principal": "1333.442722705921656993", "extra": { "text": { "shares": "$1,333.44", "price": "$2.99", "principal": "$1,333.44" } } } } } ], "debts_net_rate": { "apr": "0.107428449999999999", "apy": "0.113411189999999999", "extra": { "text": { "apy": "11.34%", "apr": "10.74%" } } } } }, "lend": { "asset_pools": [ { "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" } } }, "market_rate": { "apr": "0.28352819", "apy": "0.32780631", "extra": { "text": { "apy": "32.78%", "apr": "28.35%" } } }, "receipt_amounts": { "held": "503392454790765643939", "collateralized": "63652103341334203700", "total": "567044558132099847639", "extra": { "text": { "total": "567.0445 nINJ", "held": "503.3924 nINJ", "collateralized": "63.6521 nINJ" }, "value": { "held": "1623.155947024350227118", "collateralized": "205.242031531916407303", "price": "3.224434398205298254", "total": "1828.397978556266634422", "extra": { "text": { "price": "$3.22", "collateralized": "$205.24", "held": "$1,623.15", "total": "$1,828.39" } } } } }, "origin_equivalent": { "held": "539899466414371690487", "collateralized": "68268279158897706162", "total": "608167745573269396650", "extra": { "text": { "total": "608.1677 INJ", "collateralized": "68.2682 INJ", "held": "539.8994 INJ" } } } } ], "net_rate": { "apr": "0.283528189999999999", "apy": "0.327806309999999999", "extra": { "text": { "apy": "32.78%", "apr": "28.35%" } } } } }, "error": null, "status": 200, "status_text": "200 OK" } ``` ## Get user markets for all kinds (lend + borrow debt/collateral), grouped together by asset `user.market.get_merged(straddress, MarketGetMergedParams**kwargs) -> MarketGetMergedResponse` **get** `/api/v1/users/{address}/markets/merged` Get user markets for all kinds (lend + borrow debt/collateral), grouped together by asset ### Parameters - `address: str` The user account address - `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[UserMergedMarket]` - `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: List[UserCollateralAccountPool]` User collateral contribution for asset in borrow market, listed by subaccount - `amount: str` 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`. - `amount: 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. - `amount: 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`. - `amount: str` - `price: str` Text representation of price - `price: str` Price used in value calculations - `index: int` Account index - `borrow_debt: List[UserDebtAccountPool]` User debt contribution for asset in borrow market, listed by subaccount - `extra: Extra` - `text: Optional[ExtraText]` Human-readable field variants. Will not be null when query param `with_text` is `true`. - `principal: str` - `shares: 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: str` - `shares: str` - `price: str` Price used in value calculations - `principal: str` - `shares: str` - `index: int` Account index - `principal: str` Initial amount borrowed (of debts which have not yet been repaid) - `shares: str` - `lend: Optional[Lend]` User contribution for asset's lending market, if one exists - `origin_equivalent: UserLendOriginAmounts` The lending amounts converted into the equivalent for the receipt token's origin/source asset - `collateralized: str` Total equivalent amount of origin token collateralized across this user's borrowing portfolio **NOTE:** This is **not** the amount of the origin asset that the user holds, but the amount held in the receipt token rendered as the equivalent amount in the origin asset. Or, more formally: `origin_equivalent_collateralized = receipt_collateralized / receipt_redemption_ratio` - `extra: Extra` - `text: Optional[ExtraText]` Human-readable field variants. Will not be null when query param `with_text` is `true`. - `collateralized: str` - `held: str` - `total: str` - `held: str` Total equivalent amount of origin token held in address balance **NOTE:** This is **not** the amount of the origin asset that the user holds, but the amount held in the receipt token rendered as the equivalent amount in the origin asset. Or, more formally: `origin_equivalent_held = receipt_held / receipt_redemption_ratio` - `total: str` Total of held and collateralized equivalent for origin asset Or, more formally: `origin_equivalent_total = receipt_lent_total / receipt_redemption_ratio` - `receipt_amounts: UserLendReceiptAmounts` The lending amounts in the original receipt token amounts - `collateralized: str` Total amount of receipt token collateralized across this user's borrowing portfolio - `extra: Extra` - `text: Optional[ExtraText]` Human-readable field variants. Will not be null when query param `with_text` is `true`. - `collateralized: str` - `held: str` - `total: 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. - `collateralized: 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`. - `collateralized: str` - `held: str` - `price: str` Text representation of price - `total: str` - `held: str` - `price: str` Price used in value calculations - `total: str` - `held: str` Total amount of receipt token held in address balance - `total: str` Sum of receipt amount held and receipt amount collateralized - `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.user.market.get_merged( address="injvalcons1a03k0ztfyjnd70apawva003pkh0adqmau0a9q0", ) 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": { "receipt_amounts": { "held": "118147367218417456837", "collateralized": "140264620447028478901", "total": "258411987665445935738", "extra": { "text": { "total": "258.4119 nINJ", "held": "118.1473 nINJ", "collateralized": "140.2646 nINJ" }, "value": { "held": "380.958434916458275153", "collateralized": "452.274067020608845929", "price": "3.224434398205298254", "total": "833.232501937067121083", "extra": { "text": { "price": "$3.22", "collateralized": "$452.27", "held": "$380.95", "total": "$833.23" } } } } }, "origin_equivalent": { "held": "126715646832648060567", "collateralized": "150436886797680767926", "total": "277152533630328828494", "extra": { "text": { "total": "277.1525 INJ", "collateralized": "150.4368 INJ", "held": "126.7156 INJ" } } } }, "borrow_collateral": [ { "index": 0, "amount": "149436500580266304744", "extra": { "text": { "amount": "149.4365 INJ" }, "value": { "price": "2.99835", "amount": "448.062931514841474829", "extra": { "text": { "amount": "$448.06", "price": "$2.99" } } } } } ], "borrow_debt": [ { "index": 0, "principal": "911081148730079455959", "shares": "911081148730079455959", "extra": { "text": { "principal": "911.0811 INJ", "shares": "911.0811 INJ" }, "value": { "shares": "2731.740162294833736774", "price": "2.99835", "principal": "2731.740162294833736774", "extra": { "text": { "shares": "$2,731.74", "price": "$2.99", "principal": "$2,731.74" } } } } } ] } ], "count": 1, "error": null, "status": 200, "status_text": "200 OK" } ``` ## Get user's markets (lend + borrow debt/collateral) for a specific asset `user.market.get_merged_by_asset(straddress, MarketGetMergedByAssetParams**kwargs) -> MarketGetMergedByAssetResponse` **get** `/api/v1/users/{address}/markets/merged/lookup` Get user's markets (lend + borrow debt/collateral) for a specific asset ### Parameters - `address: str` The user account address - `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: UserMergedMarket` User market allocations grouped by asset. **Note**: because of the inverted structure of merged market accounts, account health cannot be represented and is excluded in the merged structures. - `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: List[UserCollateralAccountPool]` User collateral contribution for asset in borrow market, listed by subaccount - `amount: str` 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`. - `amount: 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. - `amount: 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`. - `amount: str` - `price: str` Text representation of price - `price: str` Price used in value calculations - `index: int` Account index - `borrow_debt: List[UserDebtAccountPool]` User debt contribution for asset in borrow market, listed by subaccount - `extra: Extra` - `text: Optional[ExtraText]` Human-readable field variants. Will not be null when query param `with_text` is `true`. - `principal: str` - `shares: 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: str` - `shares: str` - `price: str` Price used in value calculations - `principal: str` - `shares: str` - `index: int` Account index - `principal: str` Initial amount borrowed (of debts which have not yet been repaid) - `shares: str` - `lend: Optional[Lend]` User contribution for asset's lending market, if one exists - `origin_equivalent: UserLendOriginAmounts` The lending amounts converted into the equivalent for the receipt token's origin/source asset - `collateralized: str` Total equivalent amount of origin token collateralized across this user's borrowing portfolio **NOTE:** This is **not** the amount of the origin asset that the user holds, but the amount held in the receipt token rendered as the equivalent amount in the origin asset. Or, more formally: `origin_equivalent_collateralized = receipt_collateralized / receipt_redemption_ratio` - `extra: Extra` - `text: Optional[ExtraText]` Human-readable field variants. Will not be null when query param `with_text` is `true`. - `collateralized: str` - `held: str` - `total: str` - `held: str` Total equivalent amount of origin token held in address balance **NOTE:** This is **not** the amount of the origin asset that the user holds, but the amount held in the receipt token rendered as the equivalent amount in the origin asset. Or, more formally: `origin_equivalent_held = receipt_held / receipt_redemption_ratio` - `total: str` Total of held and collateralized equivalent for origin asset Or, more formally: `origin_equivalent_total = receipt_lent_total / receipt_redemption_ratio` - `receipt_amounts: UserLendReceiptAmounts` The lending amounts in the original receipt token amounts - `collateralized: str` Total amount of receipt token collateralized across this user's borrowing portfolio - `extra: Extra` - `text: Optional[ExtraText]` Human-readable field variants. Will not be null when query param `with_text` is `true`. - `collateralized: str` - `held: str` - `total: 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. - `collateralized: 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`. - `collateralized: str` - `held: str` - `price: str` Text representation of price - `total: str` - `held: str` - `price: str` Price used in value calculations - `total: str` - `held: str` Total amount of receipt token held in address balance - `total: str` Sum of receipt amount held and receipt amount collateralized - `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.user.market.get_merged_by_asset( address="injvalcons1a03k0ztfyjnd70apawva003pkh0adqmau0a9q0", 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": { "receipt_amounts": { "held": "643195861442194223248", "collateralized": "730834802009981512361", "total": "1374030663452175735609", "extra": { "text": { "total": "1,374.0306 nINJ", "held": "643.1958 nINJ", "collateralized": "730.8348 nINJ" }, "value": { "held": "2073.942860417499929371", "collateralized": "2356.528875006543036615", "price": "3.224434398205298254", "total": "4430.471735424042965987", "extra": { "text": { "price": "$3.22", "collateralized": "$2,356.52", "held": "$2,073.94", "total": "$4,430.47" } } } } }, "origin_equivalent": { "held": "689841691284211618706", "collateralized": "783836380317316233638", "total": "1473678071601527852345", "extra": { "text": { "total": "1,473.6780 INJ", "collateralized": "783.8363 INJ", "held": "689.8416 INJ" } } } }, "borrow_collateral": [ { "index": 0, "amount": "745856805244361991671", "extra": { "text": { "amount": "745.8568 INJ" }, "value": { "price": "2.99835", "amount": "2236.339752004432777726", "extra": { "text": { "amount": "$2,236.33", "price": "$2.99" } } } } } ], "borrow_debt": [ { "index": 0, "principal": "64722195311136316616", "shares": "64722195311136316616", "extra": { "text": { "principal": "64.7221 INJ", "shares": "64.7221 INJ" }, "value": { "shares": "194.059794311145574925", "price": "2.99835", "principal": "194.059794311145574925", "extra": { "text": { "shares": "$194.05", "price": "$2.99", "principal": "$194.05" } } } } } ] }, "error": null, "status": 200, "status_text": "200 OK" } ``` ## Domain Types ### User Market - `class UserMarket: …` - `borrow: UserBorrowMarket` Overview of user borrowing portfolio - `accounts: List[UserBorrowMarketAccount]` Market sub-accounts for the user - `collaterals: List[UserCollateralAssetPool]` Account collateral allocations - `amount: str` Amount of this asset which is actively collateralized - `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`) - `extra: Extra` - `text: Optional[ExtraText]` Human-readable field variants. Will not be null when query param `with_text` is `true`. - `amount: 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. - `amount: 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`. - `amount: str` - `price: str` Text representation of price - `price: str` Price used in value calculations - `debts: List[UserDebtAssetPool]` Account debt allocations - `asset_info: AssetInfo` Asset identifiers with associated metadata - `extra: Extra` - `text: Optional[ExtraText]` Human-readable field variants. Will not be null when query param `with_text` is `true`. - `principal: str` - `shares: 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: str` - `shares: str` - `price: str` Price used in value calculations - `principal: str` - `shares: str` - `market_rate: MarketRate` Current market borrowing rate - `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` - `principal: str` Initial amount borrowed (of debts which have not yet been repaid) - `shares: str` - `debts_net_rate: MarketRate` Account debt net rate - `health: Optional[UserAccountHealth]` Health data for this account - `base: str` Account health value, before any added health boosts - `boost: str` Account health boost to be applied - `extra: Extra` - `text: Optional[ExtraText]` Human-readable field variants. Will not be null when query param `with_text` is `true`. - `base: str` - `boost: str` - `result: str` - `result: str` Account health, with boost - `index: int` Account index - `totals: UserBorrowMarketPools` Collateral/debt totals of all sub-accounts by asset - `collaterals: List[UserCollateralAssetPool]` Account collateral allocations - `amount: str` Amount of this asset which is actively collateralized - `asset_info: AssetInfo` Asset identifiers with associated metadata - `extra: Extra` - `debts: List[UserDebtAssetPool]` Account debt allocations - `asset_info: AssetInfo` Asset identifiers with associated metadata - `extra: Extra` - `market_rate: MarketRate` Current market borrowing rate - `principal: str` Initial amount borrowed (of debts which have not yet been repaid) - `shares: str` - `debts_net_rate: MarketRate` Account debt net rate - `lend: UserLendMarket` Overview of user lending portfolio - `asset_pools: List[UserLendAssetPool]` User lending allocations - `asset_info: AssetInfo` Asset identifiers with associated metadata - `market_rate: MarketRate` Current market lending rate - `origin_equivalent: UserLendOriginAmounts` The lending amounts converted into the equivalent for the receipt token's origin/source asset - `collateralized: str` Total equivalent amount of origin token collateralized across this user's borrowing portfolio **NOTE:** This is **not** the amount of the origin asset that the user holds, but the amount held in the receipt token rendered as the equivalent amount in the origin asset. Or, more formally: `origin_equivalent_collateralized = receipt_collateralized / receipt_redemption_ratio` - `extra: Extra` - `text: Optional[ExtraText]` Human-readable field variants. Will not be null when query param `with_text` is `true`. - `collateralized: str` - `held: str` - `total: str` - `held: str` Total equivalent amount of origin token held in address balance **NOTE:** This is **not** the amount of the origin asset that the user holds, but the amount held in the receipt token rendered as the equivalent amount in the origin asset. Or, more formally: `origin_equivalent_held = receipt_held / receipt_redemption_ratio` - `total: str` Total of held and collateralized equivalent for origin asset Or, more formally: `origin_equivalent_total = receipt_lent_total / receipt_redemption_ratio` - `receipt_amounts: UserLendReceiptAmounts` The lending amounts in the original receipt token amounts - `collateralized: str` Total amount of receipt token collateralized across this user's borrowing portfolio - `extra: Extra` - `text: Optional[ExtraText]` Human-readable field variants. Will not be null when query param `with_text` is `true`. - `collateralized: str` - `held: str` - `total: 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. - `collateralized: 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`. - `collateralized: str` - `held: str` - `price: str` Text representation of price - `total: str` - `held: str` - `price: str` Price used in value calculations - `total: str` - `held: str` Total amount of receipt token held in address balance - `total: str` Sum of receipt amount held and receipt amount collateralized - `net_rate: MarketRate` Account debt net rate ### User Merged Market - `class UserMergedMarket: …` User market allocations grouped by asset. **Note**: because of the inverted structure of merged market accounts, account health cannot be represented and is excluded in the merged structures. - `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: List[UserCollateralAccountPool]` User collateral contribution for asset in borrow market, listed by subaccount - `amount: str` 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`. - `amount: 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. - `amount: 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`. - `amount: str` - `price: str` Text representation of price - `price: str` Price used in value calculations - `index: int` Account index - `borrow_debt: List[UserDebtAccountPool]` User debt contribution for asset in borrow market, listed by subaccount - `extra: Extra` - `text: Optional[ExtraText]` Human-readable field variants. Will not be null when query param `with_text` is `true`. - `principal: str` - `shares: 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: str` - `shares: str` - `price: str` Price used in value calculations - `principal: str` - `shares: str` - `index: int` Account index - `principal: str` Initial amount borrowed (of debts which have not yet been repaid) - `shares: str` - `lend: Optional[Lend]` User contribution for asset's lending market, if one exists - `origin_equivalent: UserLendOriginAmounts` The lending amounts converted into the equivalent for the receipt token's origin/source asset - `collateralized: str` Total equivalent amount of origin token collateralized across this user's borrowing portfolio **NOTE:** This is **not** the amount of the origin asset that the user holds, but the amount held in the receipt token rendered as the equivalent amount in the origin asset. Or, more formally: `origin_equivalent_collateralized = receipt_collateralized / receipt_redemption_ratio` - `extra: Extra` - `text: Optional[ExtraText]` Human-readable field variants. Will not be null when query param `with_text` is `true`. - `collateralized: str` - `held: str` - `total: str` - `held: str` Total equivalent amount of origin token held in address balance **NOTE:** This is **not** the amount of the origin asset that the user holds, but the amount held in the receipt token rendered as the equivalent amount in the origin asset. Or, more formally: `origin_equivalent_held = receipt_held / receipt_redemption_ratio` - `total: str` Total of held and collateralized equivalent for origin asset Or, more formally: `origin_equivalent_total = receipt_lent_total / receipt_redemption_ratio` - `receipt_amounts: UserLendReceiptAmounts` The lending amounts in the original receipt token amounts - `collateralized: str` Total amount of receipt token collateralized across this user's borrowing portfolio - `extra: Extra` - `text: Optional[ExtraText]` Human-readable field variants. Will not be null when query param `with_text` is `true`. - `collateralized: str` - `held: str` - `total: 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. - `collateralized: 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`. - `collateralized: str` - `held: str` - `price: str` Text representation of price - `total: str` - `held: str` - `price: str` Price used in value calculations - `total: str` - `held: str` Total amount of receipt token held in address balance - `total: str` Sum of receipt amount held and receipt amount collateralized # Lend ## Get user lending portfolio `user.market.lend.list(straddress, LendListParams**kwargs) -> LendListResponse` **get** `/api/v1/users/{address}/markets/lend` Get user lending portfolio ### Parameters - `address: str` The user account address - `with_text: Optional[bool]` Include text variation fields - `with_value: Optional[bool]` Calculate and include USD values for amounts, where applicable ### Returns - `class LendListResponse: …` - `data: UserLendMarket` - `asset_pools: List[UserLendAssetPool]` User lending allocations - `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`) - `market_rate: MarketRate` Current market lending rate - `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` - `origin_equivalent: UserLendOriginAmounts` The lending amounts converted into the equivalent for the receipt token's origin/source asset - `collateralized: str` Total equivalent amount of origin token collateralized across this user's borrowing portfolio **NOTE:** This is **not** the amount of the origin asset that the user holds, but the amount held in the receipt token rendered as the equivalent amount in the origin asset. Or, more formally: `origin_equivalent_collateralized = receipt_collateralized / receipt_redemption_ratio` - `extra: Extra` - `text: Optional[ExtraText]` Human-readable field variants. Will not be null when query param `with_text` is `true`. - `collateralized: str` - `held: str` - `total: str` - `held: str` Total equivalent amount of origin token held in address balance **NOTE:** This is **not** the amount of the origin asset that the user holds, but the amount held in the receipt token rendered as the equivalent amount in the origin asset. Or, more formally: `origin_equivalent_held = receipt_held / receipt_redemption_ratio` - `total: str` Total of held and collateralized equivalent for origin asset Or, more formally: `origin_equivalent_total = receipt_lent_total / receipt_redemption_ratio` - `receipt_amounts: UserLendReceiptAmounts` The lending amounts in the original receipt token amounts - `collateralized: str` Total amount of receipt token collateralized across this user's borrowing portfolio - `extra: Extra` - `text: Optional[ExtraText]` Human-readable field variants. Will not be null when query param `with_text` is `true`. - `collateralized: str` - `held: str` - `total: 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. - `collateralized: 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`. - `collateralized: str` - `held: str` - `price: str` Text representation of price - `total: str` - `held: str` - `price: str` Price used in value calculations - `total: str` - `held: str` Total amount of receipt token held in address balance - `total: str` Sum of receipt amount held and receipt amount collateralized - `net_rate: MarketRate` Account debt net rate - `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.user.market.lend.list( address="injvalcons1a03k0ztfyjnd70apawva003pkh0adqmau0a9q0", ) print(lends.data) ``` #### Response ```json { "data": { "asset_pools": [ { "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" } } }, "market_rate": { "apr": "0.1039153", "apy": "0.1095065", "extra": { "text": { "apy": "10.95%", "apr": "10.39%" } } }, "receipt_amounts": { "held": "513780364745337161485", "collateralized": "803480027354503729108", "total": "1317260392099840890593", "extra": { "text": { "total": "1,317.2603 nINJ", "held": "513.7803 nINJ", "collateralized": "803.4800 nINJ" }, "value": { "held": "1656.651081207329865421", "collateralized": "2590.768638472795811094", "price": "3.224434398205298254", "total": "4247.419719680125676516", "extra": { "text": { "price": "$3.22", "collateralized": "$2,590.76", "held": "$1,656.65", "total": "$4,247.41" } } } } }, "origin_equivalent": { "held": "551040728044852101826", "collateralized": "861749980387785183392", "total": "1412790708432637285219", "extra": { "text": { "total": "1,412.7907 INJ", "collateralized": "861.7499 INJ", "held": "551.0407 INJ" } } } } ], "net_rate": { "apr": "0.103915299999999999", "apy": "0.109506499999999999", "extra": { "text": { "apy": "10.95%", "apr": "10.39%" } } } }, "error": null, "status": 200, "status_text": "200 OK" } ``` ## Lookup user lending distribution by asset `user.market.lend.get_by_asset(straddress, LendGetByAssetParams**kwargs) -> LendGetByAssetResponse` **get** `/api/v1/users/{address}/markets/lend/lookup` Lookup user lending distribution by asset ### Parameters - `address: str` The user account address - `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: UserLendAssetPool` - `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`) - `market_rate: MarketRate` Current market lending rate - `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` - `origin_equivalent: UserLendOriginAmounts` The lending amounts converted into the equivalent for the receipt token's origin/source asset - `collateralized: str` Total equivalent amount of origin token collateralized across this user's borrowing portfolio **NOTE:** This is **not** the amount of the origin asset that the user holds, but the amount held in the receipt token rendered as the equivalent amount in the origin asset. Or, more formally: `origin_equivalent_collateralized = receipt_collateralized / receipt_redemption_ratio` - `extra: Extra` - `text: Optional[ExtraText]` Human-readable field variants. Will not be null when query param `with_text` is `true`. - `collateralized: str` - `held: str` - `total: str` - `held: str` Total equivalent amount of origin token held in address balance **NOTE:** This is **not** the amount of the origin asset that the user holds, but the amount held in the receipt token rendered as the equivalent amount in the origin asset. Or, more formally: `origin_equivalent_held = receipt_held / receipt_redemption_ratio` - `total: str` Total of held and collateralized equivalent for origin asset Or, more formally: `origin_equivalent_total = receipt_lent_total / receipt_redemption_ratio` - `receipt_amounts: UserLendReceiptAmounts` The lending amounts in the original receipt token amounts - `collateralized: str` Total amount of receipt token collateralized across this user's borrowing portfolio - `extra: Extra` - `text: Optional[ExtraText]` Human-readable field variants. Will not be null when query param `with_text` is `true`. - `collateralized: str` - `held: str` - `total: 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. - `collateralized: 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`. - `collateralized: str` - `held: str` - `price: str` Text representation of price - `total: str` - `held: str` - `price: str` Price used in value calculations - `total: str` - `held: str` Total amount of receipt token held in address balance - `total: str` Sum of receipt amount held and receipt amount collateralized - `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.user.market.lend.get_by_asset( address="injvalcons1a03k0ztfyjnd70apawva003pkh0adqmau0a9q0", 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" } } }, "market_rate": { "apr": "0.25122284", "apy": "0.28559653", "extra": { "text": { "apy": "28.55%", "apr": "25.12%" } } }, "receipt_amounts": { "held": "34390327811707579753", "collateralized": "905248963117284075569", "total": "939639290928991655322", "extra": { "text": { "total": "939.6392 nINJ", "held": "34.3903 nINJ", "collateralized": "905.2489 nINJ" }, "value": { "held": "110.889355961626261527", "collateralized": "2918.915895615050113165", "price": "3.224434398205298254", "total": "3029.805251576676374692", "extra": { "text": { "price": "$3.22", "collateralized": "$2,918.91", "held": "$110.88", "total": "$3,029.80" } } } } }, "origin_equivalent": { "held": "36884382073374002120", "collateralized": "970899399678786249629", "total": "1007783781752160251749", "extra": { "text": { "total": "1,007.7837 INJ", "collateralized": "970.8993 INJ", "held": "36.8843 INJ" } } } }, "error": null, "status": 200, "status_text": "200 OK" } ``` ## Domain Types ### User Lend Asset Pool - `class UserLendAssetPool: …` - `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`) - `market_rate: MarketRate` Current market lending rate - `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` - `origin_equivalent: UserLendOriginAmounts` The lending amounts converted into the equivalent for the receipt token's origin/source asset - `collateralized: str` Total equivalent amount of origin token collateralized across this user's borrowing portfolio **NOTE:** This is **not** the amount of the origin asset that the user holds, but the amount held in the receipt token rendered as the equivalent amount in the origin asset. Or, more formally: `origin_equivalent_collateralized = receipt_collateralized / receipt_redemption_ratio` - `extra: Extra` - `text: Optional[ExtraText]` Human-readable field variants. Will not be null when query param `with_text` is `true`. - `collateralized: str` - `held: str` - `total: str` - `held: str` Total equivalent amount of origin token held in address balance **NOTE:** This is **not** the amount of the origin asset that the user holds, but the amount held in the receipt token rendered as the equivalent amount in the origin asset. Or, more formally: `origin_equivalent_held = receipt_held / receipt_redemption_ratio` - `total: str` Total of held and collateralized equivalent for origin asset Or, more formally: `origin_equivalent_total = receipt_lent_total / receipt_redemption_ratio` - `receipt_amounts: UserLendReceiptAmounts` The lending amounts in the original receipt token amounts - `collateralized: str` Total amount of receipt token collateralized across this user's borrowing portfolio - `extra: Extra` - `text: Optional[ExtraText]` Human-readable field variants. Will not be null when query param `with_text` is `true`. - `collateralized: str` - `held: str` - `total: 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. - `collateralized: 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`. - `collateralized: str` - `held: str` - `price: str` Text representation of price - `total: str` - `held: str` - `price: str` Price used in value calculations - `total: str` - `held: str` Total amount of receipt token held in address balance - `total: str` Sum of receipt amount held and receipt amount collateralized ### User Lend Market - `class UserLendMarket: …` - `asset_pools: List[UserLendAssetPool]` User lending allocations - `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`) - `market_rate: MarketRate` Current market lending rate - `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` - `origin_equivalent: UserLendOriginAmounts` The lending amounts converted into the equivalent for the receipt token's origin/source asset - `collateralized: str` Total equivalent amount of origin token collateralized across this user's borrowing portfolio **NOTE:** This is **not** the amount of the origin asset that the user holds, but the amount held in the receipt token rendered as the equivalent amount in the origin asset. Or, more formally: `origin_equivalent_collateralized = receipt_collateralized / receipt_redemption_ratio` - `extra: Extra` - `text: Optional[ExtraText]` Human-readable field variants. Will not be null when query param `with_text` is `true`. - `collateralized: str` - `held: str` - `total: str` - `held: str` Total equivalent amount of origin token held in address balance **NOTE:** This is **not** the amount of the origin asset that the user holds, but the amount held in the receipt token rendered as the equivalent amount in the origin asset. Or, more formally: `origin_equivalent_held = receipt_held / receipt_redemption_ratio` - `total: str` Total of held and collateralized equivalent for origin asset Or, more formally: `origin_equivalent_total = receipt_lent_total / receipt_redemption_ratio` - `receipt_amounts: UserLendReceiptAmounts` The lending amounts in the original receipt token amounts - `collateralized: str` Total amount of receipt token collateralized across this user's borrowing portfolio - `extra: Extra` - `text: Optional[ExtraText]` Human-readable field variants. Will not be null when query param `with_text` is `true`. - `collateralized: str` - `held: str` - `total: 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. - `collateralized: 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`. - `collateralized: str` - `held: str` - `price: str` Text representation of price - `total: str` - `held: str` - `price: str` Price used in value calculations - `total: str` - `held: str` Total amount of receipt token held in address balance - `total: str` Sum of receipt amount held and receipt amount collateralized - `net_rate: MarketRate` Account debt net rate ### User Lend Origin Amounts - `class UserLendOriginAmounts: …` - `collateralized: str` Total equivalent amount of origin token collateralized across this user's borrowing portfolio **NOTE:** This is **not** the amount of the origin asset that the user holds, but the amount held in the receipt token rendered as the equivalent amount in the origin asset. Or, more formally: `origin_equivalent_collateralized = receipt_collateralized / receipt_redemption_ratio` - `extra: Extra` - `text: Optional[ExtraText]` Human-readable field variants. Will not be null when query param `with_text` is `true`. - `collateralized: str` - `held: str` - `total: str` - `held: str` Total equivalent amount of origin token held in address balance **NOTE:** This is **not** the amount of the origin asset that the user holds, but the amount held in the receipt token rendered as the equivalent amount in the origin asset. Or, more formally: `origin_equivalent_held = receipt_held / receipt_redemption_ratio` - `total: str` Total of held and collateralized equivalent for origin asset Or, more formally: `origin_equivalent_total = receipt_lent_total / receipt_redemption_ratio` ### User Lend Receipt Amounts - `class UserLendReceiptAmounts: …` - `collateralized: str` Total amount of receipt token collateralized across this user's borrowing portfolio - `extra: Extra` - `text: Optional[ExtraText]` Human-readable field variants. Will not be null when query param `with_text` is `true`. - `collateralized: str` - `held: str` - `total: 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. - `collateralized: 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`. - `collateralized: str` - `held: str` - `price: str` Text representation of price - `total: str` - `held: str` - `price: str` Price used in value calculations - `total: str` - `held: str` Total amount of receipt token held in address balance - `total: str` Sum of receipt amount held and receipt amount collateralized # Borrow ## Get user borrow portfolio `user.market.borrow.get_portfolio(straddress, BorrowGetPortfolioParams**kwargs) -> BorrowGetPortfolioResponse` **get** `/api/v1/users/{address}/markets/borrow` Get user borrow portfolio ### Parameters - `address: str` The user account address - `with_text: Optional[bool]` Include text variation fields - `with_value: Optional[bool]` Calculate and include USD values for amounts, where applicable ### Returns - `class BorrowGetPortfolioResponse: …` - `data: UserBorrowMarket` - `accounts: List[UserBorrowMarketAccount]` Market sub-accounts for the user - `collaterals: List[UserCollateralAssetPool]` Account collateral allocations - `amount: str` Amount of this asset which is actively collateralized - `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`) - `extra: Extra` - `text: Optional[ExtraText]` Human-readable field variants. Will not be null when query param `with_text` is `true`. - `amount: 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. - `amount: 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`. - `amount: str` - `price: str` Text representation of price - `price: str` Price used in value calculations - `debts: List[UserDebtAssetPool]` Account debt allocations - `asset_info: AssetInfo` Asset identifiers with associated metadata - `extra: Extra` - `text: Optional[ExtraText]` Human-readable field variants. Will not be null when query param `with_text` is `true`. - `principal: str` - `shares: 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: str` - `shares: str` - `price: str` Price used in value calculations - `principal: str` - `shares: str` - `market_rate: MarketRate` Current market borrowing rate - `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` - `principal: str` Initial amount borrowed (of debts which have not yet been repaid) - `shares: str` - `debts_net_rate: MarketRate` Account debt net rate - `health: Optional[UserAccountHealth]` Health data for this account - `base: str` Account health value, before any added health boosts - `boost: str` Account health boost to be applied - `extra: Extra` - `text: Optional[ExtraText]` Human-readable field variants. Will not be null when query param `with_text` is `true`. - `base: str` - `boost: str` - `result: str` - `result: str` Account health, with boost - `index: int` Account index - `totals: UserBorrowMarketPools` Collateral/debt totals of all sub-accounts by asset - `collaterals: List[UserCollateralAssetPool]` Account collateral allocations - `amount: str` Amount of this asset which is actively collateralized - `asset_info: AssetInfo` Asset identifiers with associated metadata - `extra: Extra` - `debts: List[UserDebtAssetPool]` Account debt allocations - `asset_info: AssetInfo` Asset identifiers with associated metadata - `extra: Extra` - `market_rate: MarketRate` Current market borrowing rate - `principal: str` Initial amount borrowed (of debts which have not yet been repaid) - `shares: str` - `debts_net_rate: MarketRate` Account debt net rate - `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.user.market.borrow.get_portfolio( address="injvalcons1a03k0ztfyjnd70apawva003pkh0adqmau0a9q0", ) print(response.data) ``` #### Response ```json { "data": { "accounts": [ { "index": 0, "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" } } }, "amount": "627910952933646356261", "extra": { "text": { "amount": "627.9109 INJ" }, "value": { "price": "2.99835", "amount": "1882.696805728598552295", "extra": { "text": { "amount": "$1,882.69", "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" } } }, "market_rate": { "apr": "0.1213749", "apy": "0.1290481", "extra": { "text": { "apy": "12.90%", "apr": "12.13%" } } }, "principal": "604443791936941909862", "shares": "604443791936941909862", "extra": { "text": { "principal": "604.4437 INJ", "shares": "604.4437 INJ" }, "value": { "shares": "1812.334043554129775434", "price": "2.99835", "principal": "1812.334043554129775434", "extra": { "text": { "shares": "$1,812.33", "price": "$2.99", "principal": "$1,812.33" } } } } } ], "debts_net_rate": { "apr": "0.121374899999999999", "apy": "0.129048099999999999", "extra": { "text": { "apy": "12.90%", "apr": "12.13%" } } }, "health": { "base": "6.31", "boost": "1.02", "result": "6.4362", "extra": { "text": { "base": "6.31", "boost": "2.00%", "result": "6.43" } } } } ], "totals": { "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" } } }, "amount": "627910952933646356261", "extra": { "text": { "amount": "627.9109 INJ" }, "value": { "price": "2.99835", "amount": "1882.696805728598552295", "extra": { "text": { "amount": "$1,882.69", "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" } } }, "market_rate": { "apr": "0.1213749", "apy": "0.1290481", "extra": { "text": { "apy": "12.90%", "apr": "12.13%" } } }, "principal": "604443791936941909862", "shares": "604443791936941909862", "extra": { "text": { "principal": "604.4437 INJ", "shares": "604.4437 INJ" }, "value": { "shares": "1812.334043554129775434", "price": "2.99835", "principal": "1812.334043554129775434", "extra": { "text": { "shares": "$1,812.33", "price": "$2.99", "principal": "$1,812.33" } } } } } ], "debts_net_rate": { "apr": "0.121374899999999999", "apy": "0.129048099999999999", "extra": { "text": { "apy": "12.90%", "apr": "12.13%" } } } } }, "error": null, "status": 200, "status_text": "200 OK" } ``` ## Lookup user borrow market collateral accounts by asset `user.market.borrow.get_collateral_accounts_by_asset(straddress, BorrowGetCollateralAccountsByAssetParams**kwargs) -> BorrowGetCollateralAccountsByAssetResponse` **get** `/api/v1/users/{address}/markets/borrow/lookup/collateral` Lookup user borrow market collateral accounts by asset ### Parameters - `address: str` The user account address - `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 BorrowGetCollateralAccountsByAssetResponse: …` - `data: Data` - `accounts: List[UserCollateralAccountPool]` All collateral subaccounts for the associated asset type - `amount: str` 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`. - `amount: 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. - `amount: 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`. - `amount: str` - `price: str` Text representation of price - `price: str` Price used in value calculations - `index: int` Account index - `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`) - `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.user.market.borrow.get_collateral_accounts_by_asset( address="injvalcons1a03k0ztfyjnd70apawva003pkh0adqmau0a9q0", 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" } } }, "accounts": [ { "index": 0, "amount": "74584754449782768185", "extra": { "text": { "amount": "74.5847 INJ" }, "value": { "price": "2.99835", "amount": "223.631198504506162987", "extra": { "text": { "amount": "$223.63", "price": "$2.99" } } } } } ] }, "error": null, "status": 200, "status_text": "200 OK" } ``` ## Lookup user borrow market debt accounts by asset `user.market.borrow.get_debt_accounts_by_asset(straddress, BorrowGetDebtAccountsByAssetParams**kwargs) -> BorrowGetDebtAccountsByAssetResponse` **get** `/api/v1/users/{address}/markets/borrow/lookup/debt` Lookup user borrow market debt accounts by asset ### Parameters - `address: str` The user account address - `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 BorrowGetDebtAccountsByAssetResponse: …` - `data: Data` - `accounts: List[UserDebtAccountPool]` All debt subaccounts for the associated asset type - `extra: Extra` - `text: Optional[ExtraText]` Human-readable field variants. Will not be null when query param `with_text` is `true`. - `principal: str` - `shares: 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: str` - `shares: str` - `price: str` Price used in value calculations - `principal: str` - `shares: str` - `index: int` Account index - `principal: str` Initial amount borrowed (of debts which have not yet been repaid) - `shares: str` - `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`) - `market_rate: MarketRate` Current market borrowing rate - `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` - `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.user.market.borrow.get_debt_accounts_by_asset( address="injvalcons1a03k0ztfyjnd70apawva003pkh0adqmau0a9q0", 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" } } }, "market_rate": { "apr": "0.16015918", "apy": "0.17369769", "extra": { "text": { "apy": "17.36%", "apr": "16.01%" } } }, "accounts": [ { "index": 0, "principal": "388102166736239526944", "shares": "388102166736239526944", "extra": { "text": { "principal": "388.1021 INJ", "shares": "388.1021 INJ" }, "value": { "shares": "1163.666131633603785612", "price": "2.99835", "principal": "1163.666131633603785612", "extra": { "text": { "shares": "$1,163.66", "price": "$2.99", "principal": "$1,163.66" } } } } } ] }, "error": null, "status": 200, "status_text": "200 OK" } ``` ## Get user combined collaterals for all subaccounts `user.market.borrow.get_collateral_totals(straddress, BorrowGetCollateralTotalsParams**kwargs) -> BorrowGetCollateralTotalsResponse` **get** `/api/v1/users/{address}/markets/borrow/sum/collaterals` Get user combined collaterals for all subaccounts ### Parameters - `address: str` The user account address - `with_text: Optional[bool]` Include text variation fields - `with_value: Optional[bool]` Calculate and include USD values for amounts, where applicable ### Returns - `class BorrowGetCollateralTotalsResponse: …` - `count: int` Total number of objects irrespective of any pagination parameters. - `data: List[UserCollateralAssetPool]` - `amount: str` Amount of this asset which is actively collateralized - `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`) - `extra: Extra` - `text: Optional[ExtraText]` Human-readable field variants. Will not be null when query param `with_text` is `true`. - `amount: 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. - `amount: 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`. - `amount: 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.user.market.borrow.get_collateral_totals( address="injvalcons1a03k0ztfyjnd70apawva003pkh0adqmau0a9q0", ) 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" } } }, "amount": "418777679229608382152", "extra": { "text": { "amount": "418.7776 INJ" }, "value": { "price": "2.99835", "amount": "1255.642054518096292625", "extra": { "text": { "amount": "$1,255.64", "price": "$2.99" } } } } } ], "count": 1, "error": null, "status": 200, "status_text": "200 OK" } ``` ## Get user combined debts for all subaccounts `user.market.borrow.get_debts_totals(straddress, BorrowGetDebtsTotalsParams**kwargs) -> BorrowGetDebtsTotalsResponse` **get** `/api/v1/users/{address}/markets/borrow/sum/debts` Get user combined debts for all subaccounts ### Parameters - `address: str` The user account address - `with_text: Optional[bool]` Include text variation fields - `with_value: Optional[bool]` Calculate and include USD values for amounts, where applicable ### Returns - `class BorrowGetDebtsTotalsResponse: …` - `count: int` Total number of objects irrespective of any pagination parameters. - `data: List[UserDebtAssetPool]` - `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`) - `extra: Extra` - `text: Optional[ExtraText]` Human-readable field variants. Will not be null when query param `with_text` is `true`. - `principal: str` - `shares: 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: str` - `shares: str` - `price: str` Price used in value calculations - `principal: str` - `shares: str` - `market_rate: MarketRate` Current market borrowing rate - `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` - `principal: str` Initial amount borrowed (of debts which have not yet been repaid) - `shares: 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.user.market.borrow.get_debts_totals( address="injvalcons1a03k0ztfyjnd70apawva003pkh0adqmau0a9q0", ) 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" } } }, "market_rate": { "apr": "0.27322188", "apy": "0.31419181", "extra": { "text": { "apy": "31.41%", "apr": "27.32%" } } }, "principal": "592069750990957913867", "shares": "592069750990957913867", "extra": { "text": { "principal": "592.0697 INJ", "shares": "592.0697 INJ" }, "value": { "shares": "1775.232337883738661043", "price": "2.99835", "principal": "1775.232337883738661043", "extra": { "text": { "shares": "$1,775.23", "price": "$2.99", "principal": "$1,775.23" } } } } } ], "count": 1, "error": null, "status": 200, "status_text": "200 OK" } ``` ## Domain Types ### User Borrow Market - `class UserBorrowMarket: …` - `accounts: List[UserBorrowMarketAccount]` Market sub-accounts for the user - `collaterals: List[UserCollateralAssetPool]` Account collateral allocations - `amount: str` Amount of this asset which is actively collateralized - `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`) - `extra: Extra` - `text: Optional[ExtraText]` Human-readable field variants. Will not be null when query param `with_text` is `true`. - `amount: 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. - `amount: 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`. - `amount: str` - `price: str` Text representation of price - `price: str` Price used in value calculations - `debts: List[UserDebtAssetPool]` Account debt allocations - `asset_info: AssetInfo` Asset identifiers with associated metadata - `extra: Extra` - `text: Optional[ExtraText]` Human-readable field variants. Will not be null when query param `with_text` is `true`. - `principal: str` - `shares: 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: str` - `shares: str` - `price: str` Price used in value calculations - `principal: str` - `shares: str` - `market_rate: MarketRate` Current market borrowing rate - `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` - `principal: str` Initial amount borrowed (of debts which have not yet been repaid) - `shares: str` - `debts_net_rate: MarketRate` Account debt net rate - `health: Optional[UserAccountHealth]` Health data for this account - `base: str` Account health value, before any added health boosts - `boost: str` Account health boost to be applied - `extra: Extra` - `text: Optional[ExtraText]` Human-readable field variants. Will not be null when query param `with_text` is `true`. - `base: str` - `boost: str` - `result: str` - `result: str` Account health, with boost - `index: int` Account index - `totals: UserBorrowMarketPools` Collateral/debt totals of all sub-accounts by asset - `collaterals: List[UserCollateralAssetPool]` Account collateral allocations - `amount: str` Amount of this asset which is actively collateralized - `asset_info: AssetInfo` Asset identifiers with associated metadata - `extra: Extra` - `debts: List[UserDebtAssetPool]` Account debt allocations - `asset_info: AssetInfo` Asset identifiers with associated metadata - `extra: Extra` - `market_rate: MarketRate` Current market borrowing rate - `principal: str` Initial amount borrowed (of debts which have not yet been repaid) - `shares: str` - `debts_net_rate: MarketRate` Account debt net rate ### User Borrow Market Pools - `class UserBorrowMarketPools: …` - `collaterals: List[UserCollateralAssetPool]` Account collateral allocations - `amount: str` Amount of this asset which is actively collateralized - `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`) - `extra: Extra` - `text: Optional[ExtraText]` Human-readable field variants. Will not be null when query param `with_text` is `true`. - `amount: 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. - `amount: 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`. - `amount: str` - `price: str` Text representation of price - `price: str` Price used in value calculations - `debts: List[UserDebtAssetPool]` Account debt allocations - `asset_info: AssetInfo` Asset identifiers with associated metadata - `extra: Extra` - `text: Optional[ExtraText]` Human-readable field variants. Will not be null when query param `with_text` is `true`. - `principal: str` - `shares: 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: str` - `shares: str` - `price: str` Price used in value calculations - `principal: str` - `shares: str` - `market_rate: MarketRate` Current market borrowing rate - `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` - `principal: str` Initial amount borrowed (of debts which have not yet been repaid) - `shares: str` - `debts_net_rate: MarketRate` Account debt net rate # Subaccount ## Get user borrow subaccount `user.market.borrow.subaccount.get_subaccount(intindex, SubaccountGetSubaccountParams**kwargs) -> SubaccountGetSubaccountResponse` **get** `/api/v1/users/{address}/markets/borrow/accounts/{index}` Get user borrow subaccount ### Parameters - `address: str` The user account address - `index: int` The user account index - `with_text: Optional[bool]` Include text variation fields - `with_value: Optional[bool]` Calculate and include USD values for amounts, where applicable ### Returns - `class SubaccountGetSubaccountResponse: …` - `data: UserBorrowMarketAccount` User borrowing subaccount - `collaterals: List[UserCollateralAssetPool]` Account collateral allocations - `amount: str` Amount of this asset which is actively collateralized - `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`) - `extra: Extra` - `text: Optional[ExtraText]` Human-readable field variants. Will not be null when query param `with_text` is `true`. - `amount: 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. - `amount: 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`. - `amount: str` - `price: str` Text representation of price - `price: str` Price used in value calculations - `debts: List[UserDebtAssetPool]` Account debt allocations - `asset_info: AssetInfo` Asset identifiers with associated metadata - `extra: Extra` - `text: Optional[ExtraText]` Human-readable field variants. Will not be null when query param `with_text` is `true`. - `principal: str` - `shares: 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: str` - `shares: str` - `price: str` Price used in value calculations - `principal: str` - `shares: str` - `market_rate: MarketRate` Current market borrowing rate - `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` - `principal: str` Initial amount borrowed (of debts which have not yet been repaid) - `shares: str` - `debts_net_rate: MarketRate` Account debt net rate - `health: Optional[UserAccountHealth]` Health data for this account - `base: str` Account health value, before any added health boosts - `boost: str` Account health boost to be applied - `extra: Extra` - `text: Optional[ExtraText]` Human-readable field variants. Will not be null when query param `with_text` is `true`. - `base: str` - `boost: str` - `result: str` - `result: str` Account health, with boost - `index: int` Account index - `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.user.market.borrow.subaccount.get_subaccount( index=0, address="injvalcons1a03k0ztfyjnd70apawva003pkh0adqmau0a9q0", ) print(response.data) ``` #### Response ```json { "data": { "index": 0, "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" } } }, "amount": "437536487934389798965", "extra": { "text": { "amount": "437.5364 INJ" }, "value": { "price": "2.99835", "amount": "1311.887528598077653726", "extra": { "text": { "amount": "$1,311.88", "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" } } }, "market_rate": { "apr": "0.10396566", "apy": "0.10956235", "extra": { "text": { "apy": "10.95%", "apr": "10.39%" } } }, "principal": "174187990348009513138", "shares": "174187990348009513138", "extra": { "text": { "principal": "174.1879 INJ", "shares": "174.1879 INJ" }, "value": { "shares": "522.276560859954323717", "price": "2.99835", "principal": "522.276560859954323717", "extra": { "text": { "shares": "$522.27", "price": "$2.99", "principal": "$522.27" } } } } } ], "debts_net_rate": { "apr": "0.103965659999999999", "apy": "0.109562349999999999", "extra": { "text": { "apy": "10.95%", "apr": "10.39%" } } }, "health": { "base": "2.54", "boost": "1", "result": "2.54", "extra": { "text": { "base": "2.54", "boost": "0.00%", "result": "2.54" } } } }, "error": null, "status": 200, "status_text": "200 OK" } ``` ## Get user borrow subaccount health `user.market.borrow.subaccount.get_subaccount_health(intindex, SubaccountGetSubaccountHealthParams**kwargs) -> SubaccountGetSubaccountHealthResponse` **get** `/api/v1/users/{address}/markets/borrow/accounts/{index}/health` Get user borrow subaccount health ### Parameters - `address: str` The user account address - `index: int` The user account index - `with_text: Optional[bool]` Include text variation fields ### Returns - `class SubaccountGetSubaccountHealthResponse: …` - `data: UserAccountHealth` - `base: str` Account health value, before any added health boosts - `boost: str` Account health boost to be applied - `extra: Extra` - `text: Optional[ExtraText]` Human-readable field variants. Will not be null when query param `with_text` is `true`. - `base: str` - `boost: str` - `result: str` - `result: str` Account health, with boost - `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.user.market.borrow.subaccount.get_subaccount_health( index=0, address="injvalcons1a03k0ztfyjnd70apawva003pkh0adqmau0a9q0", ) print(response.data) ``` #### Response ```json { "data": { "base": "2.35", "boost": "1.01", "result": "2.3735", "extra": { "text": { "base": "2.35", "boost": "1.00%", "result": "2.37" } } }, "error": null, "status": 200, "status_text": "200 OK" } ``` ## Get user borrow subaccount collaterals `user.market.borrow.subaccount.get_subaccount_collaterals(intindex, SubaccountGetSubaccountCollateralsParams**kwargs) -> SubaccountGetSubaccountCollateralsResponse` **get** `/api/v1/users/{address}/markets/borrow/accounts/{index}/collaterals` Get user borrow subaccount collaterals ### Parameters - `address: str` The user account address - `index: int` The user account index - `with_text: Optional[bool]` Include text variation fields - `with_value: Optional[bool]` Calculate and include USD values for amounts, where applicable ### Returns - `class SubaccountGetSubaccountCollateralsResponse: …` - `count: int` Total number of objects irrespective of any pagination parameters. - `data: List[UserCollateralAssetPool]` - `amount: str` Amount of this asset which is actively collateralized - `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`) - `extra: Extra` - `text: Optional[ExtraText]` Human-readable field variants. Will not be null when query param `with_text` is `true`. - `amount: 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. - `amount: 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`. - `amount: 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.user.market.borrow.subaccount.get_subaccount_collaterals( index=0, address="injvalcons1a03k0ztfyjnd70apawva003pkh0adqmau0a9q0", ) 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" } } }, "amount": "858801430232426819550", "extra": { "text": { "amount": "858.8014 INJ" }, "value": { "price": "2.99835", "amount": "2574.987268337396954397", "extra": { "text": { "amount": "$2,574.98", "price": "$2.99" } } } } } ], "count": 1, "error": null, "status": 200, "status_text": "200 OK" } ``` ## Get user borrow subaccount debts `user.market.borrow.subaccount.get_subaccount_debts(intindex, SubaccountGetSubaccountDebtsParams**kwargs) -> SubaccountGetSubaccountDebtsResponse` **get** `/api/v1/users/{address}/markets/borrow/accounts/{index}/debts` Get user borrow subaccount debts ### Parameters - `address: str` The user account address - `index: int` The user account index - `with_text: Optional[bool]` Include text variation fields - `with_value: Optional[bool]` Calculate and include USD values for amounts, where applicable ### Returns - `class SubaccountGetSubaccountDebtsResponse: …` - `count: int` Total number of objects irrespective of any pagination parameters. - `data: List[UserDebtAssetPool]` - `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`) - `extra: Extra` - `text: Optional[ExtraText]` Human-readable field variants. Will not be null when query param `with_text` is `true`. - `principal: str` - `shares: 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: str` - `shares: str` - `price: str` Price used in value calculations - `principal: str` - `shares: str` - `market_rate: MarketRate` Current market borrowing rate - `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` - `principal: str` Initial amount borrowed (of debts which have not yet been repaid) - `shares: 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.user.market.borrow.subaccount.get_subaccount_debts( index=0, address="injvalcons1a03k0ztfyjnd70apawva003pkh0adqmau0a9q0", ) 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" } } }, "market_rate": { "apr": "0.25736944", "apy": "0.29352292", "extra": { "text": { "apy": "29.35%", "apr": "25.73%" } } }, "principal": "304756114444346810003", "shares": "304756114444346810003", "extra": { "text": { "principal": "304.7561 INJ", "shares": "304.7561 INJ" }, "value": { "shares": "913.765495744207257772", "price": "2.99835", "principal": "913.765495744207257772", "extra": { "text": { "shares": "$913.76", "price": "$2.99", "principal": "$913.76" } } } } } ], "count": 1, "error": null, "status": 200, "status_text": "200 OK" } ``` ## Domain Types ### User Account Health - `class UserAccountHealth: …` - `base: str` Account health value, before any added health boosts - `boost: str` Account health boost to be applied - `extra: Extra` - `text: Optional[ExtraText]` Human-readable field variants. Will not be null when query param `with_text` is `true`. - `base: str` - `boost: str` - `result: str` - `result: str` Account health, with boost ### User Borrow Market Account - `class UserBorrowMarketAccount: …` User borrowing subaccount - `collaterals: List[UserCollateralAssetPool]` Account collateral allocations - `amount: str` Amount of this asset which is actively collateralized - `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`) - `extra: Extra` - `text: Optional[ExtraText]` Human-readable field variants. Will not be null when query param `with_text` is `true`. - `amount: 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. - `amount: 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`. - `amount: str` - `price: str` Text representation of price - `price: str` Price used in value calculations - `debts: List[UserDebtAssetPool]` Account debt allocations - `asset_info: AssetInfo` Asset identifiers with associated metadata - `extra: Extra` - `text: Optional[ExtraText]` Human-readable field variants. Will not be null when query param `with_text` is `true`. - `principal: str` - `shares: 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: str` - `shares: str` - `price: str` Price used in value calculations - `principal: str` - `shares: str` - `market_rate: MarketRate` Current market borrowing rate - `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` - `principal: str` Initial amount borrowed (of debts which have not yet been repaid) - `shares: str` - `debts_net_rate: MarketRate` Account debt net rate - `health: Optional[UserAccountHealth]` Health data for this account - `base: str` Account health value, before any added health boosts - `boost: str` Account health boost to be applied - `extra: Extra` - `text: Optional[ExtraText]` Human-readable field variants. Will not be null when query param `with_text` is `true`. - `base: str` - `boost: str` - `result: str` - `result: str` Account health, with boost - `index: int` Account index ### User Collateral Account Pool - `class UserCollateralAccountPool: …` Associates a subaccount's index with it's inner allocations for a given asset. This type is identical to `UserCollateralAssetPool`, except the asset association is interchanged for an account index. Typically used in contexts where multiple subaccounts with a shared underlying asset are batched together. - `amount: str` 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`. - `amount: 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. - `amount: 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`. - `amount: str` - `price: str` Text representation of price - `price: str` Price used in value calculations - `index: int` Account index ### User Collateral Asset Pool - `class UserCollateralAssetPool: …` - `amount: str` Amount of this asset which is actively collateralized - `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`) - `extra: Extra` - `text: Optional[ExtraText]` Human-readable field variants. Will not be null when query param `with_text` is `true`. - `amount: 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. - `amount: 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`. - `amount: str` - `price: str` Text representation of price - `price: str` Price used in value calculations ### User Debt Account Pool - `class UserDebtAccountPool: …` Associates a subaccount's index with it's inner allocations for a given asset. This type is identical to `UserDebtAssetPool`, except the asset association is interchanged for an account index. Typically used in contexts where multiple subaccounts with a shared underlying asset are batched together. - `extra: Extra` - `text: Optional[ExtraText]` Human-readable field variants. Will not be null when query param `with_text` is `true`. - `principal: str` - `shares: 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: str` - `shares: str` - `price: str` Price used in value calculations - `principal: str` - `shares: str` - `index: int` Account index - `principal: str` Initial amount borrowed (of debts which have not yet been repaid) - `shares: str` ### User Debt Asset Pool - `class UserDebtAssetPool: …` - `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`) - `extra: Extra` - `text: Optional[ExtraText]` Human-readable field variants. Will not be null when query param `with_text` is `true`. - `principal: str` - `shares: 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: str` - `shares: str` - `price: str` Price used in value calculations - `principal: str` - `shares: str` - `market_rate: MarketRate` Current market borrowing rate - `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` - `principal: str` Initial amount borrowed (of debts which have not yet been repaid) - `shares: str`