# Market ## Get user market portfolio **get** `/api/v1/users/{address}/markets` Get user market portfolio ### Path Parameters - `address: string` The user account address ### Query Parameters - `with_text: optional boolean` Include text variation fields - `with_value: optional boolean` Calculate and include USD values for amounts, where applicable ### Returns - `data: UserMarket` - `borrow: UserBorrowMarket` Overview of user borrowing portfolio - `accounts: array of UserBorrowMarketAccount` Market sub-accounts for the user - `collaterals: array of UserCollateralAssetPool` Account collateral allocations - `amount: string` 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: string` - `group: "native" or "token"` - `"native"` - `"token"` - `group_key: string` - `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. - `Regular = object { kind, neptune_receipt_asset }` - `kind: "regular"` - `"regular"` - `neptune_receipt_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) - `NeptuneReceiptToken = object { kind, origin_asset }` - `kind: "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) - `LiquidStakingToken = object { kind, origin_asset }` - `kind: "liquid_staking_token"` - `"liquid_staking_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) - `metadata: AssetMetadata` Additional metadata for assets - `decimals_denom: number` Denom exponent, or num. of decimal places that shift between denom/standard amounts (e.g. `18` for `INJ`) - `decimals_display: number` Number of decimals used when displaying amounts of this asset (this is subjective and used for generating text representations) - `name: string` Full name of the asset - `symbol: string` Symbol of the asset, e.g.: `NEPT` `INJ` - `symbol_denom: string` Denom symbol for the asset (e.g. `inj` for `INJ`, `sat` for `BTC`) - `extra: object { text, value }` - `text: object { amount }` Human-readable field variants. Will not be null when query param `with_text` is `true`. - `amount: string` - `value: object { amount, extra, price }` USD values for the corresponding amounts above. Will not be null when query param `with_value` is `true`. ### Note This variant group contains an additional `price` field (set to the number used in value calculation). The embedded text group will contain the text variant if `with_text` was specified as well. - `amount: string` - `extra: object { text }` - `text: object { amount, price }` Human-readable variants of USD values. Will not be null when query params `with_text` and `with_value` are `true`. - `amount: string` - `price: string` Text representation of price - `price: string` Price used in value calculations - `debts: array of UserDebtAssetPool` Account debt allocations - `asset_info: AssetInfo` Asset identifiers with associated metadata - `extra: object { text, value }` - `text: object { principal, shares }` Human-readable field variants. Will not be null when query param `with_text` is `true`. - `principal: string` - `shares: string` - `value: object { extra, price, principal, shares }` 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: object { text }` - `text: object { price, principal, shares }` Human-readable variants of USD values. Will not be null when query params `with_text` and `with_value` are `true`. - `price: string` Text representation of price - `principal: string` - `shares: string` - `price: string` Price used in value calculations - `principal: string` - `shares: string` - `market_rate: MarketRate` Current market borrowing rate - `apr: string` Market rate in APR standard as a decimal percentage - `apy: string` Market rate in APY standard as a decimal percentage - `extra: object { text }` - `text: object { apr, apy }` Human-readable field variants. Will not be null when query param `with_text` is `true`. - `apr: string` - `apy: string` - `principal: string` Initial amount borrowed (of debts which have not yet been repaid) - `shares: string` - `debts_net_rate: MarketRate` Account debt net rate - `health: UserAccountHealth` Health data for this account - `base: string` Account health value, before any added health boosts - `boost: string` Account health boost to be applied - `extra: object { text }` - `text: object { base, boost, result }` Human-readable field variants. Will not be null when query param `with_text` is `true`. - `base: string` - `boost: string` - `result: string` - `result: string` Account health, with boost - `index: number` Account index - `totals: UserBorrowMarketPools` Collateral/debt totals of all sub-accounts by asset - `collaterals: array of UserCollateralAssetPool` Account collateral allocations - `amount: string` Amount of this asset which is actively collateralized - `asset_info: AssetInfo` Asset identifiers with associated metadata - `extra: object { text, value }` - `debts: array of UserDebtAssetPool` Account debt allocations - `asset_info: AssetInfo` Asset identifiers with associated metadata - `extra: object { text, value }` - `market_rate: MarketRate` Current market borrowing rate - `principal: string` Initial amount borrowed (of debts which have not yet been repaid) - `shares: string` - `debts_net_rate: MarketRate` Account debt net rate - `lend: UserLendMarket` Overview of user lending portfolio - `asset_pools: array of 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: string` 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: object { text }` - `text: object { collateralized, held, total }` Human-readable field variants. Will not be null when query param `with_text` is `true`. - `collateralized: string` - `held: string` - `total: string` - `held: string` 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: string` 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: string` Total amount of receipt token collateralized across this user's borrowing portfolio - `extra: object { text, value }` - `text: object { collateralized, held, total }` Human-readable field variants. Will not be null when query param `with_text` is `true`. - `collateralized: string` - `held: string` - `total: string` - `value: object { collateralized, extra, held, 2 more }` USD values for the corresponding amounts above. Will not be null when query param `with_value` is `true`. ### Note This variant group contains an additional `price` field (set to the number used in value calculation). The embedded text group will contain the text variant if `with_text` was specified as well. - `collateralized: string` - `extra: object { text }` - `text: object { collateralized, held, price, total }` Human-readable variants of USD values. Will not be null when query params `with_text` and `with_value` are `true`. - `collateralized: string` - `held: string` - `price: string` Text representation of price - `total: string` - `held: string` - `price: string` Price used in value calculations - `total: string` - `held: string` Total amount of receipt token held in address balance - `total: string` Sum of receipt amount held and receipt amount collateralized - `net_rate: MarketRate` Account debt net rate - `error: unknown` Error data. Guaranteed `null` for successful response. - `status: number` HTTP status. Successful responses are guaranteed to be < `400`. Conversely, error responses are guaranteed to be >= `400`. - `status_text: string` HTTP status text ### Example ```http curl https://api-v2.nept.finance/api/v1/users/$ADDRESS/markets ``` #### 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 **get** `/api/v1/users/{address}/markets/merged` Get user markets for all kinds (lend + borrow debt/collateral), grouped together by asset ### Path Parameters - `address: string` The user account address ### Query Parameters - `with_text: optional boolean` Include text variation fields - `with_value: optional boolean` Calculate and include USD values for amounts, where applicable ### Returns - `count: number` Total number of objects irrespective of any pagination parameters. - `data: array of 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: string` - `group: "native" or "token"` - `"native"` - `"token"` - `group_key: string` - `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. - `Regular = object { kind, neptune_receipt_asset }` - `kind: "regular"` - `"regular"` - `neptune_receipt_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) - `NeptuneReceiptToken = object { kind, origin_asset }` - `kind: "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) - `LiquidStakingToken = object { kind, origin_asset }` - `kind: "liquid_staking_token"` - `"liquid_staking_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) - `metadata: AssetMetadata` Additional metadata for assets - `decimals_denom: number` Denom exponent, or num. of decimal places that shift between denom/standard amounts (e.g. `18` for `INJ`) - `decimals_display: number` Number of decimals used when displaying amounts of this asset (this is subjective and used for generating text representations) - `name: string` Full name of the asset - `symbol: string` Symbol of the asset, e.g.: `NEPT` `INJ` - `symbol_denom: string` Denom symbol for the asset (e.g. `inj` for `INJ`, `sat` for `BTC`) - `borrow_collateral: array of UserCollateralAccountPool` User collateral contribution for asset in borrow market, listed by subaccount - `amount: string` Amount of this asset which is actively collateralized - `extra: object { text, value }` - `text: object { amount }` Human-readable field variants. Will not be null when query param `with_text` is `true`. - `amount: string` - `value: object { amount, extra, price }` USD values for the corresponding amounts above. Will not be null when query param `with_value` is `true`. ### Note This variant group contains an additional `price` field (set to the number used in value calculation). The embedded text group will contain the text variant if `with_text` was specified as well. - `amount: string` - `extra: object { text }` - `text: object { amount, price }` Human-readable variants of USD values. Will not be null when query params `with_text` and `with_value` are `true`. - `amount: string` - `price: string` Text representation of price - `price: string` Price used in value calculations - `index: number` Account index - `borrow_debt: array of UserDebtAccountPool` User debt contribution for asset in borrow market, listed by subaccount - `extra: object { text, value }` - `text: object { principal, shares }` Human-readable field variants. Will not be null when query param `with_text` is `true`. - `principal: string` - `shares: string` - `value: object { extra, price, principal, shares }` 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: object { text }` - `text: object { price, principal, shares }` Human-readable variants of USD values. Will not be null when query params `with_text` and `with_value` are `true`. - `price: string` Text representation of price - `principal: string` - `shares: string` - `price: string` Price used in value calculations - `principal: string` - `shares: string` - `index: number` Account index - `principal: string` Initial amount borrowed (of debts which have not yet been repaid) - `shares: string` - `lend: optional object { origin_equivalent, receipt_amounts }` 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: string` 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: object { text }` - `text: object { collateralized, held, total }` Human-readable field variants. Will not be null when query param `with_text` is `true`. - `collateralized: string` - `held: string` - `total: string` - `held: string` 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: string` 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: string` Total amount of receipt token collateralized across this user's borrowing portfolio - `extra: object { text, value }` - `text: object { collateralized, held, total }` Human-readable field variants. Will not be null when query param `with_text` is `true`. - `collateralized: string` - `held: string` - `total: string` - `value: object { collateralized, extra, held, 2 more }` USD values for the corresponding amounts above. Will not be null when query param `with_value` is `true`. ### Note This variant group contains an additional `price` field (set to the number used in value calculation). The embedded text group will contain the text variant if `with_text` was specified as well. - `collateralized: string` - `extra: object { text }` - `text: object { collateralized, held, price, total }` Human-readable variants of USD values. Will not be null when query params `with_text` and `with_value` are `true`. - `collateralized: string` - `held: string` - `price: string` Text representation of price - `total: string` - `held: string` - `price: string` Price used in value calculations - `total: string` - `held: string` Total amount of receipt token held in address balance - `total: string` Sum of receipt amount held and receipt amount collateralized - `error: unknown` Error data. Guaranteed `null` for successful response. - `status: number` HTTP status. Successful responses are guaranteed to be < `400`. Conversely, error responses are guaranteed to be >= `400`. - `status_text: string` HTTP status text ### Example ```http curl https://api-v2.nept.finance/api/v1/users/$ADDRESS/markets/merged ``` #### 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 **get** `/api/v1/users/{address}/markets/merged/lookup` Get user's markets (lend + borrow debt/collateral) for a specific asset ### Path Parameters - `address: string` The user account address ### Query Parameters - `asset_id: string` Asset ID for lookup - `with_text: optional boolean` Include text variation fields - `with_value: optional boolean` Calculate and include USD values for amounts, where applicable ### Returns - `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: string` - `group: "native" or "token"` - `"native"` - `"token"` - `group_key: string` - `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. - `Regular = object { kind, neptune_receipt_asset }` - `kind: "regular"` - `"regular"` - `neptune_receipt_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) - `NeptuneReceiptToken = object { kind, origin_asset }` - `kind: "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) - `LiquidStakingToken = object { kind, origin_asset }` - `kind: "liquid_staking_token"` - `"liquid_staking_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) - `metadata: AssetMetadata` Additional metadata for assets - `decimals_denom: number` Denom exponent, or num. of decimal places that shift between denom/standard amounts (e.g. `18` for `INJ`) - `decimals_display: number` Number of decimals used when displaying amounts of this asset (this is subjective and used for generating text representations) - `name: string` Full name of the asset - `symbol: string` Symbol of the asset, e.g.: `NEPT` `INJ` - `symbol_denom: string` Denom symbol for the asset (e.g. `inj` for `INJ`, `sat` for `BTC`) - `borrow_collateral: array of UserCollateralAccountPool` User collateral contribution for asset in borrow market, listed by subaccount - `amount: string` Amount of this asset which is actively collateralized - `extra: object { text, value }` - `text: object { amount }` Human-readable field variants. Will not be null when query param `with_text` is `true`. - `amount: string` - `value: object { amount, extra, price }` USD values for the corresponding amounts above. Will not be null when query param `with_value` is `true`. ### Note This variant group contains an additional `price` field (set to the number used in value calculation). The embedded text group will contain the text variant if `with_text` was specified as well. - `amount: string` - `extra: object { text }` - `text: object { amount, price }` Human-readable variants of USD values. Will not be null when query params `with_text` and `with_value` are `true`. - `amount: string` - `price: string` Text representation of price - `price: string` Price used in value calculations - `index: number` Account index - `borrow_debt: array of UserDebtAccountPool` User debt contribution for asset in borrow market, listed by subaccount - `extra: object { text, value }` - `text: object { principal, shares }` Human-readable field variants. Will not be null when query param `with_text` is `true`. - `principal: string` - `shares: string` - `value: object { extra, price, principal, shares }` 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: object { text }` - `text: object { price, principal, shares }` Human-readable variants of USD values. Will not be null when query params `with_text` and `with_value` are `true`. - `price: string` Text representation of price - `principal: string` - `shares: string` - `price: string` Price used in value calculations - `principal: string` - `shares: string` - `index: number` Account index - `principal: string` Initial amount borrowed (of debts which have not yet been repaid) - `shares: string` - `lend: optional object { origin_equivalent, receipt_amounts }` 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: string` 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: object { text }` - `text: object { collateralized, held, total }` Human-readable field variants. Will not be null when query param `with_text` is `true`. - `collateralized: string` - `held: string` - `total: string` - `held: string` 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: string` 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: string` Total amount of receipt token collateralized across this user's borrowing portfolio - `extra: object { text, value }` - `text: object { collateralized, held, total }` Human-readable field variants. Will not be null when query param `with_text` is `true`. - `collateralized: string` - `held: string` - `total: string` - `value: object { collateralized, extra, held, 2 more }` USD values for the corresponding amounts above. Will not be null when query param `with_value` is `true`. ### Note This variant group contains an additional `price` field (set to the number used in value calculation). The embedded text group will contain the text variant if `with_text` was specified as well. - `collateralized: string` - `extra: object { text }` - `text: object { collateralized, held, price, total }` Human-readable variants of USD values. Will not be null when query params `with_text` and `with_value` are `true`. - `collateralized: string` - `held: string` - `price: string` Text representation of price - `total: string` - `held: string` - `price: string` Price used in value calculations - `total: string` - `held: string` Total amount of receipt token held in address balance - `total: string` Sum of receipt amount held and receipt amount collateralized - `error: unknown` Error data. Guaranteed `null` for successful response. - `status: number` HTTP status. Successful responses are guaranteed to be < `400`. Conversely, error responses are guaranteed to be >= `400`. - `status_text: string` HTTP status text ### Example ```http curl https://api-v2.nept.finance/api/v1/users/$ADDRESS/markets/merged/lookup ``` #### 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 - `UserMarket = object { borrow, lend }` - `borrow: UserBorrowMarket` Overview of user borrowing portfolio - `accounts: array of UserBorrowMarketAccount` Market sub-accounts for the user - `collaterals: array of UserCollateralAssetPool` Account collateral allocations - `amount: string` 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: string` - `group: "native" or "token"` - `"native"` - `"token"` - `group_key: string` - `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. - `Regular = object { kind, neptune_receipt_asset }` - `kind: "regular"` - `"regular"` - `neptune_receipt_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) - `NeptuneReceiptToken = object { kind, origin_asset }` - `kind: "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) - `LiquidStakingToken = object { kind, origin_asset }` - `kind: "liquid_staking_token"` - `"liquid_staking_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) - `metadata: AssetMetadata` Additional metadata for assets - `decimals_denom: number` Denom exponent, or num. of decimal places that shift between denom/standard amounts (e.g. `18` for `INJ`) - `decimals_display: number` Number of decimals used when displaying amounts of this asset (this is subjective and used for generating text representations) - `name: string` Full name of the asset - `symbol: string` Symbol of the asset, e.g.: `NEPT` `INJ` - `symbol_denom: string` Denom symbol for the asset (e.g. `inj` for `INJ`, `sat` for `BTC`) - `extra: object { text, value }` - `text: object { amount }` Human-readable field variants. Will not be null when query param `with_text` is `true`. - `amount: string` - `value: object { amount, extra, price }` USD values for the corresponding amounts above. Will not be null when query param `with_value` is `true`. ### Note This variant group contains an additional `price` field (set to the number used in value calculation). The embedded text group will contain the text variant if `with_text` was specified as well. - `amount: string` - `extra: object { text }` - `text: object { amount, price }` Human-readable variants of USD values. Will not be null when query params `with_text` and `with_value` are `true`. - `amount: string` - `price: string` Text representation of price - `price: string` Price used in value calculations - `debts: array of UserDebtAssetPool` Account debt allocations - `asset_info: AssetInfo` Asset identifiers with associated metadata - `extra: object { text, value }` - `text: object { principal, shares }` Human-readable field variants. Will not be null when query param `with_text` is `true`. - `principal: string` - `shares: string` - `value: object { extra, price, principal, shares }` 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: object { text }` - `text: object { price, principal, shares }` Human-readable variants of USD values. Will not be null when query params `with_text` and `with_value` are `true`. - `price: string` Text representation of price - `principal: string` - `shares: string` - `price: string` Price used in value calculations - `principal: string` - `shares: string` - `market_rate: MarketRate` Current market borrowing rate - `apr: string` Market rate in APR standard as a decimal percentage - `apy: string` Market rate in APY standard as a decimal percentage - `extra: object { text }` - `text: object { apr, apy }` Human-readable field variants. Will not be null when query param `with_text` is `true`. - `apr: string` - `apy: string` - `principal: string` Initial amount borrowed (of debts which have not yet been repaid) - `shares: string` - `debts_net_rate: MarketRate` Account debt net rate - `health: UserAccountHealth` Health data for this account - `base: string` Account health value, before any added health boosts - `boost: string` Account health boost to be applied - `extra: object { text }` - `text: object { base, boost, result }` Human-readable field variants. Will not be null when query param `with_text` is `true`. - `base: string` - `boost: string` - `result: string` - `result: string` Account health, with boost - `index: number` Account index - `totals: UserBorrowMarketPools` Collateral/debt totals of all sub-accounts by asset - `collaterals: array of UserCollateralAssetPool` Account collateral allocations - `amount: string` Amount of this asset which is actively collateralized - `asset_info: AssetInfo` Asset identifiers with associated metadata - `extra: object { text, value }` - `debts: array of UserDebtAssetPool` Account debt allocations - `asset_info: AssetInfo` Asset identifiers with associated metadata - `extra: object { text, value }` - `market_rate: MarketRate` Current market borrowing rate - `principal: string` Initial amount borrowed (of debts which have not yet been repaid) - `shares: string` - `debts_net_rate: MarketRate` Account debt net rate - `lend: UserLendMarket` Overview of user lending portfolio - `asset_pools: array of 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: string` 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: object { text }` - `text: object { collateralized, held, total }` Human-readable field variants. Will not be null when query param `with_text` is `true`. - `collateralized: string` - `held: string` - `total: string` - `held: string` 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: string` 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: string` Total amount of receipt token collateralized across this user's borrowing portfolio - `extra: object { text, value }` - `text: object { collateralized, held, total }` Human-readable field variants. Will not be null when query param `with_text` is `true`. - `collateralized: string` - `held: string` - `total: string` - `value: object { collateralized, extra, held, 2 more }` USD values for the corresponding amounts above. Will not be null when query param `with_value` is `true`. ### Note This variant group contains an additional `price` field (set to the number used in value calculation). The embedded text group will contain the text variant if `with_text` was specified as well. - `collateralized: string` - `extra: object { text }` - `text: object { collateralized, held, price, total }` Human-readable variants of USD values. Will not be null when query params `with_text` and `with_value` are `true`. - `collateralized: string` - `held: string` - `price: string` Text representation of price - `total: string` - `held: string` - `price: string` Price used in value calculations - `total: string` - `held: string` Total amount of receipt token held in address balance - `total: string` Sum of receipt amount held and receipt amount collateralized - `net_rate: MarketRate` Account debt net rate ### User Merged Market - `UserMergedMarket = object { asset_info, borrow_collateral, borrow_debt, lend }` 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: string` - `group: "native" or "token"` - `"native"` - `"token"` - `group_key: string` - `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. - `Regular = object { kind, neptune_receipt_asset }` - `kind: "regular"` - `"regular"` - `neptune_receipt_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) - `NeptuneReceiptToken = object { kind, origin_asset }` - `kind: "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) - `LiquidStakingToken = object { kind, origin_asset }` - `kind: "liquid_staking_token"` - `"liquid_staking_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) - `metadata: AssetMetadata` Additional metadata for assets - `decimals_denom: number` Denom exponent, or num. of decimal places that shift between denom/standard amounts (e.g. `18` for `INJ`) - `decimals_display: number` Number of decimals used when displaying amounts of this asset (this is subjective and used for generating text representations) - `name: string` Full name of the asset - `symbol: string` Symbol of the asset, e.g.: `NEPT` `INJ` - `symbol_denom: string` Denom symbol for the asset (e.g. `inj` for `INJ`, `sat` for `BTC`) - `borrow_collateral: array of UserCollateralAccountPool` User collateral contribution for asset in borrow market, listed by subaccount - `amount: string` Amount of this asset which is actively collateralized - `extra: object { text, value }` - `text: object { amount }` Human-readable field variants. Will not be null when query param `with_text` is `true`. - `amount: string` - `value: object { amount, extra, price }` USD values for the corresponding amounts above. Will not be null when query param `with_value` is `true`. ### Note This variant group contains an additional `price` field (set to the number used in value calculation). The embedded text group will contain the text variant if `with_text` was specified as well. - `amount: string` - `extra: object { text }` - `text: object { amount, price }` Human-readable variants of USD values. Will not be null when query params `with_text` and `with_value` are `true`. - `amount: string` - `price: string` Text representation of price - `price: string` Price used in value calculations - `index: number` Account index - `borrow_debt: array of UserDebtAccountPool` User debt contribution for asset in borrow market, listed by subaccount - `extra: object { text, value }` - `text: object { principal, shares }` Human-readable field variants. Will not be null when query param `with_text` is `true`. - `principal: string` - `shares: string` - `value: object { extra, price, principal, shares }` 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: object { text }` - `text: object { price, principal, shares }` Human-readable variants of USD values. Will not be null when query params `with_text` and `with_value` are `true`. - `price: string` Text representation of price - `principal: string` - `shares: string` - `price: string` Price used in value calculations - `principal: string` - `shares: string` - `index: number` Account index - `principal: string` Initial amount borrowed (of debts which have not yet been repaid) - `shares: string` - `lend: optional object { origin_equivalent, receipt_amounts }` 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: string` 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: object { text }` - `text: object { collateralized, held, total }` Human-readable field variants. Will not be null when query param `with_text` is `true`. - `collateralized: string` - `held: string` - `total: string` - `held: string` 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: string` 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: string` Total amount of receipt token collateralized across this user's borrowing portfolio - `extra: object { text, value }` - `text: object { collateralized, held, total }` Human-readable field variants. Will not be null when query param `with_text` is `true`. - `collateralized: string` - `held: string` - `total: string` - `value: object { collateralized, extra, held, 2 more }` USD values for the corresponding amounts above. Will not be null when query param `with_value` is `true`. ### Note This variant group contains an additional `price` field (set to the number used in value calculation). The embedded text group will contain the text variant if `with_text` was specified as well. - `collateralized: string` - `extra: object { text }` - `text: object { collateralized, held, price, total }` Human-readable variants of USD values. Will not be null when query params `with_text` and `with_value` are `true`. - `collateralized: string` - `held: string` - `price: string` Text representation of price - `total: string` - `held: string` - `price: string` Price used in value calculations - `total: string` - `held: string` Total amount of receipt token held in address balance - `total: string` Sum of receipt amount held and receipt amount collateralized # Lend ## Get user lending portfolio **get** `/api/v1/users/{address}/markets/lend` Get user lending portfolio ### Path Parameters - `address: string` The user account address ### Query Parameters - `with_text: optional boolean` Include text variation fields - `with_value: optional boolean` Calculate and include USD values for amounts, where applicable ### Returns - `data: UserLendMarket` - `asset_pools: array of 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: string` - `group: "native" or "token"` - `"native"` - `"token"` - `group_key: string` - `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. - `Regular = object { kind, neptune_receipt_asset }` - `kind: "regular"` - `"regular"` - `neptune_receipt_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) - `NeptuneReceiptToken = object { kind, origin_asset }` - `kind: "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) - `LiquidStakingToken = object { kind, origin_asset }` - `kind: "liquid_staking_token"` - `"liquid_staking_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) - `metadata: AssetMetadata` Additional metadata for assets - `decimals_denom: number` Denom exponent, or num. of decimal places that shift between denom/standard amounts (e.g. `18` for `INJ`) - `decimals_display: number` Number of decimals used when displaying amounts of this asset (this is subjective and used for generating text representations) - `name: string` Full name of the asset - `symbol: string` Symbol of the asset, e.g.: `NEPT` `INJ` - `symbol_denom: string` Denom symbol for the asset (e.g. `inj` for `INJ`, `sat` for `BTC`) - `market_rate: MarketRate` Current market lending rate - `apr: string` Market rate in APR standard as a decimal percentage - `apy: string` Market rate in APY standard as a decimal percentage - `extra: object { text }` - `text: object { apr, apy }` Human-readable field variants. Will not be null when query param `with_text` is `true`. - `apr: string` - `apy: string` - `origin_equivalent: UserLendOriginAmounts` The lending amounts converted into the equivalent for the receipt token's origin/source asset - `collateralized: string` 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: object { text }` - `text: object { collateralized, held, total }` Human-readable field variants. Will not be null when query param `with_text` is `true`. - `collateralized: string` - `held: string` - `total: string` - `held: string` 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: string` 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: string` Total amount of receipt token collateralized across this user's borrowing portfolio - `extra: object { text, value }` - `text: object { collateralized, held, total }` Human-readable field variants. Will not be null when query param `with_text` is `true`. - `collateralized: string` - `held: string` - `total: string` - `value: object { collateralized, extra, held, 2 more }` USD values for the corresponding amounts above. Will not be null when query param `with_value` is `true`. ### Note This variant group contains an additional `price` field (set to the number used in value calculation). The embedded text group will contain the text variant if `with_text` was specified as well. - `collateralized: string` - `extra: object { text }` - `text: object { collateralized, held, price, total }` Human-readable variants of USD values. Will not be null when query params `with_text` and `with_value` are `true`. - `collateralized: string` - `held: string` - `price: string` Text representation of price - `total: string` - `held: string` - `price: string` Price used in value calculations - `total: string` - `held: string` Total amount of receipt token held in address balance - `total: string` Sum of receipt amount held and receipt amount collateralized - `net_rate: MarketRate` Account debt net rate - `error: unknown` Error data. Guaranteed `null` for successful response. - `status: number` HTTP status. Successful responses are guaranteed to be < `400`. Conversely, error responses are guaranteed to be >= `400`. - `status_text: string` HTTP status text ### Example ```http curl https://api-v2.nept.finance/api/v1/users/$ADDRESS/markets/lend ``` #### 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 **get** `/api/v1/users/{address}/markets/lend/lookup` Lookup user lending distribution by asset ### Path Parameters - `address: string` The user account address ### Query Parameters - `asset_id: string` Asset ID for lookup - `with_text: optional boolean` Include text variation fields - `with_value: optional boolean` Calculate and include USD values for amounts, where applicable ### Returns - `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: string` - `group: "native" or "token"` - `"native"` - `"token"` - `group_key: string` - `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. - `Regular = object { kind, neptune_receipt_asset }` - `kind: "regular"` - `"regular"` - `neptune_receipt_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) - `NeptuneReceiptToken = object { kind, origin_asset }` - `kind: "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) - `LiquidStakingToken = object { kind, origin_asset }` - `kind: "liquid_staking_token"` - `"liquid_staking_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) - `metadata: AssetMetadata` Additional metadata for assets - `decimals_denom: number` Denom exponent, or num. of decimal places that shift between denom/standard amounts (e.g. `18` for `INJ`) - `decimals_display: number` Number of decimals used when displaying amounts of this asset (this is subjective and used for generating text representations) - `name: string` Full name of the asset - `symbol: string` Symbol of the asset, e.g.: `NEPT` `INJ` - `symbol_denom: string` Denom symbol for the asset (e.g. `inj` for `INJ`, `sat` for `BTC`) - `market_rate: MarketRate` Current market lending rate - `apr: string` Market rate in APR standard as a decimal percentage - `apy: string` Market rate in APY standard as a decimal percentage - `extra: object { text }` - `text: object { apr, apy }` Human-readable field variants. Will not be null when query param `with_text` is `true`. - `apr: string` - `apy: string` - `origin_equivalent: UserLendOriginAmounts` The lending amounts converted into the equivalent for the receipt token's origin/source asset - `collateralized: string` 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: object { text }` - `text: object { collateralized, held, total }` Human-readable field variants. Will not be null when query param `with_text` is `true`. - `collateralized: string` - `held: string` - `total: string` - `held: string` 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: string` 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: string` Total amount of receipt token collateralized across this user's borrowing portfolio - `extra: object { text, value }` - `text: object { collateralized, held, total }` Human-readable field variants. Will not be null when query param `with_text` is `true`. - `collateralized: string` - `held: string` - `total: string` - `value: object { collateralized, extra, held, 2 more }` USD values for the corresponding amounts above. Will not be null when query param `with_value` is `true`. ### Note This variant group contains an additional `price` field (set to the number used in value calculation). The embedded text group will contain the text variant if `with_text` was specified as well. - `collateralized: string` - `extra: object { text }` - `text: object { collateralized, held, price, total }` Human-readable variants of USD values. Will not be null when query params `with_text` and `with_value` are `true`. - `collateralized: string` - `held: string` - `price: string` Text representation of price - `total: string` - `held: string` - `price: string` Price used in value calculations - `total: string` - `held: string` Total amount of receipt token held in address balance - `total: string` Sum of receipt amount held and receipt amount collateralized - `error: unknown` Error data. Guaranteed `null` for successful response. - `status: number` HTTP status. Successful responses are guaranteed to be < `400`. Conversely, error responses are guaranteed to be >= `400`. - `status_text: string` HTTP status text ### Example ```http curl https://api-v2.nept.finance/api/v1/users/$ADDRESS/markets/lend/lookup ``` #### 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 - `UserLendAssetPool = object { asset_info, market_rate, origin_equivalent, receipt_amounts }` - `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: string` - `group: "native" or "token"` - `"native"` - `"token"` - `group_key: string` - `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. - `Regular = object { kind, neptune_receipt_asset }` - `kind: "regular"` - `"regular"` - `neptune_receipt_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) - `NeptuneReceiptToken = object { kind, origin_asset }` - `kind: "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) - `LiquidStakingToken = object { kind, origin_asset }` - `kind: "liquid_staking_token"` - `"liquid_staking_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) - `metadata: AssetMetadata` Additional metadata for assets - `decimals_denom: number` Denom exponent, or num. of decimal places that shift between denom/standard amounts (e.g. `18` for `INJ`) - `decimals_display: number` Number of decimals used when displaying amounts of this asset (this is subjective and used for generating text representations) - `name: string` Full name of the asset - `symbol: string` Symbol of the asset, e.g.: `NEPT` `INJ` - `symbol_denom: string` Denom symbol for the asset (e.g. `inj` for `INJ`, `sat` for `BTC`) - `market_rate: MarketRate` Current market lending rate - `apr: string` Market rate in APR standard as a decimal percentage - `apy: string` Market rate in APY standard as a decimal percentage - `extra: object { text }` - `text: object { apr, apy }` Human-readable field variants. Will not be null when query param `with_text` is `true`. - `apr: string` - `apy: string` - `origin_equivalent: UserLendOriginAmounts` The lending amounts converted into the equivalent for the receipt token's origin/source asset - `collateralized: string` 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: object { text }` - `text: object { collateralized, held, total }` Human-readable field variants. Will not be null when query param `with_text` is `true`. - `collateralized: string` - `held: string` - `total: string` - `held: string` 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: string` 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: string` Total amount of receipt token collateralized across this user's borrowing portfolio - `extra: object { text, value }` - `text: object { collateralized, held, total }` Human-readable field variants. Will not be null when query param `with_text` is `true`. - `collateralized: string` - `held: string` - `total: string` - `value: object { collateralized, extra, held, 2 more }` USD values for the corresponding amounts above. Will not be null when query param `with_value` is `true`. ### Note This variant group contains an additional `price` field (set to the number used in value calculation). The embedded text group will contain the text variant if `with_text` was specified as well. - `collateralized: string` - `extra: object { text }` - `text: object { collateralized, held, price, total }` Human-readable variants of USD values. Will not be null when query params `with_text` and `with_value` are `true`. - `collateralized: string` - `held: string` - `price: string` Text representation of price - `total: string` - `held: string` - `price: string` Price used in value calculations - `total: string` - `held: string` Total amount of receipt token held in address balance - `total: string` Sum of receipt amount held and receipt amount collateralized ### User Lend Market - `UserLendMarket = object { asset_pools, net_rate }` - `asset_pools: array of 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: string` - `group: "native" or "token"` - `"native"` - `"token"` - `group_key: string` - `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. - `Regular = object { kind, neptune_receipt_asset }` - `kind: "regular"` - `"regular"` - `neptune_receipt_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) - `NeptuneReceiptToken = object { kind, origin_asset }` - `kind: "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) - `LiquidStakingToken = object { kind, origin_asset }` - `kind: "liquid_staking_token"` - `"liquid_staking_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) - `metadata: AssetMetadata` Additional metadata for assets - `decimals_denom: number` Denom exponent, or num. of decimal places that shift between denom/standard amounts (e.g. `18` for `INJ`) - `decimals_display: number` Number of decimals used when displaying amounts of this asset (this is subjective and used for generating text representations) - `name: string` Full name of the asset - `symbol: string` Symbol of the asset, e.g.: `NEPT` `INJ` - `symbol_denom: string` Denom symbol for the asset (e.g. `inj` for `INJ`, `sat` for `BTC`) - `market_rate: MarketRate` Current market lending rate - `apr: string` Market rate in APR standard as a decimal percentage - `apy: string` Market rate in APY standard as a decimal percentage - `extra: object { text }` - `text: object { apr, apy }` Human-readable field variants. Will not be null when query param `with_text` is `true`. - `apr: string` - `apy: string` - `origin_equivalent: UserLendOriginAmounts` The lending amounts converted into the equivalent for the receipt token's origin/source asset - `collateralized: string` 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: object { text }` - `text: object { collateralized, held, total }` Human-readable field variants. Will not be null when query param `with_text` is `true`. - `collateralized: string` - `held: string` - `total: string` - `held: string` 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: string` 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: string` Total amount of receipt token collateralized across this user's borrowing portfolio - `extra: object { text, value }` - `text: object { collateralized, held, total }` Human-readable field variants. Will not be null when query param `with_text` is `true`. - `collateralized: string` - `held: string` - `total: string` - `value: object { collateralized, extra, held, 2 more }` USD values for the corresponding amounts above. Will not be null when query param `with_value` is `true`. ### Note This variant group contains an additional `price` field (set to the number used in value calculation). The embedded text group will contain the text variant if `with_text` was specified as well. - `collateralized: string` - `extra: object { text }` - `text: object { collateralized, held, price, total }` Human-readable variants of USD values. Will not be null when query params `with_text` and `with_value` are `true`. - `collateralized: string` - `held: string` - `price: string` Text representation of price - `total: string` - `held: string` - `price: string` Price used in value calculations - `total: string` - `held: string` Total amount of receipt token held in address balance - `total: string` Sum of receipt amount held and receipt amount collateralized - `net_rate: MarketRate` Account debt net rate ### User Lend Origin Amounts - `UserLendOriginAmounts = object { collateralized, extra, held, total }` - `collateralized: string` 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: object { text }` - `text: object { collateralized, held, total }` Human-readable field variants. Will not be null when query param `with_text` is `true`. - `collateralized: string` - `held: string` - `total: string` - `held: string` 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: string` 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 - `UserLendReceiptAmounts = object { collateralized, extra, held, total }` - `collateralized: string` Total amount of receipt token collateralized across this user's borrowing portfolio - `extra: object { text, value }` - `text: object { collateralized, held, total }` Human-readable field variants. Will not be null when query param `with_text` is `true`. - `collateralized: string` - `held: string` - `total: string` - `value: object { collateralized, extra, held, 2 more }` USD values for the corresponding amounts above. Will not be null when query param `with_value` is `true`. ### Note This variant group contains an additional `price` field (set to the number used in value calculation). The embedded text group will contain the text variant if `with_text` was specified as well. - `collateralized: string` - `extra: object { text }` - `text: object { collateralized, held, price, total }` Human-readable variants of USD values. Will not be null when query params `with_text` and `with_value` are `true`. - `collateralized: string` - `held: string` - `price: string` Text representation of price - `total: string` - `held: string` - `price: string` Price used in value calculations - `total: string` - `held: string` Total amount of receipt token held in address balance - `total: string` Sum of receipt amount held and receipt amount collateralized # Borrow ## Get user borrow portfolio **get** `/api/v1/users/{address}/markets/borrow` Get user borrow portfolio ### Path Parameters - `address: string` The user account address ### Query Parameters - `with_text: optional boolean` Include text variation fields - `with_value: optional boolean` Calculate and include USD values for amounts, where applicable ### Returns - `data: UserBorrowMarket` - `accounts: array of UserBorrowMarketAccount` Market sub-accounts for the user - `collaterals: array of UserCollateralAssetPool` Account collateral allocations - `amount: string` 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: string` - `group: "native" or "token"` - `"native"` - `"token"` - `group_key: string` - `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. - `Regular = object { kind, neptune_receipt_asset }` - `kind: "regular"` - `"regular"` - `neptune_receipt_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) - `NeptuneReceiptToken = object { kind, origin_asset }` - `kind: "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) - `LiquidStakingToken = object { kind, origin_asset }` - `kind: "liquid_staking_token"` - `"liquid_staking_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) - `metadata: AssetMetadata` Additional metadata for assets - `decimals_denom: number` Denom exponent, or num. of decimal places that shift between denom/standard amounts (e.g. `18` for `INJ`) - `decimals_display: number` Number of decimals used when displaying amounts of this asset (this is subjective and used for generating text representations) - `name: string` Full name of the asset - `symbol: string` Symbol of the asset, e.g.: `NEPT` `INJ` - `symbol_denom: string` Denom symbol for the asset (e.g. `inj` for `INJ`, `sat` for `BTC`) - `extra: object { text, value }` - `text: object { amount }` Human-readable field variants. Will not be null when query param `with_text` is `true`. - `amount: string` - `value: object { amount, extra, price }` USD values for the corresponding amounts above. Will not be null when query param `with_value` is `true`. ### Note This variant group contains an additional `price` field (set to the number used in value calculation). The embedded text group will contain the text variant if `with_text` was specified as well. - `amount: string` - `extra: object { text }` - `text: object { amount, price }` Human-readable variants of USD values. Will not be null when query params `with_text` and `with_value` are `true`. - `amount: string` - `price: string` Text representation of price - `price: string` Price used in value calculations - `debts: array of UserDebtAssetPool` Account debt allocations - `asset_info: AssetInfo` Asset identifiers with associated metadata - `extra: object { text, value }` - `text: object { principal, shares }` Human-readable field variants. Will not be null when query param `with_text` is `true`. - `principal: string` - `shares: string` - `value: object { extra, price, principal, shares }` 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: object { text }` - `text: object { price, principal, shares }` Human-readable variants of USD values. Will not be null when query params `with_text` and `with_value` are `true`. - `price: string` Text representation of price - `principal: string` - `shares: string` - `price: string` Price used in value calculations - `principal: string` - `shares: string` - `market_rate: MarketRate` Current market borrowing rate - `apr: string` Market rate in APR standard as a decimal percentage - `apy: string` Market rate in APY standard as a decimal percentage - `extra: object { text }` - `text: object { apr, apy }` Human-readable field variants. Will not be null when query param `with_text` is `true`. - `apr: string` - `apy: string` - `principal: string` Initial amount borrowed (of debts which have not yet been repaid) - `shares: string` - `debts_net_rate: MarketRate` Account debt net rate - `health: UserAccountHealth` Health data for this account - `base: string` Account health value, before any added health boosts - `boost: string` Account health boost to be applied - `extra: object { text }` - `text: object { base, boost, result }` Human-readable field variants. Will not be null when query param `with_text` is `true`. - `base: string` - `boost: string` - `result: string` - `result: string` Account health, with boost - `index: number` Account index - `totals: UserBorrowMarketPools` Collateral/debt totals of all sub-accounts by asset - `collaterals: array of UserCollateralAssetPool` Account collateral allocations - `amount: string` Amount of this asset which is actively collateralized - `asset_info: AssetInfo` Asset identifiers with associated metadata - `extra: object { text, value }` - `debts: array of UserDebtAssetPool` Account debt allocations - `asset_info: AssetInfo` Asset identifiers with associated metadata - `extra: object { text, value }` - `market_rate: MarketRate` Current market borrowing rate - `principal: string` Initial amount borrowed (of debts which have not yet been repaid) - `shares: string` - `debts_net_rate: MarketRate` Account debt net rate - `error: unknown` Error data. Guaranteed `null` for successful response. - `status: number` HTTP status. Successful responses are guaranteed to be < `400`. Conversely, error responses are guaranteed to be >= `400`. - `status_text: string` HTTP status text ### Example ```http curl https://api-v2.nept.finance/api/v1/users/$ADDRESS/markets/borrow ``` #### 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 **get** `/api/v1/users/{address}/markets/borrow/lookup/collateral` Lookup user borrow market collateral accounts by asset ### Path Parameters - `address: string` The user account address ### Query Parameters - `asset_id: string` Asset ID for lookup - `with_text: optional boolean` Include text variation fields - `with_value: optional boolean` Calculate and include USD values for amounts, where applicable ### Returns - `data: object { accounts, asset_info }` - `accounts: array of UserCollateralAccountPool` All collateral subaccounts for the associated asset type - `amount: string` Amount of this asset which is actively collateralized - `extra: object { text, value }` - `text: object { amount }` Human-readable field variants. Will not be null when query param `with_text` is `true`. - `amount: string` - `value: object { amount, extra, price }` USD values for the corresponding amounts above. Will not be null when query param `with_value` is `true`. ### Note This variant group contains an additional `price` field (set to the number used in value calculation). The embedded text group will contain the text variant if `with_text` was specified as well. - `amount: string` - `extra: object { text }` - `text: object { amount, price }` Human-readable variants of USD values. Will not be null when query params `with_text` and `with_value` are `true`. - `amount: string` - `price: string` Text representation of price - `price: string` Price used in value calculations - `index: number` 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: string` - `group: "native" or "token"` - `"native"` - `"token"` - `group_key: string` - `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. - `Regular = object { kind, neptune_receipt_asset }` - `kind: "regular"` - `"regular"` - `neptune_receipt_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) - `NeptuneReceiptToken = object { kind, origin_asset }` - `kind: "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) - `LiquidStakingToken = object { kind, origin_asset }` - `kind: "liquid_staking_token"` - `"liquid_staking_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) - `metadata: AssetMetadata` Additional metadata for assets - `decimals_denom: number` Denom exponent, or num. of decimal places that shift between denom/standard amounts (e.g. `18` for `INJ`) - `decimals_display: number` Number of decimals used when displaying amounts of this asset (this is subjective and used for generating text representations) - `name: string` Full name of the asset - `symbol: string` Symbol of the asset, e.g.: `NEPT` `INJ` - `symbol_denom: string` Denom symbol for the asset (e.g. `inj` for `INJ`, `sat` for `BTC`) - `error: unknown` Error data. Guaranteed `null` for successful response. - `status: number` HTTP status. Successful responses are guaranteed to be < `400`. Conversely, error responses are guaranteed to be >= `400`. - `status_text: string` HTTP status text ### Example ```http curl https://api-v2.nept.finance/api/v1/users/$ADDRESS/markets/borrow/lookup/collateral ``` #### 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 **get** `/api/v1/users/{address}/markets/borrow/lookup/debt` Lookup user borrow market debt accounts by asset ### Path Parameters - `address: string` The user account address ### Query Parameters - `asset_id: string` Asset ID for lookup - `with_text: optional boolean` Include text variation fields - `with_value: optional boolean` Calculate and include USD values for amounts, where applicable ### Returns - `data: object { accounts, asset_info, market_rate }` - `accounts: array of UserDebtAccountPool` All debt subaccounts for the associated asset type - `extra: object { text, value }` - `text: object { principal, shares }` Human-readable field variants. Will not be null when query param `with_text` is `true`. - `principal: string` - `shares: string` - `value: object { extra, price, principal, shares }` 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: object { text }` - `text: object { price, principal, shares }` Human-readable variants of USD values. Will not be null when query params `with_text` and `with_value` are `true`. - `price: string` Text representation of price - `principal: string` - `shares: string` - `price: string` Price used in value calculations - `principal: string` - `shares: string` - `index: number` Account index - `principal: string` Initial amount borrowed (of debts which have not yet been repaid) - `shares: string` - `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: string` - `group: "native" or "token"` - `"native"` - `"token"` - `group_key: string` - `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. - `Regular = object { kind, neptune_receipt_asset }` - `kind: "regular"` - `"regular"` - `neptune_receipt_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) - `NeptuneReceiptToken = object { kind, origin_asset }` - `kind: "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) - `LiquidStakingToken = object { kind, origin_asset }` - `kind: "liquid_staking_token"` - `"liquid_staking_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) - `metadata: AssetMetadata` Additional metadata for assets - `decimals_denom: number` Denom exponent, or num. of decimal places that shift between denom/standard amounts (e.g. `18` for `INJ`) - `decimals_display: number` Number of decimals used when displaying amounts of this asset (this is subjective and used for generating text representations) - `name: string` Full name of the asset - `symbol: string` Symbol of the asset, e.g.: `NEPT` `INJ` - `symbol_denom: string` Denom symbol for the asset (e.g. `inj` for `INJ`, `sat` for `BTC`) - `market_rate: MarketRate` Current market borrowing rate - `apr: string` Market rate in APR standard as a decimal percentage - `apy: string` Market rate in APY standard as a decimal percentage - `extra: object { text }` - `text: object { apr, apy }` Human-readable field variants. Will not be null when query param `with_text` is `true`. - `apr: string` - `apy: string` - `error: unknown` Error data. Guaranteed `null` for successful response. - `status: number` HTTP status. Successful responses are guaranteed to be < `400`. Conversely, error responses are guaranteed to be >= `400`. - `status_text: string` HTTP status text ### Example ```http curl https://api-v2.nept.finance/api/v1/users/$ADDRESS/markets/borrow/lookup/debt ``` #### 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 **get** `/api/v1/users/{address}/markets/borrow/sum/collaterals` Get user combined collaterals for all subaccounts ### Path Parameters - `address: string` The user account address ### Query Parameters - `with_text: optional boolean` Include text variation fields - `with_value: optional boolean` Calculate and include USD values for amounts, where applicable ### Returns - `count: number` Total number of objects irrespective of any pagination parameters. - `data: array of UserCollateralAssetPool` - `amount: string` 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: string` - `group: "native" or "token"` - `"native"` - `"token"` - `group_key: string` - `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. - `Regular = object { kind, neptune_receipt_asset }` - `kind: "regular"` - `"regular"` - `neptune_receipt_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) - `NeptuneReceiptToken = object { kind, origin_asset }` - `kind: "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) - `LiquidStakingToken = object { kind, origin_asset }` - `kind: "liquid_staking_token"` - `"liquid_staking_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) - `metadata: AssetMetadata` Additional metadata for assets - `decimals_denom: number` Denom exponent, or num. of decimal places that shift between denom/standard amounts (e.g. `18` for `INJ`) - `decimals_display: number` Number of decimals used when displaying amounts of this asset (this is subjective and used for generating text representations) - `name: string` Full name of the asset - `symbol: string` Symbol of the asset, e.g.: `NEPT` `INJ` - `symbol_denom: string` Denom symbol for the asset (e.g. `inj` for `INJ`, `sat` for `BTC`) - `extra: object { text, value }` - `text: object { amount }` Human-readable field variants. Will not be null when query param `with_text` is `true`. - `amount: string` - `value: object { amount, extra, price }` USD values for the corresponding amounts above. Will not be null when query param `with_value` is `true`. ### Note This variant group contains an additional `price` field (set to the number used in value calculation). The embedded text group will contain the text variant if `with_text` was specified as well. - `amount: string` - `extra: object { text }` - `text: object { amount, price }` Human-readable variants of USD values. Will not be null when query params `with_text` and `with_value` are `true`. - `amount: string` - `price: string` Text representation of price - `price: string` Price used in value calculations - `error: unknown` Error data. Guaranteed `null` for successful response. - `status: number` HTTP status. Successful responses are guaranteed to be < `400`. Conversely, error responses are guaranteed to be >= `400`. - `status_text: string` HTTP status text ### Example ```http curl https://api-v2.nept.finance/api/v1/users/$ADDRESS/markets/borrow/sum/collaterals ``` #### 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 **get** `/api/v1/users/{address}/markets/borrow/sum/debts` Get user combined debts for all subaccounts ### Path Parameters - `address: string` The user account address ### Query Parameters - `with_text: optional boolean` Include text variation fields - `with_value: optional boolean` Calculate and include USD values for amounts, where applicable ### Returns - `count: number` Total number of objects irrespective of any pagination parameters. - `data: array of 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: string` - `group: "native" or "token"` - `"native"` - `"token"` - `group_key: string` - `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. - `Regular = object { kind, neptune_receipt_asset }` - `kind: "regular"` - `"regular"` - `neptune_receipt_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) - `NeptuneReceiptToken = object { kind, origin_asset }` - `kind: "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) - `LiquidStakingToken = object { kind, origin_asset }` - `kind: "liquid_staking_token"` - `"liquid_staking_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) - `metadata: AssetMetadata` Additional metadata for assets - `decimals_denom: number` Denom exponent, or num. of decimal places that shift between denom/standard amounts (e.g. `18` for `INJ`) - `decimals_display: number` Number of decimals used when displaying amounts of this asset (this is subjective and used for generating text representations) - `name: string` Full name of the asset - `symbol: string` Symbol of the asset, e.g.: `NEPT` `INJ` - `symbol_denom: string` Denom symbol for the asset (e.g. `inj` for `INJ`, `sat` for `BTC`) - `extra: object { text, value }` - `text: object { principal, shares }` Human-readable field variants. Will not be null when query param `with_text` is `true`. - `principal: string` - `shares: string` - `value: object { extra, price, principal, shares }` 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: object { text }` - `text: object { price, principal, shares }` Human-readable variants of USD values. Will not be null when query params `with_text` and `with_value` are `true`. - `price: string` Text representation of price - `principal: string` - `shares: string` - `price: string` Price used in value calculations - `principal: string` - `shares: string` - `market_rate: MarketRate` Current market borrowing rate - `apr: string` Market rate in APR standard as a decimal percentage - `apy: string` Market rate in APY standard as a decimal percentage - `extra: object { text }` - `text: object { apr, apy }` Human-readable field variants. Will not be null when query param `with_text` is `true`. - `apr: string` - `apy: string` - `principal: string` Initial amount borrowed (of debts which have not yet been repaid) - `shares: string` - `error: unknown` Error data. Guaranteed `null` for successful response. - `status: number` HTTP status. Successful responses are guaranteed to be < `400`. Conversely, error responses are guaranteed to be >= `400`. - `status_text: string` HTTP status text ### Example ```http curl https://api-v2.nept.finance/api/v1/users/$ADDRESS/markets/borrow/sum/debts ``` #### 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 - `UserBorrowMarket = object { accounts, totals }` - `accounts: array of UserBorrowMarketAccount` Market sub-accounts for the user - `collaterals: array of UserCollateralAssetPool` Account collateral allocations - `amount: string` 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: string` - `group: "native" or "token"` - `"native"` - `"token"` - `group_key: string` - `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. - `Regular = object { kind, neptune_receipt_asset }` - `kind: "regular"` - `"regular"` - `neptune_receipt_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) - `NeptuneReceiptToken = object { kind, origin_asset }` - `kind: "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) - `LiquidStakingToken = object { kind, origin_asset }` - `kind: "liquid_staking_token"` - `"liquid_staking_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) - `metadata: AssetMetadata` Additional metadata for assets - `decimals_denom: number` Denom exponent, or num. of decimal places that shift between denom/standard amounts (e.g. `18` for `INJ`) - `decimals_display: number` Number of decimals used when displaying amounts of this asset (this is subjective and used for generating text representations) - `name: string` Full name of the asset - `symbol: string` Symbol of the asset, e.g.: `NEPT` `INJ` - `symbol_denom: string` Denom symbol for the asset (e.g. `inj` for `INJ`, `sat` for `BTC`) - `extra: object { text, value }` - `text: object { amount }` Human-readable field variants. Will not be null when query param `with_text` is `true`. - `amount: string` - `value: object { amount, extra, price }` USD values for the corresponding amounts above. Will not be null when query param `with_value` is `true`. ### Note This variant group contains an additional `price` field (set to the number used in value calculation). The embedded text group will contain the text variant if `with_text` was specified as well. - `amount: string` - `extra: object { text }` - `text: object { amount, price }` Human-readable variants of USD values. Will not be null when query params `with_text` and `with_value` are `true`. - `amount: string` - `price: string` Text representation of price - `price: string` Price used in value calculations - `debts: array of UserDebtAssetPool` Account debt allocations - `asset_info: AssetInfo` Asset identifiers with associated metadata - `extra: object { text, value }` - `text: object { principal, shares }` Human-readable field variants. Will not be null when query param `with_text` is `true`. - `principal: string` - `shares: string` - `value: object { extra, price, principal, shares }` 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: object { text }` - `text: object { price, principal, shares }` Human-readable variants of USD values. Will not be null when query params `with_text` and `with_value` are `true`. - `price: string` Text representation of price - `principal: string` - `shares: string` - `price: string` Price used in value calculations - `principal: string` - `shares: string` - `market_rate: MarketRate` Current market borrowing rate - `apr: string` Market rate in APR standard as a decimal percentage - `apy: string` Market rate in APY standard as a decimal percentage - `extra: object { text }` - `text: object { apr, apy }` Human-readable field variants. Will not be null when query param `with_text` is `true`. - `apr: string` - `apy: string` - `principal: string` Initial amount borrowed (of debts which have not yet been repaid) - `shares: string` - `debts_net_rate: MarketRate` Account debt net rate - `health: UserAccountHealth` Health data for this account - `base: string` Account health value, before any added health boosts - `boost: string` Account health boost to be applied - `extra: object { text }` - `text: object { base, boost, result }` Human-readable field variants. Will not be null when query param `with_text` is `true`. - `base: string` - `boost: string` - `result: string` - `result: string` Account health, with boost - `index: number` Account index - `totals: UserBorrowMarketPools` Collateral/debt totals of all sub-accounts by asset - `collaterals: array of UserCollateralAssetPool` Account collateral allocations - `amount: string` Amount of this asset which is actively collateralized - `asset_info: AssetInfo` Asset identifiers with associated metadata - `extra: object { text, value }` - `debts: array of UserDebtAssetPool` Account debt allocations - `asset_info: AssetInfo` Asset identifiers with associated metadata - `extra: object { text, value }` - `market_rate: MarketRate` Current market borrowing rate - `principal: string` Initial amount borrowed (of debts which have not yet been repaid) - `shares: string` - `debts_net_rate: MarketRate` Account debt net rate ### User Borrow Market Pools - `UserBorrowMarketPools = object { collaterals, debts, debts_net_rate }` - `collaterals: array of UserCollateralAssetPool` Account collateral allocations - `amount: string` 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: string` - `group: "native" or "token"` - `"native"` - `"token"` - `group_key: string` - `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. - `Regular = object { kind, neptune_receipt_asset }` - `kind: "regular"` - `"regular"` - `neptune_receipt_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) - `NeptuneReceiptToken = object { kind, origin_asset }` - `kind: "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) - `LiquidStakingToken = object { kind, origin_asset }` - `kind: "liquid_staking_token"` - `"liquid_staking_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) - `metadata: AssetMetadata` Additional metadata for assets - `decimals_denom: number` Denom exponent, or num. of decimal places that shift between denom/standard amounts (e.g. `18` for `INJ`) - `decimals_display: number` Number of decimals used when displaying amounts of this asset (this is subjective and used for generating text representations) - `name: string` Full name of the asset - `symbol: string` Symbol of the asset, e.g.: `NEPT` `INJ` - `symbol_denom: string` Denom symbol for the asset (e.g. `inj` for `INJ`, `sat` for `BTC`) - `extra: object { text, value }` - `text: object { amount }` Human-readable field variants. Will not be null when query param `with_text` is `true`. - `amount: string` - `value: object { amount, extra, price }` USD values for the corresponding amounts above. Will not be null when query param `with_value` is `true`. ### Note This variant group contains an additional `price` field (set to the number used in value calculation). The embedded text group will contain the text variant if `with_text` was specified as well. - `amount: string` - `extra: object { text }` - `text: object { amount, price }` Human-readable variants of USD values. Will not be null when query params `with_text` and `with_value` are `true`. - `amount: string` - `price: string` Text representation of price - `price: string` Price used in value calculations - `debts: array of UserDebtAssetPool` Account debt allocations - `asset_info: AssetInfo` Asset identifiers with associated metadata - `extra: object { text, value }` - `text: object { principal, shares }` Human-readable field variants. Will not be null when query param `with_text` is `true`. - `principal: string` - `shares: string` - `value: object { extra, price, principal, shares }` 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: object { text }` - `text: object { price, principal, shares }` Human-readable variants of USD values. Will not be null when query params `with_text` and `with_value` are `true`. - `price: string` Text representation of price - `principal: string` - `shares: string` - `price: string` Price used in value calculations - `principal: string` - `shares: string` - `market_rate: MarketRate` Current market borrowing rate - `apr: string` Market rate in APR standard as a decimal percentage - `apy: string` Market rate in APY standard as a decimal percentage - `extra: object { text }` - `text: object { apr, apy }` Human-readable field variants. Will not be null when query param `with_text` is `true`. - `apr: string` - `apy: string` - `principal: string` Initial amount borrowed (of debts which have not yet been repaid) - `shares: string` - `debts_net_rate: MarketRate` Account debt net rate # Subaccount ## Get user borrow subaccount **get** `/api/v1/users/{address}/markets/borrow/accounts/{index}` Get user borrow subaccount ### Path Parameters - `address: string` The user account address - `index: number` The user account index ### Query Parameters - `with_text: optional boolean` Include text variation fields - `with_value: optional boolean` Calculate and include USD values for amounts, where applicable ### Returns - `data: UserBorrowMarketAccount` User borrowing subaccount - `collaterals: array of UserCollateralAssetPool` Account collateral allocations - `amount: string` 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: string` - `group: "native" or "token"` - `"native"` - `"token"` - `group_key: string` - `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. - `Regular = object { kind, neptune_receipt_asset }` - `kind: "regular"` - `"regular"` - `neptune_receipt_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) - `NeptuneReceiptToken = object { kind, origin_asset }` - `kind: "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) - `LiquidStakingToken = object { kind, origin_asset }` - `kind: "liquid_staking_token"` - `"liquid_staking_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) - `metadata: AssetMetadata` Additional metadata for assets - `decimals_denom: number` Denom exponent, or num. of decimal places that shift between denom/standard amounts (e.g. `18` for `INJ`) - `decimals_display: number` Number of decimals used when displaying amounts of this asset (this is subjective and used for generating text representations) - `name: string` Full name of the asset - `symbol: string` Symbol of the asset, e.g.: `NEPT` `INJ` - `symbol_denom: string` Denom symbol for the asset (e.g. `inj` for `INJ`, `sat` for `BTC`) - `extra: object { text, value }` - `text: object { amount }` Human-readable field variants. Will not be null when query param `with_text` is `true`. - `amount: string` - `value: object { amount, extra, price }` USD values for the corresponding amounts above. Will not be null when query param `with_value` is `true`. ### Note This variant group contains an additional `price` field (set to the number used in value calculation). The embedded text group will contain the text variant if `with_text` was specified as well. - `amount: string` - `extra: object { text }` - `text: object { amount, price }` Human-readable variants of USD values. Will not be null when query params `with_text` and `with_value` are `true`. - `amount: string` - `price: string` Text representation of price - `price: string` Price used in value calculations - `debts: array of UserDebtAssetPool` Account debt allocations - `asset_info: AssetInfo` Asset identifiers with associated metadata - `extra: object { text, value }` - `text: object { principal, shares }` Human-readable field variants. Will not be null when query param `with_text` is `true`. - `principal: string` - `shares: string` - `value: object { extra, price, principal, shares }` 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: object { text }` - `text: object { price, principal, shares }` Human-readable variants of USD values. Will not be null when query params `with_text` and `with_value` are `true`. - `price: string` Text representation of price - `principal: string` - `shares: string` - `price: string` Price used in value calculations - `principal: string` - `shares: string` - `market_rate: MarketRate` Current market borrowing rate - `apr: string` Market rate in APR standard as a decimal percentage - `apy: string` Market rate in APY standard as a decimal percentage - `extra: object { text }` - `text: object { apr, apy }` Human-readable field variants. Will not be null when query param `with_text` is `true`. - `apr: string` - `apy: string` - `principal: string` Initial amount borrowed (of debts which have not yet been repaid) - `shares: string` - `debts_net_rate: MarketRate` Account debt net rate - `health: UserAccountHealth` Health data for this account - `base: string` Account health value, before any added health boosts - `boost: string` Account health boost to be applied - `extra: object { text }` - `text: object { base, boost, result }` Human-readable field variants. Will not be null when query param `with_text` is `true`. - `base: string` - `boost: string` - `result: string` - `result: string` Account health, with boost - `index: number` Account index - `error: unknown` Error data. Guaranteed `null` for successful response. - `status: number` HTTP status. Successful responses are guaranteed to be < `400`. Conversely, error responses are guaranteed to be >= `400`. - `status_text: string` HTTP status text ### Example ```http curl https://api-v2.nept.finance/api/v1/users/$ADDRESS/markets/borrow/accounts/$INDEX ``` #### 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 **get** `/api/v1/users/{address}/markets/borrow/accounts/{index}/health` Get user borrow subaccount health ### Path Parameters - `address: string` The user account address - `index: number` The user account index ### Query Parameters - `with_text: optional boolean` Include text variation fields ### Returns - `data: UserAccountHealth` - `base: string` Account health value, before any added health boosts - `boost: string` Account health boost to be applied - `extra: object { text }` - `text: object { base, boost, result }` Human-readable field variants. Will not be null when query param `with_text` is `true`. - `base: string` - `boost: string` - `result: string` - `result: string` Account health, with boost - `error: unknown` Error data. Guaranteed `null` for successful response. - `status: number` HTTP status. Successful responses are guaranteed to be < `400`. Conversely, error responses are guaranteed to be >= `400`. - `status_text: string` HTTP status text ### Example ```http curl https://api-v2.nept.finance/api/v1/users/$ADDRESS/markets/borrow/accounts/$INDEX/health ``` #### 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 **get** `/api/v1/users/{address}/markets/borrow/accounts/{index}/collaterals` Get user borrow subaccount collaterals ### Path Parameters - `address: string` The user account address - `index: number` The user account index ### Query Parameters - `with_text: optional boolean` Include text variation fields - `with_value: optional boolean` Calculate and include USD values for amounts, where applicable ### Returns - `count: number` Total number of objects irrespective of any pagination parameters. - `data: array of UserCollateralAssetPool` - `amount: string` 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: string` - `group: "native" or "token"` - `"native"` - `"token"` - `group_key: string` - `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. - `Regular = object { kind, neptune_receipt_asset }` - `kind: "regular"` - `"regular"` - `neptune_receipt_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) - `NeptuneReceiptToken = object { kind, origin_asset }` - `kind: "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) - `LiquidStakingToken = object { kind, origin_asset }` - `kind: "liquid_staking_token"` - `"liquid_staking_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) - `metadata: AssetMetadata` Additional metadata for assets - `decimals_denom: number` Denom exponent, or num. of decimal places that shift between denom/standard amounts (e.g. `18` for `INJ`) - `decimals_display: number` Number of decimals used when displaying amounts of this asset (this is subjective and used for generating text representations) - `name: string` Full name of the asset - `symbol: string` Symbol of the asset, e.g.: `NEPT` `INJ` - `symbol_denom: string` Denom symbol for the asset (e.g. `inj` for `INJ`, `sat` for `BTC`) - `extra: object { text, value }` - `text: object { amount }` Human-readable field variants. Will not be null when query param `with_text` is `true`. - `amount: string` - `value: object { amount, extra, price }` USD values for the corresponding amounts above. Will not be null when query param `with_value` is `true`. ### Note This variant group contains an additional `price` field (set to the number used in value calculation). The embedded text group will contain the text variant if `with_text` was specified as well. - `amount: string` - `extra: object { text }` - `text: object { amount, price }` Human-readable variants of USD values. Will not be null when query params `with_text` and `with_value` are `true`. - `amount: string` - `price: string` Text representation of price - `price: string` Price used in value calculations - `error: unknown` Error data. Guaranteed `null` for successful response. - `status: number` HTTP status. Successful responses are guaranteed to be < `400`. Conversely, error responses are guaranteed to be >= `400`. - `status_text: string` HTTP status text ### Example ```http curl https://api-v2.nept.finance/api/v1/users/$ADDRESS/markets/borrow/accounts/$INDEX/collaterals ``` #### 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 **get** `/api/v1/users/{address}/markets/borrow/accounts/{index}/debts` Get user borrow subaccount debts ### Path Parameters - `address: string` The user account address - `index: number` The user account index ### Query Parameters - `with_text: optional boolean` Include text variation fields - `with_value: optional boolean` Calculate and include USD values for amounts, where applicable ### Returns - `count: number` Total number of objects irrespective of any pagination parameters. - `data: array of 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: string` - `group: "native" or "token"` - `"native"` - `"token"` - `group_key: string` - `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. - `Regular = object { kind, neptune_receipt_asset }` - `kind: "regular"` - `"regular"` - `neptune_receipt_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) - `NeptuneReceiptToken = object { kind, origin_asset }` - `kind: "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) - `LiquidStakingToken = object { kind, origin_asset }` - `kind: "liquid_staking_token"` - `"liquid_staking_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) - `metadata: AssetMetadata` Additional metadata for assets - `decimals_denom: number` Denom exponent, or num. of decimal places that shift between denom/standard amounts (e.g. `18` for `INJ`) - `decimals_display: number` Number of decimals used when displaying amounts of this asset (this is subjective and used for generating text representations) - `name: string` Full name of the asset - `symbol: string` Symbol of the asset, e.g.: `NEPT` `INJ` - `symbol_denom: string` Denom symbol for the asset (e.g. `inj` for `INJ`, `sat` for `BTC`) - `extra: object { text, value }` - `text: object { principal, shares }` Human-readable field variants. Will not be null when query param `with_text` is `true`. - `principal: string` - `shares: string` - `value: object { extra, price, principal, shares }` 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: object { text }` - `text: object { price, principal, shares }` Human-readable variants of USD values. Will not be null when query params `with_text` and `with_value` are `true`. - `price: string` Text representation of price - `principal: string` - `shares: string` - `price: string` Price used in value calculations - `principal: string` - `shares: string` - `market_rate: MarketRate` Current market borrowing rate - `apr: string` Market rate in APR standard as a decimal percentage - `apy: string` Market rate in APY standard as a decimal percentage - `extra: object { text }` - `text: object { apr, apy }` Human-readable field variants. Will not be null when query param `with_text` is `true`. - `apr: string` - `apy: string` - `principal: string` Initial amount borrowed (of debts which have not yet been repaid) - `shares: string` - `error: unknown` Error data. Guaranteed `null` for successful response. - `status: number` HTTP status. Successful responses are guaranteed to be < `400`. Conversely, error responses are guaranteed to be >= `400`. - `status_text: string` HTTP status text ### Example ```http curl https://api-v2.nept.finance/api/v1/users/$ADDRESS/markets/borrow/accounts/$INDEX/debts ``` #### 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 - `UserAccountHealth = object { base, boost, extra, result }` - `base: string` Account health value, before any added health boosts - `boost: string` Account health boost to be applied - `extra: object { text }` - `text: object { base, boost, result }` Human-readable field variants. Will not be null when query param `with_text` is `true`. - `base: string` - `boost: string` - `result: string` - `result: string` Account health, with boost ### User Borrow Market Account - `UserBorrowMarketAccount = object { collaterals, debts, debts_net_rate, 2 more }` User borrowing subaccount - `collaterals: array of UserCollateralAssetPool` Account collateral allocations - `amount: string` 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: string` - `group: "native" or "token"` - `"native"` - `"token"` - `group_key: string` - `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. - `Regular = object { kind, neptune_receipt_asset }` - `kind: "regular"` - `"regular"` - `neptune_receipt_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) - `NeptuneReceiptToken = object { kind, origin_asset }` - `kind: "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) - `LiquidStakingToken = object { kind, origin_asset }` - `kind: "liquid_staking_token"` - `"liquid_staking_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) - `metadata: AssetMetadata` Additional metadata for assets - `decimals_denom: number` Denom exponent, or num. of decimal places that shift between denom/standard amounts (e.g. `18` for `INJ`) - `decimals_display: number` Number of decimals used when displaying amounts of this asset (this is subjective and used for generating text representations) - `name: string` Full name of the asset - `symbol: string` Symbol of the asset, e.g.: `NEPT` `INJ` - `symbol_denom: string` Denom symbol for the asset (e.g. `inj` for `INJ`, `sat` for `BTC`) - `extra: object { text, value }` - `text: object { amount }` Human-readable field variants. Will not be null when query param `with_text` is `true`. - `amount: string` - `value: object { amount, extra, price }` USD values for the corresponding amounts above. Will not be null when query param `with_value` is `true`. ### Note This variant group contains an additional `price` field (set to the number used in value calculation). The embedded text group will contain the text variant if `with_text` was specified as well. - `amount: string` - `extra: object { text }` - `text: object { amount, price }` Human-readable variants of USD values. Will not be null when query params `with_text` and `with_value` are `true`. - `amount: string` - `price: string` Text representation of price - `price: string` Price used in value calculations - `debts: array of UserDebtAssetPool` Account debt allocations - `asset_info: AssetInfo` Asset identifiers with associated metadata - `extra: object { text, value }` - `text: object { principal, shares }` Human-readable field variants. Will not be null when query param `with_text` is `true`. - `principal: string` - `shares: string` - `value: object { extra, price, principal, shares }` 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: object { text }` - `text: object { price, principal, shares }` Human-readable variants of USD values. Will not be null when query params `with_text` and `with_value` are `true`. - `price: string` Text representation of price - `principal: string` - `shares: string` - `price: string` Price used in value calculations - `principal: string` - `shares: string` - `market_rate: MarketRate` Current market borrowing rate - `apr: string` Market rate in APR standard as a decimal percentage - `apy: string` Market rate in APY standard as a decimal percentage - `extra: object { text }` - `text: object { apr, apy }` Human-readable field variants. Will not be null when query param `with_text` is `true`. - `apr: string` - `apy: string` - `principal: string` Initial amount borrowed (of debts which have not yet been repaid) - `shares: string` - `debts_net_rate: MarketRate` Account debt net rate - `health: UserAccountHealth` Health data for this account - `base: string` Account health value, before any added health boosts - `boost: string` Account health boost to be applied - `extra: object { text }` - `text: object { base, boost, result }` Human-readable field variants. Will not be null when query param `with_text` is `true`. - `base: string` - `boost: string` - `result: string` - `result: string` Account health, with boost - `index: number` Account index ### User Collateral Account Pool - `UserCollateralAccountPool = object { amount, extra, index }` 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: string` Amount of this asset which is actively collateralized - `extra: object { text, value }` - `text: object { amount }` Human-readable field variants. Will not be null when query param `with_text` is `true`. - `amount: string` - `value: object { amount, extra, price }` USD values for the corresponding amounts above. Will not be null when query param `with_value` is `true`. ### Note This variant group contains an additional `price` field (set to the number used in value calculation). The embedded text group will contain the text variant if `with_text` was specified as well. - `amount: string` - `extra: object { text }` - `text: object { amount, price }` Human-readable variants of USD values. Will not be null when query params `with_text` and `with_value` are `true`. - `amount: string` - `price: string` Text representation of price - `price: string` Price used in value calculations - `index: number` Account index ### User Collateral Asset Pool - `UserCollateralAssetPool = object { amount, asset_info, extra }` - `amount: string` 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: string` - `group: "native" or "token"` - `"native"` - `"token"` - `group_key: string` - `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. - `Regular = object { kind, neptune_receipt_asset }` - `kind: "regular"` - `"regular"` - `neptune_receipt_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) - `NeptuneReceiptToken = object { kind, origin_asset }` - `kind: "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) - `LiquidStakingToken = object { kind, origin_asset }` - `kind: "liquid_staking_token"` - `"liquid_staking_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) - `metadata: AssetMetadata` Additional metadata for assets - `decimals_denom: number` Denom exponent, or num. of decimal places that shift between denom/standard amounts (e.g. `18` for `INJ`) - `decimals_display: number` Number of decimals used when displaying amounts of this asset (this is subjective and used for generating text representations) - `name: string` Full name of the asset - `symbol: string` Symbol of the asset, e.g.: `NEPT` `INJ` - `symbol_denom: string` Denom symbol for the asset (e.g. `inj` for `INJ`, `sat` for `BTC`) - `extra: object { text, value }` - `text: object { amount }` Human-readable field variants. Will not be null when query param `with_text` is `true`. - `amount: string` - `value: object { amount, extra, price }` USD values for the corresponding amounts above. Will not be null when query param `with_value` is `true`. ### Note This variant group contains an additional `price` field (set to the number used in value calculation). The embedded text group will contain the text variant if `with_text` was specified as well. - `amount: string` - `extra: object { text }` - `text: object { amount, price }` Human-readable variants of USD values. Will not be null when query params `with_text` and `with_value` are `true`. - `amount: string` - `price: string` Text representation of price - `price: string` Price used in value calculations ### User Debt Account Pool - `UserDebtAccountPool = object { extra, index, principal, shares }` 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: object { text, value }` - `text: object { principal, shares }` Human-readable field variants. Will not be null when query param `with_text` is `true`. - `principal: string` - `shares: string` - `value: object { extra, price, principal, shares }` 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: object { text }` - `text: object { price, principal, shares }` Human-readable variants of USD values. Will not be null when query params `with_text` and `with_value` are `true`. - `price: string` Text representation of price - `principal: string` - `shares: string` - `price: string` Price used in value calculations - `principal: string` - `shares: string` - `index: number` Account index - `principal: string` Initial amount borrowed (of debts which have not yet been repaid) - `shares: string` ### User Debt Asset Pool - `UserDebtAssetPool = object { asset_info, extra, market_rate, 2 more }` - `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: string` - `group: "native" or "token"` - `"native"` - `"token"` - `group_key: string` - `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. - `Regular = object { kind, neptune_receipt_asset }` - `kind: "regular"` - `"regular"` - `neptune_receipt_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) - `NeptuneReceiptToken = object { kind, origin_asset }` - `kind: "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) - `LiquidStakingToken = object { kind, origin_asset }` - `kind: "liquid_staking_token"` - `"liquid_staking_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) - `metadata: AssetMetadata` Additional metadata for assets - `decimals_denom: number` Denom exponent, or num. of decimal places that shift between denom/standard amounts (e.g. `18` for `INJ`) - `decimals_display: number` Number of decimals used when displaying amounts of this asset (this is subjective and used for generating text representations) - `name: string` Full name of the asset - `symbol: string` Symbol of the asset, e.g.: `NEPT` `INJ` - `symbol_denom: string` Denom symbol for the asset (e.g. `inj` for `INJ`, `sat` for `BTC`) - `extra: object { text, value }` - `text: object { principal, shares }` Human-readable field variants. Will not be null when query param `with_text` is `true`. - `principal: string` - `shares: string` - `value: object { extra, price, principal, shares }` 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: object { text }` - `text: object { price, principal, shares }` Human-readable variants of USD values. Will not be null when query params `with_text` and `with_value` are `true`. - `price: string` Text representation of price - `principal: string` - `shares: string` - `price: string` Price used in value calculations - `principal: string` - `shares: string` - `market_rate: MarketRate` Current market borrowing rate - `apr: string` Market rate in APR standard as a decimal percentage - `apy: string` Market rate in APY standard as a decimal percentage - `extra: object { text }` - `text: object { apr, apy }` Human-readable field variants. Will not be null when query param `with_text` is `true`. - `apr: string` - `apy: string` - `principal: string` Initial amount borrowed (of debts which have not yet been repaid) - `shares: string`