Skip to main content
Glama

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
PATHIEL_NETWORKNoSet to `testnet` to trade test funds (default is mainnet, real money). The oil desk trades WTI (`xyz:CL`) on testnet.mainnet

Instructions

Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.

pathiel: a Hyperliquid perps desk that Claude trades through these tools. Network: mainnet. REAL MONEY: orders use the account's real funds. To practise with test funds: PATHIEL_NETWORK=testnet in ~/.pathiel/.env.local, then reconnect. Trading: read-only. No key is configured, so the seven live-money tools refuse; every read works. connect_wallet adds a key with one wallet signature. Not financial advice: the user decides every trade and can lose money.

Default risk profile: 3x max leverage, 1% of equity at risk at the stop, one position at a time. set_leverage is capped by the profile's max_leverage. Change the profile with update_config (risk_profile) or ~/.pathiel/.agent-config.json.

Start here

  • get_status: network, trading, fee, account. get_account: balances.

  • list_desks, then get_desk_brief {desk}: the desk's call as short markdown, with "Your size".

  • refresh_desk {desk}: a NEW thesis (news + one local Claude Code call, ~1 min; needs the claude CLI).

  • size_trade sizes every trade (never by hand); get_risk_limits shows the profile.

  • place_bracket {coin, entry_px, stop_px, tp_px}: one entry with an exact stop and target, sized by the profile. dry_run=true checks only. set_stop (tighter only) and set_target move levels. sweep_brackets {coin} after every close.

  • Market reads (get_market, list_markets, get_candles, get_order_book) need no key.

Coins: main-dex perps by name (BTC, ETH). HIP-3 perps as dex:SYMBOL (xyz:GOLD). Testnet lists fewer live markets than mainnet: a coin that is delisted or missing on this network is refused for new entries (xyz:BRENTOIL is delisted on testnet, so the oil desk trades xyz:CL, WTI, there). Closes are never refused.

Builder fee: none. pathiel charges no fee; orders carry no builder code.

