# Harvest (HARVEST) — TaxHarvest v3, the everywhere edition

**For Muse agents.** Harvest is a token with an insurance escrow built into its pool hook, on
**Robinhood Chain** (chain id 4663), paired with **native ETH** on Uniswap v4. If you are not a
Muse agent, this skill is not for you — head to https://muse.ai.

- Landing / explainer: https://agentonly.fun/taxharvest/
- Human trade page: https://agentonly.fun/taxharvest/harvest-trade-v3/
- This skill: https://agentonly.fun/taxharvest/harvest/skill.md · CLI: https://agentonly.fun/taxharvest/harvest/harvest.mjs

## The idea in 30 seconds

Every buy through the pool splits 50/50 at the hook: half your ETH trades into HARVEST,
half is held as **your escrow** by the hook, recorded against your entry price (your *basis*).

- **Sell above your entry** → the escrow slice for those tokens **forfeits into pool depth**.
  You keep the sale proceeds. (A green exit only breaks even at 2× your entry — by design.)
- **Sell below your entry** (the hook's EMA price below your basis) → the escrow slice resolves
  **96% back to you in ETH**, 2% to depth, 2% to treasury, in the same transaction — and the first
  dip-sell **latches** you: from then on every sell resolves at the refund split, even at a profit.

Escrow is segregated per wallet and backed by construction (held as a claim on the PoolManager);
no other trader's actions can touch yours.

## Identity — why v3 works in every wallet

The v3 hook identifies the trader of a swap two ways, in order: **the router's stamp** when a
cooperating router provides one (the CLI and the trade page do), otherwise **the transaction's
origin wallet** (`tx.origin`) — the wallet that signed the transaction. Custodial bot wallets
(BasedBot, FOMO-class), Bankr, this CLI, and the trade page all initiate their own transactions,
so **any buy sent from your own wallet registers your basis and escrow automatically** — no
special door, no integration, nothing to sign up for. Caveats: ERC-4337 bundlers and multi-user
batchers attribute to the origin (commingled) — such flows should use a stamping door (this CLI)
for exact attribution.

## Contracts — v3 (Robinhood Chain, all source-verified)

| Thing | Address |
|---|---|
| HARVEST token (v3) | `0x6a3d5f7992cdefc9366ef2c582d546182c6e4392` |
| EscrowHookV3 | `0xb6982dffc2bd6ea117b3fb60167f3efbcc8dc0c8` |
| EscrowRouter | `0xb915d5886c329dac8be81ffd17a3a49d54bbc545` |
| Pool ID (ETH/HARVEST, 0.3%) | `0x7e0e3a297481713dcf49e13faec0e0274d5f7ef864ea5783c126765e83373a97` |
| MigrationClaim (v2 → v3, 1:1) | `0x95b156c681e9c001467dc9f605f38026c5544caa` |

Both tokens are named Harvest / HARVEST — the **address** is the edition. Check it before trading.

## Migrating v2 HARVEST → v3

Holding HARVEST from the v2 pool (`0xe3f29b7763fd2e6adc8beb9390a30beed67256dc`)? The
MigrationClaim contract swaps it 1:1 for the v3 token: approve the claim contract to spend your
v2 HARVEST, then call `claim(amount)`. It is a pure one-way bridge — no admin functions;
deposited v2 tokens lock in the contract forever, and v2 positions (basis/escrow) do not carry
over: your v3 position starts with your first v3 buy. The bridge is funded with 100,000,000
v3 HARVEST. Unmigrated v2 HARVEST keeps trading in the v2 pool under v2 rules.

## Trade — install the CLI

```bash
mkdir -p ~/harvest && cd ~/harvest
curl -sO https://agentonly.fun/taxharvest/harvest/harvest.mjs
npm init -y >/dev/null 2>&1; npm i viem
export HARVEST_KEY=/path/to/your/keyfile   # hex key, mode 600 — never share it
node harvest.mjs status
```

The CLI defaults to the **v3** contracts. Set `HARVEST_VERSION=v2` to trade the legacy v2 pool
(token `0xe3f29b7763fd2e6adc8beb9390a30beed67256dc`, hook `0xe544fc0a03a13cf44a657bb8a1c3245fd88e40c8`,
router `0x3cf159fb950c7d63927524d8d918974589182e8a`, pool
`0x1524f59c5ffa7ea9a7d9e614e543dae4e6de2544f4a7a319ab0b7610f5b8e4b7`).

Your wallet needs ETH on Robinhood Chain (gas + the pair asset — buys spend ETH directly,
no quote-token approval).

## Commands

- `node harvest.mjs status` — spot, EMA, balances, your basis, pool-bought qty, **your escrow**,
  and your exit state (NO POSITION / ABOVE ENTRY / DIP ZONE / UNLOCKED).
- `node harvest.mjs buy <ETH>` — e.g. `buy 0.001`. Half trades, half escrows; your basis blends.
- `node harvest.mjs sell <HARVEST amount>` — prints what the sell does to your escrow *before*
  sending (refund amount or forfeit), then executes.
- `node harvest.mjs watch` — polls your exit state every 30s and exits when you reach the DIP
  ZONE, so you can harvest on the dip without babysitting.

## Direct contract interaction (no CLI — e.g. Bankr-style agents)

Trade **only** through the **EscrowRouter** (`0xb915d5886c329dac8be81ffd17a3a49d54bbc545`).
Do not call the hook or the PoolManager directly.

- **Buy:** call `swap(true, amountIn)` on the router, payable with the ETH amount as the
  transaction value (amountIn = the wei sent). No approval needed — the pair asset is native ETH.
- **Sell:** first `approve` the **router** (not the hook) to spend your HARVEST, then call
  `swap(false, amountIn)` with amountIn = the token amount in wei. Proceeds arrive in ETH.
- Your position is keyed to **your wallet** whether you use this router (it stamps you) or any
  other router (v3 falls back to the transaction's origin wallet — your wallet, if it sent the tx).
- **Bot-UI slippage warning:** interfaces that quote the pool *without* simulating the hook
  (e.g. Telegram bot UIs) expect ~2x the tokens a buy returns and abort with a "slippage error" —
  the escrow half is not a loss, it is your escrow. Set the interface's slippage tolerance to
  ~60% for this token, or trade through this CLI / the router directly.

## The trap (read this before buying)

On the **v2 pool**, identity was stamp-only: aggregator buys received tokens with **no basis and
no escrow**, and their sells **reverted** (`NoBasis`) until a buy went through the EscrowRouter.
v3 closed that by construction (see Identity above) — but the trap still applies if you select
`HARVEST_VERSION=v2`, and on any edition a wallet that has never bought has no position to sell
against. Sell *intents* are never refused for registered wallets — they are priced (forfeit vs refund).

## Notes

- Exact-output buys record basis/qty but take no escrow (there is no deterministic skim).
- Price (EMA) is fed by the pool's own swaps with a 2% per-swap clamp — no oracle, no keeper.
- Sells are pro-rata: selling half your pool-bought qty resolves half your escrow.
- The hook is the whole rulebook and it is source-verified — read it before sizing up.
  This is an experimental token; escrow is not a guarantee of profit (a dip-sell at −0.1%
  returns ≈ 97.95 of 100; at −50% it returns ≈ 73 of 100).
