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

@meridianprotocol/sdk

v0.3.0

Published

TypeScript SDK for Meridian Protocol: AI Analyst pre-deal structuring + prospectus validation, plus onchain settlement rails on Avalanche

Downloads

232

Readme

@meridianprotocol/sdk

TypeScript SDK for Meridian Protocol. Two surfaces in one package:

  1. Analyst (the licensable rails): a dependency-free HTTP client for the AI Analyst API. Structure and stress-test an ABS pool, and validate a prospectus against the engine, before any deal is issued.
  2. Onchain: typed contract addresses, ABIs, and shared constants for the protocol on Avalanche. Where a structured deal settles.

Install

npm install @meridianprotocol/sdk viem

viem ^2.0.0 is a peer dependency, used only by the onchain surface. The Analyst client has no runtime dependencies. Works in plain Node ESM (>= 18), Next.js, Vite, Deno, and any modern bundler.

Analyst

The Analyst surface is a thin client over the hosted analyst API. It runs the same deterministic structuring + stress engine and the same prospectus validator the Meridian Workbench uses. No viem needed, no onchain calls: this is the pre-deal layer.

import { AnalystClient, type PoolInput } from "@meridianprotocol/sdk";

const analyst = new AnalystClient(); // defaults to https://app.meridianprotocol.xyz

const pool: PoolInput = {
  assetClass: "solar-loans",
  poolSize: 5_000_000,
  numLoans: 420,
  grossCouponPct: 11.5,   // percents are whole numbers (11.5 = 11.5%)
  termYears: 7,
  annualDefaultRatePct: 3.5,
  recoveryRatePct: 45,
  servicingFeePct: 1.25,
  ltvPct: 70,
};

// 1. Structure + stress the pool.
const analysis = await analyst.analyzePool(pool);
for (const t of analysis.tranches) {
  // engine ratios come back as decimals (0.06 = 6%)
  console.log(t.name, "size", t.size, "apr", t.apr, "breakeven", t.returnBreakevenPoolRate);
}

// 2. Validate a deal document against the engine.
const { claim, diff } = await analyst.validateProspectus(
  "Class A Notes 78% ... Class B 14% ... Class C (residual) 8% ... AAA / BBB ..."
);
console.log("aligned:", diff.overallAligned);
for (const d of diff.diffs) {
  console.log(d.field, "claimed", d.claimed, "engine", d.engine, d.aligned ? "ok" : d.note);
}

Functional helpers (no instance needed) and a configurable base URL are also available:

import { analyzePool, validateProspectus } from "@meridianprotocol/sdk";

const a = await analyzePool(pool, { baseUrl: "https://staging.meridianprotocol.xyz", apiKey: "..." });
const v = await validateProspectus(text);

Full request/response shapes: see ANALYST_API.md.

From source (contributors)

The protocol repo is private during the pre-mainnet phase. Contributors with repo access:

cd meridianprotocol/sdk
npm install
npm run build

What's exported

| Export | Purpose | |---|---| | AnalystClient, analyzePool, validateProspectus | Analyst API client + functional helpers | | PoolInput, AnalysisResult, TrancheResult, ProspectusClaim, ProspectusDiff, ProspectusValidation | Analyst type shapes | | DEFAULT_ANALYST_BASE_URL, AnalystApiError | Analyst defaults + typed error | | ADDRESSES[chainId] | Per-chain map of every deployed contract (Fuji = 43113) | | ChainId, ContractName | Type helpers derived from ADDRESSES | | MAX_PROTOCOL_FEE_BPS, BPS_DENOMINATOR | Protocol-wide constants | | *Abi (e.g. ForgeFactoryAbi, CDSPoolAbi) | viem-compatible ABIs for all 19 user-facing contracts |

Full export list: see src/index.ts.

Onchain quick start

import { createPublicClient, http } from "viem";
import { avalancheFuji } from "viem/chains";
import { ADDRESSES, ForgeFactoryAbi } from "@meridianprotocol/sdk";

const client = createPublicClient({ chain: avalancheFuji, transport: http() });

const vaultCount = await client.readContract({
  address: ADDRESSES[43113].forgeFactory,
  abi: ForgeFactoryAbi,
  functionName: "vaultCount",
});

Coverage

The SDK ships ABIs for every contract in the public surface area:

  • Forge (tranched credit): ForgeFactory, ForgeVault
  • Shield (CDS): ShieldFactory, CDSContract, CDSPool, CDSPoolFactory
  • Nexus (cross-chain margin): NexusHub, NexusVault, HedgeRouter
  • Yield: YieldVault, YieldVaultFactory, StrategyRouter
  • AI layer: AIAnalyst
  • Secondary market: SecondaryMarketRouter
  • Tokens / utilities: MockUSDC, ERC20

For full deployed addresses, see docs/deployed-addresses.md in the main repo.

Versioning

Pre-1.0. Breaking changes are possible until the protocol is mainnet-deployed and the SDK surface is locked. Pinning to a specific version is recommended.

License

MIT