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

revm-sdk

v0.5.0

Published

4-layer execution engine for Solana — ACO routing, Kalman prediction, Thompson fee optimization, EWMA congestion detection

Readme

revm-sdk

TypeScript SDK for the REVM Ant Colony Optimization routing protocol on Solana.

Routes transactions through optimal validator paths using bio-inspired ACO algorithms, minimizing latency and MEV exposure.

Installation

npm install revm-sdk @solana/web3.js

Quick Start

import { RevmClient } from 'revm-sdk';
import { Connection, Keypair, Transaction, SystemProgram, LAMPORTS_PER_SOL } from '@solana/web3.js';

const client = new RevmClient({
  rpcUrl: 'https://api.mainnet-beta.solana.com',
});

await client.initialize();

// Build your transaction
const tx = new Transaction().add(
  SystemProgram.transfer({
    fromPubkey: sender.publicKey,
    toPubkey: receiver,
    lamports: 0.01 * LAMPORTS_PER_SOL,
  })
);

// Send with ACO-optimized routing
const result = await client.sendTransaction(
  { transaction: tx },
  { strategy: 'leader-lookahead' }
);

console.log(`Signature: ${result.signature}`);
console.log(`Latency: ${result.sendLatencyMs.toFixed(1)}ms`);
console.log(`Hops: ${result.hopCount}`);
console.log(`Target: ${result.targetValidator}`);

Routing Strategies

| Strategy | Description | |----------|-------------| | leader-lookahead | Routes to the best of current + upcoming slot leaders (default) | | leader-only | Routes directly to the current slot leader | | stake-weighted | Routes to the highest-stake validator with the best ACO path | | full-colony | Runs full colony optimization across all validators |

// Leader lookahead with 4 slots ahead
const result = await client.sendTransaction(
  { transaction: tx },
  { strategy: 'leader-lookahead', slotsAhead: 4 }
);

// Stake-weighted routing, top 10 validators
const result = await client.sendTransaction(
  { transaction: tx },
  { strategy: 'stake-weighted', topN: 10 }
);

ACO Configuration

const client = new RevmClient({
  rpcUrl: 'https://api.mainnet-beta.solana.com',
  acoConfig: {
    alpha: 1.2,           // Pheromone influence
    beta: 3.0,            // Latency heuristic influence
    evaporationRate: 0.25, // Pheromone decay per iteration
    antCount: 32,          // Ants per iteration
    maxIterations: 50,     // Max ACO iterations
  },
});

API Reference

RevmClient

new RevmClient(config: RevmClientConfig)

Creates a new REVM client instance.

client.initialize(): Promise<void>

Fetches validator data and builds the ACO routing topology. Must be called before sending transactions.

client.sendTransaction(payload, options?): Promise<SendResult>

Sends a transaction using ACO-optimized routing.

Payload:

  • transactionTransaction | VersionedTransaction
  • skipPreflight? — Skip preflight simulation (default: false)
  • maxRetries? — Max send retries (default: 3)

Options:

  • strategy? — Routing strategy (default: 'leader-lookahead')
  • slotsAhead? — Slots to look ahead for leaders (default: 2)
  • topN? — Top N validators for stake-weighted (default: 5)

Returns SendResult:

  • signature — Transaction signature
  • targetValidator — Selected validator pubkey
  • sendLatencyMs — Send latency in milliseconds
  • hopCount — Number of hops in the route
  • slot — Current slot
  • confirmed — Confirmation status

client.confirmTransaction(signature, timeout?): Promise<boolean>

Waits for transaction confirmation.

client.getMetrics(): ColonyMetrics

Returns routing performance metrics.

client.getValidators(): ValidatorNode[]

Returns the current validator topology.

AcoRouter

Standalone ACO router for custom routing logic.

import { AcoRouter } from 'revm-sdk';

const router = new AcoRouter(10, {
  alpha: 1.2,
  beta: 3.0,
  evaporationRate: 0.25,
  antCount: 32,
  maxIterations: 50,
});

router.setEdge(0, 1, 5.0);  // node 0 -> node 1, 5ms latency
router.setEdge(0, 2, 8.0);
router.setEdge(1, 3, 3.0);
router.setEdge(2, 3, 2.0);

const result = router.route(0, 3);
// { path: [0, 2, 3], cost: 10.0, hopCount: 2, iterationsUsed: 15 }

Companion Crate

The core ACO engine is written in Rust for maximum performance:

cargo add revm-core

See revm-core on crates.io for the Rust implementation.

Links

License

MIT