---
name: onchain-connector
description: Connect a Grok Bot to the onchain trading connector, fund the user's own Hyperliquid wallet with Arbitrum USDC, and trade with take-profit and stop-loss. Use when the user wants to connect, fund, or trade.
---

# Onchain connector

The connector is a remote MCP server. Each person who connects gets their own wallet. You never see private keys. Do not ask for a seed phrase, a private key, a browser-extension wallet, or ETH.

MCP URL: `https://nfa-connector.fly.dev/mcp`

## Connect

Add that URL in the Grok Bot connect card. The card completes OAuth itself: it discovers the server, registers a client, and opens the sign-in page.

The user signs in with email or a passkey, enters the invite code the operator gave them if the page asks, and presses Allow. When the page shows a wallet address, read it back. That address is only this user's. Do not reuse an address from another chat.

If the connect card fails, say so. Do not invent a bearer token. Do not ask the user to paste an API key unless they are the operator and already have one.

## Fund

Call `get_account` before the first trade. It returns `owner_address` and `funding`.

Tell the user to send native Arbitrum USDC to `owner_address`. The token is `0xaf88d065e77c8cC2239327C5EDb3A432268e5831`. Send at least 5 USDC. 5.5 USDC leaves room for the USDC gas reserve. A deposit under 5 USDC is dropped by the Hyperliquid bridge and the funds are lost. Do not tell them to send ETH. Do not tell them to bridge from another chain unless they already hold Arbitrum USDC.

`fund_testnet` only works while the server is in testnet mode. This deployment trades mainnet. Do not call `fund_testnet` expecting faucet funds.

## Before every order

1. Call `get_risk_limits`. A new user starts near $25 per order, $50 open exposure, 5x leverage, and $10 daily loss, on any Hyperliquid perp market. Do not raise those numbers unless the user asks.
2. Call `get_account` and `get_positions` when size depends on equity or an open position.
3. Say the market, side, size in USD and units, leverage, order type, and any take-profit or stop-loss. A long stop is below the mark and the take profit is above it. A short is the reverse.
4. Wait for an explicit yes.
5. Pass `user_confirmed=true` on `place_order`, `close_position`, and `set_tpsl`. The server rejects mainnet orders without it.
6. If the tool returns a risk rejection, explain that reason. Do not split the order, raise limits, or flip `reduce_only` to get around it.

## Take-profit and stop-loss

On `place_order`, optional `take_profit` and `stop_loss` are reduce-only triggers sent with the entry. Omit `tp_limit_px` and `sl_limit_px` for a market trigger. Pass a limit price only when the user asked for one.

`set_tpsl` replaces the triggers on an open position. It still needs `user_confirmed=true` on mainnet. Triggers add no exposure.

## Position card

After a fill, a close, or when the user asks what is open, call `get_positions` and show one card per position:

- Market and side (`long` or `short`)
- Size and notional USD
- Entry price, leverage, liquidation price, and unrealized PnL
- Triggers from `open_orders` whose `order_kind` is `tp` or `sl`, with `trigger_price` and whether `is_market` is true

Say when the list is empty. Do not invent a fill. Quote `status` from the tool. `filled` is a fill. `resting` has an `order_id` you can cancel.

## Stops

If the user says stop, pause, or kill trading, call `kill_switch` with `enabled=true` before any other trading tool. The switch blocks new risk for this user only. Closes and cancels still work. Offer `close_position` only if they also want out.

## What you cannot do

- Touch another user's wallet. Every tool is scoped to the signed-in user. If a result shows a different address than `get_account`, stop and say so.
- Withdraw, export a key, or send USDC anywhere except the funding instructions above.
- Place a mainnet order without `user_confirmed=true`.
- Ask for ETH. Gas is paid in Arbitrum USDC.
