Introducing The Sweep: OX’s New Live Security Research Series
Register Now
Breaking: The 2026 Vulnpocalypse Hits PHP: Four Critical RCEs, but How Dangerous Are They?
Read the Report
Are you exposed? Connect your apps in minutes.
Scan your apps free

@coffer_so/sdk

Latest version: v2.0.0

Overview

Last scanned
26 Nov 2026
Published
26 Nov 2026
npm package Publisher: fiezzyy, kodolbenko_1, sepezho, zhers
11 Versions
1.7K Downloads

Scan summary

@coffer_so/sdk was last scanned on 26 Nov 2026 at version 2.0.0. Risk score 0 of 100. No malicious behavior was detected.

  • Releases: 11 versions; the latest was published on 26 Nov 2026.
  • Findings: No rules fired in version 2.0.0.
  • Downloads: 1,668 downloads.

Versions

11 versions published
Versions and the rules that fired in each
VersionPublishedStatus
2.0.0 LATEST 26 Nov 2026 No rules fired
1.4.8 15 Nov 2026 No rules fired
1.4.7 12 Nov 2026 No rules fired
1.4.6 9 Nov 2026 Not shown
1.4.3 28 Oct 2026 Not shown

No rules fired in 2.0.0

Findings

Findings for v2.0.0. 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.0.0; other versions have their own rules, not their own score.

README

The publisher’s own README, as collected from the registry.

@coffer_so/sdk-v6

Client library for the v6 Coffer Pool AMM contracts on Solana. Targeted at both frontend and backend consumers; no bundler-specific code.

Glossary: LP token (formerly "BPT") is the pool's liquidity-provider mint; Coffer Pool / coffer_pool (formerly "Cubic Pool" / cubic_pool) is the AMM program. 0.2.0 renamed the whole TypeScript surface accordingly, with no deprecated aliases — see the changelog for the migration table. The on-chain PDA seed bytes ("cubic_pool", "bpt_mint") are unchanged; only the constants' names are (POOL_SEED, LP_MINT_SEED).

This is a separate package from @coffer_so/sdk (the 1.x line), which targets the historical v5 ABI. Pick by the program version you talk to:

Package Contracts Status
@coffer_so/sdk 1.x v5 (main, mainnet since 2026-09-07) stable
@coffer_so/sdk-v6 0.x v6.1 (../contracts-v6.1: Token-2022 transfer fees, hooks and memos; planned and rc5 routed single-token deposits; 100 % fee ceilings; v6 rounding) deployment verification required

Contract compatibility

Source: contracts-v6.1 v6.1 at e22707d (rc7: rc5 plus the pool vault_bump_cache account field; rc5 candidate: the LP-transfer-fee ABI plus swap_route_join_v1, deposit_single_token_routed and errors 6116–6119 / STLD 6040; IDL sha256 pins in CONTRACT_COMPATIBILITY.md). Vendored IDLs contain 120 instructions (57 + 58 + 5) and 87 events (45 + 40 + 2); raw builders, generated types and event decoding cover that ABI. Program addresses are configuration values; this checkout has no verified owner deployment receipt for installed devnet v6.1. Final stable contract integration remains a parent gate. Compatibility, state fields, owner devnet tests.

The package also ships the coffer_rewards IDL and builders (boosts, REWARDS.md) and the Coffer backend API client (CofferBackendClient).

Install

npm install @coffer_so/sdk-v6
# or
yarn add @coffer_so/sdk-v6

Workspace-local development (linking against the in-repo source):

cd sdk
npm install
npm run build

From sibling packages:

{
  "dependencies": {
    "@coffer_so/sdk-v6": "file:../sdk"
  }
}

Quick start

import { getConfig, CofferPoolClient, CofferBackendClient } from "@coffer_so/sdk-v6";
import { PublicKey } from "@solana/web3.js";

const config = getConfig("mainnet", {
  backendEndpoint: "https://api.coffer.so",
  // Optional: put your paid RPC first; SDK falls back to the defaults below.
  rpcEndpoints: [
    process.env.COFFER_RPC_URL!,
    "https://api.mainnet-beta.solana.com",
    "https://solana-rpc.publicnode.com",
    "https://solana.api.pocket.network",
  ],
  rpcTimeoutMs: 2_000,
  slippageHundredthsBps: 30_000, // 3 %
});

const pool = new CofferPoolClient({
  config,
  poolAddress: new PublicKey("..."),
});

const res = await pool.sync();
if (!res.ok) {
  // res.error.humanMessage is safe to render to users
  console.error(res.error.humanMessage);
  return;
}
const info = res.data;
// info.tokens[i].metadata contains ticker / logo / decimals
// info.tokens[i].actualBalance is a bn.js BN in native units

Architecture

