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

@intentsolutionsio/flash-loan-simulator

v1.0.0

Published

Simulate and analyze flash loan strategies including arbitrage, liquidations, and collateral swaps

Readme

Flash Loan Simulator Plugin

Simulate and analyze flash loan strategies including arbitrage, liquidations, and collateral swaps across major DeFi protocols.

Features

  • Strategy Simulation - Model complex multi-step flash loan transactions
  • Profitability Analysis - Calculate net profit after all fees and costs
  • Risk Assessment - Identify execution risks and competition levels
  • Protocol Support - Aave V3, dYdX, Balancer, Uniswap V3
  • Gas Optimization - Estimate gas costs and optimize strategies
  • Historical Testing - Backtest strategies against historical data

Installation

/plugin install flash-loan-simulator@claude-code-plugins-plus

FREE RPC Endpoints: No Alchemy Required

Run flash loan simulations using free public RPC endpoints - no Alchemy subscription needed.

Quick Comparison

| RPC Provider | Paid (Alchemy) | FREE (Public RPCs) | |--------------|---------------|-------------------| | Monthly Cost | $49-199/mo | $0/mo | | Requests/day | 300M-1500M | 1M-10M (sufficient) | | Rate Limit | 660 req/sec | 25-100 req/sec | | Setup | Credit card required | No signup |

Annual Savings: $588-2,388 for flash loan development.

Why Free RPCs Work for Flash Loan Simulations

Simulation Requirements:

  • Read blockchain state (getBlock, getTransaction, call)
  • Query DeFi protocol data (Aave, Uniswap, Balancer)
  • Gas estimation (estimateGas)
  • Historical data for backtesting

Free RPCs provide:

  • 25-100 requests/second (more than enough for simulations)
  • Archive node access (historical data)
  • Multi-chain support (Ethereum, Polygon, Arbitrum)
  • 99.9% uptime

You DON'T need Alchemy's premium features for simulations (webhooks, NFT API, trace API are for production, not testing).

Free RPC Provider Catalog

1. Ankr (Best for Multi-Chain)

What: Public RPC endpoints for 15+ chains

Limits:

  • Ethereum: 30 requests/second
  • No rate limits on queries
  • Archive data available

Setup:

{
  "rpcEndpoint": "https://rpc.ankr.com/eth"
}

Cost: $0 (no API key required)

Chains: Ethereum, Polygon, Arbitrum, Optimism, BSC, Avalanche

2. Infura Free Tier

What: Free tier with 100K requests/day

Limits:

  • 100,000 requests/day (sufficient for development)
  • 10 requests/second
  • Requires free account (no credit card)

Setup:

{
  "rpcEndpoint": "https://mainnet.infura.io/v3/YOUR_FREE_KEY"
}

Get Free Key: infura.io/register (no payment required)

Cost: $0 (free tier)

3. Chainstack Free Plan

What: 3M requests/month free

Limits:

  • 3,000,000 requests/month
  • 25 requests/second
  • Free account (no card)

Setup:

{
  "rpcEndpoint": "https://nd-XXX-XXX-XXX.p2pify.com/YOUR_FREE_KEY"
}

Get Free Key: chainstack.com/pricing

Cost: $0 (free plan)

4. Public Ethereum RPC (Fastest Setup)

What: Community-run public endpoints

Limits:

  • Variable rate limits
  • May be slower during peak times
  • No signup required

Setup:

{
  "rpcEndpoint": "https://eth.llamarpc.com"
}

Cost: $0 (completely free)

Alternatives:

  • https://ethereum.publicnode.com
  • https://cloudflare-eth.com
  • https://rpc.flashbots.net (MEV-protected)

Configuration with Free RPCs

Option 1: Ankr (Recommended - No Signup)

{
  "protocols": {
    "aave": { "enabled": true, "fee": 0.0009 },
    "dydx": { "enabled": true, "fee": 0 },
    "balancer": { "enabled": true, "fee": 0.001 }
  },
  "simulation": {
    "slippageTolerance": 0.01,
    "gasPrice": "auto",
    "minProfitUSD": 50
  },
  "rpcEndpoint": "https://rpc.ankr.com/eth"
}

Cost: $0 (vs Alchemy $49/mo)

Option 2: Infura Free Tier (Best Features)

{
  "rpcEndpoint": "https://mainnet.infura.io/v3/YOUR_FREE_KEY"
}

Setup Steps:

  1. Sign up at infura.io (free, no card)
  2. Create project
  3. Copy API key
  4. Paste into config

Cost: $0 for 100K requests/day

Option 3: Multi-Chain Setup (All Free)

{
  "networks": {
    "ethereum": "https://rpc.ankr.com/eth",
    "polygon": "https://rpc.ankr.com/polygon",
    "arbitrum": "https://rpc.ankr.com/arbitrum",
    "optimism": "https://rpc.ankr.com/optimism"
  }
}

Cost: $0 across all chains

Cost Comparison: Flash Loan Development

Paid Approach (Alchemy)

Annual Subscriptions:

  • Alchemy Growth: $49/mo → $588/year
  • Alchemy Scale: $199/mo → $2,388/year (if high usage)

Advantages:

  • 660 requests/second
  • Advanced analytics dashboard
  • Dedicated support

Free Approach (Public RPCs)

Annual Subscriptions:

  • Ankr: $0
  • Infura free tier: $0
  • Public RPCs: $0
  • Total: $0/year

