New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

@silo-finance/silo-sdk

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@silo-finance/silo-sdk

Complete SDK for Silo Finance - aggregates all packages

latest
npmnpm
Version
0.0.1
Version published
Maintainers
1
Created
Source

@silo-finance/silo-sdk

Version MIT License

Complete SDK for Silo Finance - a unified package that re-exports all Silo SDK packages.

Installation

pnpm add @silo-finance/silo-sdk viem
npm install @silo-finance/silo-sdk viem

Quick Start

import { createPublicClient, http } from "viem";
import { arbitrum } from "viem/chains";
import { SiloSdk, ViemAdapter, percentToDecimal } from "@silo-finance/silo-sdk";

// 1. Create viem client
const publicClient = createPublicClient({ chain: arbitrum, transport: http() });

// 2. Create adapter and SDK
const adapter = new ViemAdapter({ provider: publicClient });
const sdk = new SiloSdk({ chain: "arbitrum", adapter });

// 3. Use namespaced API
const siloAddress = "0x0696e6808ee11a5750733a3d821f9bb847e584fb";
const borrowApr = await sdk.markets.getBorrowAPR(siloAddress);
const borrowApy = sdk.calc.getApy({ apr: borrowApr, periods: 365n });

console.log(`Borrow APY: ${(percentToDecimal(borrowApy) * 100).toFixed(2)}%`);

What's Included

This package re-exports functionality from all Silo SDK packages:

PackageDescription
@silo-finance/primitivesBranded types (Amount, Percent, USD), math utilities, formatters
@silo-finance/address-bookContract addresses and ABIs for all supported chains
@silo-finance/corePure calculation library - APR, LTV, health factors
@silo-finance/adapter-commonAbstract adapter interfaces
@silo-finance/adapter-viemViem adapter for blockchain reads/writes
@silo-finance/indexerGraphQL client for indexed data

Available Exports

From adapter-viem (Blockchain Access)

import {
  // SDK class (recommended)
  SiloSdk, ViemAdapter,
  // Write functions
  deposit, withdraw, borrow, repay, approve, approveMax,
  // Oracle utilities
  fetchQuote, fetchOracleQuotes, fetchQuoteToken,
  // Router utilities
  fetchRouterPaused,
  // Enums
  SiloCollateralType, RiskLevel,
} from "@silo-finance/silo-sdk";

// SiloSdk provides namespaced API:
// sdk.markets - getBorrowAPR(), getDepositAPR(), getUtilization(), getLiquidity(), etc.
// sdk.positions - get(), getLtv(), isSolvent(), getBalances(), getData()
// sdk.tokens - getBalance(), getBalances(), getAllowance(), getMetadata()
// sdk.actions - deposit(), withdraw(), borrow(), repay(), approve()
// sdk.calc - getApy(), calculateLtv(), getRiskLevel()

From sdk (Pure Calculations)

import {
  // APR/APY
  getApy, getCollateralBaseApr, calculateRewardsApr, calculateLeverageApr,
  // LTV analysis
  calculateLtv, getMaxBorrowWithBuffer, getMaxWithdrawWithBuffer, getRiskLevel,
} from "@silo-finance/silo-sdk";

From primitives (Types & Utilities)

import {
  // Type constructors
  makePercent, makeAmount, makeUSD, makeAddress,
  // Formatters
  formatPercent, formatAmount, formatUSD,
  // Constants
  PERCENT_FACTOR, PERCENT_ZERO, PERCENT_ONE,
  // Math utilities
  abs, min, max, clamp, mulDiv,
} from "@silo-finance/silo-sdk";

From address-book (Contracts)

import {
  // Contract addresses
  siloLensAddress, siloRouterV2Address, siloFactoryAddress,
  // Chain utilities
  chainKeys, chainIds, getChainKeyFromId,
  // ABIs
  siloAbi, siloLensAbi, erc20Abi,
} from "@silo-finance/silo-sdk";

From indexer (GraphQL)

import {
  SiloIndexerClient, createIndexerClient,
} from "@silo-finance/silo-sdk";

When to Use Individual Packages

While this unified SDK is recommended for most applications, you may want to import individual packages when:

  • Bundle size matters: Only import what you need
  • No blockchain access: Use @silo-finance/core + @silo-finance/primitives for pure calculations
  • Custom adapter: Build on @silo-finance/adapter-common for other blockchain libraries
  • Server-side only: Use @silo-finance/indexer for GraphQL-only access

Documentation

For detailed documentation of each module, see the individual package READMEs or visit our documentation site.

License

MIT

FAQs

Package last updated on 27 Nov 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts