npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

stx-defi-activity-sdk

v1.0.6

Published

Production SDK for real-time DeFi, NFT, and wallet analytics on the Stacks blockchain powered by Hiro Chainhooks.

Readme

stx-defi-activity-sdk

npm version npm downloads license GitHub stars GitHub issues build

Production-ready SDK for real-time DeFi, NFT, and wallet analytics on the Stacks blockchain.

The SDK indexes blockchain activity using Hiro Chainhooks and exposes a powerful developer API for analytics, dashboards, trading tools, and monitoring systems.


✨ Features

  • Real-time DeFi activity tracking
  • Protocol TVL analytics
  • Deposit and withdrawal monitoring
  • Token transfer tracking
  • Wallet portfolio analytics
  • NFT transfer tracking
  • Whale transaction alerts
  • Protocol ranking metrics
  • Websocket real-time streaming
  • Vercel-ready production deployment

📦 Installation

npm install stx-defi-activity-sdk

🚀 Quick Start

import {
  getTVL,
  getDeposits,
  getProtocolRanking,
  getWalletPortfolio
} from "stx-defi-activity-sdk"

async function run(){

  const tvl = await getTVL()
  console.log("TVL:", tvl)

  const deposits = await getDeposits()
  console.log("Deposits:", deposits)

  const protocols = await getProtocolRanking()
  console.log("Protocols:", protocols)

  const wallet = await getWalletPortfolio("SP123...")
  console.log("Wallet:", wallet)

}

run()

📊 SDK Functions

DeFi Tracking

| Function | Description | |--------|--------| | getTVL() | Total value locked | | getDeposits() | Protocol deposits | | getWithdrawals() | Protocol withdrawals | | getTransfers() | Token transfers |


Analytics

| Function | Description | |--------|--------| | getActiveUsers() | Number of active users | | getVolume() | Protocol trading volume | | getWhaleAlerts() | Detect large transactions | | getProtocolRanking() | Top DeFi protocols |


Wallet Analytics

| Function | Description | |--------|--------| | getWalletPortfolio(address) | Wallet balances and assets |


NFT Tracking

| Function | Description | |--------|--------| | getNFTTransfers() | Track NFT transfers | | getNFTTransfers(collection) | Track transfers by collection |


⚡ Real-time Streaming

import { connectRealtime } from "stx-defi-activity-sdk"

connectRealtime((event) => {
  console.log("Realtime event:", event)
})

🧠 Use Cases

This SDK can power:

  • DeFi analytics dashboards
  • Portfolio tracking applications
  • Whale monitoring tools
  • NFT analytics platforms
  • Trading analytics
  • Blockchain research tools

🏗 Architecture

The SDK uses:

  • Hiro Chainhooks event indexing
  • Clarity smart contract event decoding
  • Websocket streaming
  • REST analytics APIs

🌍 Ecosystem Impact

This project aims to become the analytics infrastructure layer for Stacks DeFi, giving developers easy access to real-time blockchain data.


📜 License

MIT


👨‍💻 Author

Built for the Stacks developer ecosystem.