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

@sailbound/sdk

v0.1.0

Published

JavaScript SDK for Sailbound: borrow USDG against stock tokens on Robinhood Chain, fund the pool, and pay or settle x402 requests in USDG.

Readme

@sailbound/sdk

JavaScript SDK for Sailbound: a USDG lending pool on Robinhood Chain backed by stock tokens. Borrow USDG against listed stock tokens, fund the pool, follow loans, and pay or settle x402 requests in USDG.

The Robinhood Chain mainnet deployment (chain id 4663) ships with the package, so you only need an RPC URL and, to send transactions, a signer.

Unaudited software. The pool contract has not been audited, a liquidation takes all of a loan's collateral, and the pool currently has no deposit cap. Use only amounts you can afford to lose. Stock tokens are not offered to U.S. persons.

Install

npm install @sailbound/sdk

Node.js 20 or newer. The only dependency is ethers v6.

Read the pool

import { JsonRpcProvider } from "ethers";
import { LendingClient, loadDeployment, formatUsd } from "@sailbound/sdk";

const provider = new JsonRpcProvider("https://rpc.mainnet.chain.robinhood.com", 4663);
const pool = new LendingClient({ provider, deployment: loadDeployment(4663) });

console.log(await pool.poolStats());          // funds, idle USDG, utilization, safety fund, limits
console.log((await pool.assets()).map((a) => a.symbol)); // listed stock tokens

Quote, borrow, repay

import { Wallet } from "ethers";
import { LendingClient, loadDeployment, parseUsd, parseToken } from "@sailbound/sdk";

const signer = new Wallet(process.env.PRIVATE_KEY, provider); // never hard-code a key
const pool = new LendingClient({ provider, signer, deployment: loadDeployment(4663) });

const q = await pool.quote({ asset: "NVDA", collateral: parseToken("2"), amount: parseUsd("50"), days: 7 });
if (q.canBorrow) {
  const { loanId } = await pool.borrow({ asset: "NVDA", collateral: parseToken("2"), amount: parseUsd("50"), days: 7 });
  const loan = await pool.loan(loanId); // health, liquidation price, due date
  await pool.repay(loanId);
} else {
  console.log(q.reasons); // why the pool would refuse: e.g. not enough idle USDG, or the address limit
}
// A new address starts with a small limit (3 USDG) that grows with loans held 7+ days and repaid in full.

Terms are 1, 3, 7, 14 or 30 days. The fee (1% per 30 days, pro rata) is fixed when the loan opens and paid in full, even when repaid early. After the due date there is a one-day grace period; then, or when the collateral falls below its threshold, anyone can liquidate the loan and take all of its collateral.

Other methods: borrowLimit, loansOf, addCollateral, previewDeposit / deposit, positionsOf, previewWithdraw / withdraw, previewLiquidate / liquidate, record (an address's repayment history), doctor (checks the connection and the deployment).

Pay x402 endpoints

import { X402Payer, parseUsd } from "@sailbound/sdk";

const payer = new X402Payer({ client: pool, maxPrice: parseUsd("0.05"), maxBorrow: parseUsd("5"), collateral: "NVDA", days: 7 });
const preview = await payer.preview("https://sailbound.xyz/api/x402/pool"); // price, balance, any loan; nothing signed
const { response, paid, borrowed, loanId } = await payer.pay("https://sailbound.xyz/api/x402/pool");

The payer pays any x402 endpoint in USDG on this chain (v2 PAYMENT-SIGNATURE, or v1 X-PAYMENT). If the USDG balance is short and maxBorrow allows it, it first borrows the gap from the pool against collateral; that loan follows every normal rule. maxPrice and maxBorrow are hard limits.

Sell your own data

  • createPaywall({ chainId, asset, payTo, relayer, provider }) charges per request and settles the payment itself.
  • Or use the hosted facilitator at https://sailbound.xyz/api/facilitator with any x402 server; register on sailbound.xyz/merchants.

Configuration

loadDeployment(chainId) reads the shipped deployment. Override any address with POOL_ADDRESS, USDG_ADDRESS or a DEPLOYMENTS_DIR folder. resolveEnv() builds a provider and a signer from RPC_URLS and PRIVATE_KEY in the environment.

More: sailbound.xyz/developers. License: MIT.