web3skill 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +127 -0
- package/dist/archives/web3-audit-orchestrator.skill +0 -0
- package/dist/archives/web3-audit-reporting.skill +0 -0
- package/dist/archives/web3-fuzzing-and-invariants.skill +0 -0
- package/dist/archives/web3-native-operator.skill +0 -0
- package/dist/archives/web3-repo-heuristics.skill +0 -0
- package/dist/archives/web3-research-and-market-intel.skill +0 -0
- package/dist/archives/web3-risk-gate.skill +0 -0
- package/dist/archives/web3-service-orchestrator.skill +0 -0
- package/dist/archives/web3-static-analysis-runner.skill +0 -0
- package/dist/archives/web3-trace-and-state-analysis.skill +0 -0
- package/dist/archives/web3-transaction-simulator.skill +0 -0
- package/dist/archives/web3-wallet-operator.skill +0 -0
- package/dist/manifest.json +170 -0
- package/dist/skills/web3-audit-orchestrator/SKILL.md +79 -0
- package/dist/skills/web3-audit-orchestrator/references/ADAPTER_CONSUMPTION_MAP.md +15 -0
- package/dist/skills/web3-audit-orchestrator/references/OUTPUT_TEMPLATE.md +52 -0
- package/dist/skills/web3-audit-orchestrator/references/REVIEW_STATE_MACHINE.md +25 -0
- package/dist/skills/web3-audit-orchestrator/scripts/render_audit_review.py +95 -0
- package/dist/skills/web3-audit-reporting/SKILL.md +77 -0
- package/dist/skills/web3-audit-reporting/references/FINDING_TEMPLATE.md +54 -0
- package/dist/skills/web3-audit-reporting/references/REPORT_TEMPLATE.md +58 -0
- package/dist/skills/web3-audit-reporting/references/RETEST_TEMPLATE.md +35 -0
- package/dist/skills/web3-audit-reporting/references/SEVERITY_RUBRIC.md +75 -0
- package/dist/skills/web3-fuzzing-and-invariants/SKILL.md +68 -0
- package/dist/skills/web3-fuzzing-and-invariants/references/ADAPTER_CONSUMPTION_MAP.md +14 -0
- package/dist/skills/web3-fuzzing-and-invariants/references/OUTPUT_TEMPLATE.md +40 -0
- package/dist/skills/web3-fuzzing-and-invariants/references/READINESS_AND_FAILURES.md +25 -0
- package/dist/skills/web3-fuzzing-and-invariants/scripts/render_fuzz_summary.py +64 -0
- package/dist/skills/web3-native-operator/SKILL.md +218 -0
- package/dist/skills/web3-native-operator/references/EXECUTION_BUNDLE_TEMPLATE.md +47 -0
- package/dist/skills/web3-native-operator/references/OPERATOR_BUNDLE_TEMPLATE.md +39 -0
- package/dist/skills/web3-native-operator/references/POSTTRADE_FOLLOWUP_BUNDLE_TEMPLATE.md +35 -0
- package/dist/skills/web3-native-operator/references/POSTTRADE_WATCH_TEMPLATE.md +34 -0
- package/dist/skills/web3-native-operator/references/PRETRADE_PACKET_TEMPLATE.md +34 -0
- package/dist/skills/web3-native-operator/references/ROUTE_RECIPES.md +140 -0
- package/dist/skills/web3-native-operator/references/ROUTING_STATE_MACHINE.md +73 -0
- package/dist/skills/web3-native-operator/references/WATCH_CRON_REQUEST_TEMPLATE.md +26 -0
- package/dist/skills/web3-native-operator/references/WATCH_FOLLOWUP_BUNDLE_TEMPLATE.md +35 -0
- package/dist/skills/web3-native-operator/references/WATCH_HEARTBEAT_TEMPLATE.md +31 -0
- package/dist/skills/web3-native-operator/scripts/apply_followup_bundle_to_heartbeat.py +118 -0
- package/dist/skills/web3-native-operator/scripts/render_execution_bundle.py +259 -0
- package/dist/skills/web3-native-operator/scripts/render_operator_bundle.py +800 -0
- package/dist/skills/web3-native-operator/scripts/render_posttrade_followup_bundle.py +118 -0
- package/dist/skills/web3-native-operator/scripts/render_posttrade_watch_status.py +125 -0
- package/dist/skills/web3-native-operator/scripts/render_pretrade_packet.py +205 -0
- package/dist/skills/web3-native-operator/scripts/render_watch_cron_request.py +88 -0
- package/dist/skills/web3-native-operator/scripts/render_watch_followup_bundle.py +118 -0
- package/dist/skills/web3-native-operator/scripts/render_watch_heartbeat.py +52 -0
- package/dist/skills/web3-repo-heuristics/SKILL.md +37 -0
- package/dist/skills/web3-repo-heuristics/references/FOUNDRY.md +49 -0
- package/dist/skills/web3-repo-heuristics/references/HARDHAT.md +47 -0
- package/dist/skills/web3-repo-heuristics/references/VYPER.md +26 -0
- package/dist/skills/web3-research-and-market-intel/SKILL.md +138 -0
- package/dist/skills/web3-research-and-market-intel/references/ADAPTER_CONSUMPTION_MAP.md +66 -0
- package/dist/skills/web3-research-and-market-intel/references/EVIDENCE_QUALITY.md +27 -0
- package/dist/skills/web3-research-and-market-intel/references/OUTPUT_TEMPLATE.md +37 -0
- package/dist/skills/web3-research-and-market-intel/references/PORTFOLIO_STATUS_TEMPLATE.md +51 -0
- package/dist/skills/web3-research-and-market-intel/references/WATCH_STATUS_TEMPLATE.md +39 -0
- package/dist/skills/web3-research-and-market-intel/scripts/render_portfolio_status.py +85 -0
- package/dist/skills/web3-research-and-market-intel/scripts/render_research_brief.py +58 -0
- package/dist/skills/web3-research-and-market-intel/scripts/render_watch_status.py +70 -0
- package/dist/skills/web3-risk-gate/SKILL.md +100 -0
- package/dist/skills/web3-risk-gate/references/OUTPUT_TEMPLATE.md +72 -0
- package/dist/skills/web3-risk-gate/references/SIGNAL_TAXONOMY.md +34 -0
- package/dist/skills/web3-risk-gate/scripts/merge_risk_gate_blocks.py +189 -0
- package/dist/skills/web3-service-orchestrator/SKILL.md +34 -0
- package/dist/skills/web3-static-analysis-runner/SKILL.md +76 -0
- package/dist/skills/web3-static-analysis-runner/references/ADAPTER_CONSUMPTION_MAP.md +13 -0
- package/dist/skills/web3-static-analysis-runner/references/OUTPUT_TEMPLATE.md +45 -0
- package/dist/skills/web3-static-analysis-runner/references/TRIAGE_BUCKETS.md +16 -0
- package/dist/skills/web3-static-analysis-runner/scripts/render_static_analysis_summary.py +64 -0
- package/dist/skills/web3-trace-and-state-analysis/SKILL.md +74 -0
- package/dist/skills/web3-trace-and-state-analysis/references/ADAPTER_CONSUMPTION_MAP.md +27 -0
- package/dist/skills/web3-trace-and-state-analysis/references/OUTPUT_TEMPLATE.md +63 -0
- package/dist/skills/web3-trace-and-state-analysis/references/TRACE_BACKEND_PREFLIGHT.md +47 -0
- package/dist/skills/web3-trace-and-state-analysis/scripts/render_trace_summary.py +99 -0
- package/dist/skills/web3-transaction-simulator/SKILL.md +83 -0
- package/dist/skills/web3-transaction-simulator/references/OUTPUT_TEMPLATE.md +86 -0
- package/dist/skills/web3-transaction-simulator/references/STATUS_AND_FAILURES.md +49 -0
- package/dist/skills/web3-transaction-simulator/scripts/merge_simulation_blocks.py +198 -0
- package/dist/skills/web3-wallet-operator/SKILL.md +52 -0
- package/dist/skills/web3-wallet-operator/references/ACTION_RECIPES.md +56 -0
- package/dist/skills/web3-wallet-operator/references/OUTPUT_TEMPLATE.md +43 -0
- package/dist/skills/web3-wallet-operator/scripts/render_wallet_operation_plan.py +101 -0
- package/index.js +50 -0
- package/package.json +36 -0
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""Render a stable HEARTBEAT.md task block from watch status fields."""
|
|
3
|
+
|
|
4
|
+
from __future__ import annotations
|
|
5
|
+
|
|
6
|
+
import argparse
|
|
7
|
+
import sys
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
def build_parser() -> argparse.ArgumentParser:
|
|
11
|
+
parser = argparse.ArgumentParser(description="Render a Web3 watch heartbeat block.")
|
|
12
|
+
parser.add_argument("--subject", required=True)
|
|
13
|
+
parser.add_argument("--watch-kind", required=True)
|
|
14
|
+
parser.add_argument("--status", required=True)
|
|
15
|
+
parser.add_argument("--severity", required=True)
|
|
16
|
+
parser.add_argument("--recommended-adapter", required=True)
|
|
17
|
+
parser.add_argument("--schedule-hint", default="")
|
|
18
|
+
parser.add_argument("--next-check-hint", default="")
|
|
19
|
+
parser.add_argument("--task-note", default="")
|
|
20
|
+
return parser
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
def build_heartbeat_task(args: argparse.Namespace) -> str:
|
|
24
|
+
status = getattr(args, "status", getattr(args, "watch_status", ""))
|
|
25
|
+
task = (
|
|
26
|
+
args.task_note
|
|
27
|
+
or (
|
|
28
|
+
f"Re-run {args.recommended_adapter} for {args.subject} on heartbeat and summarize any new evidence. "
|
|
29
|
+
"Escalate immediately if severity becomes high or critical."
|
|
30
|
+
)
|
|
31
|
+
)
|
|
32
|
+
lines = [
|
|
33
|
+
f"- [ ] Watch {args.subject}",
|
|
34
|
+
f" Task: {task}",
|
|
35
|
+
f" Watch Kind: {args.watch_kind}",
|
|
36
|
+
f" Status: {status}",
|
|
37
|
+
f" Severity: {args.severity}",
|
|
38
|
+
f" Adapter: {args.recommended_adapter}",
|
|
39
|
+
f" Schedule Hint: {args.schedule_hint or 'manual'}",
|
|
40
|
+
f" Next Check Hint: {args.next_check_hint or 'refresh on next heartbeat'}",
|
|
41
|
+
]
|
|
42
|
+
return "\n".join(lines)
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
def main() -> int:
|
|
46
|
+
args = build_parser().parse_args()
|
|
47
|
+
sys.stdout.write(build_heartbeat_task(args) + "\n")
|
|
48
|
+
return 0
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
if __name__ == "__main__":
|
|
52
|
+
raise SystemExit(main())
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: web3-repo-heuristics
|
|
3
|
+
description: Repository triage and execution heuristics for Solidity and Vyper codebases, with explicit support for Foundry, Hardhat, and mixed monorepos. Use when inspecting, modifying, testing, or auditing smart contract repositories and deployment scripts.
|
|
4
|
+
always: true
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Web3 Repo Heuristics
|
|
8
|
+
|
|
9
|
+
Use this skill to fingerprint the repository before editing or testing.
|
|
10
|
+
|
|
11
|
+
## Detection Order
|
|
12
|
+
|
|
13
|
+
1. Look for `foundry.toml`, `remappings.txt`, `lib/`, `src/`, `script/`, `test/`.
|
|
14
|
+
2. Look for `hardhat.config.*`, `package.json`, `contracts/`, `ignition/`, `deploy/`, `tasks/`, `test/`.
|
|
15
|
+
3. Look for Vyper signals such as `.vy` files, `pyproject.toml`, `requirements*.txt`, `ape-config.yaml`, or `brownie-config.yaml`.
|
|
16
|
+
4. If multiple stacks exist, map which stack is authoritative for build, test, deploy, and verification instead of assuming one toolchain owns everything.
|
|
17
|
+
|
|
18
|
+
## Read Order
|
|
19
|
+
|
|
20
|
+
- manifest and build config first
|
|
21
|
+
- dependency and remapping files second
|
|
22
|
+
- contracts and libraries third
|
|
23
|
+
- scripts and deployment paths fourth
|
|
24
|
+
- tests and invariants fifth
|
|
25
|
+
- artifacts or broadcasts last, as outputs rather than source of truth
|
|
26
|
+
|
|
27
|
+
## Command Selection
|
|
28
|
+
|
|
29
|
+
- For Foundry, read `references/FOUNDRY.md`.
|
|
30
|
+
- For Hardhat, read `references/HARDHAT.md`.
|
|
31
|
+
- For Vyper-oriented repos, read `references/VYPER.md`.
|
|
32
|
+
|
|
33
|
+
## Guardrails
|
|
34
|
+
|
|
35
|
+
- Do not edit generated artifacts unless the user explicitly asks for it.
|
|
36
|
+
- Prefer running the framework-native formatter and test commands before inventing custom shell glue.
|
|
37
|
+
- If compile targets or Solidity versions differ across packages, record that explicitly before patching.
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# Foundry Heuristics
|
|
2
|
+
|
|
3
|
+
## Primary Files
|
|
4
|
+
|
|
5
|
+
- `foundry.toml`
|
|
6
|
+
- `remappings.txt`
|
|
7
|
+
- `src/`
|
|
8
|
+
- `script/`
|
|
9
|
+
- `test/`
|
|
10
|
+
- `lib/`
|
|
11
|
+
- `broadcast/`
|
|
12
|
+
- `out/`
|
|
13
|
+
|
|
14
|
+
## Default Commands
|
|
15
|
+
|
|
16
|
+
- format:
|
|
17
|
+
- `forge fmt`
|
|
18
|
+
- build:
|
|
19
|
+
- `forge build`
|
|
20
|
+
- test:
|
|
21
|
+
- `forge test`
|
|
22
|
+
- focused test:
|
|
23
|
+
- `forge test --match-test <name>`
|
|
24
|
+
- `forge test --match-contract <name>`
|
|
25
|
+
- gas and verbosity:
|
|
26
|
+
- `forge test -vvv`
|
|
27
|
+
- inspect:
|
|
28
|
+
- `forge inspect <Contract> methods`
|
|
29
|
+
- `forge inspect <Contract> storage-layout`
|
|
30
|
+
- local chain:
|
|
31
|
+
- `anvil`
|
|
32
|
+
- ad hoc RPC or ABI work:
|
|
33
|
+
- `cast call`
|
|
34
|
+
- `cast sig`
|
|
35
|
+
- `cast 4byte`
|
|
36
|
+
|
|
37
|
+
## Review Patterns
|
|
38
|
+
|
|
39
|
+
- Read `script/` to understand deployment assumptions and broadcast behavior.
|
|
40
|
+
- Read `test/` for expected invariants and edge cases before modifying contracts.
|
|
41
|
+
- Treat `broadcast/` and `out/` as derived outputs.
|
|
42
|
+
- Check for invariant tests, fuzz tests, and cheatcode usage in `forge-std/Test.sol`.
|
|
43
|
+
|
|
44
|
+
## Common Risks
|
|
45
|
+
|
|
46
|
+
- stale remappings
|
|
47
|
+
- hidden dependency logic in `lib/`
|
|
48
|
+
- deployment parameters embedded in scripts
|
|
49
|
+
- tests that rely on forked state or env vars not obvious from the contract files
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# Hardhat Heuristics
|
|
2
|
+
|
|
3
|
+
## Primary Files
|
|
4
|
+
|
|
5
|
+
- `package.json`
|
|
6
|
+
- `hardhat.config.js|ts|cjs|mjs`
|
|
7
|
+
- `contracts/`
|
|
8
|
+
- `test/`
|
|
9
|
+
- `scripts/`
|
|
10
|
+
- `tasks/`
|
|
11
|
+
- `ignition/`
|
|
12
|
+
- `deploy/`
|
|
13
|
+
- `artifacts/`
|
|
14
|
+
- `cache/`
|
|
15
|
+
|
|
16
|
+
## Default Commands
|
|
17
|
+
|
|
18
|
+
- install:
|
|
19
|
+
- `pnpm install`
|
|
20
|
+
- `npm install`
|
|
21
|
+
- `yarn install`
|
|
22
|
+
- compile:
|
|
23
|
+
- `npx hardhat compile`
|
|
24
|
+
- test:
|
|
25
|
+
- `npx hardhat test`
|
|
26
|
+
- run a script:
|
|
27
|
+
- `npx hardhat run scripts/<name>.ts --network <network>`
|
|
28
|
+
- local node:
|
|
29
|
+
- `npx hardhat node`
|
|
30
|
+
- console:
|
|
31
|
+
- `npx hardhat console --network <network>`
|
|
32
|
+
|
|
33
|
+
Choose the package manager already used by the repo.
|
|
34
|
+
|
|
35
|
+
## Review Patterns
|
|
36
|
+
|
|
37
|
+
- Start from `package.json` to see plugins, scripts, and package manager.
|
|
38
|
+
- Read `hardhat.config.*` before running anything; it often hides compiler versions, forking, networks, named accounts, and verify settings.
|
|
39
|
+
- Prefer repo scripts if they wrap standard Hardhat commands with required env vars.
|
|
40
|
+
- Treat `artifacts/` and `cache/` as generated outputs.
|
|
41
|
+
|
|
42
|
+
## Common Risks
|
|
43
|
+
|
|
44
|
+
- tests relying on implicit `.env` values
|
|
45
|
+
- mixed TypeScript and JavaScript task runners
|
|
46
|
+
- deployment logic split between `deploy/`, `scripts/`, and `ignition/`
|
|
47
|
+
- multiple Solidity compiler versions or optimizer settings
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# Vyper Heuristics
|
|
2
|
+
|
|
3
|
+
## Detection Signals
|
|
4
|
+
|
|
5
|
+
- `.vy` contracts
|
|
6
|
+
- `pyproject.toml`
|
|
7
|
+
- `requirements.txt`
|
|
8
|
+
- `requirements-dev.txt`
|
|
9
|
+
- `ape-config.yaml`
|
|
10
|
+
- `brownie-config.yaml`
|
|
11
|
+
|
|
12
|
+
## Default Commands
|
|
13
|
+
|
|
14
|
+
- compile:
|
|
15
|
+
- `vyper <file>.vy`
|
|
16
|
+
- project-specific wrapper commands from `pyproject.toml`
|
|
17
|
+
- tests:
|
|
18
|
+
- `pytest`
|
|
19
|
+
- `ape test`
|
|
20
|
+
- `brownie test`
|
|
21
|
+
|
|
22
|
+
## Review Patterns
|
|
23
|
+
|
|
24
|
+
- Read the Python project manifest before assuming test or build entrypoints.
|
|
25
|
+
- Check whether the repo uses Ape, Brownie, or direct Vyper plus pytest.
|
|
26
|
+
- Treat Python fixtures and helper modules as part of the protocol surface, not just test plumbing.
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: web3-research-and-market-intel
|
|
3
|
+
description: Web3 market and protocol research routing layer. Use for token research, protocol diligence, TVL and market data analysis, whale flow review, wallet portfolio review, and multi-source investment intelligence before trading or monitoring.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Web3 Research And Market Intel
|
|
7
|
+
|
|
8
|
+
Use this skill when the task is research, project diligence, token comparison, or pre-trade intelligence gathering.
|
|
9
|
+
|
|
10
|
+
## Required Profile Adapters
|
|
11
|
+
|
|
12
|
+
- `defillama`
|
|
13
|
+
- `coingecko`
|
|
14
|
+
- `dune`
|
|
15
|
+
- `whale-watcher`
|
|
16
|
+
- `trading-signal`
|
|
17
|
+
- `binance-token-info`
|
|
18
|
+
- `binance-market-rank`
|
|
19
|
+
- `binance-meme-rush`
|
|
20
|
+
- `four-meme`
|
|
21
|
+
- `debank`
|
|
22
|
+
|
|
23
|
+
Use [references/ADAPTER_CONSUMPTION_MAP.md](references/ADAPTER_CONSUMPTION_MAP.md)
|
|
24
|
+
to keep research adapter outputs stable and comparable.
|
|
25
|
+
Use [references/EVIDENCE_QUALITY.md](references/EVIDENCE_QUALITY.md) and
|
|
26
|
+
[references/OUTPUT_TEMPLATE.md](references/OUTPUT_TEMPLATE.md) to keep source
|
|
27
|
+
freshness and conclusion routing stable.
|
|
28
|
+
Use [scripts/render_research_brief.py](scripts/render_research_brief.py) when a
|
|
29
|
+
downstream skill or runtime needs a normalized research block.
|
|
30
|
+
Use [references/PORTFOLIO_STATUS_TEMPLATE.md](references/PORTFOLIO_STATUS_TEMPLATE.md)
|
|
31
|
+
and [scripts/render_portfolio_status.py](scripts/render_portfolio_status.py)
|
|
32
|
+
when wallet, address, or venue position state must be emitted as a stable
|
|
33
|
+
`portfolio_status` block.
|
|
34
|
+
Use [references/WATCH_STATUS_TEMPLATE.md](references/WATCH_STATUS_TEMPLATE.md)
|
|
35
|
+
and [scripts/render_watch_status.py](scripts/render_watch_status.py) when a
|
|
36
|
+
monitoring or alerting workflow must be emitted as a stable `watch_status`
|
|
37
|
+
block for operator consumption.
|
|
38
|
+
|
|
39
|
+
## Workflow
|
|
40
|
+
|
|
41
|
+
1. Decide the research question:
|
|
42
|
+
- token
|
|
43
|
+
- protocol
|
|
44
|
+
- chain ecosystem
|
|
45
|
+
- whale flow
|
|
46
|
+
- smart-money signal
|
|
47
|
+
- wallet / address / venue portfolio state
|
|
48
|
+
- recurring watch / alert condition
|
|
49
|
+
2. Pull only the sources that answer that question.
|
|
50
|
+
3. Keep raw source outputs separate from synthesized judgment.
|
|
51
|
+
4. Summarize the result as evidence, not as blind trade advice.
|
|
52
|
+
|
|
53
|
+
## Suggested Source Split
|
|
54
|
+
|
|
55
|
+
- `defillama` for TVL, chain comparison, yield, and protocol-level metrics
|
|
56
|
+
- `coingecko` for price, market cap, trending, and historical market context
|
|
57
|
+
- `dune` for query-driven custom analytics
|
|
58
|
+
- `whale-watcher` for large address flow
|
|
59
|
+
- `trading-signal` for Binance smart-money style signals
|
|
60
|
+
- `binance-token-info` for metadata, dynamic data, and kline access
|
|
61
|
+
- `binance-market-rank` for ranked discovery and social/smart-money leaderboards
|
|
62
|
+
- `binance-meme-rush` for launchpad and narrative discovery
|
|
63
|
+
- `four-meme` for BSC launchpad-specific discovery
|
|
64
|
+
- `debank` for wallet portfolio, protocol position, and address-level diligence
|
|
65
|
+
- `query-address-info` for chain-scoped wallet holdings and concentration hints
|
|
66
|
+
- `hyperliquid` for venue-native position and order state when the portfolio question is venue-specific
|
|
67
|
+
|
|
68
|
+
## Output Contract
|
|
69
|
+
|
|
70
|
+
```text
|
|
71
|
+
Question:
|
|
72
|
+
- what was investigated
|
|
73
|
+
Evidence:
|
|
74
|
+
- source + key observation
|
|
75
|
+
Cross-Checks:
|
|
76
|
+
- where sources agree or disagree
|
|
77
|
+
Conclusion:
|
|
78
|
+
- watch | investigate more | suitable for next-step simulation | avoid for now
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
## Reusable Output Contract
|
|
82
|
+
|
|
83
|
+
Always emit both:
|
|
84
|
+
|
|
85
|
+
1. A short research summary
|
|
86
|
+
2. A normalized `research_brief` block
|
|
87
|
+
|
|
88
|
+
The normalized block must preserve:
|
|
89
|
+
|
|
90
|
+
- question and source freshness
|
|
91
|
+
- sources actually used
|
|
92
|
+
- evidence observations
|
|
93
|
+
- cross-checks or disagreements
|
|
94
|
+
- conclusion bucket
|
|
95
|
+
- next steps and route-back conditions
|
|
96
|
+
|
|
97
|
+
## Watch Status Contract
|
|
98
|
+
|
|
99
|
+
Always emit a normalized `watch_status` block when the user asks to:
|
|
100
|
+
|
|
101
|
+
- watch a token, protocol, address, or venue state over time
|
|
102
|
+
- keep monitoring post-trade settlement or venue positions
|
|
103
|
+
- produce an alert-ready monitoring bundle for the operator or scheduler
|
|
104
|
+
|
|
105
|
+
The normalized block must preserve:
|
|
106
|
+
|
|
107
|
+
- status and watch kind
|
|
108
|
+
- the monitored subject
|
|
109
|
+
- trigger source and severity
|
|
110
|
+
- next check or schedule hints
|
|
111
|
+
- the recommended adapter for the next monitoring step
|
|
112
|
+
- evidence provenance per source
|
|
113
|
+
|
|
114
|
+
## Portfolio Status Contract
|
|
115
|
+
|
|
116
|
+
Always emit a normalized `portfolio_status` block when the user asks:
|
|
117
|
+
|
|
118
|
+
- "这个地址里有什么"
|
|
119
|
+
- "我在 Hyperliquid 上现在有哪些仓位"
|
|
120
|
+
- "帮我看这个钱包/仓位状态"
|
|
121
|
+
|
|
122
|
+
The normalized block must preserve:
|
|
123
|
+
|
|
124
|
+
- status and coverage
|
|
125
|
+
- source class: `wallet | address | venue`
|
|
126
|
+
- venue or provider identity
|
|
127
|
+
- address or user reference
|
|
128
|
+
- chain / network scope
|
|
129
|
+
- asset and position summary
|
|
130
|
+
- evidence provenance per source
|
|
131
|
+
|
|
132
|
+
## Guardrails
|
|
133
|
+
|
|
134
|
+
- Do not present a single data provider as ground truth.
|
|
135
|
+
- Separate descriptive analysis from trading recommendation.
|
|
136
|
+
- If the data is stale, chain-limited, or sparse, say that explicitly.
|
|
137
|
+
- If the user wants to trade after research, send the flow to `web3-risk-gate` and `web3-transaction-simulator`.
|
|
138
|
+
- If the outcome is "keep watching", emit `watch_status` instead of implying trade readiness.
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
# Research Adapter Consumption Map
|
|
2
|
+
|
|
3
|
+
- `defillama` -> TVL, protocol metrics, chain comparison
|
|
4
|
+
- `coingecko` -> price, market cap, historical context
|
|
5
|
+
- `dune` -> custom query evidence
|
|
6
|
+
- `whale-watcher` -> large flow evidence
|
|
7
|
+
- `trading-signal` -> smart-money style signals
|
|
8
|
+
- `binance-token-info` -> metadata and dynamic token fields
|
|
9
|
+
- `binance-market-rank` -> ranked discovery
|
|
10
|
+
- `binance-meme-rush` -> meme/token launch discovery
|
|
11
|
+
- `four-meme` -> BSC launchpad discovery
|
|
12
|
+
- `debank` -> address portfolio and position evidence
|
|
13
|
+
- `query-address-info` -> chain-scoped holdings and asset concentration evidence
|
|
14
|
+
- `hyperliquid` -> venue-native position / order / balance status
|
|
15
|
+
|
|
16
|
+
Normalize into:
|
|
17
|
+
|
|
18
|
+
- question
|
|
19
|
+
- evidence
|
|
20
|
+
- cross-checks
|
|
21
|
+
- conclusion
|
|
22
|
+
|
|
23
|
+
For wallet, address, or venue state questions, also normalize into:
|
|
24
|
+
|
|
25
|
+
```yaml
|
|
26
|
+
portfolio_status:
|
|
27
|
+
status: COMPLETE | PARTIAL | UNAVAILABLE
|
|
28
|
+
coverage: complete | partial | missing
|
|
29
|
+
source_class: wallet | address | venue
|
|
30
|
+
provider: debank | query-address-info | hyperliquid
|
|
31
|
+
venue: hyperliquid | none
|
|
32
|
+
subject:
|
|
33
|
+
address: "0x..."
|
|
34
|
+
user: "0x..."
|
|
35
|
+
scope:
|
|
36
|
+
chain: base
|
|
37
|
+
network: mainnet
|
|
38
|
+
assets:
|
|
39
|
+
- symbol: USDC
|
|
40
|
+
usd_value: "1200"
|
|
41
|
+
positions:
|
|
42
|
+
- protocol: Aave
|
|
43
|
+
type: lending
|
|
44
|
+
usd_value: "800"
|
|
45
|
+
evidence:
|
|
46
|
+
- adapter: debank
|
|
47
|
+
detail: total balance and token list fetched
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
For monitoring or alerting tasks, also normalize into:
|
|
51
|
+
|
|
52
|
+
```yaml
|
|
53
|
+
watch_status:
|
|
54
|
+
version: 1
|
|
55
|
+
status: ACTIVE | TRIGGERED | CLEARED | UNAVAILABLE
|
|
56
|
+
watch_kind: research | portfolio | posttrade | trace | venue | execution
|
|
57
|
+
subject: token:PEPE
|
|
58
|
+
trigger_source: whale-watcher
|
|
59
|
+
severity: medium
|
|
60
|
+
next_check_hint: refresh whale flow after 15 minutes
|
|
61
|
+
schedule_hint: "*/15 * * * *"
|
|
62
|
+
recommended_adapter: whale-watcher
|
|
63
|
+
evidence:
|
|
64
|
+
- adapter: whale-watcher
|
|
65
|
+
detail: large inflow exceeds prior 24h baseline
|
|
66
|
+
```
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# Research Evidence Quality
|
|
2
|
+
|
|
3
|
+
Normalize data freshness into:
|
|
4
|
+
|
|
5
|
+
- `fresh`
|
|
6
|
+
- recent enough for the research question and cross-checked with at least one other source when possible
|
|
7
|
+
- `mixed`
|
|
8
|
+
- some evidence is current, some is stale or chain-limited
|
|
9
|
+
- `stale`
|
|
10
|
+
- core evidence is outdated, sparse, or unavailable
|
|
11
|
+
|
|
12
|
+
## Conclusion Buckets
|
|
13
|
+
|
|
14
|
+
- `watch`
|
|
15
|
+
- evidence is interesting but not ready for execution
|
|
16
|
+
- `investigate-more`
|
|
17
|
+
- evidence conflicts or coverage is too thin
|
|
18
|
+
- `ready-for-risk-gate`
|
|
19
|
+
- research is good enough to proceed into safety checks and simulation
|
|
20
|
+
- `avoid-for-now`
|
|
21
|
+
- evidence is materially negative or too weak for action
|
|
22
|
+
|
|
23
|
+
## Rules
|
|
24
|
+
|
|
25
|
+
- Always separate factual evidence from final judgment.
|
|
26
|
+
- If a source is chain-limited or provider-limited, mention that in cross-checks.
|
|
27
|
+
- If the user wants execution after research, route to `web3-risk-gate` and `web3-transaction-simulator`.
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# Web3 Research Output Template
|
|
2
|
+
|
|
3
|
+
Always emit:
|
|
4
|
+
|
|
5
|
+
1. A short human-readable research summary
|
|
6
|
+
2. A normalized block
|
|
7
|
+
|
|
8
|
+
```yaml
|
|
9
|
+
research_brief:
|
|
10
|
+
version: 1
|
|
11
|
+
question: Should this token move into trade-prep?
|
|
12
|
+
freshness: mixed
|
|
13
|
+
sources_used:
|
|
14
|
+
- defillama
|
|
15
|
+
- coingecko
|
|
16
|
+
- dune
|
|
17
|
+
evidence:
|
|
18
|
+
- adapter: defillama
|
|
19
|
+
detail: TVL has been flat for 30 days
|
|
20
|
+
- adapter: coingecko
|
|
21
|
+
detail: market cap up 18% this week
|
|
22
|
+
cross_checks:
|
|
23
|
+
- price momentum improved but TVL confirmation is weak
|
|
24
|
+
conclusion: investigate-more
|
|
25
|
+
next_steps:
|
|
26
|
+
- pull whale flow and address concentration before risk gate
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## Required Fields
|
|
30
|
+
|
|
31
|
+
- `question`
|
|
32
|
+
- `freshness`: `fresh | mixed | stale`
|
|
33
|
+
- `sources_used`
|
|
34
|
+
- `evidence`
|
|
35
|
+
- `cross_checks`
|
|
36
|
+
- `conclusion`: `watch | investigate-more | ready-for-risk-gate | avoid-for-now`
|
|
37
|
+
- `next_steps`
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
# Web3 Portfolio Status Template
|
|
2
|
+
|
|
3
|
+
Always emit:
|
|
4
|
+
|
|
5
|
+
1. A short human-readable portfolio / position summary
|
|
6
|
+
2. A normalized block
|
|
7
|
+
|
|
8
|
+
```yaml
|
|
9
|
+
portfolio_status:
|
|
10
|
+
version: 1
|
|
11
|
+
status: COMPLETE
|
|
12
|
+
coverage: complete
|
|
13
|
+
source_class: wallet
|
|
14
|
+
provider: debank
|
|
15
|
+
venue: none
|
|
16
|
+
subject:
|
|
17
|
+
address: 0xabc
|
|
18
|
+
user: ""
|
|
19
|
+
scope:
|
|
20
|
+
chain: multi
|
|
21
|
+
network: mainnet
|
|
22
|
+
assets:
|
|
23
|
+
- symbol: ETH
|
|
24
|
+
amount: "1.2"
|
|
25
|
+
usd_value: "2400"
|
|
26
|
+
positions:
|
|
27
|
+
- protocol: Aave
|
|
28
|
+
type: lending
|
|
29
|
+
usd_value: "1800"
|
|
30
|
+
evidence:
|
|
31
|
+
- adapter: debank
|
|
32
|
+
detail: total balance and protocol positions fetched
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## Required Fields
|
|
36
|
+
|
|
37
|
+
- `status`: `COMPLETE | PARTIAL | UNAVAILABLE`
|
|
38
|
+
- `coverage`: `complete | partial | missing`
|
|
39
|
+
- `source_class`: `wallet | address | venue`
|
|
40
|
+
- `provider`
|
|
41
|
+
- `subject`
|
|
42
|
+
- `scope`
|
|
43
|
+
- `assets`
|
|
44
|
+
- `positions`
|
|
45
|
+
- `evidence`
|
|
46
|
+
|
|
47
|
+
## Notes
|
|
48
|
+
|
|
49
|
+
- Use empty lists instead of dropping `assets` or `positions`.
|
|
50
|
+
- `venue` should be `none` for non-venue sources.
|
|
51
|
+
- `UNAVAILABLE` still requires concrete evidence or unknowns in the human summary.
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# Web3 Watch Status Template
|
|
2
|
+
|
|
3
|
+
Always emit:
|
|
4
|
+
|
|
5
|
+
1. A short human-readable monitoring or alert summary
|
|
6
|
+
2. A normalized block
|
|
7
|
+
|
|
8
|
+
```yaml
|
|
9
|
+
watch_status:
|
|
10
|
+
version: 1
|
|
11
|
+
status: TRIGGERED
|
|
12
|
+
watch_kind: research
|
|
13
|
+
subject: token:PEPE
|
|
14
|
+
trigger_source: whale-watcher
|
|
15
|
+
severity: high
|
|
16
|
+
next_check_hint: refresh large-holder flow after 5 minutes
|
|
17
|
+
schedule_hint: "*/5 * * * *"
|
|
18
|
+
recommended_adapter: whale-watcher
|
|
19
|
+
evidence:
|
|
20
|
+
- adapter: whale-watcher
|
|
21
|
+
detail: net inflow exceeded 1m USDT in 10 minutes
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## Required Fields
|
|
25
|
+
|
|
26
|
+
- `status`: `ACTIVE | TRIGGERED | CLEARED | UNAVAILABLE`
|
|
27
|
+
- `watch_kind`: `research | portfolio | posttrade | trace | venue | execution`
|
|
28
|
+
- `subject`
|
|
29
|
+
- `trigger_source`
|
|
30
|
+
- `severity`: `low | medium | high | critical`
|
|
31
|
+
- `next_check_hint`
|
|
32
|
+
- `recommended_adapter`
|
|
33
|
+
- `evidence`
|
|
34
|
+
|
|
35
|
+
## Notes
|
|
36
|
+
|
|
37
|
+
- `schedule_hint` is optional and should stay advisory until a runtime actually schedules it.
|
|
38
|
+
- Use `recommended_adapter = none` only when the watch is cleared or intentionally terminated.
|
|
39
|
+
- `UNAVAILABLE` still requires concrete evidence about missing data, backend failure, or unsupported scope.
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""Render a stable Web3 portfolio status block."""
|
|
3
|
+
|
|
4
|
+
from __future__ import annotations
|
|
5
|
+
|
|
6
|
+
import argparse
|
|
7
|
+
import json
|
|
8
|
+
import sys
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
def build_parser() -> argparse.ArgumentParser:
|
|
12
|
+
parser = argparse.ArgumentParser(description="Render a Web3 portfolio status block.")
|
|
13
|
+
parser.add_argument("--status", choices=("COMPLETE", "PARTIAL", "UNAVAILABLE"), required=True)
|
|
14
|
+
parser.add_argument("--coverage", choices=("complete", "partial", "missing"), default="partial")
|
|
15
|
+
parser.add_argument("--source-class", choices=("wallet", "address", "venue"), required=True)
|
|
16
|
+
parser.add_argument("--provider", required=True)
|
|
17
|
+
parser.add_argument("--venue", default="none")
|
|
18
|
+
parser.add_argument("--address", default="")
|
|
19
|
+
parser.add_argument("--user", default="")
|
|
20
|
+
parser.add_argument("--chain", default="")
|
|
21
|
+
parser.add_argument("--network", default="mainnet")
|
|
22
|
+
parser.add_argument("--asset", action="append", default=[])
|
|
23
|
+
parser.add_argument("--position", action="append", default=[])
|
|
24
|
+
parser.add_argument("--evidence", action="append", default=[])
|
|
25
|
+
return parser
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
def parse_pairs(entries: list[str], kind: str) -> list[dict[str, str]]:
|
|
29
|
+
parsed: list[dict[str, str]] = []
|
|
30
|
+
for entry in entries:
|
|
31
|
+
parts = [part.strip() for part in entry.split("|")]
|
|
32
|
+
if kind == "asset":
|
|
33
|
+
symbol = parts[0] if len(parts) > 0 else ""
|
|
34
|
+
amount = parts[1] if len(parts) > 1 else ""
|
|
35
|
+
usd_value = parts[2] if len(parts) > 2 else ""
|
|
36
|
+
parsed.append({"symbol": symbol, "amount": amount, "usd_value": usd_value})
|
|
37
|
+
else:
|
|
38
|
+
protocol = parts[0] if len(parts) > 0 else ""
|
|
39
|
+
position_type = parts[1] if len(parts) > 1 else ""
|
|
40
|
+
usd_value = parts[2] if len(parts) > 2 else ""
|
|
41
|
+
parsed.append({"protocol": protocol, "type": position_type, "usd_value": usd_value})
|
|
42
|
+
return parsed
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
def parse_evidence(entries: list[str]) -> list[dict[str, str]]:
|
|
46
|
+
parsed: list[dict[str, str]] = []
|
|
47
|
+
for entry in entries:
|
|
48
|
+
adapter, sep, detail = entry.partition(":")
|
|
49
|
+
if sep:
|
|
50
|
+
parsed.append({"adapter": adapter.strip(), "detail": detail.strip()})
|
|
51
|
+
else:
|
|
52
|
+
parsed.append({"adapter": "unknown", "detail": entry})
|
|
53
|
+
return parsed
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
def main() -> int:
|
|
57
|
+
args = build_parser().parse_args()
|
|
58
|
+
payload = {
|
|
59
|
+
"portfolio_status": {
|
|
60
|
+
"version": 1,
|
|
61
|
+
"status": args.status,
|
|
62
|
+
"coverage": args.coverage,
|
|
63
|
+
"source_class": args.source_class,
|
|
64
|
+
"provider": args.provider,
|
|
65
|
+
"venue": args.venue,
|
|
66
|
+
"subject": {
|
|
67
|
+
"address": args.address,
|
|
68
|
+
"user": args.user,
|
|
69
|
+
},
|
|
70
|
+
"scope": {
|
|
71
|
+
"chain": args.chain,
|
|
72
|
+
"network": args.network,
|
|
73
|
+
},
|
|
74
|
+
"assets": parse_pairs(args.asset, "asset"),
|
|
75
|
+
"positions": parse_pairs(args.position, "position"),
|
|
76
|
+
"evidence": parse_evidence(args.evidence),
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
json.dump(payload, sys.stdout, ensure_ascii=False, indent=2)
|
|
80
|
+
sys.stdout.write("\n")
|
|
81
|
+
return 0
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
if __name__ == "__main__":
|
|
85
|
+
raise SystemExit(main())
|