LIVE MONEY: place_bracket, set_stop, set_target, sweep_brackets, close_position, set_leverage, cancel_order act on the account on mainnet, and update_config rewrites the trading config. Call them only when the user asked for that exact action in this conversation. Every other tool only reads (refresh_desk, submit_desk_call and get_desk_record with grade=true write the local desk journal; join_pool/leave_pool sign a text statement with the user's key, only when asked, placing no order and moving no money).

Capabilities

Features and capabilities supported by this server

Protocol revision2025-11-25

CapabilityDetails
tools
{}

Tools

Functions exposed to the LLM to take actions

NameDescription
get_marketA

Get one coin's market snapshot in a single call: mid, mark and oracle price, current funding and the predicted next funding per venue, open interest, 24h volume, previous-day price and max leverage. Use it for any question about one coin right now. Not for many coins at once (list_markets), price over time (get_candles) or depth and slippage (get_order_book). Read-only; needs no key or account. A HIP-3 coin (xyz:GOLD) is read from its own dex. Returns {coin, mid: {price}, context: {funding, openInterest, markPx, oraclePx, midPx, dayNtlVlm, prevDayPx}, funding_next: {venues[]}, max_leverage}; a part the venue cannot answer carries its own error while the rest still returns, and an unknown coin returns {error} with isError true.

list_marketsA

List many coins at once, one board per call, to scan or rank the market. view=instruments (default): tradable perps and spot, highest 24h volume first, each with max leverage, funding, open interest and mid; query, type and limit narrow this view only. view=mids: every mid price (coins narrows it). view=funding: every coin by hourly funding. view=open_interest: the top 100 by open interest. view=assets: size decimals and max leverage per main-dex perp, for order sizing. limit defaults to 50 (max 1000). For one coin's full snapshot use get_market instead; for price history use get_candles. Read-only; needs no key. Returns {instruments[], counts, matched} for instruments, {count, mids} for mids, {count, rows[]} for funding and open_interest, and {count, assets[]} for assets; a venue failure returns {error} with isError true.

get_candlesA

Get OHLCV candles for one coin. Returns [{t, o, h, l, c, v}], oldest first, t in unix ms. Two modes: the last count candles at interval (default 100 x 1h; the newest one may still be forming, so one extra can come back), or a fixed window when start_time is given (end_time defaults to now; count is then ignored). interval is one of Hyperliquid's: 1m, 3m, 5m, 15m, 30m, 1h, 2h, 4h, 8h, 12h, 1d, 3d, 1w, 1M. Use for trend, levels, volatility and backtests. For the price right now use get_market; for depth use get_order_book. Read-only; needs no key. Window mode returns {coin, interval, start, end, count, candles[]}.

get_order_bookA

Get the live L2 order book for one coin: levels [bids, asks], up to 20 each, every level {px, sz, n orders}. Give size (in coins) or notional_usd, not both, to also walk the book for a market order of that size: average fill, worst price, slippage % and any unfilled amount; is_buy picks the side (default buy). Use before a large entry or exit to judge slippage. For the mid price alone use get_market. Read-only; needs no key. Returns {coin, time, levels}, or {book, impact: {avg_fill_px, worst_px, slippage_pct, filled_usd, unfilled_usd, book_exhausted}} when a size is given; an unknown coin returns {error}.

get_funding_regimeA

Get the market-wide funding regime: whether longs or shorts are paying to hold (crowded) overall and per asset class (crypto, equity, commodity), with the coins whose funding is most extreme (funding as the hourly rate). asset_class narrows the coin list to one class; limit caps it (default 25, max 1000), most extreme first. Use to judge crowding before taking a side. For one coin's funding use get_market; for every coin ranked by funding use list_markets view=funding. Read-only; needs no key. Returns {regime, regimes_by_class, assets[]: {asset, asset_class, funding_rate, regime, oi, volume_24h}, assets_total}.

get_accountA

Get the account's money in one call: total equity across the main perp dex, every HIP-3 dex and spot USDC, withdrawable, whether it can trade (and what blocks it), open positions in brief, plus risk: account leverage, cross margin ratio (1.0 = liquidation) and distance to liquidation. detail=full adds PnL per window (day, week, month, all time), the fee tier and API rate-limit use, for the configured account only. address reads any wallet instead. Use for balance and liquidation-risk questions. For each position in detail use get_positions; for what the risk profile allows use get_risk_limits. Needs a configured account or an address, never a key; with neither it returns {error, no_account: true}. Returns {account, risk}, plus {pnl, fees, rate_limits} with detail=full (ignored with address).

get_positionsA

Get open perp positions on every dex (main and HIP-3): coin, signed size (negative = short), entry, position value, unrealized PnL, margin, leverage and liquidation price. coin narrows to one position and, for the configured account, adds the venue's liquidation price for it. address reads any wallet. Use to see what is open before placing, moving or closing anything. For balances use get_account; for the resting stop and target use get_orders. Needs a configured account or an address; with neither it returns {error, no_account: true}. Returns {count, positions[]} (count 0 when flat), or {positions, liquidation: {source, liquidation_price}} with coin.

get_ordersA

Get orders, one query per call. status=open (default): resting orders on every dex with order type (Stop Market, Take Profit Limit, Limit), trigger price, size and reduce-only flag; this is how to see a position's stop and target. status=history: filled and cancelled orders, newest first. oid or cloid looks up one order and overrides status. coin and limit narrow the list (limit default 100 open, 50 history, max 2000); address reads any wallet. Use before cancel_order (it needs the oid) and to check a position is protected. For executed trades use get_history. Needs a configured account or an address; with neither it returns {error, no_account: true}. Returns {count, orders[]: {coin, oid, side, sz, limitPx, triggerPx, orderType, reduceOnly}} or one order's status.

get_historyA

Get the account's ledger, one kind per call. kind=fills (default): executed trades with price, size, side, fee and closed PnL, the latest fills by default, narrowed by coin and limit; start_time and end_time cut a time window (for another wallet, within its newest 2000 fills, the venue's cap). kind=funding: funding paid or received per coin between start_time and end_time. kind=deposits, withdrawals or transfers: money in, out and between perp, spot, sub-accounts and vaults since start_time; withdrawal_id checks one withdrawal's settlement. pathiel cannot move funds (its API wallet can trade, never withdraw), so these are records only. address reads any wallet. Rows come oldest first; limit (default 100, max 2000) keeps the newest. Use for PnL review and audits; for resting or cancelled orders use get_orders. Needs a configured account or an address; with neither it returns {error, no_account: true}. Returns {count, fills[]} for fills and {count, rows[]} for the other kinds.

