Get user markets for all kinds (lend + borrow debt/collateral), grouped together by asset
user.market.get_merged(straddress, MarketGetMergedParams**kwargs) -> MarketGetMergedResponse
GET/api/v1/users/{address}/markets/merged
Get user markets for all kinds (lend + borrow debt/collateral), grouped together by asset
Get user markets for all kinds (lend + borrow debt/collateral), grouped together by asset
from neptune_api_v2 import NeptuneAPIV2
client = NeptuneAPIV2()
response = client.user.market.get_merged(
address="injvalcons1a03k0ztfyjnd70apawva003pkh0adqmau0a9q0",
)
print(response.count){
"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": "83554004830102299663",
"collateralized": "752960360256328550651",
"total": "836514365086430850314",
"extra": {
"text": {
"total": "836.5143 nINJ",
"collateralized": "752.9603 nINJ",
"held": "83.5540 nINJ"
},
"value": {
"total": "2697.285693377552815399",
"held": "269.414407281993492198",
"collateralized": "2427.8712860955593232",
"price": "3.224434398205298254",
"extra": {
"text": {
"held": "$269.41",
"collateralized": "$2,427.87",
"price": "$3.22",
"total": "$2,697.28"
}
}
}
}
},
"origin_equivalent": {
"held": "89613505715548101937",
"collateralized": "807566527596317523958",
"total": "897180033311865625895",
"extra": {
"text": {
"collateralized": "807.5665 INJ",
"total": "897.1800 INJ",
"held": "89.6135 INJ"
}
}
}
},
"borrow_collateral": [
{
"index": 0,
"principal": "782952579489904269695",
"shares": "563190221360717641092",
"extra": {
"text": {
"principal": "782.9525 INJ",
"shares": "563.1902 INJ"
},
"value": {
"shares": "1688.641400216907739168",
"price": "2.99835",
"principal": "2347.56586671355446704",
"extra": {
"text": {
"price": "$2.99",
"shares": "$1,688.64",
"principal": "$2,347.56"
}
}
}
}
}
],
"borrow_debt": [
{
"index": 0,
"principal": "363137513144439643883",
"shares": "363137513144439643883",
"extra": {
"text": {
"principal": "363.1375 INJ",
"shares": "363.1375 INJ"
},
"value": {
"shares": "1088.813362536630606236",
"price": "2.99835",
"principal": "1088.813362536630606236",
"extra": {
"text": {
"shares": "$1,088.81",
"price": "$2.99",
"principal": "$1,088.81"
}
}
}
}
}
]
}
],
"count": 1,
"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": "83554004830102299663",
"collateralized": "752960360256328550651",
"total": "836514365086430850314",
"extra": {
"text": {
"total": "836.5143 nINJ",
"collateralized": "752.9603 nINJ",
"held": "83.5540 nINJ"
},
"value": {
"total": "2697.285693377552815399",
"held": "269.414407281993492198",
"collateralized": "2427.8712860955593232",
"price": "3.224434398205298254",
"extra": {
"text": {
"held": "$269.41",
"collateralized": "$2,427.87",
"price": "$3.22",
"total": "$2,697.28"
}
}
}
}
},
"origin_equivalent": {
"held": "89613505715548101937",
"collateralized": "807566527596317523958",
"total": "897180033311865625895",
"extra": {
"text": {
"collateralized": "807.5665 INJ",
"total": "897.1800 INJ",
"held": "89.6135 INJ"
}
}
}
},
"borrow_collateral": [
{
"index": 0,
"principal": "782952579489904269695",
"shares": "563190221360717641092",
"extra": {
"text": {
"principal": "782.9525 INJ",
"shares": "563.1902 INJ"
},
"value": {
"shares": "1688.641400216907739168",
"price": "2.99835",
"principal": "2347.56586671355446704",
"extra": {
"text": {
"price": "$2.99",
"shares": "$1,688.64",
"principal": "$2,347.56"
}
}
}
}
}
],
"borrow_debt": [
{
"index": 0,
"principal": "363137513144439643883",
"shares": "363137513144439643883",
"extra": {
"text": {
"principal": "363.1375 INJ",
"shares": "363.1375 INJ"
},
"value": {
"shares": "1088.813362536630606236",
"price": "2.99835",
"principal": "1088.813362536630606236",
"extra": {
"text": {
"shares": "$1,088.81",
"price": "$2.99",
"principal": "$1,088.81"
}
}
}
}
}
]
}
],
"count": 1,
"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"
}