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"
}
}
},
"principal": "955094137983627705654",
"shares": "611291918790647923636",
"extra": {
"text": {
"principal": "955.0941 INJ",
"shares": "611.2919 INJ"
},
"value": {
"shares": "1832.867124705939201834",
"price": "2.99835",
"principal": "2863.706508623210131247",
"extra": {
"text": {
"price": "$2.99",
"shares": "$1,832.86",
"principal": "$2,863.70"
}
}
}
}
}
],
"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.24689622",
"apy": "0.28004626",
"extra": {
"text": {
"apy": "28.00%",
"apr": "24.68%"
}
}
},
"principal": "972918889269350848394",
"shares": "972918889269350848394",
"extra": {
"text": {
"principal": "972.9188 INJ",
"shares": "972.9188 INJ"
},
"value": {
"shares": "2917.151351640758116282",
"price": "2.99835",
"principal": "2917.151351640758116282",
"extra": {
"text": {
"shares": "$2,917.15",
"price": "$2.99",
"principal": "$2,917.15"
}
}
}
}
}
],
"debts_net_rate": {
"apr": "0.246896219999999999",
"apy": "0.280046259999999999",
"extra": {
"text": {
"apy": "28.00%",
"apr": "24.68%"
}
}
},
"health": {
"base": "0.07",
"boost": "1",
"result": "0.07",
"extra": {
"text": {
"boost": "0.00%",
"result": "0.07",
"base": "0.07"
}
}
}
}
],
"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"
}
}
},
"principal": "955094137983627705654",
"shares": "611291918790647923636",
"extra": {
"text": {
"principal": "955.0941 INJ",
"shares": "611.2919 INJ"
},
"value": {
"shares": "1832.867124705939201834",
"price": "2.99835",
"principal": "2863.706508623210131247",
"extra": {
"text": {
"price": "$2.99",
"shares": "$1,832.86",
"principal": "$2,863.70"
}
}
}
}
}
],
"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.24689622",
"apy": "0.28004626",
"extra": {
"text": {
"apy": "28.00%",
"apr": "24.68%"
}
}
},
"principal": "972918889269350848394",
"shares": "972918889269350848394",
"extra": {
"text": {
"principal": "972.9188 INJ",
"shares": "972.9188 INJ"
},
"value": {
"shares": "2917.151351640758116282",
"price": "2.99835",
"principal": "2917.151351640758116282",
"extra": {
"text": {
"shares": "$2,917.15",
"price": "$2.99",
"principal": "$2,917.15"
}
}
}
}
}
],
"debts_net_rate": {
"apr": "0.246896219999999999",
"apy": "0.280046259999999999",
"extra": {
"text": {
"apy": "28.00%",
"apr": "24.68%"
}
}
}
}
},
"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.29565415",
"apy": "0.34400525",
"extra": {
"text": {
"apy": "34.40%",
"apr": "29.56%"
}
}
},
"receipt_amounts": {
"held": "604029084855724050535",
"collateralized": "457499954503410229167",
"total": "1061529039359134279702",
"extra": {
"text": {
"total": "1,061.5290 nINJ",
"collateralized": "457.4999 nINJ",
"held": "604.0290 nINJ"
},
"value": {
"total": "3422.830749203418505322",
"held": "1947.652158725263612227",
"collateralized": "1475.178590478154893095",
"price": "3.224434398205298254",
"extra": {
"text": {
"held": "$1,947.65",
"collateralized": "$1,475.17",
"price": "$3.22",
"total": "$3,422.83"
}
}
}
}
},
"origin_equivalent": {
"held": "647834462969684123724",
"collateralized": "490678751678265340890",
"total": "1138513214647949464614",
"extra": {
"text": {
"collateralized": "490.6787 INJ",
"total": "1,138.5132 INJ",
"held": "647.8344 INJ"
}
}
}
}
],
"net_rate": {
"apr": "0.295654149999999999",
"apy": "0.344005249999999999",
"extra": {
"text": {
"apy": "34.40%",
"apr": "29.56%"
}
}
}
}
},
"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": {
"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"
}
}
},
"principal": "955094137983627705654",
"shares": "611291918790647923636",
"extra": {
"text": {
"principal": "955.0941 INJ",
"shares": "611.2919 INJ"
},
"value": {
"shares": "1832.867124705939201834",
"price": "2.99835",
"principal": "2863.706508623210131247",
"extra": {
"text": {
"price": "$2.99",
"shares": "$1,832.86",
"principal": "$2,863.70"
}
}
}
}
}
],
"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.24689622",
"apy": "0.28004626",
"extra": {
"text": {
"apy": "28.00%",
"apr": "24.68%"
}
}
},
"principal": "972918889269350848394",
"shares": "972918889269350848394",
"extra": {
"text": {
"principal": "972.9188 INJ",
"shares": "972.9188 INJ"
},
"value": {
"shares": "2917.151351640758116282",
"price": "2.99835",
"principal": "2917.151351640758116282",
"extra": {
"text": {
"shares": "$2,917.15",
"price": "$2.99",
"principal": "$2,917.15"
}
}
}
}
}
],
"debts_net_rate": {
"apr": "0.246896219999999999",
"apy": "0.280046259999999999",
"extra": {
"text": {
"apy": "28.00%",
"apr": "24.68%"
}
}
},
"health": {
"base": "0.07",
"boost": "1",
"result": "0.07",
"extra": {
"text": {
"boost": "0.00%",
"result": "0.07",
"base": "0.07"
}
}
}
}
],
"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"
}
}
},
"principal": "955094137983627705654",
"shares": "611291918790647923636",
"extra": {
"text": {
"principal": "955.0941 INJ",
"shares": "611.2919 INJ"
},
"value": {
"shares": "1832.867124705939201834",
"price": "2.99835",
"principal": "2863.706508623210131247",
"extra": {
"text": {
"price": "$2.99",
"shares": "$1,832.86",
"principal": "$2,863.70"
}
}
}
}
}
],
"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.24689622",
"apy": "0.28004626",
"extra": {
"text": {
"apy": "28.00%",
"apr": "24.68%"
}
}
},
"principal": "972918889269350848394",
"shares": "972918889269350848394",
"extra": {
"text": {
"principal": "972.9188 INJ",
"shares": "972.9188 INJ"
},
"value": {
"shares": "2917.151351640758116282",
"price": "2.99835",
"principal": "2917.151351640758116282",
"extra": {
"text": {
"shares": "$2,917.15",
"price": "$2.99",
"principal": "$2,917.15"
}
}
}
}
}
],
"debts_net_rate": {
"apr": "0.246896219999999999",
"apy": "0.280046259999999999",
"extra": {
"text": {
"apy": "28.00%",
"apr": "24.68%"
}
}
}
}
},
"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.29565415",
"apy": "0.34400525",
"extra": {
"text": {
"apy": "34.40%",
"apr": "29.56%"
}
}
},
"receipt_amounts": {
"held": "604029084855724050535",
"collateralized": "457499954503410229167",
"total": "1061529039359134279702",
"extra": {
"text": {
"total": "1,061.5290 nINJ",
"collateralized": "457.4999 nINJ",
"held": "604.0290 nINJ"
},
"value": {
"total": "3422.830749203418505322",
"held": "1947.652158725263612227",
"collateralized": "1475.178590478154893095",
"price": "3.224434398205298254",
"extra": {
"text": {
"held": "$1,947.65",
"collateralized": "$1,475.17",
"price": "$3.22",
"total": "$3,422.83"
}
}
}
}
},
"origin_equivalent": {
"held": "647834462969684123724",
"collateralized": "490678751678265340890",
"total": "1138513214647949464614",
"extra": {
"text": {
"collateralized": "490.6787 INJ",
"total": "1,138.5132 INJ",
"held": "647.8344 INJ"
}
}
}
}
],
"net_rate": {
"apr": "0.295654149999999999",
"apy": "0.344005249999999999",
"extra": {
"text": {
"apy": "34.40%",
"apr": "29.56%"
}
}
}
}
},
"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"
}