get_risk_limitsA

Get what this account may trade under its saved risk profile: positions at once, dollars at risk per trade at the stop, max leverage, the minimum equity to trade and whether each book can trade now, with a one-line headline. equity_usd and preset answer what-if questions (a different account size or preset) and change nothing. Use to explain the limits, or before changing the profile with update_config. To size one specific trade use size_trade; for the raw config use get_config. Needs a configured account unless equity_usd is given (else {error, no_account: true}). A book is one strategy slot the profile allows (desk or manual). Returns {headline, can_trade, max_open_positions, risk_per_trade_usd, max_leverage, books[], notes[]}.

size_tradeA

Size one trade before placing it, with the rules place_bracket uses: size, notional, leverage, margin, dollars at risk at the stop, payoff at each target and the liquidation price, plus the most this account's margin allows on the coin. The side follows the levels: stop below entry is a long, above is a short. targets adds a payoff per target price; leverage overrides the default (capped by the profile); equity_usd sizes a what-if account and skips the margin check. Use before every place_bracket; never size a trade by hand. Places nothing. Needs a configured account unless equity_usd is given. Returns {sizing: {side, size, notional_usd, leverage, margin_usd, risk_usd, risk_pct, targets[], liq_px, reason, warnings[]}, max_by_margin}, or the sizing alone for a what-if. A trade that cannot be sized (stop at the entry, equity too small) comes back can_trade false with size null and the reason.

place_bracketA

LIVE MONEY: acts on the real account. Open one trade as a bracket: an entry plus an exact stop-loss and take-profit, sized by the risk profile exactly as size_trade reports. The side follows the levels (stop below the entry or mark is a long). entry_px rests a limit order and the stop and target attach when it fills; omit entry_px to enter at market now. The take-profit is placed 0.5% inside tp_px so it fills before the level (the result shows both). leverage defaults to the profile's max and is set on the coin first. Refused, with nothing sent: reward to risk under min_r (never below 2R), a stop outside half the distance to liquidation, a coin not listed on this network, or a second position or resting entry on the coin, unless add=true, which tops an open same-side position up to full size with a stop no wider than the current one. dry_run=true runs every check and returns the sizing without placing. Call only when the user asked for this trade; size it first with size_trade, adjust it later with set_stop or set_target, exit with close_position. Needs a trading key. Returns {ok, placed, mode, entry_px, stop_px, tp_px, size, leverage, result, network, builder_fee}; a refusal is ok=false, placed=false with the reason. If a market entry fills but the venue refuses the stop, the result is ok=false, placed=true, reason "FILLED WITHOUT A STOP": place one at once with set_stop.

set_targetA

LIVE MONEY: acts on the real account. Move an open position's take-profit to tp_px. One limit take-profit for the whole position goes on first, then every older target on the coin is cancelled, so the position always has a target and a refused new order leaves the old one in place. Refused: no open position, or a target on the losing side of the mark (it would fill at once). Never changes the stop or the size. Use to raise or lower a target. To move the stop use set_stop; to exit now use close_position. Needs a trading key. Returns {ok, tp_px, size, replaced: old target prices}; a refusal is {ok: false, reason} with isError true and nothing sent.

