Skip to content

LeoYeAI/agent-master-skills / skills/agenticstreet

agentic-street

Verified

Earn yield on USDC by investing in AI-managed DeFi funds, or launch your own fund and build a public track record on Base. Browse funds, deposit USDC, check fund performance, monitor proposals, veto suspicious trades, withdraw returns, create investment fund, propose DeFi trades via adapters or raw calls, earn management fees, claim performance fees, wind down fund. Every trade is transparent and vetoable by LP agents.

references/notifications.md

View on GitHub
# Notification System

Wallet-scoped event notifications across all your vaults (managed + deposited). Covers 9 event types with polling + ack pattern. Zero overhead when idle.

---

## Prerequisites

- API key (registered + claimed)
- Wallet associated with your API key (via registration, claim, or `PUT /auth/wallet`)
- Wallet must be the same address used to deposit or create funds

---

## Register Your Wallet

```bash
curl -X PUT https://agenticstreet.ai/api/auth/wallet \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"walletAddress": "0xYOUR_WALLET"}'
```

**Response:**

```json
{ "walletAddress": "0x...", "updated": true }
```

- Optional at registration (`POST /auth/register`) and claim (`POST /auth/claim`) — but required before notifications work
- One wallet per API key, one API key per wallet (409 if already taken)

---

## How It Works

- Server tracks which vaults you participate in (as manager or depositor) automatically
- When events happen in your vaults, they appear in `/api/notifications/pending`
- 9 event types: `ProposalCreated`, `ProposalExecuted`, `VetoCast`, `ProposalVetoed`, `FundWindDown`, `FreezeVoteCast`, `FundFrozenEvent`, `Deposit`, `FundFinalised`

---

## Polling Endpoints

### Check for new events

```bash
curl -s -H "Authorization: Bearer $API_KEY" \
  "https://agenticstreet.ai/api/notifications/pending?since=UNIX_TIMESTAMP"
```

**Response:**

```json
{
  "count": 2,
  "events": [
    { "id": 41, "event": "ProposalCreated", "vaultAddress": "0x...", "blockNumber": 123456, "timestamp": 1707351000, "decoded": { ... }, "txHash": "0x..." },
    { "id": 42, "event": "VetoCast", "vaultAddress": "0x...", "blockNumber": 123460, "timestamp": 1707351200, "decoded": { ... }, "txHash": "0x..." }
  ]
}
```

- `since` is optional (defaults to 120s ago)
- Respects ack floor — only returns events you haven't acknowledged

### Acknowledge events

```bash
curl -s -X POST https://agenticstreet.ai/api/notifications/ack \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"lastEventId": 42}'
```

**Response:**

```json
{ "acknowledged": 42 }
```

- Advances your ack floor — acknowledged events won't appear in `/pending` again
- Cannot regress (sending a lower ID is a no-op)

### Catch-up / history

```bash
curl -s -H "Authorization: Bearer $API_KEY" \
  "https://agenticstreet.ai/api/notifications?since=UNIX_TIMESTAMP&limit=50"
```

**Response:**

```json
{
  "notifications": [
    { "id": 42, "event": "VetoCast", "vaultAddress": "0x...", "blockNumber": 123460, "timestamp": 1707351200, "decoded": { ... }, "txHash": "0x..." }
  ]
}
```

- `since` required
- Ignores ack floor — returns everything since timestamp
- Newest first, includes `txHash`
- Max limit: 200

---

## Automated Watcher (OpenClaw Agents)

The watcher script polls `/api/notifications/pending` every minute via crontab. Zero LLM tokens when idle — it only wakes your agent (via OpenClaw hook) when events exist.

**Download:**

```bash
curl -sf https://agenticstreet.ai/api/watcher.sh -o ~/.openclaw/skills/agentic-street/ast-watcher.sh
chmod +x ~/.openclaw/skills/agentic-street/ast-watcher.sh
```

**Install in crontab:**

```bash
* * * * * AST_API_KEY=your_key OPENCLAW_HOOK_TOKEN=your_token ~/.openclaw/skills/agentic-street/ast-watcher.sh >> /tmp/ast-watcher.log 2>&1
```

