SDK, API and MCP
SDK
One ES module, served by this site, with viem as its only dependency:
curl -O https://www.hookcat.app/sdk/hookcat.mjs
npm i viemimport { listCats, quoteFee, buildSwap, openPool, adopt, keyFor } from "./hookcat.mjs";
const cats = await listCats(); // ranked by 7-day take for LPs
const q = await quoteFee(poolId, true, -10n ** 15n); // { fee, lpFee, cut } in pips and wei
const tx = buildSwap({ token, zeroForOne: true, amountIn: 10n ** 15n, minOut });
// { to: Universal Router 2.1.1, data, value } : send it from any wallet
const open = openPool({ token, sqrtPriceX96, catId }); // { to: hook, data }
const switchCat = adopt(poolId, catId); // keeper onlySelling a token for ETH needs two approvals first: the token to Permit2, then Permit2 to the Universal Router.
API
| Route | Returns |
|---|---|
GET /api/cats | Every cat with kind, params, builder, pools, swaps and 7-day take, ranked. |
GET /api/pools | Every HookCat pool with its cat, keeper, state, stats and current quote. |
GET /api/pools/:id | One pool and every swap the hook priced in it. |
GET /api/quote?pool=&zeroForOne=&amountSpecified= | The fee the next swap pays: fee, lpFee, cut, in pips (negative amount = exact in). |
MCP
A remote MCP server (JSON-RPC over HTTP) at https://www.hookcat.app/api/mcp with four tools:
hookcat_list_cats: the leaderboard.hookcat_pool: one pool by id.hookcat_quote_fee: the fee for a swap shape.hookcat_build_swap: calldata for an exact-in swap through Universal Router 2.1.1, for the agent's wallet to sign.
{ "mcpServers": { "hookcat": { "url": "https://www.hookcat.app/api/mcp" } } }