Advantages:

  • 25-100 requests/second (sufficient for simulations)
  • Archive data for backtesting
  • No rate limit concerns for development

Savings: $588-2,388/year with identical simulation quality.

Real Use Case Examples

Flash Loan Arbitrage Simulation

const { ethers } = require('ethers');

// Before (Alchemy - Paid)
const provider = new ethers.providers.JsonRpcProvider(
  `https://eth-mainnet.g.alchemy.com/v2/${ALCHEMY_KEY}`  // $49-199/mo
);

// After (Ankr - FREE)
const provider = new ethers.providers.JsonRpcProvider(
  'https://rpc.ankr.com/eth'  // $0/mo
);

// Same simulation capability, zero cost
const uniswapPrice = await uniswapContract.getAmountsOut(...);
const sushiswapPrice = await sushiswapContract.getAmountsOut(...);
const profit = calculateArbitrage(uniswapPrice, sushiswapPrice);

Cost: $0 (vs $49-199/mo)

Aave Liquidation Simulation

// Using free Infura RPC
const provider = new ethers.providers.JsonRpcProvider(
  `https://mainnet.infura.io/v3/${INFURA_FREE_KEY}`  // $0 (free tier)
);

const aaveContract = new ethers.Contract(AAVE_ADDRESS, ABI, provider);

// Simulate liquidation
const healthFactor = await aaveContract.getUserAccountData(user);
if (healthFactor < 1e18) {
  const liquidationProfit = calculateLiquidationProfit(...);
  console.log(`Profit: $${liquidationProfit}`);
}

Cost: $0 (100K requests/day free)

Performance Comparison

| Metric | Alchemy (Paid) | Free RPCs | |--------|---------------|-----------| | Response Time | 50-100ms | 100-300ms ⚠️ | | Requests/sec | 660 | 25-100 | | Uptime | 99.99% | 99.9% | | Archive Data | ✅ | ✅ | | Cost | $49-199/mo | $0 |

For simulations, 100-300ms response time is acceptable (not production trading).

When Free RPCs Are NOT Enough

Use paid Alchemy if:

  • You're deploying live flash loan bots (need <50ms latency)
  • You need >100 requests/second
  • You require webhooks for mempool monitoring
  • Your firm needs enterprise SLA

For 99% of flash loan learning/simulation: Free RPCs are sufficient.

Hybrid Approach

Best of both worlds: Use free RPCs for development, Alchemy only for production.

const RPC_ENDPOINTS = {
  development: 'https://rpc.ankr.com/eth',  // $0
  production: `https://eth-mainnet.g.alchemy.com/v2/${ALCHEMY_KEY}`  // $49/mo
};

const provider = new ethers.providers.JsonRpcProvider(
  RPC_ENDPOINTS[process.env.NODE_ENV]
);

Cost Reduction: $588/year → $49/year (92% savings)

Resources

Bottom Line: For flash loan simulations and learning, free public RPCs save $588-2,388/year with no quality loss.


Usage

The flash loan agent automatically activates when you discuss:

  • Flash loan strategies and simulations
  • DeFi arbitrage opportunities
  • Liquidation strategies
  • Collateral swaps and refinancing
  • Multi-protocol DeFi transactions

Example Queries

Simulate a flash loan arbitrage between Uniswap and SushiSwap for ETH

Calculate profitability of liquidating this Aave position

What's the optimal flash loan amount for this arbitrage opportunity?

Simulate a collateral swap from USDC to ETH on Aave V3

Build a flash loan strategy to arbitrage these 3 DEXes

Supported Strategies

  1. Simple Arbitrage: DEX price discrepancies
  2. Liquidation: Undercollateralized position liquidations
  3. Collateral Swap: Position refinancing
  4. Self-Liquidation: Efficient position closing
  5. Debt Refinancing: Moving debt between protocols
  6. Triangular Arbitrage: Multi-asset circular trading

Configuration

Create a .flashloan-config.json file:

{
  "protocols": {
    "aave": {
      "enabled": true,
      "fee": 0.0009
    },
    "dydx": {
      "enabled": true,
      "fee": 0
    },
    "balancer": {
      "enabled": true,
      "fee": 0.001
    }
  },
  "simulation": {
    "slippageTolerance": 0.01,
    "gasPrice": "auto",
    "minProfitUSD": 50
  },
  "rpcEndpoint": "https://eth-mainnet.g.alchemy.com/v2/YOUR_KEY"
}

Flash Loan Providers

| Provider | Fee | Assets | Chains | |----------|-----|--------|--------| | Aave V3 | 0.09% | All markets | ETH, Polygon, Arbitrum, Optimism | | dYdX | 0% | ETH, USDC, DAI, WBTC | Ethereum | | Balancer | 0.01-0.1% | Pool tokens | ETH, Polygon, Arbitrum | | Uniswap V3 | Implicit | Any pair | ETH, Polygon, Arbitrum, Optimism |

Risk Warnings

Critical Considerations:

  • Smart contract code must be thoroughly audited
  • Gas costs can eliminate profitability
  • Front-running by MEV bots is common
  • Slippage can cause unexpected losses
  • Protocol risks (bugs, exploits)
  • Requires advanced Solidity development skills
  • For educational purposes only

Simulation Tools

  • Tenderly (transaction simulation)
  • Foundry (forked network testing)
  • Hardhat (mainnet forking)
  • Flashbots (MEV protection)

License

MIT License - See LICENSE file for details

Support


Built with ️ for DeFi developers by Intent Solutions IO