config/       CofferConfig, program IDs per network, token registry
types/        Result<T> shape, PoolInfo, SwapQuote, AddLiquidityQuote,
              RemoveLiquidityQuote, CofferPoolEvent
utils/        Error mapping, retry wrapper (safeCall), PDA helpers
math/         Pure math — ports of the v6 coffer-pool + stld Rust math, the
              swap simulator and the zap planner
parsers/      Binary layout decoders for CofferPool / Mint / events
clients/      RpcClient, CofferBackendClient, CofferPoolClient, PlannedZapClient,
              AdminClient, PoolFactoryClient
idl/          Anchor IDL exports generated from the current contracts
examples/     Runnable scripts demonstrating each capability

RpcClient starts with its last successful endpoint and rotates through config.defaults.rpcEndpoints after a retryable failure. If one endpoint times out or returns a transient provider error, the SDK tries the next endpoint instead of waiting on the same RPC. Mainnet defaults are no-key public endpoints; production frontends should prepend their paid RPC via getConfig("mainnet", { rpcEndpoints: [...] }).

Client sync and quote methods return SdkResult<T>: { ok: true, data } or { ok: false, error: { code, humanMessage, cause? } }. Pure math, parsers and low-level instruction builders throw on invalid input.

What lives in the SDK vs the frontend

In the SDK:

  • All on-chain account parsing (pool, mint, events)
  • All math (quote, allocations, slippage, price impact)
  • All transaction building (swap, add/remove liquidity, planned single-token deposit, pool deploy)
  • The off-chain zap planner and the Token-2022 hook/memo tail resolver
  • Current Anchor IDLs for coffer_pool, single_token_liquidity, protocol_admin and coffer_rewards
  • Retry + fallback for RPC and backend calls
  • Event log decoding

In the application: UI/state, wallet signing, transaction submission and confirmation, native SOL wrapping, token-account setup (the SDK hands you the idempotent-create instructions) and wallet-ALT setup for large pools. Use the SDK quote and ABI helpers for contract math and encoding; direct rpc.connection calls bypass its fallback wrapper.

v0 transactions + per-pool ALT

Multi-token pools (especially 7–10 token ones) exceed Solana's 1232-byte legacy transaction wire ceiling on add_liquidity / remove_liquidity. The contract provisions an Address Lookup Table (ALT) per pool via initialize_pool_alt. After init the ALT is frozen and its address is recorded on pool.lookup_table.

Builders return instructions. Call compileBuiltTx to fetch the pool's ALT and compile a v0 transaction. The wallet supplies signatures and the caller sends it.

import { compileBuiltTx } from "@coffer_so/sdk-v6";

const built = client.buildRemoveLiquidityTx({ user, lpAmount, minimumTokenAmounts });
if (!built.ok) throw new Error(built.error.humanMessage);
const compiled = await compileBuiltTx(connection, user, built.data, info);
if (!compiled.ok) throw new Error(compiled.error.humanMessage);
// Sign compiled.data.tx with the wallet, then send and confirm it.
Provisioning an ALT for a new pool
import { buildInitializePoolAltTx } from "@coffer_so/sdk-v6";

const recentSlot = new BN(await connection.getSlot("finalized"));
const { instructions, lookupTable } = buildInitializePoolAltTx(config, {
  pool: poolPubkey,
  config: poolConfigPubkey,    // from pool.config — required
  authority: poolAdmin,         // pool admin OR config.protocol_admin
  payer: poolAdmin,             // funds the table; rent depends on its size
  recentSlot,
});
// Sign, send, confirm, then sync the pool. Wait for a later slot before
// using newly added ALT addresses in a dependent transaction.

Account fields:

  • pool — CofferPool account
  • config — the CofferPoolConfig the pool is pinned to (read for the alternative-authority check). Always required.
  • authority — signs the create+extend+freeze CPIs. Either pool.pool_admin or config.protocol_admin (Treasury PDA, only reachable via protocol_admin.pool_initialize_alt). ALT pubkey is derived from [authority, recent_slot].
  • payer — pays ALT rent. Decoupled from authority because Treasury PDA can't be a system_program::transfer source (carries data). For the pool-admin path, pass the same key as authority.

ALT rent depends on the address count and the current rent calculation. The contract freezes the table; it cannot then be closed to reclaim that rent.

Token-2022 support

Pools may mix the classic SPL Token program and Token-2022. Every PoolTokenInfo carries tokenProgram, extensions, transferFee (the schedule in force at the snapshot epoch), transferHookProgram (armed hooks only) and paused, all decoded on sync(). Builders thread token.tokenProgram through ATA derivation and remaining-accounts assembly.

