Build on a
fee set last.

The docs for neat3-sdk. Quote a trade, read the fee, and swap, in plain TypeScript and without Solidity.

Read the quickstart
3
calls: quote, encode, submit
4
pool reverts, decoded by name
Start with the introduction →
quote.ts
const q = await client.quote({
  tokenIn: dWETH,
  amountIn: parseEther("10"),
});
You get
29,614.74USDC
Best venue pays 29,610.00
Fee on this trade0.30% · beats best venue by $4.74
Run it yourself

Output of the live devnet pool, Nov 6.

Flow

Three calls, from quote to swap.

The pool sets its fee last. The SDK hands you the numbers and the calldata, and you decide how to send it.

// 1. what will this trade get me?
const q = await client.quote({ tokenIn, amountIn });

// 2. approve + swap, with minOut = q.amountOut and a 10-minute deadline
const calls = client.encodeSwap(q);

// 3. or send both as one atomic frame transaction
const hash = await client.submit(q);
  1. 01
    Install

    npm install neat3-sdk viem. Node 20.12 or newer.

  2. 02
    Quote

    quote() returns the pool's output, its fee and the best venue's output for that exact size.

  3. 03
    Encode

    encodeSwap() builds approve and swap, with minOut set to the quote and a 10-minute deadline.

  4. 04
    Submit

    Send the calls with your wallet, or submit() them as one atomic EIP-8141 frame transaction.

Docs

Start here, then go deeper.

One quickstart to see a fee on screen, then a guide for each thing you can do with it.

Quickstart

Quote in five minutes

Create a client and ask the live devnet pool for a fee.

Install
neat3-sdk
Runtime
Node ≥ 20.12
Quote mode
public
Pool
Devnet 1337
Read the quickstart →

Install the package, point it at a pool and read a fee. It works in Node with no extras.

Guides

Private quotes

Reads over Anon-RPC, so the RPC doesn't learn who asked.

Transport
Anon-RPC
Networks
nox · nym · tor
Runs in
Browser
Default
private
Quote privately →

Quoting through a mixnet from a browser: which networks work, how slow they are, and what stays unhidden.

Guides

Swapping

Approve and swap, with a floor on the output and a deadline.

minOut
Quoted output
Deadline
10 min
Batch
Atomic
Reverts
4 decoded
Send the swap →

Encode the calls, send them with your wallet or as one frame transaction, and read the pool's reverts by name.

Built on
  • viem
  • Anon-RPC
  • EIP-8141
FAQ

Good to know.

Is neat3-sdk on npm?

Yes. Run npm install neat3-sdk viem. The current version is 0.1.0.

Does it work in Node?

Yes, with quoteMode set to "public". Private mode needs Anon-RPC, which only runs in a browser. Without anonFetch, a private quote throws instead of falling back to a plain fetch.

Where can I use it today?

The EIP-8141 devnet (chain 1337) is the default target. The Sepolia demo pool is the same contract, but the SDK has not been run against it yet. The Aqua and SwapVM pool is not wrapped.

Does submit() hide my swap?

No. The alt-mempool is public, so anyone can read pending frame transactions. Protection comes from minOut and the atomic batch: if the price moves first, the whole batch reverts and you keep your tokens.

What does a bestOut of zero mean?

The pool had no fresh competitor quote and used its fallback fee. beatsBestVenue is false in that case. It is the pool failing safe, not an error.

What are pips?

One pip is 1e-6, so 1,000,000 is 100% and 3000 is 0.30%. Divide feePips by 1e4 to get a percentage.

On npm

Quote in five minutes.

Read the quickstart