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
2 changes: 1 addition & 1 deletion skills/zerion-somnia-blockchain/SKILL.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
name: somnia-blockchain
name: zerion-somnia-blockchain
description: Comprehensive Somnia blockchain knowledge — network info, unique features, gas model, and deployment guidance for building on Somnia
---

Expand Down
2 changes: 1 addition & 1 deletion skills/zerion-somnia-reactivity/SKILL.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
name: somnia-reactivity
name: zerion-somnia-reactivity
description: Deep-dive reference for Somnia Reactivity — the native event-driven pub/sub system. Covers off-chain WebSocket subscriptions, on-chain Solidity handlers, subscription creation from both TypeScript and Solidity, gas configuration, system events (BlockTick/Schedule), and troubleshooting. Use when the user is building reactive dApps, creating subscriptions, writing handler contracts, or debugging reactivity issues.
---

Expand Down
71 changes: 71 additions & 0 deletions skills/zerion-uniswap-lp/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
---
name: zerion-uniswap-lp
description: >
Plan Uniswap v4 LP positions using Zerion CLI portfolio data and PnL to size
exposure correctly before deploying capital via the Uniswap /liquidity-planner skill.
license: MIT
---

# Uniswap LP Planning with Portfolio Context

**Purpose:** Use Zerion CLI to assess current exposure and PnL before sizing a Uniswap LP position with `/liquidity-planner`, so the agent deploys capital with full portfolio context.

## Key Commands

**Uniswap skill (invoke in agent context):**
- `/liquidity-planner` — plans LP positions and generates Uniswap interface deep links

**Zerion CLI (shell):**
- `zerion positions <address>` — current token and DeFi positions by chain
- `zerion pnl <address>` — profit and loss per wallet and per asset
- `zerion portfolio <address>` — total portfolio value and top holdings
- `zerion bridge <from-chain> <from-token> <amount> <to-chain> <to-token>` — move capital to the target chain for LP deployment

## Requirements

- Uniswap AI skills: `npx skills add Uniswap/uniswap-ai`
- Zerion CLI: `npx -y zerion-cli init -y --browser`
- Zerion API key: `export ZERION_API_KEY="zk_..."`

## Workflow

### 1. Check current positions across all chains
```bash
zerion positions $WALLET
```
Understand what the agent already holds and where, so LP sizing doesn't over-concentrate exposure.

### 2. Review PnL before committing capital
```bash
zerion pnl $WALLET
```
Check unrealized gains and losses per asset. Avoid deploying into a pool with an asset already deep in loss.

### 3. Confirm total portfolio value
```bash
zerion portfolio $WALLET
```
Validate the proportion of total portfolio the intended LP position represents.

### 4. Bridge capital to the target chain if needed
```bash
zerion bridge ethereum ETH 1 base ETH --cheapest
```
Move tokens to the chain where the LP pool lives before planning. Signature: `zerion bridge <from-chain> <from-token> <amount> <to-chain> <to-token>`.

### 5. Plan the LP position
Invoke the Uniswap skill in your agent context:
```
/liquidity-planner
```
The skill generates the LP position plan and interface deep link based on your inputs (pool, fee tier, range).

## Common Blockers

- **LP size too large relative to portfolio** — re-check `zerion portfolio` and reduce the intended deposit amount
- **Capital on wrong chain** — `zerion positions` shows chain breakdown; bridge first with `zerion bridge` before planning
- **Asset already at a loss** — `zerion pnl` will surface this; consider whether IL risk compounds an existing losing position

## Related Skills

- **zerion-uniswap-x402** — pay x402 HTTP 402 challenges with cross-chain funding via Zerion CLI
113 changes: 113 additions & 0 deletions skills/zerion-uniswap-x402/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
---
name: zerion-uniswap-x402
description: >
Pay HTTP 402 (x402) payment challenges using any token via Uniswap swaps,
with Zerion CLI handling cross-chain balance checks and optional bridging beforehand.
license: MIT
---

# Uniswap x402 Payments with Cross-Chain Funding

**Purpose:** Use Zerion CLI to verify and optionally position capital across chains, then pay x402 HTTP 402 challenges in any token using the Uniswap `/pay-with-any-token` skill.

> **Scope:** This skill covers x402 only. MPP/Tempo is out of scope.

