# shit.cash · agent instructions

You are buying one share of $SHIT on BNB Chain for your user.
Payment is x402 v2 (`exact` scheme, `eip3009`) in U, signed with a **Binance Agentic Wallet** (CLI `baw`).
The payment, the delivery of the tokens and the pool deposit all happen **in one transaction**:
your U can't be taken without the tokens arriving in the same transaction.

## Facts (live, read at 2026-10-30T04:52:55.296Z)

| | |
|---|---|
| Network | `eip155:56` |
| payTo (sale contract, also the Uniswap v4 hook) | `0x17F5104aCDa9c778aD564920Ef11d9223fF42069` |
| Pay token (U, 18 decimals) | `0xcE24439F2D9C6a2289F741120FE202248B666666` |
| Token | `0x97736ba46da1a14C50EB29805b4984C500842069` ($SHIT) |
| Price | exactly **20 U** per payment, for **1 $SHIT** |
| Shares left | 19581 |
| Open now | yes |

## Eligibility

Your Agentic Wallet must hold a SPACE ID `.ai` name; the contract checks it on-chain for every purchase. Use your AW's **EVM** address. It must hold at least 20 U.

## Rules that protect your user's quota

- An Agentic Wallet has an x402 limit of **20 USD per day** by default — one purchase here uses all of it.
  **Signing consumes the quota even if the payment is never settled.** Never sign unless step 1 returned `402`.
- Sign once per quote. If the payment fails, request a new quote before signing again; don't loop.
- Signatures are valid for **120 seconds**. Submit immediately after signing.
- Re-sending the **same** `PAYMENT-SIGNATURE` is safe: it returns the original result and never pays twice.

## Steps

**1. Check and get a quote.**

```
GET https://shit.cash/api/buy?payer=<AW_EVM_ADDRESS>
```

- `402`: you are eligible. Take the `PAYMENT-REQUIRED` response header (base64). Continue.
- Any other status: **stop, do not sign.** Report `error.code` to the user (table below).

To check without getting a quote: `GET https://shit.cash/api/quote?payer=<AW_EVM_ADDRESS>`.

**2. Preview** (does not sign, does not use quota):

```
baw x402-payment preview --paymentRequirements "<PAYMENT-REQUIRED header value>" --json
```

Pick the option whose `status` is `READY_TO_SIGN`, whose `tokenAddress` is `0xcE24439F2D9C6a2289F741120FE202248B666666` and whose `payTo` is `0x17F5104aCDa9c778aD564920Ef11d9223fF42069`.
If no option is `READY_TO_SIGN`, stop and tell the user why.

**3. Sign.** `--selectedIndex` is that option's own `index` field, not its position in the array:

```
baw x402-payment sign --paymentId <paymentId> --selectedIndex <option.index> --json
```

**4. Pay** with `paymentHeaderValue` from step 3:

```
POST https://shit.cash/api/buy
PAYMENT-SIGNATURE: <paymentHeaderValue>
```

- `200`: bought. Body has `paid`, `tokensOut`, `transaction`; the `PAYMENT-RESPONSE` header carries the x402 settlement.
- `202`: submitted, not confirmed yet (the relayer retries on its own until your signature expires). Re-send the same request after a few seconds.
- `402` with `error`: the payment was **not** taken. The body already holds a fresh quote; you may go back to step 2 **once**.
- other `4xx`/`5xx` with `error.code`: stop and report.

## Where your 20 U goes

It goes into the $SHIT/U Uniswap v4 pool in the same transaction, together with a matching share from the sale contract.
If a share trades above 20 U the sale contract sells into the pool first; below, it buys — the price keeps getting pulled back to 20 U.
A small remainder that doesn't fit the pool ratio, plus the 1% fees outside traders pay, go to a separate treasury wallet.
Every sale makes the pool deeper. After you hold $SHIT you can sell it on Uniswap v4 (pool `0xec1f9879f3935b0a3ca0fcf07f78d027ddf0e2eb61ec4ec3ac2830095250ee84`, 1% fee) like any token.

## Before you buy

- 20 U is a soft **ceiling**, not a floor. Below 20 U sales stop and nothing supports the price.
- Spot value of one share right now: 5.768354588062064442 U. If it is below 20 U, buying in the pool is cheaper than buying here.

## Error codes

| Code | Meaning | What to do |
|---|---|---|
| `NOT_AGENT_WALLET` | payer hasn't claimed a `.ai` name | stop; claim a `.ai` with the Agentic Wallet first |
| `INSUFFICIENT_U` | payer holds less than 20 U | stop; top up U first |
| `SOLD_OUT` | all shares are gone | stop; trade on Uniswap v4 instead |
| `PAUSED` / `NOT_OPEN` | sale paused / pool not opened yet | stop; try later |
| `EXPIRING` / `NOT_YET_VALID` | signature too close to expiry / clock skew | re-quote and sign again, once |
| `INVALID_SIGNATURE`, `PAYMENT_MISMATCH`, `INVALID_PAYLOAD`, `UNSUPPORTED_VERSION` | payment doesn't match the quote | re-quote; never edit the signed payload |
| `SIMULATION_FAILED` | the on-chain check rejected it; nothing was charged | re-quote once; if it fails again, stop and report |
| `QUEUE_FULL` | too many payments in flight; nothing was charged | wait a minute, re-quote |
| `AUTH_USED_ELSEWHERE` | that authorization nonce was spent on a payment to someone else | nothing was paid here; re-quote and sign a fresh one |
| `NEEDS_REVIEW` | your payment arrived but delivery hasn't confirmed yet; it is retried automatically every minute | stop, re-send the same request later; do not pay again |
