Scan your whole stack
Are you using @curvefi/api?
Find out what’s in your code.
Scan your apps free in minutes (opens in a new tab)Latest version: v2.72.11
@curvefi/api was last scanned on 1 Dec 2026 at version 2.72.11. Risk score 0 of 100. No malicious behavior was detected.
| Version | Published | Status |
|---|---|---|
| 2.72.12 | 1 Dec 2026 | Not shown |
| 2.72.11 | 1 Dec 2026 | No rules fired |
| 2.72.10 | 23 Nov 2026 | No rules fired |
| 2.72.9 | 19 Nov 2026 | Not shown |
| 2.72.8 | 19 Nov 2026 | Not shown |
Findings for v2.72.11. The score is a capped sum of the weights of the rules that fired — not CVSS, not exploitability, and not a probability. It is not comparable across packages with different scan coverage.
The score describes 2.72.11; other versions have their own rules, not their own score.
The publisher’s own README, as collected from the registry.
Install from npm:
npm install @curvefi/api
import curve from "@curvefi/api";
(async () => {
// 1. Dev
await curve.init('JsonRpc', {url: 'http://localhost:8545/', privateKey: ''}, { gasPrice: 0, maxFeePerGas: 0, maxPriorityFeePerGas: 0, chainId: 1 });
// OR
await curve.init('JsonRpc', {}, {}); // In this case JsonRpc url, privateKey, fee data and chainId will be specified automatically
// 2. Infura
await curve.init("Infura", { network: "homestead", apiKey: <INFURA_KEY> }, { chainId: 1 });
// 3. Web3 provider
await curve.init('Web3', { externalProvider: <WEB3_PROVIDER> }, { chainId: 1 });
// 4. Without RPC
await curve.init('NoRPC', {chainId: 1, networkName: 'ETHEREUM'});
// 5. API-only metadata (RPC stays live for quotes/routing)
await curve.init('JsonRpc', { url: <RPC_URL> }, { chainId: 1, apiOnlyMetadata: true });
// Fetch factory pools
await curve.factory.fetchPools();
await curve.crvUSDFactory.fetchPools();
await curve.cryptoFactory.fetchPools();
await curve.twocryptoFactory.fetchPools();
await curve.tricryptoFactory.fetchPools();
await curve.stableNgFactory.fetchPools();
})()
Note 1. chainId parameter is optional, but you must specify it in the case you use Metamask on localhost network, because Metamask has that bug
Note 2. Web3 init requires the address. Therefore, it can be initialized only after receiving the address.
Note 3. apiOnlyMetadata (default false) makes the library source pool metadata and TVL exclusively from the HTTP APIs, with no on-chain reads during fetchPools or route-graph building. Unlike NoRPC, the RPC provider stays live and is still used for user-facing quotes/routing — this is intended for backends that want to avoid hammering RPC nodes (e.g. rate-limited public endpoints) while initializing and listing pools. Two effects to be aware of:
gaugeImplementation() returns the zero address).Wrong ❌️
import type { FunctionComponent } from 'react'
import { useState, useMemo } from 'react'
import { providers } from 'ethers'
import Onboard from 'bnc-onboard'
import type { Wallet } from 'bnc-onboard/dist/src/interfaces'
import curve from '@curvefi/api'
...
const WalletProvider: FunctionComponent = ({ children }) => {
const [wallet, setWallet] = useState<Wallet>()
const [provider, setProvider] = useState<providers.Web3Provider>()
const [address, setAddress] = useState<string>()
const networkId = 1
const onboard = useMemo(
() =>
Onboard({
dappId: DAPP_ID,
networkId,
subscriptions: {
address: (address) => {
setAddress(address)
},
wallet: (wallet) => {
setWallet(wallet)
if (wallet.provider) {
curve.init("Web3", { externalProvider: wallet.provider }, { chainId: networkId })
}
},
},
walletSelect: {
wallets: wallets,
},
}),
[]
)
...
Right ✔️
import type { FunctionComponent } from 'react'
import { useState, useMemo, useEffect } from 'react'
import { providers } from 'ethers'
import Onboard from 'bnc-onboard'
import type { Wallet } from 'bnc-onboard/dist/src/interfaces'
import curve from '@curvefi/api'
...
const WalletProvider: FunctionComponent = ({ children }) => {
const [wallet, setWallet] = useState<Wallet>()
const [provider, setProvider] = useState<providers.Web3Provider>()
const [address, setAddress] = useState<string>()
const networkId = 1
const onboard = useMemo(
() =>
Onboard({
dappId: DAPP_ID,
networkId,
subscriptions: {
address: (address) => {
setAddress(address)
},
wallet: (wallet) => {
setWallet(wallet)
},
},
walletSelect: {
wallets: wallets,
},
}),
[]
)
useEffect(() => {
if (address && wallet?.provider) {
curve.init("Web3", { externalProvider: wallet.provider }, { chainId: networkId })
}
}, [address, wallet?.provider]);
...
import curve from "@curvefi/api";
(async () => {
await curve.getTVL();
// 7870819849.685552
await curve.getVolume();
// {
// totalVolume: 514893871.3481678,
// cryptoVolume: 162757004.96876568,
// cryptoShare: 31.609815930147377
// }
const balances1 = await curve.getBalances(['DAI', 'sUSD']);
// OR const balances1 = await curve.getBalances(['0x6B175474E89094C44Da98b954EedeAC495271d0F', '0x57Ab1ec28D129707052df4dF418D58a2D46d5f51']);
console.log(balances1);
// [ '10000.0', '0.0' ]
// You can specify addresses
const balances2 = await curve.getBalances(['aDAI', 'aSUSD'], "0x0063046686E46Dc6F15918b61AE2B121458534a5", "0x66aB6D9362d4F35596279692F0251Db635165871");
// OR const balances2 = await curve.getBalances(['0x028171bCA77440897B824Ca71D1c56caC55b68A3', '0x6c5024cd4f8a59110119c56f8933403a539555eb'], ["0x0063046686E46Dc6F15918b61AE2B121458534a5", "0x66aB6D9362d4F35596279692F0251Db635165871"]);
console.log(balances2);
// {
// '0x0063046686E46Dc6F15918b61AE2B121458534a5': [ '0.0', '0.0' ],
// '0x66aB6D9362d4F35596279692F0251Db635165871': [ '0.0', '0.0' ]
// }
const spender = "0xbEbc44782C7dB0a1A60Cb6fe97d0b483032FF1C7" // 3pool swap address
await curve.getAllowance(["DAI", "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"], curve.signerAddress, spender);
// [ '0.0', '0.0' ]
await curve.hasAllowance(["DAI", "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"], ['1000', '1000'], curve.signerAddress, spender);
// false
await curve.ensureAllowance(["DAI", "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"], ['1000', '1000'], spender);
// [
// '0xb0cada2a2983dc0ed85a26916d32b9caefe45fecde47640bd7d0e214ff22aed3',
// '0x00ea7d827b3ad50ce933e96c579810cd7e70d66a034a86ec4e1e10005634d041'
// ]
// Get populated approve transactions (without executing)
const approveTxs = await curve.populateApprove(["DAI", "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"], ['1000', '1000'], spender);
// OR with custom user address (for API):
// await curve.populateApprove(["DAI", "USDC"], ['1000', '1000'], spender, false, '0x...userAddress');
// Returns array of TransactionLike objects (may include reset to 0 if needed for some tokens)
console.log(approveTxs);
// [
// { to: '0x6B17...', data: '0x095ea7b3...', hash: '0x...', ... },
// { to: '0xA0b8...', data: '0x095ea7b3...', hash: '0x...', ... }
// ]
})()
import curve from "@curvefi/api";
(async () => {
await curve.init('JsonRpc', {}, { gasPrice: 0, maxFeePerGas: 0, maxPriorityFeePerGas: 0 });
await curve.factory.fetchPools();
await curve.crvUSDFactory.fetchPools();
await curve.cryptoFactory.fetchPools();
await curve.twocryptoFactory.fetchPools();
await curve.tricryptoFactory.fetchPools();
await curve.stableNgFactory.fetchPools();
curve.getMainPoolList();
// [
// 'compound', 'usdt', 'y', 'busd',
// 'susd', 'pax', 'ren', 'sbtc',
// 'hbtc', '3pool', 'gusd', 'husd',
// 'usdk', 'usdn', 'musd', 'rsv',
// 'tbtc', 'dusd', 'pbtc', 'bbtc',
// 'obtc', 'seth', 'eurs', 'ust',
// 'aave', 'steth', 'saave', 'ankreth',
// 'usdp', 'ib', 'link', 'tusd',
// 'frax', 'lusd', 'busdv2', 'reth',
// 'alusd', 'mim', 'tricrypto2', 'eurt',
// 'eurtusd', 'eursusd', 'crveth', 'rai',
// 'cvxeth', 'xautusd', 'spelleth', 'teth',
// '2pool', '4pool'
// ]
curve.factory.getPoolList();
// [
// 'factory-v2-0', 'factory-v2-2', 'factory-v2-3', 'factory-v2-4',
// 'factory-v2-5', 'factory-v2-6', 'factory-v2-7', 'factory-v2-8',
// 'factory-v2-9', 'factory-v2-10', 'factory-v2-11', 'factory-v2-14',
// 'factory-v2-15', 'factory-v2-17', 'factory-v2-18', 'factory-v2-19',
// 'factory-v2-21', 'factory-v2-22', 'factory-v2-23', 'factory-v2-24',
// 'factory-v2-25', 'factory-v2-26', 'factory-v2-27', 'factory-v2-28',
// 'factory-v2-29', 'factory-v2-30', 'factory-v2-31', 'factory-v2-32',
// 'factory-v2-33', 'factory-v2-34', 'factory-v2-35', 'factory-v2-36',
// 'factory-v2-37', 'factory-v2-38', 'factory-v2-39', 'factory-v2-40',
// 'factory-v2-41', 'factory-v2-42', 'factory-v2-43', 'factory-v2-44',
// 'factory-v2-45', 'factory-v2-46', 'factory-v2-47', 'factory-v2-48',
// 'factory-v2-49', 'factory-v2-50', 'factory-v2-51', 'factory-v2-52',
// 'factory-v2-53', 'factory-v2-54', 'factory-v2-55', 'factory-v2-56',
// 'factory-v2-57', 'factory-v2-58', 'factory-v2-59', 'factory-v2-60',
// 'factory-v2-61', 'factory-v2-62', 'factory-v2-63', 'factory-v2-64',
// 'factory-v2-65', 'factory-v2-66', 'factory-v2-67', 'factory-v2-68',
// 'factory-v2-69', 'factory-v2-70', 'factory-v2-71', 'factory-v2-72',
// 'factory-v2-73', 'factory-v2-74', 'factory-v2-75', 'factory-v2-76',
// 'factory-v2-77', 'factory-v2-78', 'factory-v2-79', 'factory-v2-80',
// 'factory-v2-81', 'factory-v2-82', 'factory-v2-83', 'factory-v2-84',
// 'factory-v2-85', 'factory-v2-86', 'factory-v2-87', 'factory-v2-88',
// 'factory-v2-89', 'factory-v2-90', 'factory-v2-91', 'factory-v2-92',
// 'factory-v2-93', 'factory-v2-94', 'factory-v2-95', 'factory-v2-96',
// 'factory-v2-97', 'factory-v2-98', 'factory-v2-99', 'factory-v2-100',
// 'factory-v2-101', 'factory-v2-102', 'factory-v2-103', 'factory-v2-104',
// ... 27 more items
// ]
curve.crvUSDFactory.getPoolList();
// ['factory-crvusd-0', 'factory-crvusd-1', 'factory-crvusd-2', 'factory-crvusd-3']
curve.cryptoFactory.getPoolList();
// [
// 'factory-crypto-0', 'factory-crypto-1', 'factory-crypto-2',
// 'factory-crypto-3', 'factory-crypto-4', 'factory-crypto-5',
// 'factory-crypto-6', 'factory-crypto-7', 'factory-crypto-8',
// 'factory-crypto-9', 'factory-crypto-10', 'factory-crypto-11',
// 'factory-crypto-12', 'factory-crypto-13', 'factory-crypto-14',
// 'factory-crypto-15', 'factory-crypto-16', 'factory-crypto-17',
// 'factory-crypto-18', 'factory-crypto-19', 'factory-crypto-20',
// 'factory-crypto-21', 'factory-crypto-22', 'factory-crypto-23',
// 'factory-crypto-24', 'factory-crypto-25', 'factory-crypto-26',
// 'factory-crypto-27', 'factory-crypto-28', 'factory-crypto-29',
// 'factory-crypto-30', 'factory-crypto-31', 'factory-crypto-32',
// 'factory-crypto-33', 'factory-crypto-34', 'factory-crypto-35',
// 'factory-crypto-36', 'factory-crypto-37', 'factory-crypto-38',
// 'factory-crypto-39', 'factory-crypto-40', 'factory-crypto-41',
// 'factory-crypto-42', 'factory-crypto-43', 'factory-crypto-44',
// 'factory-crypto-45', 'factory-crypto-46', 'factory-crypto-47',
// 'factory-crypto-48', 'factory-crypto-49', 'factory-crypto-50',
// 'factory-crypto-51', 'factory-crypto-52', 'factory-crypto-53',
// 'factory-crypto-54', 'factory-crypto-55', 'factory-crypto-56',
// 'factory-crypto-57', 'factory-crypto-58', 'factory-crypto-59',
// 'factory-crypto-60', 'factory-crypto-61', 'factory-crypto-62'
// ]
curve.twocryptoFactory.getPoolList();
// ['factory-twocrypto-0', 'factory-twocrypto-1']
curve.tricryptoFactory.getPoolList();
// ['factory-tricrypto-0', 'factory-tricrypto-1']
curve.stableNgFactory.getPoolList();
// ['factory-stable-ng-0', 'factory-stable-ng-1']
curve.getPoolList();
// [
// 'compound', 'usdt', 'y', 'busd',
// 'susd', 'pax', 'ren', 'sbtc',
// 'hbtc', '3pool', 'gusd', 'husd',
// 'usdk', 'usdn', 'musd', 'rsv',
// 'tbtc', 'dusd', 'pbtc', 'bbtc',
// 'obtc', 'seth', 'eurs', 'ust',
// 'aave', 'steth', 'saave', 'ankreth',
// 'usdp', 'ib', 'link', 'tusd',
// 'frax', 'lusd', 'busdv2', 'reth',
// 'alusd', 'mim', 'tricrypto2', 'eurt',
// 'eurtusd', 'eursusd', 'crveth', 'rai',
// 'cvxeth', 'xautusd', 'spelleth', 'teth',
// '2pool', '4pool', 'fraxusdc', 'euroc',
// 'frxeth', 'sbtc2', 'fraxusdp', 'wbeth',
// 'factory-v2-2', 'factory-v2-3', 'factory-v2-5', 'factory-v2-7',
// 'factory-v2-9', 'factory-v2-10', 'factory-v2-11', 'factory-v2-14',
// 'factory-v2-21', 'factory-v2-22', 'factory-v2-23', 'factory-v2-24',
// 'factory-v2-25', 'factory-v2-27', 'factory-v2-28', 'factory-v2-29',
// 'factory-v2-30', 'factory-v2-31', 'factory-v2-32', 'factory-v2-33',
// 'factory-v2-34', 'factory-v2-35', 'factory-v2-37', 'factory-v2-38',
// 'factory-v2-41', 'factory-v2-42', 'factory-v2-43', 'factory-v2-44',
// 'factory-v2-45', 'factory-v2-47', 'factory-v2-48', 'factory-v2-49',
// 'factory-v2-50', 'factory-v2-51', 'factory-v2-52', 'factory-v2-53',
// 'factory-v2-55', 'factory-v2-56', 'factory-v2-57', 'factory-v2-58',
// 'factory-v2-59', 'factory-v2-60', 'factory-v2-61', 'factory-v2-62',
// ... 493 more items
// ]
})()
curve.getPoolByData(data) builds a fully working pool from an externally supplied descriptor,
without calling fetchPools first. Use it when the pool metadata comes from your own source
(backend, cache, DB) instead of Curve's API. curve resolves all the ABIs (swap / gauge / zap / LP)
itself from poolType + implementationAddress + isMetaPool — you don't pass any ABI.
The descriptor (IExternalPoolData) mirrors the shape of the getPools/{network}/{poolType} API:
Find threats in your stack.
OX Radar can check high-priority threats, like critical package CVEs, against your context.
Each incident is marked Detected or Not Detected with a remediation plan and proof all tracked in the Response Center.
The probe returned only these fields for this server — auth requirement, protocol and tool list weren’t observed, so they’re not shown (never guessed).
The publisher’s own links, as the registry reports them. These are not sources for the assessment on this page.