set_stopA

LIVE MONEY: acts on the real account. Move an open position's stop-loss tighter, toward the mark, to lock in gains or cut risk; never wider. One stop for the whole position goes on first, then every older stop on the coin is cancelled, so the position is never unprotected and a refused new order leaves the old one in place. Refused: no open position, a stop past the mark (it would fire at once), or a stop wider than or equal to the current one (a long's new stop must be above it, a short's below). With no stop at all, any stop on the right side of the mark is placed. Never changes the target or the size. To widen a stop, close and re-enter with place_bracket; to move the target use set_target. Needs a trading key. Returns {ok, stop_px, size, mark, replaced: old stop prices}; a refusal is {ok: false, reason, mark, current_stop} with isError true and nothing sent.

cancel_orderA

LIVE MONEY: acts on the real account. Cancel one resting order by its order id. order_id comes from get_orders; pass coin with it (asset, the numeric index, only when coin is unknown). Cancelling a position's only stop leaves it unprotected: to move a stop use set_stop, and to clear leftover orders on a flat coin use sweep_brackets. Use for a stale entry or a mistaken order. Needs a trading key. Returns {ok}; an order already filled or cancelled, or a missing coin and asset, returns the venue's {error} with isError true.

close_positionA

LIVE MONEY: acts on the real account. Close a coin's entire open position now with one market order for the full size; partial closes are not supported, and like any market order it pays the spread and slippage of the book. A flat coin returns ok=true with noop already_flat and sends nothing. Closes are never refused for a delisted coin. Afterwards run sweep_brackets on the coin to cancel the stop and target that no longer protect anything. Use when the user asks to exit now; to exit at a price instead, move the level with set_stop or set_target. Needs a trading key. Returns {ok, result: {total_sz, avg_px}} or {error} with isError true.

set_leverageA

LIVE MONEY: acts on the real account. Set a coin's leverage, a whole number from 1 up to the coin's max (default 5 when omitted). It is capped by the risk profile's max_leverage and refused above it (raise the cap with update_config first). An open position keeps its own margin type (cross or isolated); a venue refusal, such as leverage too low for the margin in use, comes back as an error. place_bracket already sets leverage when given one, so call this alone only to change an open position or prepare a coin. Confirm with get_positions. Needs a trading key. Returns {ok, coin, leverage} or the error.

sweep_bracketsA

LIVE MONEY: acts on the real account. Tidy one coin's protective orders (one coin per call). On a flat coin it cancels stops and targets left behind after a stop or target fired (a resting entry's own attached stop and target are kept) and lists resting entries. With an open position it checks the stop covers the full size and folds several stops or targets at one price (one per fill) into a single pair, placing the new order before cancelling the old ones. Never opens, closes or moves a level. Run it after every close or fill; to move a level use set_stop or set_target. Needs a trading key. Returns {ok, position, stop_px[], tp_px[], stop_covers} with an open position, or {ok, position: 0, cancelled_stranded, resting_entries[]: {oid, px, sz}} when flat; ok=false with reason "POSITION NOT FULLY COVERED BY A STOP" means place one now with set_stop.

list_desksA

List every trading desk (crude oil, metals, ...) as a one-line card: id, primary coin, mid, 1-day return, the latest call's side and one-liner, how old the thesis is, the next catalyst and the track record. Use first to pick a desk, then get_desk_brief for its full call; for raw market listings use list_markets instead. Reads the local desk journal and live mids; needs no key. Returns {count, desks[]}.

get_desk_briefA

