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

ada-harvest-sdk

v1.0.0

Published

Flash loan borrower SDK for ADA Harvest — borrow ADA from the vault in a single Cardano transaction

Readme

@ada-harvest/sdk

Flash loan borrower SDK for ADA Harvest — borrow ADA from the vault in a single Cardano transaction.

What is a flash loan?

Borrow ADA with no collateral. The Plutus V3 smart contract enforces repayment atomically — if your transaction doesn't return principal + fee to the vault, the whole transaction is rejected by every Cardano node. No trust required.

Use cases: DEX arbitrage · protocol liquidations · collateral swaps

Install

npm install @ada-harvest/sdk lucid-cardano

Quick start

import { FlashLoanClient } from '@ada-harvest/sdk';
import { Lucid, Blockfrost } from 'lucid-cardano';

// Set up Lucid with your wallet
const lucid = await Lucid.new(
  new Blockfrost('https://cardano-mainnet.blockfrost.io/api/v0', 'mainnetXXX'),
  'Mainnet'
);
lucid.selectWalletFromSeed('your twelve word seed phrase...');

// Create client (defaults to https://api.ada-harvest.com)
const client = new FlashLoanClient();

// Fetch terms: vault UTXO, fee rate, max borrow
const terms = await client.getTerms();
console.log('Max loan:', terms.maxLoanLovelace, 'lovelace');
console.log('Fee:', terms.feeBps, 'bps');

// Build + submit in one call
const result = await client.buildAndSubmit({
  terms,
  amountLovelace: '50000000',             // 50 ADA
  borrowerAddress: await lucid.wallet.address(),
  lucid,
  buildArbitrageTx: async (tx, loanedAda) => {
    // Add your arbitrage / liquidation steps here.
    // tx is a Lucid TxBuilder. loanedAda is BigInt lovelace.
    // The SDK appends the vault repayment output after this callback.
    return tx;
  },
});

console.log('Submitted:', result.txHash);
console.log('Fee paid:', Number(result.feeLovelace) / 1_000_000, 'ADA');

API

new FlashLoanClient(apiBase?)

Creates a client. Defaults to https://api.ada-harvest.com.

client.getTerms(): Promise<FlashLoanTerms>

Returns the current vault UTXO, validator CBOR, fee rate, and borrowable cap.

client.buildTx(params): Promise<string>

Builds a signed flash loan transaction. Returns CBOR hex.

client.verify(params): Promise<{ valid: boolean; reason?: string }>

Optional pre-flight: checks your tx returns enough to the vault before broadcasting.

client.submit(params): Promise<FlashLoanSubmitResult>

Submits a signed tx CBOR. Returns { txHash, logId, amountLovelace, feeLovelace }.

client.buildAndSubmit(params): Promise<FlashLoanSubmitResult>

Combines buildTx + submit in one call.

calcFeeLovelace(amountLovelace, feeBps): bigint

Compute the fee for a given amount and fee rate.

calcRepaymentLovelace(vaultInput, amount, feeBps): bigint

Compute the minimum amount to return to the vault.

Fee

The fee rate is set daily by the AI council — currently 0.50% (50 bps). You can always read the current rate from terms.feeBps before building your tx.

Limits

| Parameter | Value | |-----------|-------| | Min loan | 10 ADA | | Max loan | 50% of vault TVL (enforced on-chain) | | Fee range | 0.05% – 1.00% (set by AI council) |

Docs

Full developer documentation: https://ada-harvest.com/flash-loan-docs

License

MIT