check_swap_intent
PG1 Sovereign Threat Intelligence: checks an unsigned swap against the owner's instructions BEFORE it reaches the signer. Send the EIP-1559 transaction (type 0x02, unsigned or signed) as hex and the intent: chain_id, recipient (who must receive the output) and min_amount_out (the floor, in the output token's smallest units) are required; router (one permitted address or a list), token_in, token_out, amount_in, native_value, fee_tier, payer_is_user, signer (to resolve output sent to msg.sender), as_of (the reference time for the deadline; now by default), max_deadline_seconds and max_fee_bips are optional, and each one you give is checked. Optionally expected_sha256 of the transaction bytes. PG1 decodes the raw bytes itself (never trusts decoded fields sent alongside): the Universal Router's execute(bytes,bytes[],uint256) or execute(bytes,bytes[]) with V3_SWAP_EXACT_IN, V2_SWAP_EXACT_IN, SWEEP, UNWRAP_WETH, WRAP_ETH, PERMIT2_PERMIT (the permit must name the router as spender) and PAY_PORTION (interface fees, checked against max_fee_bips), following output held by the router (address(2)) to where it is swept or unwrapped; and the Aerodrome / Velodrome v2 router's exact-input swaps (swapExactTokensForTokens, swapExactETHForTokens, swapExactTokensForETH and their fee-on-transfer variants). Any other function or command is reported as not evaluated, never guessed. Reason codes, high: SWAP_RECIPIENT_MISMATCH, SWAP_MIN_OUT_BELOW_FLOOR (with the shortfall), SWAP_ROUTER_NOT_PERMITTED, SWAP_CHAIN_MISMATCH, SWAP_TOKEN_MISMATCH, SWAP_AMOUNT_IN_MISMATCH, SWAP_NATIVE_VALUE_MISMATCH, SWAP_DEADLINE_PASSED, SWAP_PERMIT_SPENDER_NOT_ROUTER, SWAP_OUTPUT_LEFT_IN_ROUTER (output the router still holds at the end, which anyone could sweep), SWAP_TX_DIGEST_MISMATCH; medium: SWAP_FEE_TIER_MISMATCH, SWAP_PAYER_MISMATCH, SWAP_DEADLINE_TOO_FAR, SWAP_NO_DEADLINE, SWAP_FEE_ABOVE_LIMIT; SWAP_INTENT_NOT_EVALUATED makes the status unknown. Returns verdict does_not_match, review, not_evaluated or matches_intent, one intent_checks row per field (match, mismatch or not_evaluated, with expected and actual), the decoded transaction and commands, and where each output goes. matches_intent means the transaction does what the intent asks; it does not judge the tokens, router, price or anything on chain, and is never "safe" or advice to sign. Deterministic, no network, no AI model; nothing is signed, sent or stored. Always free (60/hour per caller).
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"transaction": "<transaction>",
"intent": "<intent>"
},
"name": "check_swap_intent"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| intent | Yes | The owner's instructions. Every field given is checked; fields left out are reported as not_evaluated. | |
| transaction | Yes | The EIP-1559 transaction (type 0x02), unsigned or signed, as 0x hex. | |
| expected_sha256 | No | Optional: the SHA-256 you expect of the transaction bytes. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| call | No | ||
| note | No | ||
| checks | No | Which underlying sources were checked for this result and whether each one completed. | |
| status | No | "unknown" whenever a source needed for this answer timed out, errored, or was skipped - never "no_flags" in that case. | |
| reasons | No | Machine-readable reason codes for anything flagged in this result. Empty when nothing was flagged. | |
| summary | Yes | ||
| verdict | Yes | ||
| findings | Yes | ||
| deliveries | No | ||
| request_id | No | UUID for this request, also sent as the X-Request-Id response header. | |
| transaction | Yes | ||
| intent_checks | Yes | ||
| not_evaluated | Yes | ||
| rules_version | No |