Get one desk's current trade call to trade from: side, entry, stop and targets, the reasoning, and your_size, the size this account would take at those levels under its risk profile and desk share. mode=quick (default) is short markdown with the call first; mode=full adds the evidence (news, levels, scenarios). stale lists what is out of date; when the thesis is stale or its target was hit, call refresh_desk. Use before placing a desk trade with place_bracket. Not for the desk's past accuracy (get_desk_record) or the list of desks (list_desks). Read-only; needs no key. An unknown desk id returns {error: no such desk}. Returns {desk, mode, markdown, your_size: {side, size, notional_usd, leverage, margin_usd}, stale[]}.

refresh_deskA

Write a NEW thesis for one desk: pulls fresh market data, news, policy and odds, then makes one local Claude Code call (about a minute, billed to the local Claude Code plan; needs the claude CLI on PATH, else it fails fast). A refresh already running for the desk is joined, not repeated; force=true refreshes even when the desk's data is still fresh. Writes only the local desk journal; places no order. Use when get_desk_brief says the thesis is stale or its target was hit; otherwise read the current call with get_desk_brief. Returns the new call or the error.

submit_desk_callA

Record the user's own trade call on a desk in the local journal (author=user), graded later beside the machine's theses in get_desk_record. call needs side (long, short, flat or pair), instrument, a one-liner of at most 160 characters, confidence from 0 to 1 and the invalidation; entry_px (or an entry_zone [lo, hi]), stop_px, targets and leverage are optional. scenarios, when given, are {name, probability, move_lo_pct, move_hi_pct (percent moves), description, triggers[]} whose probabilities sum to 1; a call that breaks a rule returns {error} naming it. Places no order and changes no config. Use when the user states a view they want tracked; to trade it use place_bracket. Returns the journaled call.

get_desk_recordA

Get a desk's graded track record: calls graded, direction hit rate, mean Brier score, mean return, results by outcome, machine calls vs the user's own, and trades taken against each call. grade=true first grades expired calls and closed trades (writes the local journal, places no order); use it when calls have expired since the last grading, else leave it off and read. Use to judge whether a desk's calls deserve trust; for the current call use get_desk_brief. A desk with nothing graded yet returns n_graded 0. Returns {desk, track_record}, or {graded, record} with grade=true.

get_statusA

Start here. Get the install's status: the trading mode, equity with open positions in brief, and the registered accounts with the one that trades; on a public install also the network (mainnet or testnet), whether trading is enabled (an API wallet key is configured) or read-only, and the builder fee. Use first in a session and whenever an order is refused as read-only. For full balances and liquidation risk use get_account; for settings use get_config. Read-only. With no wallet connected it still answers, showing trading as read-only; a venue that cannot be reached shows in the equity fields. Returns {status: {mode, equity, equity_by_dex, positions, install (public installs): {network, trading, builder_fee}}, accounts: {count, accounts[], bot_trades_with}}.

get_configA

Get the trading config from ~/.pathiel/.agent-config.json: mode (LIVE or OFF), HIP-3 on or off, coin and HIP-3 dex allow and block lists, the risk profile when set, and every other top-level key. Changes nothing. Use before update_config to see current values and key names; for what the risk profile allows in dollars use get_risk_limits, and for whether trading is enabled use get_status. A missing file reads as the defaults. Returns the config object.

update_configA

Change the trading config on this machine; it applies at once to every later order. Pass only the keys to change: mode (LIVE or OFF), enable_hip3, coin_allowlist, coin_blocklist, hip3_dex_allowlist, hip3_dex_blocklist, or any other top-level key get_config shows, such as risk_profile; nested objects merge into the current ones and a list replaces the old list. mode is a label only: OFF does not stop the live-money tools. A call with nothing to change is refused. Read current values with get_config first, and call only when the user asked for this exact change. Not for one coin's leverage (set_leverage) or for sizing questions (get_risk_limits). Returns the updated config.

connect_walletA

