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 🙏

© 2025 – Pkg Stats / Ryan Hefner

tapfi-sdk

v0.0.6

Published

SDK to query lending market data (deposit/borrow APR, APY, liquidity, limits) from multiple protocols on Sui.

Readme

Yield Route Aggregator SDK

SDK to query lending market data (deposit/borrow APR, APY, liquidity, limits) from multiple protocols on Sui.

Prerequisites

  • Node.js 18+
  • pnpm 8+
  • Sui fullnode URL (mainnet). Scripts default to mainnet via @mysten helpers.

Project Structure

yield_route_aggreator/
├─ sources/                        # Move modules (on-chain helpers)
│  ├─ scallop.move                # Scallop Query
│  └─ suilend.move                # Suilend Query
│  └─ navi.move                # Navi Query
├─ sdk/
│  ├─ src/
│  │  ├─ modules/
│  │  │  ├─ scallop.ts            # Scallop market query + calculations
│  │  │  └─ suilend.ts            # Suilend market query
│  │  ├─ constants.ts             # Protocol addresses
│  │  ├─ types.ts                 # Common types (CoinInfo, PoolData, etc)
│  │  ├─ config.ts                # Protocol configs
│  │  ├─ client.ts                # Aggregator client
│  │  └─ utils.ts                 # Common helpers (e.g., APR->APY)
│  └─ scripts/
│     ├─ query-scallop.ts       # devInspect Scallop market
│     └─ query-suilend.ts       # devInspect Suilend market
│     └─ query-navi.ts          # devInspect Navi market
└─ README.md

Install

# from repo root
cd sdk
pnpm install

Run Suilend Query

pnpm tsx scripts/query-suilend.ts

Expected example response (shape may evolve as the SDK aligns protocols):

[
    {
        "protocol": "Suilend",
        "coinType": "0000000000000000000000000000000000000000000000000000000000000002::sui::SUI",
        "decimals": 0,
        "depositApr": 0.023389859551080742,
        "depositApy": 0,
        "borrowApr": 0.057075294756684415,
        "borrowApy": 0,
        "availableLiquidity": 34888052431796488,
        "totalSupply": 71474344531773026,
        "totalBorrow": 36641798821612551,
        "utilizationRate": 0.5126566610950017,
        "supplyLimit": 100000000000000000,
        "borrowLimit": 80000000000000000,
        "isolated": false,
        "lendingMarketId": "0x84030d26d85eaa7035084a057f2f11f701b7e2e4eda87551becbc7c97505ece1",
        "lastUpdated": null
    }
]

Run Scallop Query

pnpm tsx scripts/query-scallop.ts

Example response:

[
    {
        "protocol": "Scallop",
        "coinType": "0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI",
        "decimals": 0,
        "depositApr": 0.025949487501878057,
        "depositApy": 0.026288160100167435,
        "borrowApr": 0.07650051952712238,
        "borrowApy": 0.07949409815721498,
        "availableLiquidity": 6130161831271046,
        "totalSupply": 10642796428246174,
        "totalBorrow": 4512634596975128,
        "utilizationRate": 0.4240083541388158,
        "supplyLimit": 0,
        "borrowLimit": 100000000000000000,
        "isolated": null,
        "lendingMarketId": "0xa757975255146dc9686aa823b7838b507f315d704f428cbadad2f4ea061939d9",
        "lastUpdated": 1756192560
    }
]

Run Navi Query

pnpm tsx scripts/query-navi.ts

Example response:

{
    "protocol": "Navi",
    "coinType": "0000000000000000000000000000000000000000000000000000000000000002::sui::SUI",
    "depositApr": 0.02802,
    "depositApy": 0.02802,
    "borrowApr": 0.0017499999999999983,
    "borrowApy": 0.0017499999999999998,
    "availableLiquidity": 12365813820897864,
    "totalSupply": 39045185620856192,
    "totalBorrow": 18870334675787092,
    "utilizationRate": 0.48329478719925467,
    "supplyLimit": 54999999999999996,
    "borrowLimit": 31236148496684953600000000,
    "isolated": false,
    "lendingMarketId": "",
    "lastUpdated": 1756226060969
}

Response attributes (types and descriptions)

| Field | Type | Description | Example | | ------------------ | --------------- | ----------------------------------------------------------------------- | ------------------ | | protocol | string | Protocol label | "Suilend" | | coinType | string | Fully qualified Sui type tag | "0x2::sui::SUI" | | decimals | number | Coin decimals from metadata | 9 | | depositApr | number | Annual deposit rate (fraction, 0.05 = 5%) | 0.0233 | | depositApy | number | Annual deposit yield (fraction) | 0.0236 | | borrowApr | number | Annual borrow rate (fraction). Can be negative; if < 0, no interest due | 0.0571 | | borrowApy | number | Annual borrow yield (fraction). Can be negative; if < 0, no interest due| 0.0595 | | availableLiquidity | BigInt | Available liquidity (coin units) | 34888052431796488 | | totalSupply | BigInt | Total supplied (coin units) | 71474344531773026 | | totalBorrow | BigInt | Total borrowed (coin units) | 36641798821612551 | | utilizationRate | number | totalBorrow / totalSupply (fraction, typically 0–1) | 0.5126 | | supplyLimit | BigInt | Max supply allowed (coin units) | 100000000000000000 | | borrowLimit | BigInt | Max borrow allowed (coin units) | 80000000000000000 | | isolated | boolean or null | Whether the pool is isolated; null if not exposed | false | | lendingMarketId | string | Sui object ID of the lending market | "0x8403...05ece1" | | lastUpdated | number or null | Unix timestamp (seconds) if provided, otherwise null | 1756192560 |