Access historical timeseries data using the Pulsar SDK.

Usage Costs:

Wallet timeseries request cost 1 credit per wallet.

Overview

This page provides information on how to use the Pulsar SDK to access historical wallet values over time.

We provide a feature that allows you to view historical wallet values for specific time periods, such as 1 day, 1 week, and 1 month.

Input Typing

enum TierKeys {
    ONE_DAY = '1d',
    ONE_WEEK = '7d',
    ONE_MONTH = '30d',
    ONE_YEAR = '365d',
}
{
  "method": string,
  "command": {
    "key": string,
    "data": {
      "address": string,
      "chain": string,
      "tier": string,
      "hide_tokens": Array<string>,
      "hide_integrations": Array<string>,
      "hide_nfts": Array<string>
    }
  },
}

Data Example

{
   "method":"COMMAND",
   "command":{
      "key":"GET_WALLET_TIMESERIES",
      "data":{
         "address":"terra1r7dke7zyzk3njkyquanscq70359d5tgmc2zn2e",
         "chain":"TERRA2",
         "tier":"1d",
         "hide_tokens":[],
         "hide_integrations":[],
         "hide_nfts":[]
      }
   },
   "request_id":"a9d4b2a1-1f10-4a88-9112-338a35029013"
}

Using the Pulsar SDK for Wallet Timeseries

To use this feature, call the get_wallet_timeseries method, which returns a Timeseries object with two important fields: timeseries and events.

  • timeseries: Presents your wallet's value over time in USD.
  • events: Captures various wallet events within the chosen time range, such as changes in balances and received tokens.
import PulsarSDK, { ChainKeys, TierKeys } from "pulsar_sdk_js";

const chain = ChainKeys.ETHEREUM;
const responses_list: any[] = [];
const wallet_addr = "YOUR WALLET ADDR";
const API_KEY = "YOUR API KEY";
const tier = TierKeys.ONE_MONTH;
const sdk = new PulsarSDK(API_KEY);

async function getWalletTimeseries() {
  const balances = sdk.balances.getWalletTimeseries(wallet_addr, chain, tier);
  for await (const balance of balances) {
    responses_list.push(balance);
  }
}

getWalletTimeseries().then(() => {
  console.log(responses_list);
});
import asyncio
from pulsar_sdk_py import PulsarSDK
from pulsar_sdk_py.enums import ChainKeys, TierKeys

sdk = PulsarSDK(API_KEY)
responses_list = []

async def main():
    global responses_list
    async for timeseries in sdk.balances.get_wallet_timeseries(
        wallet_addr="YOUR WALLET_ADDR", chain=ChainKeys.AVALANCHE, tier=TierKeys.ONE_MONTH
    ):
        responses_list.append(timeseries)

if __name__ == "__main__":
    asyncio.run(main())