Historical

In order to retrieve values at multiple points in time, use the value/historical endpoint.

To fully understand the output data, please refer to the Value Point in time documentation and see the example below.

To fully understand how to specify the time series for which you want to retrieve data, please refer to the Historical Data documentation.

Request

This is a sample request for the value in wallet 0x295B61866dAA53a76CE4b3a927EFAF0059b4a90A from block 17540049 until the most recent block, every 1,000 blocks.

curl \
-H 'Authorization: Bearer <API KEY>' \
'https://gateway.credmark.com/v1/portfolio/1/0x295B61866dAA53a76CE4b3a927EFAF0059b4a90A/value/historical?startBlockNumber=17540049&blockInterval=1000

In this example we pass two query parameters, startBlockNumber and blockInterval. These mean that the first block for which positions should be retrieved is startBlockNumber, in this case, 17540049. Because we did not specify an endBlockNumber, it is assumed to be the latest block available when the API call is made. And finally, blockInterval is used to specify how often to retrieve positions between those two block numbers, in this case, once every 1,000 blocks.

Response

Given that input, this is what our output looks like.

{
  "chainId": 1,
  "startBlockNumber": 17540049,
  "endBlockNumber": 17564266,
  "startTimestamp": 1687496255,
  "endTimestamp": 1687790591,
  "accounts": [
    "0x295B61866dAA53a76CE4b3a927EFAF0059b4a90A"
  ],
  "quoteAddress": "0x0000000000000000000000000000000000000348",
  "data": [
    {
      "blockNumber": 17540266,
      "blockTimestamp": 1687498871,
      "value": 26863.386775903306
    },
    {
      "blockNumber": 17541266,
      "blockTimestamp": 1687511159,
      "value": 26897.45687233562
    },
    {
      "blockNumber": 17542266,
      "blockTimestamp": 1687523303,
      "value": 26904.728837334223
    },
    {
      "blockNumber": 17543266,
      "blockTimestamp": 1687535387,
      "value": 26859.61581626583
    },
    {
      "blockNumber": 17544266,
      "blockTimestamp": 1687547507,
      "value": 26911.594732533093
    },
    {
      "blockNumber": 17545266,
      "blockTimestamp": 1687559663,
      "value": 26867.482940163063
    },
    {
      "blockNumber": 17546266,
      "blockTimestamp": 1687571807,
      "value": 26868.37804021465
    },
    {
      "blockNumber": 17547266,
      "blockTimestamp": 1687583927,
      "value": 26865.585307313282
    },
    {
      "blockNumber": 17548266,
      "blockTimestamp": 1687596107,
      "value": 26861.074241098922
    },
    {
      "blockNumber": 17549266,
      "blockTimestamp": 1687608299,
      "value": 26864.768035644945
    },
    {
      "blockNumber": 17550266,
      "blockTimestamp": 1687620443,
      "value": 26837.320762514595
    },
    {
      "blockNumber": 17551266,
      "blockTimestamp": 1687632671,
      "value": 26877.373783413743
    },
    {
      "blockNumber": 17552266,
      "blockTimestamp": 1687644779,
      "value": 26855.74884391756
    },
    {
      "blockNumber": 17553266,
      "blockTimestamp": 1687656863,
      "value": 26886.070142738194
    },
    {
      "blockNumber": 17554266,
      "blockTimestamp": 1687669019,
      "value": 26864.764963056132
    },
    {
      "blockNumber": 17555266,
      "blockTimestamp": 1687681187,
      "value": 26839.02201552651
    },
    {
      "blockNumber": 17556266,
      "blockTimestamp": 1687693343,
      "value": 26869.817085293354
    },
    {
      "blockNumber": 17557266,
      "blockTimestamp": 1687705427,
      "value": 26909.625762356118
    },
    {
      "blockNumber": 17558266,
      "blockTimestamp": 1687717607,
      "value": 26861.55799243244
    },
    {
      "blockNumber": 17559266,
      "blockTimestamp": 1687729799,
      "value": 26845.777393398625
    },
    {
      "blockNumber": 17560266,
      "blockTimestamp": 1687741991,
      "value": 26916.857999695345
    },
    {
      "blockNumber": 17561266,
      "blockTimestamp": 1687754123,
      "value": 26856.944548487078
    },
    {
      "blockNumber": 17562266,
      "blockTimestamp": 1687766315,
      "value": 26858.113567645894
    },
    {
      "blockNumber": 17563266,
      "blockTimestamp": 1687778459,
      "value": 26866.3134378715
    },
    {
      "blockNumber": 17564266,
      "blockTimestamp": 1687790591,
      "value": 26863.121761903232
    }
  ]
}

As with the output from our point in time example, our response body includes the context of the request, as well as an array called data. Each array element includes a blockNumber, a blockTimestamp and an array of the portfolio value that existed at blockNumber.

Changing includePositions to true would add the individual asset value to each data block. Its format is described in the Point in time section.

Last updated