Provisions and signs
Privy owns the user-owned master wallet and the Privy-managed execution wallet. It signs ordinary Hyperliquid actions through a named agent. No private key reaches the harness, the T3 client, or any prompt.
§15 + §17 · Exchange, identity, and protection
The T3 server reaches Hyperliquid through one adapter shared by every harness. Privy supplies the signing identity. Hyperliquid is the only source of market and account truth. Any acknowledged position increase must carry confirmed exchange-native reduce-only protection before the reconciliation window closes.
Authority split
Privy owns the user-owned master wallet and the Privy-managed execution wallet. It signs ordinary Hyperliquid actions through a named agent. No private key reaches the harness, the T3 client, or any prompt.
Hyperliquid owns canonical market metadata, account state, orders, fills, positions, margin, funding, and PnL. Local records are reconciled against it, never ranked above it.
The T3 server owns deterministic validation, nonce coordination, signing coordination, order submission, reconciliation, and the protective-order invariant. It never invents strategy.
Every position-increasing action must include stop information before submission, and no acknowledged increase may remain unprotected past the reconciliation window.
Codex, Claude, or OpenCode requests typed actions through the shared tool surface. The harness never sees credentials, raw payloads, or the signing boundary.
The user approves the Privy-backed Hyperliquid API wallet a single time. After approval, ordinary trading actions need no per-order prompt; risk-reducing buttons never depend on the harness.
§15.1 · Wallet model
Account state is always queried with the master-wallet address. The execution wallet is a signing mechanism for the master account, not a separate trading account, and must never be passed to account-query endpoints.
t3-trades-poc
The execution wallet is approved once under this agent name. Revocation creates a new wallet and a new approval rather than reusing the prior signing identity.
§15.2 · Hyperliquid gateway
All providers reach Hyperliquid through the same HyperliquidGateway interface. No provider-specific exchange client is permitted: Codex, Claude, and OpenCode converge on identical market reads, account reads, and submission paths.
interface HyperliquidGateway {
resolveMarket(symbol: string): Promise<ResolvedMarket>;
getMarketSnapshot(market: string): Promise<MarketSnapshot>;
getMarketHistory(input: MarketHistoryRequest): Promise<MarketHistory>;
getAccountSnapshot(address: `0x${string}`): Promise<AccountSnapshot>;
getOpenOrders(address: `0x${string}`): Promise<CanonicalOrder[]>;
getOrderStatus(
address: `0x${string}`,
oidOrCloid: string,
): Promise<OrderStatus>;
submit(action: NormalizedTradingAction): Promise<ExchangeSubmissionResult>;
}
address is always the master-wallet address, never the execution-wallet address. submit accepts a normalized action, not a raw Hyperliquid payload.
§15.3 · Market resolution and precision
szDecimals)szDecimals.For the ETH-only proof of concept the ETH asset index is resolved at runtime from perp metadata, not copied into source. A metadata change on testnet must not silently break signing.
§15.4 · Market-like orders
Buy IOC limit = fresh best ask + allowed slippage
Sell IOC limit = fresh best bid - allowed slippage
§15.5 · Client order IDs and idempotency
cloid = derive16Bytes(
missionId,
strategyVersion,
executionSequence,
actionType,
)
cloid and idempotency key.§15.6 · Nonce coordination
All actions signed by the execution wallet pass through one serialized nonce lane. The coordinator:
Because the lane is serialized, two harness-requested actions can never race for the same nonce, and a T3 restart can rehydrate the last issued value before submitting again.
§17 · Protective-order invariant
No acknowledged position increase may remain without confirmed exchange-native reduce-only protection beyond the shortest technically necessary reconciliation window.
Any position increase must include stop information before submission. The invariant is confirmed from exchange state, not inferred from a grouped response or a local record.
§17.1 · Hyperliquid behavior to respect
Hyperliquid's order action accepts multiple orders and a grouping value of na, normalTpsl, or positionTpsl. A grouped submission is useful for expressing TP/SL relationships, but the HTTP response or the presence of a group is not proof that every requested order is live.
A parent-linked normalTpsl request is an optimization and linkage mechanism. It is not the final safety invariant.
normalTpsl request that returns 200 can still contain a rejected child, an untriggered child, or a child canceled by parent cancellation. Confirm protection from canonical exchange state before marking an execution protected.
§17.2 · Marketable IOC entry path
normalTpsl order action after that exact request shape passes testnet validation.positionTpsl behavior or an explicitly sized reduce-only trigger order.protected.§17.3 · Resting GTC entry path
A resting parent may use linked normalTpsl children, but T3 must subscribe to parent fills and order updates. On any partial fill:
§17.4 · Scale-in and protection replacement
After any scale-in fill:
§17.5 · Emergency-close procedure
The emergency close is invoked when full protection cannot be confirmed within the bounded reconciliation window. It runs without the harness.
blocked and block all position increases.§17.6 · Required testnet evidence
Before the protection path is considered complete, record testnet results for:
Hyperliquid research grounding
Documented candle intervals, candle history behavior, order status, and userFees.
Direct candle subscriptions for 1m, 3m, 5m, 15m, and 1h.
Multi-order actions, per-order statuses, normalTpsl, positionTpsl, reduce-only orders, modification, cancellation, and API-wallet actions.
Parent-linked versus position-linked TP/SL behavior and partial-fill cancellation consequences.
Current fee model and use of the user-specific fee response.
The exact client library and request shape selected during implementation must still be validated on Hyperliquid testnet. Documentation establishes the intended API behavior; testnet evidence establishes that the T3 integration implements it correctly.