haiku_get_quote returns the Permit2 and bridge signing payloads alongside outputs, fees and approvals, so the question of where the private key lives is settled after pricing rather than before: set WALLET_PRIVATE_KEY and the server signs and broadcasts, leave it unset and haiku_prepare_signatures reduces the same quote to a signTypedData payload a wallet MCP such as Coinbase Payments MCP or wallet-agent can consume. The read side is built for the same loop — haiku_discover_yields returns iid values that drop straight into haiku_get_quote as targetWeights keys, so moving from a yield search to a priced rebalance needs no lookup in between. What this server does not do is custody: the signing decision stays with you either way.
A DeFi trading server of 7 tools over wallet balances, supported tokens and positions, yield discovery, portfolio analysis, quoting and execution, with an external-wallet signing path alongside the self-contained one.
- Holdings read as positions rather than as raw balances: haiku_get_balances returns balances, USD prices, total portfolio value and categorised positions across tokens, collateral, debt and vaults, and takes chainIds for a partial refresh — querying only the chains a swap touched.
- A token list that already knows about DeFi: haiku_get_tokens covers vanilla tokens, Aave collateral and debt, yield vaults and LP tokens, narrows by category and network, and returns the IID in chainSlug:tokenAddress form that haiku_get_quote and haiku_discover_yields work in.
- Yield search with thresholds attached: haiku_discover_yields filters by minApy, minTvl, category and network with a sortBy, returns APY, TVL and risk parameters, and hands back iid values usable directly as targetWeights keys.
- Analysis tied to what a wallet actually holds: haiku_analyze_portfolio enriches current positions with the APY options available to them and reports collateral health factors.
- Quotes that carry their own signing instructions: haiku_get_quote takes inputPositions, targetWeights, slippage and receiver and returns expected outputs, fees, gas estimates, required approvals and, where signatures are needed, the EIP-712 signing payloads for Permit2 and for a bridge.
- Execution on either path: with a private key configured, haiku_execute takes quoteId, sourceChainId, the signing payloads and approvals, signs and broadcasts, and returns a transaction hash; without one, haiku_prepare_signatures normalises the same quote's EIP-712 payloads into the standard shape any wallet's signTypedData consumes, and haiku_execute takes the resulting userSignature back.
No key is needed to read. A wallet address for the balance and portfolio calls, and — for the self-contained execution path — a signing key in WALLET_PRIVATE_KEY; without it, signing happens in an external wallet and the signature comes back through haiku_execute.
One command — npm install haiku-mcp-server
