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

valeo-idle

v0.2.8

Published

Automatic yield for AI agent wallets. One import. Zero config.

Readme

@valeo/idle

Automatic yield on idle USDC for Solana agent wallets. MVP: Drift spot deposits only — one import, defaults for everything else.

import { idle } from "@valeo/idle"

idle()

Set SOLANA_PRIVATE_KEY (base58 or JSON byte array) and optional SOLANA_RPC. The background loop deposits excess USDC into Drift when you look idle, and pulls back toward a target wallet balance when your USDC token account changes.

Wait, that’s it?

Yes for wiring. You still need:

  • A funded Solana wallet (SOL for fees).
  • USDC in the wallet’s associated token account (mainnet mint EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v by default).
  • An RPC that can handle your polling + Drift account loads.

Usage

Recommended

import { idle } from "@valeo/idle"

idle()

Auto-start (no code besides import)

IDLE_AUTO_START=true SOLANA_PRIVATE_KEY=... node agent.js
import "@valeo/idle"

Configuration

import { idle } from "@valeo/idle"

idle({
  bufferAmount: 10_000_000,       // $10 USDC (6 decimals) minimum in wallet
  minDeposit: 5_000_000,
  checkInterval: 30_000,
  protocols: ["drift"],
  maxAllocation: 0.9,
  activityWithdrawAmount: 5_000_000, // extra target liquidity on ATA activity (optional)
  rpc: process.env.SOLANA_RPC,
  onDeposit: (amount, protocol) => {},
  onWithdraw: (amount, reason) => {},
  onYield: (earned) => {},
  onError: (err) => {},
})

idle() returns a singleton per wallet (keyed by public key), so multiple agents need different keys or separate processes.

CLI

Run without writing code:

npx valeo-idle

Uses env keys if set; otherwise offers ~/.config/solana/id.json, or prompts for a base58 secret or keypair path (masked input in TTY). Ctrl+C withdraws from Drift and prints a session summary.

npx valeo-idle --help
npx valeo-idle --keypair ~/.config/solana/id.json
npx valeo-idle --buffer 5.00 --rpc https://api.mainnet-beta.solana.com
npx valeo-idle --devnet --keypair ./test-wallet.json
SOLANA_PRIVATE_KEY=... npx valeo-idle --quiet

Flags: --key, --keypair, --rpc, --buffer (USD), --min-deposit (USD), --devnet, --quiet, --version.

MVP limitations (read this)

  1. Drift only — Kamino, Marginfi, and Marinade adapters are stubs for a later release.
  2. No cross-protocol rebalance — Optimizer always picks the enabled adapter (Drift).
  3. Activity detection is heuristic — “Idle” means no recent signatures on your wallet (~60s) and deposits pause while “active”. USDC ATA changes trigger a debounced withdraw toward bufferAmount + activityWithdrawAmount.
  4. Not true AMP pre-withdraw — Without v0.2 hooks into @ampvaleo/amp-client, a transaction built only from the current wallet balance can still fail if you need more USDC than is liquid. Mitigation: raise bufferAmount / activityWithdrawAmount, or ensure spend size fits the buffer.
  5. Silent degradation — RPC/Drift errors are swallowed unless you set onError; your agent keeps working, possibly without yield.

Wallet env vars

Detection order: SOLANA_PRIVATE_KEY, AGENT_PRIVATE_KEY, WALLET_PRIVATE_KEY, PRIVATE_KEY, SOL_PRIVATE_KEY, then SOLANA_WALLET_PATH (JSON key file).

Scripts

| Command | Description | | --------- | ------------------ | | npm run build | tscdist/ + postbuild chmod dist/cli.js | | npm test | Jest (unit tests) | | npm run dev | tsx examples/basic.ts | | node dist/cli.js --help | Local CLI smoke test |

Requirements

  • Node 18+ (Drift’s published SDK may declare newer engines; overrides align @solana/web3.js with this package.)

License

Apache-2.0 (match Drift SDK; confirm for your org before publish).