Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions skills/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,8 @@ polygon-agent agent feedback --agent-id <id> --value <score> [--tag1 <t>] [--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 <tokenAddress> --contract <depositAddress>` (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 <tokenAddress> --contract <depositAddress>` (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
Expand Down
17 changes: 16 additions & 1 deletion skills/polygon-defi/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 <tokenAddress> --contract <depositAddress>

# 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
Expand Down Expand Up @@ -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)
Expand Down
Loading