diff --git a/skills/SKILL.md b/skills/SKILL.md index 018814c..77e515f 100644 --- a/skills/SKILL.md +++ b/skills/SKILL.md @@ -140,8 +140,8 @@ polygon-agent agent feedback --agent-id --value [--tag1 ] [--tag - **Smart defaults** — `--wallet main`, `--chain polygon`, auto-wait on `wallet create` - **`balances --chains`** — comma-separated chains (max 20); two or more return JSON with `multiChain: true` and a `chains` array (same wallet address on each) - **Fee preference** — auto-selects USDC over native POL when both available -- **`fund`** — reads `walletAddress` from the wallet session and sets it as `toAddress` in the Trails widget URL. Always run `polygon-agent fund` to get the correct URL — never construct it manually or hardcode any address. -- **`deposit`** — picks highest-TVL pool via Trails `getEarnPools`. Sends two txs: ERC-20 `approve()` on the token contract, then the pool deposit. If session rejects, re-create wallet with both `--contract --contract ` (the dry-run output shows both addresses). +- **`fund`** — returns `https://wallet.polygon.technology` as the `fundingUrl`. Always run `polygon-agent fund` to get the URL and wallet address — never hardcode or construct manually. +- **`deposit`** — picks highest-TVL pool via Trails `getEarnPools` and deposits directly. If the session rejects the call, re-create the wallet with `--contract --contract ` (the dry-run output shows both addresses). Full deposit reference: https://agentconnect.polygon.technology/polygon-defi/SKILL.md - **`withdraw`** — `--position` = aToken or ERC-4626 vault; `--amount` = `max` or underlying units (Aave / vault). Dry-run JSON includes `poolAddress` / `vault`. Broadcast needs session on the **same chain** as `--chain`, with pool/vault + underlying token whitelisted where the relayer touches them - **`x402-pay`** — probes endpoint for 402, smart wallet funds builder EOA with exact token amount, EOA signs EIP-3009 payment. Chain auto-detected from 402 response - **`send-native --direct`** — bypasses ValueForwarder contract for direct EOA transfer diff --git a/skills/polygon-defi/SKILL.md b/skills/polygon-defi/SKILL.md index fd4cfe5..3aee20f 100644 --- a/skills/polygon-defi/SKILL.md +++ b/skills/polygon-defi/SKILL.md @@ -110,6 +110,21 @@ Pool discovery uses `TrailsApi.getEarnPools` — picks the most liquid pool (hig **Gas requirement:** The wallet needs POL for gas, or a session created with `--usdc-limit` to enable USDC paymaster. If the wallet has no POL, create the session with `--usdc-limit 5`. When USDC paymaster is active and the deposit amount would consume the full balance, the CLI auto-reserves 0.05 USDC for gas and prints a note. +**Session setup:** The wallet session must whitelist the token contract and the pool deposit contract, or the relay will reject the transaction with a 400 error. Run a dry-run first to get the exact addresses, then create (or re-create) the session with both contracts: + +```bash +# 1. Dry-run to discover the token address and pool depositAddress +polygon-agent deposit --asset USDC --amount 1 + +# 2. Create session with those contracts whitelisted (prevents 400 permission error on broadcast) +polygon-agent wallet create --usdc-limit 5 --contract --contract + +# 3. Broadcast +polygon-agent deposit --asset USDC --amount 1 --broadcast +``` + +Omitting `--contract` for the deposit pool is the most common cause of a "Request aborted" (code 1005) error on broadcast. + ```bash # Dry-run — shows pool name, APY, TVL, and deposit address before committing polygon-agent deposit --asset USDC --amount 0.3 @@ -152,7 +167,7 @@ Whitelist the **pool** (Aave) or **vault** contract on the session if the wallet ### Session Whitelisting -A deposit sends **two transactions**: an ERC-20 `approve()` on the token contract, then the pool deposit call. Both contracts must be whitelisted in the session. If the deposit is rejected with a session permission error: +If the deposit is rejected with a session permission error, both the token contract and the pool deposit contract must be whitelisted in the session: ```bash # 1. Dry-run first — output includes both addresses under `transactions[0].to` (token) and `depositAddress` (pool)