Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

pg1-swap-check

БесплатноБез исполняемых скриптовНе проверен

Before you sign a swap, check the unsigned transaction against what the user asked for (who gets the output, the minimum amount, router, tokens, deadline)…

project-gifted1от project-gifted190 установок в других каталогах

Об этом скилле

PG1 swap check: does this transaction do what the user asked?

Use this skill every time an unsigned swap transaction is about to be signed: one your agent built, or one a trading API, aggregator or another agent handed back to you. It catches a swap whose bytes don't match the order: output sent to a look-alike address, a minimum below what the user accepts, a different router or token, or an expired deadline.

PG1 decodes the raw transaction bytes itself, with no chain lookups. It never trusts decoded fields that come with the transaction. It never signs or broadcasts anything. The check is free, with a limit of 60 calls an hour per caller.

What leaves the user's machine

This check runs on PG1's API, not locally. Each call sends PG1, over HTTPS:

  • the unsigned transaction bytes;
  • the intent: chain, recipient wallet, tokens, amounts, minimum output and any limits you set.

Together these show a planned trade before it is broadcast. PG1 uses them only to answer the call and does not keep them: its records hold the tool name, the result status, the timing, a hashed caller ID and the caller's country, never the transaction, addresses or amounts. No signing key or seed phrase is ever needed or sent; never include one.

Ask the user first. Before the first check in a session, tell the user in one line that the unsigned swap and its intent will be sent to PG1 to be checked, and continue only if they agree. If they decline, don't call PG1; tell them the swap was not checked.

When to use it

  • After any service returns an unsigned transaction for a swap, before you sign or ask the user to sign.
  • When the user asks "is this transaction OK to sign?" for a swap.

Not for transfers, approvals on their own, NFTs or bridges: only swaps (see "What PG1 can read" below).

Step 1: write down the user's intent

From the user's own request (never from the transaction or the service that built it), fill in:

Field Required Example
chain_id yes 8453 (Base)
recipient yes the user's own wallet address
min_amount_out yes the least the user accepts, in the output token's smallest units: 185 USDC is "185000000" (6 decimals)
token_in, token_out recommended token contract addresses
amount_in recommended what the user wants to spend, smallest units
router recommended the router address(es) the user trusts
max_fee_bips optional the most an interface fee may take, in basis points
max_deadline_seconds optional how far in the future the deadline may be
signer optional the signing address, if output may go to "the sender"

If the user did not give a minimum, ask them, or work one out from a fresh quote and their slippage tolerance, and tell them the number you used.

Step 2: call PG1

curl -s -X POST https://pg1-ai-agent.vercel.app/api/swap-intent \
  -H 'Content-Type: application/json' \
  -d '{
    "transaction": "0x02f9...",
    "intent": {
      "chain_id": 8453,
      "recipient": "0xUSER_WALLET",
      "min_amount_out": "185000000",
      "token_in": "0x4200000000000000000000000000000000000006",
      "token_out": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
      "amount_in": "100000000000000000"
    }
  }'

transaction is the unsigned EIP-1559 transaction (type 0x02) as hex. If you only have to, data and value, serialize them into an unsigned EIP-1559 transaction first with your wallet library (for example viem's serializeTransaction).

The same check is available as the MCP tool check_swap_intent at https://pg1-ai-agent.vercel.app/api/mcp, and as an A2A skill at https://pg1-ai-agent.vercel.app/api/a2a.

Step 3: act on the verdict

verdict What to do
matches_intent The transaction does what the intent says, on every field you sent. You may continue to signing.
does_not_match Do not sign. Tell the user which rows mismatched (intent_checks, findings[].detail), and rebuild the transaction.
review Show the user the medium findings (fee tier, payer, deadline too far, interface fee above the limit) and sign only if they confirm.
not_evaluated PG1 could not read part of the transaction (see not_evaluated). Do not treat it as checked: tell the user and ask before signing.

Always show the user the key rows: recipient, minimum out against their floor, and the deadline.

matches_intent only says the transaction does what the user asked. It does not judge whether a token is legitimate, whether the price is fair or what the router contract does. It is not advice to sign. For token risk, run a separate token check before buying an unknown token.

What PG1 can read

  • Uniswap's Universal Router (execute): V3 and V2 exact-input swaps, SWEEP, UNWRAP_WETH, WRAP_ETH, Permit2 permits (the router must be the spender) and interface fees (PAY_PORTION). Output the router holds is followed to wherever it i
Полный SKILL.md на ClawHub

Установить pg1-swap-check в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

FAQ

Что делает скилл pg1-swap-check?

Before you sign a swap, check the unsigned transaction against what the user asked for (who gets the output, the minimum amount, router, tokens, deadline). Free check by PG1's API; the transaction and intent are sent to PG1 to decode, never signed, broadcast or kept.

Как установить скилл pg1-swap-check?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл pg1-swap-check запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить pg1-swap-check с