GET
/
lending
/
{protocolId}
/
wallets
/
{address}
/
portfolio
Track Positions - Lending Wallets
curl --request GET \
  --url https://api.amberdata.com/defi/lending/{protocolId}/wallets/{address}/portfolio \
  --header 'x-amberdata-blockchain-id: <x-amberdata-blockchain-id>' \
  --header 'x-api-key: <api-key>'
{
  "status": 200,
  "title": "OK",
  "description": "Successful request",
  "payload": {
    "metadata": {
      "next": null
    },
    "data": {
      "timestamp": "2022-11-07 20:02:00 000",
      "totalLiquidityETH": 1.960386955045967,
      "totalLiquidityUSD": 3141.9905883303727,
      "totalCollateralETH": 1.960386955045967,
      "totalCollateralUSD": 3141.9905883303727,
      "totalBorrowedETH": 0.8354476352995496,
      "totalBorrowedUSD": 1339.005343,
      "availableToBorrowETH": 0.5745894213541245,
      "availableToBorrowUSD": 920.9174491811094,
      "netWorthETH": 1.1249393197464175,
      "netWorthUSD": 1802.985245330373,
      "lifetimeRewardsETH": 0,
      "lifetimeRewardsUSD": 0,
      "unclaimedRewardsETH": 0,
      "unclaimedRewardsUSD": 0,
      "healthFactor": 1.805087884251727,
      "loanToValueRatio": 0.719264659981688,
      "liquidationThresholdRatio": 0.769264659981688,
      "positions": [
        {
          "assetId": "0x1bfd67037b42cf73acf2047067bd4f2c47d9bfd6",
          "assetSymbol": "WBTC",
          "positionType": "Lend",
          "isCollateral": true,
          "loanToValueRatio": 0.7,
          "liquidationThresholdRatio": 0.75,
          "amountNative": 0.09259605,
          "amountUSD": 1931.4029813334043,
          "interestRateAPY": 0.00035615996484214454,
          "interestRateType": "Stable"
        }
      ]
    }
  }
}

Authorizations

x-api-key
string
header
default:API_KEY
required

Headers

x-amberdata-blockchain-id
enum<string>
default:polygon-mainnet
required

[Optional] The id of the blockchain for which you want protocol data from. Defaults to ethereum-mainnet if not specified. Use the Information Protocols API to view the supported protocol and blockchain id combinations.

Available options:
ethereum-mainnet,
polygon-mainnet,
avalanche-mainnet,
arbitrum-mainnet,
optimism-mainnet

Path Parameters

protocolId
enum<string>
default:aavev3
required
Available options:
aavev2,
aavev3,
compoundv2,
compoundv3,
makerdao
address
string
default:0x884d6fa3a4b349880486ad4d7c833ca968c785d8
required

The address for which the portfolio summary is desired. Example address is for aavev3 plus polygon-mainnet only.

Query Parameters

timeFormat
enum<string>
default:hr

[Optional] Time format of the timestamps in the return payload.

Available options:
milliseconds,
ms,
iso,
iso8601,
hr,
human_readable
endDate
string

[Optional] If provided, returns the balances of the address at this date. Enables historical look-back of the portfolio.<BR>[Formats] seconds | milliseconds | iso8601<BR>[Examples] 1578531600 | 1578531600000 | 2020-09-01T01:00:00<BR>[Warning] Cannot be combined with blockNumber, use only one, either endDate or blockNumber.

blockNumber
integer

[Optional] If provided, returns the balances of the address when this block was finalized. Enables historical look-back of the portfolio.<BR>[Warning] Cannot be combined with endDate, use only one, either blockNumber or endDate.

Response

200 - application/json

200

The response is of type object.