Get user market portfolio
user.market.get_portfolio(straddress, MarketGetPortfolioParams**kwargs) -> MarketGetPortfolioResponse
GET/api/v1/users/{address}/markets
Get user market portfolio
Get user market portfolio
from neptune_api_v2 import NeptuneAPIV2
client = NeptuneAPIV2()
response = client.user.market.get_portfolio(
address="injvalcons1a03k0ztfyjnd70apawva003pkh0adqmau0a9q0",
)
print(response.data){
"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"
}{
"data": null,
"error": {
"kind": "internal",
"scope": "server",
"message": "An unexpected error occurred"
},
"status": 500,
"status_text": "500 Internal Server Error"
}Returns Examples
{
"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"
}{
"data": null,
"error": {
"kind": "internal",
"scope": "server",
"message": "An unexpected error occurred"
},
"status": 500,
"status_text": "500 Internal Server Error"
}