GET
/
lending
/
wallets
/
{walletAddress}
/
returns
Profit & Loss Analytics in DeFi Lending
curl --request GET \
  --url https://api.amberdata.com/defi/lending/wallets/{walletAddress}/returns \
  --header 'x-api-key: <api-key>'
{
  "status": 200,
  "title": "OK",
  "description": "Successful request",
  "payload": {
    "metadata": {
      "blockchainId": "ethereum-mainnet"
    },
    "data": {
      "metrics": [
        {
          "timestamp": "2023-02-01 23:59:59 999",
          "totalLiquidityUSD": 8656.285473022097,
          "totalCollateralUSD": 4358.700898606331,
          "totalBorrowedUSD": 0,
          "netWorthUSD": 8656.285473022097,
          "changeInLendInterestUSD": 0.5259982184550633,
          "changeInBorrowInterestUSD": 0.0014350103195127153,
          "marketValueLendInterestUSD": 0.3368423914981944,
          "marketValueBorrowInterestUSD": 0,
          "cumulativeLendInterestUSD": 19.6001513365206,
          "cumulativeBorrowInterestUSD": 0.049160105311165075,
          "netWorthInProtocols": [
            {
              "protocolId": "aavev2",
              "totalLiquidityUSD": 4358.700898606331,
              "totalCollateralUSD": 4358.700898606331,
              "totalBorrowedUSD": 0,
              "netWorthUSD": 4358.700898606331,
              "changeInLendInterestUSD": 0.3338916490191206,
              "changeInBorrowInterestUSD": 0.0014350103195127153,
              "marketValueLendInterestUSD": 0.18517998485067053,
              "marketValueBorrowInterestUSD": 0,
              "cumulativeLendInterestUSD": 11.058956431389353,
              "cumulativeBorrowInterestUSD": 0.049160105311165075
            }
          ]
        }
      ]
    }
  }
}

Authorizations

x-api-key
string
header
default:API_KEY
required

Headers

x-amberdata-blockchain-id
enum<string>

[Optional] The id of the blockchain for which you want data from. Defaults to ethereum-mainnet if not specified.

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

Path Parameters

walletAddress
string
default:0x884d6fa3a4b349880486ad4d7c833ca968c785d8
required

The address to analyze. <BR><BR>Note Across different blockchains, a single user will most likely have different addresses i.e. the address on ethereum-mainnet will not be the same address on avalanche-mainnet.

Query Parameters

startDate
string<date-time>

[Optional] Payload only includes data after this date (inclusive).<BR>[Formats] seconds | milliseconds | iso8601<BR>[Examples] 1578531600 | 1578531600000 | 2020-09-01T01:00:00

endDate
string<date-time>

[Optional] Payload only includes data after this date (inclusive).<BR>[Formats] seconds | milliseconds | iso8601<BR>[Examples] 1578531600 | 1578531600000 | 2020-09-01T01:00:00

timeFormat
enum<string>
default:hr

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

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

Response

200 - application/json

200

The response is of type object.