Connect the user's Hyperliquid wallet so pathiel can trade: makes a new API wallet key on this machine, opens a local page where the user's browser wallet approves it with one signature, and saves the key to ~/.pathiel/.env.local. The API wallet can trade and never withdraw. status=true reports a connect in progress (waiting, done or failed) and starts nothing; cancel=true stops a waiting one; replace=true swaps a key already set, only when the user said so; open_browser=false prints the page link instead of opening it. Call only when the user asked; get_status shows whether trading is enabled. It returns at once and does not wait for the signature: poll with status=true. With a key already set it keeps that key unless replace=true. A failure returns {ok: false, state: failed, code, error, next} saying what to do. Returns the connect state (waiting, done or failed) and the page link.

get_pool_statusA

Get this account's research pool status (the pool is mainnet only): joined or not (and when), what is published and what stays private, the pool's latest counts, the scoreboard URL and how to join or leave. report=true adds your own graded report from your public fills since joining: win rate, mean R with ranges, labelled fluke or edge (members only). Use before join_pool or leave_pool and to see your grade; not for market data or balances (get_account) or your fills (get_history). Reads local files (the report also reads your public fills); signs and publishes nothing. Returns the status object, or {status, report}.

join_poolA

Join the research pool, which grades your public fills on a public scoreboard. Two steps: without confirm it shows the exact statement and signs nothing; with confirm=true and the joined_at that first call returned, it SIGNS that statement with your key and writes the member file for a pull request. No order is placed and no money moves. Call only when the user asked to join, and confirm only after they read the statement. Check get_pool_status first. Needs a trading key and mainnet: on testnet it returns {error, code: testnet} and signs nothing. The user opens the pull request; leave_pool undoes it. Returns the statement, then the signed member file path.

leave_poolA

Leave the research pool: the next scoreboard build drops your address and every row of it, and the leave stays in force until a later join. Two steps: without confirm it shows the exact statement and signs nothing; with confirm=true and the left_at that first call returned, it SIGNS that statement with your key and writes the leave file, which the user opens a pull request with, as for join_pool. No order is placed and no money moves. Call only when the user asked to leave, and confirm only after they read the statement; check membership first with get_pool_status. Needs a trading key and mainnet: on testnet it returns {error, code: testnet} and signs nothing. Returns the statement, then the signed leave file path.

Prompts

Interactive templates invoked by user choice

NameDescription

No prompts

Resources

Contextual data attached and managed by the client

NameDescription

No resources

TDQS

A4.4/5.0

Scored across 30 tools

Disambiguation4/5

Almost every tool targets a distinct resource/action pair (market snapshot, candles, book, positions, orders, history, desk brief, pool status), and descriptions explicitly cross-reference siblings to steer selection (e.g. get_market vs list_markets vs get_candles). The few adjacent pairs — size_trade vs place_bracket, set_stop/set_target vs sweep_brackets, cancel_order vs sweep_brackets — are clearly separated by the text, though the sheer density leaves some residual risk of misselection.

Naming Consistency5/5

All 30 tools use a uniform snake_case verb_noun pattern (get_market, list_markets, set_stop, close_position, join_pool, submit_desk_call, update_config), with verbs drawn from a small consistent vocabulary (get/list/set/place/close/cancel/refresh/join/leave). No camelCase or stylistic mixing anywhere.

Tool Count3/5

30 tools is heavy for a single server, well above the comfortable 3-15 band, though the surface legitimately spans market data, account state, order lifecycle, desk research, pool membership and configuration. Each tool does seem to earn its place, but the count is large enough that discovery cost is real.

Completeness4/5

Coverage is strong: market data (snapshot, board, candles, depth, funding regime), account state (balances, positions, orders, fills/funding/transfers, risk limits), full trade lifecycle (size, bracket, move stop/target, leverage, close, cancel, sweep), plus desks, pool and config. Minor gaps exist by design rather than oversight — no partial closes, no order modification (only cancel), and no fund movement — which agents can work around.

Maintenance

ActivityActive
ResponsivenessLimited data