PayStage Trade Preflight

v0.2.0
xyz.paystage/trade-preflight Checked 3 hours ago Published 21 days ago

MCP tool: evaluate HIP-3/trade.xyz orders against a local TradePolicy before trading

MCP tool: evaluate HIP-3 / trade.xyz orders against a local TradePolicy before trading. Published on npm as @paystage/trade-preflight@0.2.0. Given a proposed HIP-3 / trade.xyz order and a local policy file, the server returns one of:

Summary extracted from the README.

@paystage/trade-preflight

MCP tool: evaluate HIP-3 / trade.xyz orders against a local TradePolicy before trading.

Not financial advice. This is a local policy gate only — it does not place orders, route orders, or recommend trades. It evaluates a proposed order against rules you define and returns a decision.

Published on npm as @paystage/trade-preflight@0.2.0.

What it does

Given a proposed HIP-3 / trade.xyz order and a local policy file, the server returns one of:

  • allow — the order satisfies every rule in the policy
  • review — the order needs a human or higher-level check before proceeding
  • do_not_trade — the order violates a hard rule in the policy

The decision is deterministic and local. No network calls are required to evaluate a policy; the tool is a gate you put in front of your own order flow.

Install

Run directly with npx:

npx -y @paystage/trade-preflight

Or install it:

npm install @paystage/trade-preflight

The package exposes a stdio MCP server (bin: paystage-trade-preflight).

MCP configuration

{
  "mcpServers": {
    "paystage-trade-preflight": {
      "command": "npx",
      "args": ["-y", "@paystage/trade-preflight"]
    }
  }
}

No environment variables are required. The policy is passed as a tool argument.

Tool

evaluate_hip3_trade

Evaluates a proposed HIP-3 / trade.xyz order against a local TradePolicy.

Inputs (shape):

  • order — the proposed order (market, side, size, price/limit, etc.)
  • policy — the local TradePolicy object (or a path to it, depending on your setup)

Output:

  • decision — allow | review | do_not_trade
  • reasons — list of rule results explaining the decision

Example policy shape:

{
  "version": 1,
  "max_notional": { "value": "100.00", "asset": "USDC", "decimals": 6 },
  "allowed_markets": ["BTC-USD", "ETH-USD"],
  "allowed_sides": ["buy", "sell"],
  "max_leverage": 1,
  "unknown_market": "review"
}

Decisions

Decision Meaning
allow Order satisfies all policy rules.
review Order needs a human or higher-level check.
do_not_trade Order violates a hard policy rule.

Supply chain and access

Flag Why it is there
Network access One read-only POST to https://api.hyperliquid.xyz/info (metaAndAssetCtxs) when the caller does not pass a market snapshot.
URL strings That endpoint.
Filesystem access Indirect, through the policy file for TradePolicy.

It never places an order and never signs. Not financial advice. Full table: SECURITY.md.

License

MIT