Get user's markets (lend + borrow debt/collateral) for a specific asset
user.market.get_merged_by_asset(straddress, MarketGetMergedByAssetParams**kwargs) -> MarketGetMergedByAssetResponse
GET/api/v1/users/{address}/markets/merged/lookup
Get user's markets (lend + borrow debt/collateral) for a specific asset
Get user's markets (lend + borrow debt/collateral) for a specific asset
from neptune_api_v2 import NeptuneAPIV2
client = NeptuneAPIV2()
response = client.user.market.get_merged_by_asset(
address="injvalcons1a03k0ztfyjnd70apawva003pkh0adqmau0a9q0",
asset_id="token;-K-//-//3-",
)
print(response.data){
"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": "165520769200846056707",
"collateralized": "33911861127944816220",
"total": "199432630328790872927",
"extra": {
"text": {
"total": "199.4326 nINJ",
"collateralized": "33.9118 nINJ",
"held": "165.5207 nINJ"
},
"value": {
"total": "643.057433356714511211",
"held": "533.710861828608120866",
"collateralized": "109.346571528106390345",
"price": "3.224434398205298254",
"extra": {
"text": {
"held": "$533.71",
"collateralized": "$109.34",
"price": "$3.22",
"total": "$643.05"
}
}
}
}
},
"origin_equivalent": {
"held": "177524661169539006844",
"collateralized": "36371216043962731117",
"total": "213895877213501737962",
"extra": {
"text": {
"collateralized": "36.3712 INJ",
"total": "213.8958 INJ",
"held": "177.5246 INJ"
}
}
}
},
"borrow_collateral": [
{
"index": 0,
"principal": "962867080566382903969",
"shares": "830304967600907020638",
"extra": {
"text": {
"principal": "962.8670 INJ",
"shares": "830.3049 INJ"
},
"value": {
"shares": "2489.544899606179565329",
"price": "2.99835",
"principal": "2887.012511016214180115",
"extra": {
"text": {
"price": "$2.99",
"shares": "$2,489.54",
"principal": "$2,887.01"
}
}
}
}
}
],
"borrow_debt": [
{
"index": 0,
"principal": "371548017952988694184",
"shares": "371548017952988694184",
"extra": {
"text": {
"principal": "371.5480 INJ",
"shares": "371.5480 INJ"
},
"value": {
"shares": "1114.030999629343651206",
"price": "2.99835",
"principal": "1114.030999629343651206",
"extra": {
"text": {
"shares": "$1,114.03",
"price": "$2.99",
"principal": "$1,114.03"
}
}
}
}
}
]
},
"error": null,
"status": 200,
"status_text": "OK"
}{
"data": null,
"error": {
"kind": "internal",
"scope": "server",
"message": "An unexpected error occurred"
},
"status": 500,
"status_text": "Internal Server Error"
}Returns Examples
{
"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": "165520769200846056707",
"collateralized": "33911861127944816220",
"total": "199432630328790872927",
"extra": {
"text": {
"total": "199.4326 nINJ",
"collateralized": "33.9118 nINJ",
"held": "165.5207 nINJ"
},
"value": {
"total": "643.057433356714511211",
"held": "533.710861828608120866",
"collateralized": "109.346571528106390345",
"price": "3.224434398205298254",
"extra": {
"text": {
"held": "$533.71",
"collateralized": "$109.34",
"price": "$3.22",
"total": "$643.05"
}
}
}
}
},
"origin_equivalent": {
"held": "177524661169539006844",
"collateralized": "36371216043962731117",
"total": "213895877213501737962",
"extra": {
"text": {
"collateralized": "36.3712 INJ",
"total": "213.8958 INJ",
"held": "177.5246 INJ"
}
}
}
},
"borrow_collateral": [
{
"index": 0,
"principal": "962867080566382903969",
"shares": "830304967600907020638",
"extra": {
"text": {
"principal": "962.8670 INJ",
"shares": "830.3049 INJ"
},
"value": {
"shares": "2489.544899606179565329",
"price": "2.99835",
"principal": "2887.012511016214180115",
"extra": {
"text": {
"price": "$2.99",
"shares": "$2,489.54",
"principal": "$2,887.01"
}
}
}
}
}
],
"borrow_debt": [
{
"index": 0,
"principal": "371548017952988694184",
"shares": "371548017952988694184",
"extra": {
"text": {
"principal": "371.5480 INJ",
"shares": "371.5480 INJ"
},
"value": {
"shares": "1114.030999629343651206",
"price": "2.99835",
"principal": "1114.030999629343651206",
"extra": {
"text": {
"shares": "$1,114.03",
"price": "$2.99",
"principal": "$1,114.03"
}
}
}
}
}
]
},
"error": null,
"status": 200,
"status_text": "OK"
}{
"data": null,
"error": {
"kind": "internal",
"scope": "server",
"message": "An unexpected error occurred"
},
"status": 500,
"status_text": "Internal Server Error"
}