## Key Commands

**Uniswap skill (invoke in agent context):**
- `/pay-with-any-token` — pays an x402 HTTP 402 challenge by swapping tokens via Uniswap

**Zerion CLI (shell):**
- `zerion positions <address>` — check token balances by chain
- `zerion bridge <token> <chain> <amount> --to-address <address> --cheapest` — optionally pre-position capital to the signing wallet
- `zerion portfolio <address>` — verify balance before paying

## Requirements

- Uniswap AI skills: `npx skills add Uniswap/uniswap-ai`
- Zerion CLI: `npx -y zerion-cli init -y --browser`
- Zerion API key: `export ZERION_API_KEY="zk_..."`
- Uniswap API key: `export UNISWAP_API_KEY="..."`
- `cast` (Foundry): `curl -L https://foundry.paradigm.xyz | bash && foundryup`
- `jq`: `brew install jq` / `apt install jq`
- An x402-compatible endpoint to pay (see [x402 docs](https://x402.org))

## Wallet Setup

> **Critical:** `/pay-with-any-token` signs EIP-3009 using the wallet referenced by your keystore or `PRIVATE_KEY` env var. Zerion CLI manages its own wallet separately. For the flow to work end-to-end, both must point to the same key.

**Import your EVM key into Zerion CLI:**
```bash
zerion wallet import --evm-key
```

**Import the same key into cast (recommended — encrypted keystore, no plaintext in env):**
```bash
cast wallet import <name> --interactive
```
Zerion CLI encrypts keys via OpenWallet. Using cast keystore keeps both layers encrypted and avoids exposing a raw key in the environment.

If using `PRIVATE_KEY` directly instead:
```bash
export PRIVATE_KEY=0x... # plaintext — only use in trusted environments
```

Set your signing wallet address:
```bash
export WALLET=<your-evm-address>
```

## Workflow

### 1. Check agent wallet balances by chain
```bash
zerion positions $WALLET
```
Identify which chain holds sufficient liquidity. If balance is sufficient on the target chain, skip to step 4 — `/pay-with-any-token` will source funds itself.

### 2. (Optional) Pre-position capital with Zerion CLI

Two paths — choose one:

**Path A — Pre-bridge with Zerion CLI:**
```bash
zerion bridge USDC base 50 --to-address $WALLET --cheapest
```
Funds land in the signing wallet on the target chain. Use `--cheapest` to minimise bridge fees.

**Path B — Skip the bridge:**
Let `/pay-with-any-token` handle funding via its internal phase 4a/4b sourcing. No Zerion bridge step needed.

> If you pre-bridge (Path A), the trading API funding phase does not run. If you skip (Path B), `/pay-with-any-token` sources funds itself. Both paths work — pre-bridging gives you explicit control; skipping is simpler if funds are already available.

### 3. Verify balance (Path A only)
```bash
zerion portfolio $WALLET
```
Confirm the bridge completed and the target chain balance is sufficient before proceeding.

### 4. Pay the x402 challenge
Invoke the Uniswap skill in your agent context:
```
/pay-with-any-token
```
The skill handles token selection, swap routing, EIP-3009 signing, and payment submission.

## Reference Behavior

Validate end-to-end behavior against:
[`evals/suites/pay-with-any-token/cases/x402-detection-probe.md`](https://github.com/Uniswap/uniswap-ai/blob/main/evals/suites/pay-with-any-token/cases/x402-detection-probe.md)

Future changes on either side should be tested against this eval case.

## Common Blockers

- **Two separate wallets** — most common failure. Ensure `zerion wallet import --evm-key` and your cast keystore or `PRIVATE_KEY` all reference the same key
- **Insufficient balance after bridge** — bridges can take 1–3 minutes; re-run `zerion portfolio $WALLET` to confirm arrival before invoking `/pay-with-any-token`
- **Wrong chain** — `zerion positions` shows balances per chain; ensure the signing wallet holds funds on the chain the x402 endpoint requires
- **Bridge tx pending** — run `zerion history $WALLET` to check bridge transaction status
- **Missing `jq` or `cast`** — `/pay-with-any-token` requires both; install before running

## Related Skills

- **zerion-uniswap-lp** — plan Uniswap LP positions using Zerion CLI portfolio context
Loading