About PayStage Trade Preflight
PayStage Trade Preflight evaluates proposed HIP-3 / trade.xyz orders against a local TradePolicy. It is for order flows that need a policy gate; it does not place, route, or recommend trades.
Key features
- 01Local TradePolicy evaluation
- 02allow, review, or do_not_trade decisions
- 03Rule results explaining decisions
- 04No network required for evaluation
Use cases
- 01Check a proposed order before trading
- 02Send uncertain orders for human review
- 03Reject orders that break hard rules
MCP support
Runs as a stdio MCP server and exposes evaluate_hip3_trade, which accepts a proposed order and policy and returns a decision with rule results.
Configuration
Local server config is the same for every client. Copy it into your client’s MCP config file.
Tools
1Saved tool list · updated 4d ago
| Parameter | Type | Required | Description |
|---|---|---|---|
| policy | any | No | |
| proposal | object | Yes | |
| proposal.dex | string | Yes | |
| proposal.side | enum | Yes | buy | sell |
| proposal.size | string | Yes | |
| proposal.asset | string | Yes | |
| proposal.leverage | number | No | |
| proposal.limit_px | string | No | |
| proposal.order_type | enum | No | limit | market |
| snapshot | object | No | |
| snapshot.dex | string | Yes | |
| snapshot.meta | object | Yes | |
| snapshot.meta.universe | array | Yes | |
| snapshot.assetCtxs | array | Yes |
Details
From the project 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/[email protected].
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 policyreview— the order needs a human or higher-level check before proceedingdo_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 localTradePolicyobject (or a path to it, depending on your setup)
Output:
decision—allow|review|do_not_tradereasons— 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. |
Links
- Website: paystage.xyz
- HIP-3 context: docs.trade.xyz
- Source: github.com/base-buzz/paystage (
packages/trade-preflight)
License
MIT
Comments
New to MCP?
From what the protocol is to installing your first server, these answers cover most first questions.
An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.