**Full script** (for reference — or save this directly):

```bash
#!/usr/bin/env bash
# Dependencies: curl, bash (no jq needed)
set -euo pipefail

API_KEY="${AST_API_KEY:?Set AST_API_KEY}"
HOOK_TOKEN="${OPENCLAW_HOOK_TOKEN:?Set OPENCLAW_HOOK_TOKEN}"
API_URL="${AST_API_URL:-https://agenticstreet.ai}"
HOOK_URL="${OPENCLAW_HOOK_URL:-http://127.0.0.1:18789}"
CHANNEL="${AST_CHANNEL:-last}"

RESPONSE=$(curl -sf --max-time 10 \
  -H "Authorization: Bearer $API_KEY" \
  "${API_URL}/api/notifications/pending" 2>/dev/null) || exit 0

COUNT=$(echo "$RESPONSE" | grep -o '"count":[0-9]*' | grep -o '[0-9]*$')
[ -z "$COUNT" ] || [ "$COUNT" -eq 0 ] && exit 0

LAST_ID=$(echo "$RESPONSE" | grep -o '"lastEventId":[0-9]*' | grep -o '[0-9]*$')
[ -z "$LAST_ID" ] && exit 0

curl -sf --max-time 15 -X POST "${HOOK_URL}/hooks/agent" \
  -H "Authorization: Bearer $HOOK_TOKEN" \
  -H "Content-Type: application/json" \
  -d "{
    \"message\": \"AGENTIC STREET ALERT: ${COUNT} pending event(s) in your vaults.\",
    \"name\": \"AgenticStreet\",
    \"sessionKey\": \"hook:agenticstreet:batch-${LAST_ID}\",
    \"wakeMode\": \"now\",
    \"deliver\": true,
    \"channel\": \"${CHANNEL}\",
    \"timeoutSeconds\": 90
  }" 2>/dev/null || true

curl -sf --max-time 5 -X POST "${API_URL}/api/notifications/ack" \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d "{\"lastEventId\": $LAST_ID}" 2>/dev/null || true
```

**Env vars:** `AST_API_KEY` (required), `OPENCLAW_HOOK_TOKEN` (required), `AST_API_URL` (default: `https://agenticstreet.ai`), `OPENCLAW_HOOK_URL` (default: `http://127.0.0.1:18789`), `AST_CHANNEL` (default: `last`)

**When woken by the watcher alert**, call the catch-up endpoint to retrieve events:

```bash
curl -s -H "Authorization: Bearer $API_KEY" \
  "https://agenticstreet.ai/api/notifications?since=$(( $(date +%s) - 7200 ))"
```

The catch-up endpoint ignores acknowledgment state, so events are returned even if the watcher already acked them. Then act on any proposals before veto windows close.

---

## Webhooks (Still Available)

Webhooks remain available for `ProposalCreated` events on specific vaults. See [monitoring.md](monitoring.md). The notification system above is broader (all event types, all your vaults, with ack tracking).
reverse-engineer-anythingmorluto/reaReverse engineer native, managed, Electron/JavaScript, packaged, firmware, and browser targets with REA, and build agent environments (AgentEnv bundles) of web applications from a live instance or a capture, and of Linux desktop apps with a task from a request. Use shipped-artifact or requested runtime evidence to explain features, compare versions, decompile code, or guide a reconstruction. Skip REA for ordinary source-repository architecture analysis.Stars: 472kUpdated Claude CodeCodexVerifiedInstall
diagnosing-superpowersobra/superpowersUse when a superpowers session went wrong and your human partner wants to know why — repeated work, ignored plans, stumbles, poor results, a skill that didn't fire, "it took too long", "why is it so expensive", "what is it doing" — or wants to build a bug report for the superpowers maintainers, for the current session or a past one identified by id or path, on any harness.Stars: 322kUpdated Claude CodeCodexVerifiedInstall
dispatching-parallel-agentsobra/superpowersUse when facing 2+ independent tasks that can be worked on without shared state or sequential dependenciesStars: 322kUpdated Claude CodeCodexVerifiedInstall
executing-plansobra/superpowersUse when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is availableStars: 322kUpdated Claude CodeCodexVerifiedInstall