The v6 program moves every token with transfer_checked, nets transfer fees on both legs and forwards a remaining-account tail to armed hooks and to the memo program. The SDK:

  • nets fees in every quote (transferFeeIn/Out, amountOutReceived, chargedAmounts vs creditedAmounts, receivedAmounts);
  • resolves the tail (resolveSwapExtraAccounts, …, PlannedZapClient.resolveExtraAccounts) and appends it through extraAccounts;
  • refuses only what the program refuses: NonTransferable, the Token-2022 native mint, unknown extension types, and any paused mint (unsupported_token_extension). Hooks that need an extra signer or a core account are outside the supported profile.

The LP mint defaults to classic SPL Token; lpTokenProgram can select Token-2022 for joins/exits, but the planned zap requires a plain LP mint.

There is no Token-2022 extension policy any more (v6.1, T19): the pool creator decides which mints go into a pool, and consumers disclose what the mints carry — PoolTokenInfo.extensions / parseMintExtensions / mintExtensionName are the data source for such an alert. The former banned_extensions bytes stay in the account layouts as RawPoolAccount.deprecatedBannedExtensions / _deprecated_extension_policy and must not be interpreted.

Examples

See examples/*.ts:

  • 01-init-sdk.ts — initialisation patterns
  • 02-fetch-pool.ts — parse pool state
  • 03-quote-swap.ts — swap quote with slippage
  • 06-single-token-deposit.ts — planned single-token deposit: snapshot, plan, tail, packet budget
  • 08-backend-stats.ts — statistics via CofferBackendClient

Run: npx ts-node examples/<name>.ts.

Error handling pattern

const res = await pool.sync();
if (!res.ok) {
  toast.error(res.error.humanMessage);
  logger.debug(res.error.cause);
  return;
}
const poolInfo = res.data;

The SDK's safeCall helper retries transient errors up to 3 times with configurable backoff (default schedule: 200ms / 500ms / 1500ms). Permanent errors (parse failure, invalid input, insufficient funds, HTTP 4xx other than 429) short-circuit.

toSdkError classifies by structure first, then by text:

Failure code Retried by default
Backend fetch rejected — no HTTP answer (Chrome "Failed to fetch", Safari "Load failed", Firefox "NetworkError when attempting to fetch resource.", Node "fetch failed", CORS), or the response body broke off backend_unavailable, humanMessage "Backend unreachable: " yes
Backend fetch refused before sending (invalid URL such as apiEndpoint without https://, invalid header value) unknown, original message no
Backend HTTP 2xx whose body is not JSON backend_invalid_response no
Backend HTTP 5xx backend_unavailable yes
Backend HTTP 429 rpc_rate_limited yes
Backend HTTP 401/403/404/… unknown; cause.status holds the status no
TimeoutError, or the per-attempt timeout (timed out after …) rpc_timeout yes
RPC network failure (web3.js "fetch failed", "…: TypeError: Failed to fetch") rpc_unavailable yes, next endpoint
RPC HTTP 5xx from web3.js ("502 Bad Gateway: …", "…: Error: 503 Service Unavailable: …") rpc_unavailable yes, next endpoint
RPC "429 Too Many Requests" / "403 Forbidden" from web3.js rpc_rate_limited / rpc_unavailable yes, next endpoint

For backend HTTP errors humanMessage stays "METHOD path → HTTP nnn statusText", so matching HTTP 404 keeps working; prefer (res.error.cause as { status?: number })?.status. Digits inside the request path or in a JSON parse error never change the class of a backend error. Exceptions to the default policy: claimAttribution retries only transport errors and timeouts (any HTTP status, 429 included, is final), and verifySignature / verifyTransaction retry only HTTP 429 — their nonce is single-use and the backend consumes it before the signature check, so a resend after a lost response, a timeout or a 5xx (which can arrive after the nonce is gone) would answer "nonce already used" (401) and hide the real outcome. A failed token refresh logs the user out (clearTokens + onAuthExpired) only when the backend rejects the refresh token (HTTP 400/401); when the refresh gets no answer the tokens are kept and the original 401 is returned. The per-attempt timeout does not abort the underlying fetch (no AbortController); the request may still complete server-side.

Public operation surface

OX Radar and Response Center

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.

Where it’s listed

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).

  • npm @coffer_so/sdk

References

The publisher’s own links, as the registry reports them. These are not sources for the assessment on this page.

Powered by Read the latest findings

Scan your whole stack

Group 1261154050 1
Group 1261154050
 

From OX Research Newsroom

Cry2Wolf: How to Tell a Real Bug from a Nothingburger
AI & VibeSec

Cry2Wolf: Not Every Branded Bug Deserves a Fire Drill

Copy of Template Design OX Blog (3)
Research

Ruby2Shell: Ruby Memory Corruption Flaws Expose Applications to Remote Code Execution, But is it an Actual Risk?

Plug and Pray: Your AI Agents Are Taking Orders From Strangers
Research

Plug and Pray: Your AI Agents Are Taking Orders From Strangers

Frame 2085668439 (1)
Group 1261154229