@wiimdy/openfunderse 0.1.2 → 1.1.1

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/README.md CHANGED
@@ -1,77 +1,34 @@
1
1
  # openfunderse
2
2
 
3
- Install OpenFunderse skill packs into Codex.
3
+ Install OpenFunderse split skill packs (`strategy`, `participant`) for OpenClaw/Codex.
4
4
 
5
- ## Role
6
- - Monorepo distribution package for Codex skills/prompts/manifests.
7
- - Owns install UX (`npx @wiimdy/openfunderse@latest install openfunderse`) and pack copy logic.
8
-
9
- ## Usage
5
+ ## Quick Start
10
6
 
11
7
  ```bash
12
- # list bundled packs
13
- npx @wiimdy/openfunderse@latest list
14
-
15
- # install pack into ~/.codex/skills
16
- npx @wiimdy/openfunderse@latest install openfunderse
17
-
18
- # install strategy-only pack
19
- npx @wiimdy/openfunderse@latest install openfunderse-strategy
20
-
21
- # install participant-only pack
22
- npx @wiimdy/openfunderse@latest install openfunderse-participant
23
-
24
- # install pack + runtime package in one command (recommended)
25
- npx @wiimdy/openfunderse@latest install openfunderse --with-runtime
26
-
27
- # install pack + runtime + strategy env scaffold in one command
28
- npx @wiimdy/openfunderse@latest install openfunderse \
29
- --with-runtime \
30
- --env-profile strategy
31
-
32
- # install into custom codex home
33
- npx @wiimdy/openfunderse@latest install openfunderse --codex-home /custom/.codex
34
-
35
- # install runtime into a specific project directory
36
- npx @wiimdy/openfunderse@latest install openfunderse \
37
- --with-runtime \
38
- --runtime-dir /path/to/project
8
+ # 1) install skill + runtime
9
+ npx @wiimdy/openfunderse@latest install openfunderse-strategy --with-runtime
10
+ # or
11
+ npx @wiimdy/openfunderse@latest install openfunderse-participant --with-runtime
12
+
13
+ # 2) create/rotate bot wallet and write env
14
+ npx @wiimdy/openfunderse@latest bot-init --skill-name strategy --yes
15
+ # or
16
+ npx @wiimdy/openfunderse@latest bot-init --skill-name participant --yes
17
+
18
+ # 3) load env in current shell
19
+ set -a; source .env; set +a
20
+ ```
39
21
 
40
- # initialize bot env + fresh Monad wallet (strategy)
41
- npx @wiimdy/openfunderse@latest bot-init \
42
- --skill-name strategy \
43
- --env-path .env.strategy \
44
- --yes
22
+ ## Where Files Are Stored
45
23
 
46
- # initialize participant bot env + wallet
47
- npx @wiimdy/openfunderse@latest bot-init \
48
- --skill-name participant \
49
- --env-path .env.participant \
50
- --yes
51
- ```
24
+ - In OpenClaw, skills are installed under `~/.openclaw/workspace/skills`.
25
+ - Pack metadata is stored under `~/.openclaw/workspace/packs/<pack-name>`.
26
+ - Wallet backups from `bot-init` are stored under `~/.openclaw/workspace/openfunderse/wallets`.
52
27
 
53
- ## Notes
28
+ ## Important Notes
54
29
 
55
- - Skills are copied into `$CODEX_HOME/skills` (default `~/.codex/skills`).
56
- - Pack metadata/prompts are copied into `$CODEX_HOME/packs/<pack-name>`.
57
- - Use `--force` to overwrite existing installed skills.
58
- - `--with-runtime` installs `@wiimdy/openfunderse-agents` into the current project (`package.json` required).
59
- - Env scaffold generation is enabled by default (default path: `.env.openfunderse`).
60
- - `--env-profile` controls scaffold scope: `strategy` | `participant` | `all` (auto-selected by pack when omitted).
61
- - Use `--no-init-env` to skip env scaffold generation.
62
- - `--env-path` sets a custom env scaffold path.
63
- - Optional: `--runtime-package`, `--runtime-dir`, `--runtime-manager`.
64
- - Available packs: `openfunderse` (unified), `openfunderse-strategy`, `openfunderse-participant`.
65
- - Split packs (`openfunderse-strategy`, `openfunderse-participant`) are intentionally minimal and centered on the skill payload.
66
- - Prefer `--env-path` (Node 20+ reserves `--env-file` as a runtime flag).
67
- - `bot-init` uses `cast wallet new --json` (Foundry) to generate a new wallet for Monad testnet.
68
- - `bot-init` infers role from `--skill-name`, `--env-path`, or `--wallet-name` when `--role` is omitted.
69
- - It also infers from active skill env hints (`OPENCLAW_SKILL_KEY`, `OPENCLAW_ACTIVE_SKILL`, `SKILL_KEY`, `SKILL_NAME`).
70
- - `bot-init` writes role-specific key fields:
71
- - `strategy`: `STRATEGY_PRIVATE_KEY`, `BOT_ADDRESS`
72
- - `participant`: `PARTICIPANT_PRIVATE_KEY`, `PARTICIPANT_BOT_ADDRESS`, `BOT_ADDRESS`
73
- - `bot-init` stores a wallet backup JSON under `$CODEX_HOME/openfunderse/wallets`.
74
- - Generated scaffolds include a temporary bootstrap key value. It is public/unsafe and must be rotated via `bot-init` before funding.
75
- - `bot-init` shows a warning and requires confirmation (`Type YES`) unless `--yes` is passed.
76
- - If private key already exists in the target env file, `bot-init` requires `--force` to rotate.
77
- - CLI cannot mutate your parent shell env directly; run the printed `set -a; source ...; set +a` command.
30
+ - Use only:
31
+ - `openfunderse-strategy`
32
+ - `openfunderse-participant`
33
+ - Default env scaffold path is `.env`.
34
+ - If you run both bots in the same directory, use `--env-path` to split files (for example `.env.strategy`, `.env.participant`).
@@ -56,7 +56,6 @@ BOT_ADDRESS=0x0000000000000000000000000000000000000000
56
56
  CHAIN_ID=10143
57
57
  # Temporary bootstrap key (public and unsafe). Replace via bot-init before real usage.
58
58
  PARTICIPANT_PRIVATE_KEY=${TEMP_PRIVATE_KEY}
59
- CLAIM_ATTESTATION_VERIFIER_ADDRESS=0x0000000000000000000000000000000000000000
60
59
  PARTICIPANT_REQUIRE_EXPLICIT_SUBMIT=true
61
60
  PARTICIPANT_AUTO_SUBMIT=false
62
61
  # PARTICIPANT_TRUSTED_RELAYER_HOSTS=openfunderse-relayer.example.com
@@ -75,12 +74,11 @@ Usage:
75
74
 
76
75
  Examples:
77
76
  openfunderse list
78
- openfunderse install openfunderse
79
- openfunderse install openfunderse --with-runtime
80
77
  openfunderse install openfunderse-strategy --with-runtime
81
- openfunderse install openfunderse --codex-home /tmp/codex-home
82
- openfunderse bot-init --env-path .env.participant --wallet-name participant-bot --yes
83
- openfunderse bot-init --skill-name strategy --env-path .env.strategy --force
78
+ openfunderse install openfunderse-participant --with-runtime
79
+ openfunderse install openfunderse-strategy --codex-home /tmp/codex-home
80
+ openfunderse bot-init --skill-name participant --wallet-name participant-bot --yes
81
+ openfunderse bot-init --skill-name strategy --force
84
82
  `);
85
83
  }
86
84
 
@@ -342,7 +340,7 @@ async function writeEnvScaffold(options) {
342
340
  const profile = normalizeEnvProfile(rawProfile);
343
341
  const envTarget = options.envFile
344
342
  ? path.resolve(options.envFile)
345
- : path.join(runtimeDir, ".env.openfunderse");
343
+ : path.join(runtimeDir, ".env");
346
344
 
347
345
  const alreadyExists = existsSync(envTarget);
348
346
  if (alreadyExists && !options.force) {
@@ -369,7 +367,7 @@ async function writeEnvScaffold(options) {
369
367
  }
370
368
 
371
369
  function defaultEnvPathForRole(role) {
372
- return path.join(process.cwd(), `.env.${role}`);
370
+ return path.join(process.cwd(), ".env");
373
371
  }
374
372
 
375
373
  function readAssignedEnvValue(content, key) {
@@ -717,6 +715,12 @@ async function installRuntimePackage(options) {
717
715
  }
718
716
 
719
717
  async function installPack(packName, options) {
718
+ if (packName === "openfunderse") {
719
+ throw new Error(
720
+ "pack 'openfunderse' has been removed. use 'openfunderse-strategy' or 'openfunderse-participant'."
721
+ );
722
+ }
723
+
720
724
  const packDir = path.join(PACKS_ROOT, packName);
721
725
  if (!existsSync(packDir)) {
722
726
  throw new Error(`pack not found: ${packName}`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wiimdy/openfunderse",
3
- "version": "0.1.2",
3
+ "version": "1.1.1",
4
4
  "description": "Install OpenFunderse skill packs into Codex",
5
5
  "type": "module",
6
6
  "bin": {
@@ -3,6 +3,7 @@ name: openfunderse-participant
3
3
  description: Participant MoltBot for data mining (claims) and cross-verification (attestations)
4
4
  metadata:
5
5
  openclaw:
6
+ installCommand: npx @wiimdy/openfunderse@latest install openfunderse-participant --with-runtime
6
7
  requires:
7
8
  env:
8
9
  - RELAYER_URL
@@ -24,12 +25,36 @@ The Participant MoltBot is responsible for mining data claims from specified sou
24
25
 
25
26
  ## Quick Start (ClawHub Users)
26
27
 
27
- Install the skill first:
28
+ 1) Install the skill:
28
29
 
29
30
  ```bash
30
31
  npx clawhub@latest install openfunderse-participant
31
32
  ```
32
33
 
34
+ 2) Install runtime + generate env scaffold:
35
+
36
+ ```bash
37
+ npx @wiimdy/openfunderse@latest install openfunderse-participant --with-runtime
38
+ ```
39
+
40
+ 3) Rotate the temporary bootstrap key and write a fresh participant wallet to env:
41
+
42
+ ```bash
43
+ npx @wiimdy/openfunderse@latest bot-init \
44
+ --skill-name participant \
45
+ --yes
46
+ ```
47
+
48
+ 4) Load env for the current shell:
49
+
50
+ ```bash
51
+ set -a; source .env; set +a
52
+ ```
53
+
54
+ Note:
55
+ - The scaffold includes a temporary public key placeholder by default.
56
+ - Always run `bot-init` before funding or running production actions.
57
+
33
58
  ## Credential Scope
34
59
 
35
60
  - `PARTICIPANT_PRIVATE_KEY` (or runtime fallback key) is used only for claim-attestation signing.
@@ -5,6 +5,7 @@ always: false
5
5
  disable-model-invocation: false
6
6
  metadata:
7
7
  openclaw:
8
+ installCommand: npx @wiimdy/openfunderse@latest install openfunderse-strategy --with-runtime
8
9
  requires:
9
10
  env:
10
11
  - RELAYER_URL
@@ -46,41 +47,35 @@ In runtime, use `proposeIntentAndSubmit` to build a canonical proposal first, th
46
47
 
47
48
  ## Quick Start (ClawHub Users)
48
49
 
49
- Install the skill first:
50
+ 1) Install the skill:
50
51
 
51
52
  ```bash
52
53
  npx clawhub@latest install openfunderse-strategy
53
54
  ```
54
55
 
55
- This skill is instruction-only. You need the runtime package:
56
+ 2) Install runtime + generate env scaffold:
56
57
 
57
58
  ```bash
58
- npm init -y && npm i @wiimdy/openfunderse-agents@0.1.1 --ignore-scripts
59
+ npx @wiimdy/openfunderse@latest install openfunderse-strategy --with-runtime
59
60
  ```
60
61
 
61
- Create editable env scaffold in one line:
62
+ 3) Rotate the temporary bootstrap key and write a fresh strategy wallet to env:
62
63
 
63
64
  ```bash
64
- cp node_modules/@wiimdy/openfunderse-agents/.env.strategy.example .env.openfunderse
65
+ npx @wiimdy/openfunderse@latest bot-init \
66
+ --skill-name strategy \
67
+ --yes
65
68
  ```
66
69
 
67
- Verify source before install (recommended):
70
+ 4) Load env for the current shell:
68
71
 
69
72
  ```bash
70
- npm view @wiimdy/openfunderse-agents@0.1.1 repository.url homepage dist.integrity
73
+ set -a; source .env; set +a
71
74
  ```
72
75
 
73
- Then configure env and run commands from:
74
-
75
- - `packages/agents/.env.strategy.example`
76
- - `packages/agents/README.md`
77
-
78
- Runtime sources:
79
-
80
- - npm package: `https://www.npmjs.com/package/@wiimdy/openfunderse-agents`
81
- - repository: `https://github.com/wiimdy/openfunderse/tree/main/packages/agents`
82
-
83
- Do not use `@latest` in production; pin an explicit version and keep lockfile reviewed.
76
+ Note:
77
+ - The scaffold includes a temporary public key placeholder by default.
78
+ - Always run `bot-init` before funding or running production actions.
84
79
 
85
80
  ## Credential Scope
86
81
 
@@ -1,33 +0,0 @@
1
- {
2
- "name": "openfunderse-agent-pack",
3
- "version": "0.1.0",
4
- "installCommand": "npx @wiimdy/openfunderse@latest install openfunderse --with-runtime",
5
- "description": "Scaffold manifest for future MoltBot skills/prompts packaging.",
6
- "bundles": [
7
- {
8
- "id": "clawbot-core",
9
- "skill": "skills/clawbot-core/SKILL.md",
10
- "prompt": "prompts/core/system.md"
11
- },
12
- {
13
- "id": "strategy",
14
- "skill": "skills/openfunderse-strategy/SKILL.md",
15
- "prompt": "prompts/strategy/system.md"
16
- },
17
- {
18
- "id": "participant",
19
- "skill": "skills/openfunderse-participant/SKILL.md",
20
- "prompt": "prompts/participant/system.md"
21
- },
22
- {
23
- "id": "relayer",
24
- "skill": "skills/relayer/SKILL.md",
25
- "prompt": "prompts/relayer/system.md"
26
- }
27
- ],
28
- "todo": [
29
- "Implement openfunderse installer package publishing flow",
30
- "Add signed package checksum and version pinning",
31
- "Add integration test that installs this pack in a clean environment"
32
- ]
33
- }
@@ -1,25 +0,0 @@
1
- # ClawBot Core System Prompt
2
-
3
- You are ClawBot Core.
4
-
5
- ## Role routing
6
- - If `role=strategy`, perform strategy lifecycle actions.
7
- - If `role=participant`, perform participant claim lifecycle actions.
8
-
9
- ## Strategy priority
10
- 1. Read relayer state and verify threshold readiness.
11
- 2. Build/validate intent from finalized snapshot only.
12
- 3. Use onchain attest/execute paths only when preconditions pass.
13
- 4. Ack onchain result back to relayer.
14
-
15
- ## Participant priority
16
- 1. Mine deterministic claim payload.
17
- 2. Verify reproducibility before PASS.
18
- 3. Submit canonical claim payload.
19
- 4. Sign/submit attestation with correct EIP-712 domain.
20
-
21
- ## Hard rules
22
- - No secret leakage.
23
- - No fabricated data.
24
- - No bypass of SDK canonical hashing/signing paths.
25
- - Return structured JSON outputs.
@@ -1,35 +0,0 @@
1
- # Participant System Prompt
2
-
3
- You are the Participant MoltBot for Openfunderse.
4
-
5
- ## Objective
6
- - Mine reproducible claims from configured sources.
7
- - Verify claim technical validity deterministically.
8
- - Submit mined claims and attest validated claims through relayer APIs.
9
-
10
- ## Hard rules
11
- - Never fabricate source data.
12
- - Never return `PASS` when reproducibility fails.
13
- - Fail closed on missing evidence, stale data, or hash mismatch.
14
- - Keep outputs strict JSON with stable keys.
15
- - Never print private keys or secrets.
16
-
17
- ## Task contracts
18
-
19
- ### `mine_claim`
20
- - Input: `fundId`, `epochId`, `sourceSpec`, `tokenContext`.
21
- - Output: `status`, `observation`, `confidence`, `reasonCode`.
22
- - Must include: `claimHash`, `responseHash`, `evidenceURI`, `canonicalPayload`.
23
-
24
- ### `verify_claim_or_intent_validity`
25
- - Output verdict: `PASS | FAIL | NEED_MORE_EVIDENCE`.
26
- - Must include `reasonCode`.
27
- - Claim verification requires reproducibility check when policy says `reproducible=true`.
28
-
29
- ### `submit_mined_claim`
30
- - Submit canonical payload as-is to relayer.
31
- - Reject if local `claimHash` differs from relayer response hash.
32
-
33
- ### `attest_claim`
34
- - Produce EIP-712 signature and submit attestation.
35
- - Use claim domain verifier address from runtime config.
@@ -1,14 +0,0 @@
1
- # Relayer System Prompt
2
-
3
- You are the relayer orchestration assistant for Openfunderse.
4
-
5
- ## Objective
6
- - Validate fund/bot authorization boundaries.
7
- - Route claims, attestations, and intent submissions safely.
8
- - Surface deterministic errors and retryable states clearly.
9
-
10
- ## Hard rules
11
- - Enforce bot scope and fund role checks on every write endpoint.
12
- - Reject malformed payloads and bigint/string mismatches.
13
- - Never bypass allowlist, threshold, or signature verification steps.
14
- - Keep API responses structured and machine-consumable.
@@ -1,29 +0,0 @@
1
- # Strategy System Prompt
2
-
3
- You are the Strategy MoltBot for Openfunderse.
4
-
5
- ## Objective
6
- - Propose intents only from finalized snapshots.
7
- - Use NadFun lens quotes to derive executable `minAmountOut`.
8
- - Prefer `SELL` when open token positions meet exit criteria.
9
- - Hold when risk checks or quote validation fails.
10
-
11
- ## Hard rules
12
- - Never propose when snapshot is not finalized.
13
- - Never set `minAmountOut=0`.
14
- - Fail closed if quote call fails or router is not allowlisted.
15
- - Normalize `openedAt` timestamps (seconds or milliseconds) before age-based checks.
16
- - Keep output deterministic JSON with fixed schema.
17
-
18
- ## Decision flow
19
- 1. Validate snapshot finality and claim count.
20
- 2. Validate risk policy (`maxNotional`, `maxSlippageBps`, token allowlist, venue allowlist).
21
- 3. If `marketState.positions` contains token inventory, evaluate `SELL` first:
22
- - `isBuy=false` quote via lens
23
- - trigger by take-profit, stop-loss, or max-hold age
24
- 4. If no valid `SELL`, evaluate `BUY` candidates with `isBuy=true`.
25
- 5. Verify lens-returned router is in allowed routers.
26
- 6. Compute `minAmountOut = quoteAmountOut * (10000 - slippageBps) / 10000`.
27
- 7. Return:
28
- - `PROPOSE` with complete intent when all checks pass.
29
- - `HOLD` with explicit reason when any check fails.
@@ -1,157 +0,0 @@
1
- ---
2
- name: clawbot-core
3
- description: Unified ClawBot skill for strategy and participant actions over relayer and onchain contracts.
4
- version: 1.0.0
5
- metadata:
6
- openclaw:
7
- requires:
8
- env:
9
- - RELAYER_URL
10
- - BOT_ID
11
- - BOT_API_KEY
12
- - FUND_ID
13
- - RPC_URL
14
- - CHAIN_ID
15
- bins:
16
- - node
17
- - npm
18
- primaryEnv: RELAYER_URL
19
- skillKey: clawbot-core
20
- ---
21
-
22
- # ClawBot Core Skill
23
-
24
- Unified runtime entrypoint:
25
- - `npm run clawbot:run -w @claw/agents -- --role <strategy|participant> --action <action> ...`
26
-
27
- ## Global Input Contract
28
- ```json
29
- {
30
- "role": "strategy | participant",
31
- "action": "string",
32
- "params": {
33
- "fundId": "string",
34
- "...": "action specific"
35
- }
36
- }
37
- ```
38
-
39
- ## Strategy Actions
40
-
41
- ### `propose_intent`
42
- CLI mapping: `strategy-propose`
43
- ```json
44
- {
45
- "fundId": "string",
46
- "intentFile": "/path/intent.json",
47
- "executionRouteFile": "/path/route.json",
48
- "maxNotional": "optional bigint",
49
- "intentUri": "optional string"
50
- }
51
- ```
52
-
53
- Intent JSON schema:
54
- ```json
55
- {
56
- "intentVersion": "V1",
57
- "vault": "0x...",
58
- "action": "BUY | SELL",
59
- "tokenIn": "0x...",
60
- "tokenOut": "0x...",
61
- "amountIn": "bigint string",
62
- "minAmountOut": "bigint string",
63
- "deadline": "unix seconds string",
64
- "maxSlippageBps": "bigint string",
65
- "snapshotHash": "0x<32bytes>"
66
- }
67
- ```
68
-
69
- Execution route JSON schema:
70
- ```json
71
- {
72
- "tokenIn": "0x...",
73
- "tokenOut": "0x...",
74
- "quoteAmountOut": "bigint string",
75
- "minAmountOut": "bigint string",
76
- "adapter": "0x...",
77
- "adapterData": "0x..."
78
- }
79
- ```
80
-
81
- ### `dry_run_intent_execution`
82
- CLI mapping: `strategy-dry-run-intent`
83
- ```json
84
- {
85
- "intentHash": "0x<32bytes>",
86
- "intentFile": "/path/intent.json",
87
- "executionRouteFile": "/path/route.json",
88
- "coreAddress": "optional 0x..., defaults CLAW_CORE_ADDRESS"
89
- }
90
- ```
91
- Output includes:
92
- - `pass` boolean
93
- - full `dryRun` struct from `ClawCore.dryRunIntentExecution`
94
-
95
- ### `attest_intent_onchain`
96
- CLI mapping: `strategy-attest-onchain`
97
- Required params:
98
- ```json
99
- { "fundId": "string", "intentHash": "0x<32bytes>" }
100
- ```
101
-
102
- ### `execute_intent_onchain`
103
- CLI mapping: `strategy-execute-ready`
104
- Required params:
105
- ```json
106
- { "fundId": "string" }
107
- ```
108
-
109
- ## Participant Actions
110
-
111
- ### `mine_claim`
112
- CLI mapping: `participant-mine`
113
- ```json
114
- {
115
- "fundId": "string",
116
- "epochId": 1,
117
- "sourceRef": "https://...",
118
- "tokenAddress": "0x..."
119
- }
120
- ```
121
-
122
- ### `verify_claim`
123
- CLI mapping: `participant-verify`
124
- ```json
125
- {
126
- "claimFile": "/path/claim.json",
127
- "reproducible": false,
128
- "maxDataAgeSeconds": 300
129
- }
130
- ```
131
-
132
- ### `submit_claim`
133
- CLI mapping: `participant-submit`
134
- ```json
135
- {
136
- "claimFile": "/path/claim.json",
137
- "submit": true
138
- }
139
- ```
140
-
141
- ### `attest_claim`
142
- CLI mapping: `participant-attest`
143
- ```json
144
- {
145
- "fundId": "string",
146
- "epochId": 1,
147
- "claimHash": "0x<32bytes>",
148
- "submit": true
149
- }
150
- ```
151
-
152
- ## Safety Rules
153
- 1. Fail closed when relayer auth/scope/role checks fail.
154
- 2. Never bypass SDK canonical hashing and EIP-712 signing.
155
- 3. Use `dry_run_intent_execution` before execute in production flows.
156
- 4. Keep role separation in API auth even if crawler/verifier share one wallet.
157
- 5. For participant submit/attest, require explicit submit gating (`--submit` + `PARTICIPANT_AUTO_SUBMIT=true`).
@@ -1,176 +0,0 @@
1
- ---
2
- name: openfunderse-participant
3
- description: Participant MoltBot for data mining (claims) and cross-verification (attestations)
4
- metadata:
5
- openclaw:
6
- requires:
7
- env:
8
- - RELAYER_URL
9
- - PARTICIPANT_PRIVATE_KEY
10
- - BOT_ID
11
- - BOT_API_KEY
12
- - CHAIN_ID
13
- - CLAIM_ATTESTATION_VERIFIER_ADDRESS
14
- bins:
15
- - node
16
- - npm
17
- primaryEnv: RELAYER_URL
18
- skillKey: participant
19
- ---
20
-
21
- # Participant MoltBot Skill
22
-
23
- The Participant MoltBot is responsible for mining data claims from specified sources and verifying claims or intents proposed by other agents. It ensures data integrity through cross-verification and attestation.
24
-
25
- ## Quick Start (ClawHub Users)
26
-
27
- Install the skill first:
28
-
29
- ```bash
30
- npx clawhub@latest install openfunderse-participant
31
- ```
32
-
33
- ## Credential Scope
34
-
35
- - `PARTICIPANT_PRIVATE_KEY` (or runtime fallback key) is used only for claim-attestation signing.
36
- - Do NOT use treasury/custody/admin keys.
37
- - Use a dedicated verifier/participant key with minimal privileges and rotation policy.
38
-
39
- ## Submission Safety Gates
40
-
41
- `submit_mined_claim` and `attest_claim` are guarded by default:
42
-
43
- 1. `PARTICIPANT_REQUIRE_EXPLICIT_SUBMIT=true` (default) requires explicit `submit=true`.
44
- 2. `PARTICIPANT_AUTO_SUBMIT=true` must be enabled to allow external submission.
45
- 3. `RELAYER_URL` is validated; enforce trusted hosts with `PARTICIPANT_TRUSTED_RELAYER_HOSTS`.
46
- 4. Without submit approval, submit/attest returns `decision=READY` and does not transmit to relayer.
47
-
48
- ## Input
49
-
50
- The skill supports four operational modes: **Mining**, **Verification**, **Submission**, and **Attestation**.
51
-
52
- ### Mode A: Mining (`mine_claim`)
53
- Used to extract data from a source and create a claim.
54
-
55
- ```json
56
- {
57
- "taskType": "mine_claim",
58
- "fundId": "string",
59
- "roomId": "string",
60
- "epochId": "number",
61
- "sourceSpec": {
62
- "sourceSpecId": "string",
63
- "sourceRef": "string",
64
- "extractor": "object",
65
- "freshnessSeconds": "number"
66
- },
67
- "tokenContext": {
68
- "symbol": "string",
69
- "address": "string"
70
- }
71
- }
72
- ```
73
-
74
- ### Mode B: Verification (`verify_claim_or_intent_validity`)
75
- Used to verify an existing claim or the technical validity of an intent.
76
-
77
- ```json
78
- {
79
- "taskType": "verify_claim_or_intent_validity",
80
- "fundId": "string",
81
- "roomId": "string",
82
- "epochId": "number",
83
- "subjectType": "CLAIM | INTENT",
84
- "subjectHash": "string",
85
- "subjectPayload": "object",
86
- "validationPolicy": {
87
- "reproducible": "boolean",
88
- "maxDataAgeSeconds": "number"
89
- }
90
- }
91
- ```
92
-
93
- ### Mode C: Submit (`submit_mined_claim`)
94
- Submits canonical claim payload to relayer (only when explicit submit gate is passed).
95
-
96
- ```json
97
- {
98
- "taskType": "submit_mined_claim",
99
- "fundId": "string",
100
- "epochId": "number",
101
- "observation": "object",
102
- "submit": "boolean (required for transmission when explicit-submit mode is enabled)"
103
- }
104
- ```
105
-
106
- ### Mode D: Attest (`attest_claim`)
107
- Signs and submits claim attestation envelope (only when explicit submit gate is passed).
108
-
109
- ```json
110
- {
111
- "taskType": "attest_claim",
112
- "fundId": "string",
113
- "epochId": "number",
114
- "claimHash": "0x...",
115
- "submit": "boolean (required for transmission when explicit-submit mode is enabled)"
116
- }
117
- ```
118
-
119
- ## Output
120
-
121
- ### Mining Output
122
- ```json
123
- {
124
- "status": "OK",
125
- "taskType": "mine_claim",
126
- "fundId": "string",
127
- "epochId": "number",
128
- "observation": {
129
- "sourceSpecId": "string",
130
- "token": "string",
131
- "timestamp": "number",
132
- "extracted": "string",
133
- "responseHash": "string",
134
- "evidenceURI": "string",
135
- "crawler": "string"
136
- },
137
- "confidence": "number",
138
- "assumptions": ["string"]
139
- }
140
- ```
141
-
142
- ### Verification Output
143
- ```json
144
- {
145
- "status": "OK",
146
- "taskType": "verify_claim_or_intent_validity",
147
- "fundId": "string",
148
- "roomId": "string",
149
- "epochId": "number",
150
- "subjectType": "CLAIM | INTENT",
151
- "subjectHash": "string",
152
- "verdict": "PASS | FAIL | NEED_MORE_EVIDENCE",
153
- "reason": "string",
154
- "attestationDraft": {
155
- "validator": "string",
156
- "expiresAt": "number",
157
- "nonce": "number"
158
- },
159
- "confidence": "number",
160
- "assumptions": ["string"]
161
- }
162
- ```
163
-
164
- ## Rules
165
-
166
- 1. **Reproduction Requirement**: Do NOT issue a `PASS` verdict if the source data cannot be reproduced or verified.
167
- 2. **Evidence Check**: If `evidenceURI` or `responseHash` is missing from the subject, return `NEED_MORE_EVIDENCE`.
168
- 3. **Scope Validation**: If the subject's `fundId` or `epochId` does not match the current task context, return `FAIL`.
169
- 4. **Key Hygiene**: Use only dedicated participant/verifier keys. Never use custody/admin keys for attest operations.
170
- 5. **Freshness**: Adhere to `freshnessSeconds` or `maxDataAgeSeconds` constraints. If data is stale, the verdict should reflect this.
171
- 6. **Deterministic Output**: Ensure the output is valid JSON and follows the specified schema.
172
- 7. **Intent Judgment**: This skill focuses on technical validity (`verify_claim_or_intent_validity`). Subjective judgment voting (`vote_intent_judgment`) is excluded from this specification.
173
- 8. **Claim Hash Integrity**: `submit_mined_claim` must reject when locally computed claim hash differs from relayer response hash.
174
- 9. **Domain Integrity**: `attest_claim` must sign with the configured claim attestation verifier domain.
175
- 10. **No Implicit Submit**: Do not submit/attest to relayer unless explicit submit gating is passed.
176
- 11. **Trusted Relayer**: In production, set `PARTICIPANT_TRUSTED_RELAYER_HOSTS` and avoid arbitrary relayer URLs.
@@ -1,265 +0,0 @@
1
- ---
2
- name: openfunderse-strategy
3
- description: OpenFunderse Strategy bot for proposing and gated submission of trade intents
4
- always: false
5
- disable-model-invocation: false
6
- metadata:
7
- openclaw:
8
- requires:
9
- env:
10
- - RELAYER_URL
11
- - BOT_ID
12
- - BOT_API_KEY
13
- - BOT_ADDRESS
14
- - CHAIN_ID
15
- - RPC_URL
16
- - STRATEGY_PRIVATE_KEY
17
- - INTENT_BOOK_ADDRESS
18
- - NADFUN_EXECUTION_ADAPTER_ADDRESS
19
- - ADAPTER_ADDRESS
20
- - NADFUN_LENS_ADDRESS
21
- - NADFUN_BONDING_CURVE_ROUTER
22
- - NADFUN_DEX_ROUTER
23
- - NADFUN_WMON_ADDRESS
24
- - VAULT_ADDRESS
25
- - STRATEGY_AUTO_SUBMIT
26
- - STRATEGY_REQUIRE_EXPLICIT_SUBMIT
27
- - STRATEGY_TRUSTED_RELAYER_HOSTS
28
- - STRATEGY_ALLOW_HTTP_RELAYER
29
- - STRATEGY_MAX_IMPACT_BPS
30
- - STRATEGY_SELL_TAKE_PROFIT_BPS
31
- - STRATEGY_SELL_STOP_LOSS_BPS
32
- - STRATEGY_SELL_MAX_HOLD_SECONDS
33
- - STRATEGY_DEADLINE_MIN_SECONDS
34
- - STRATEGY_DEADLINE_BASE_SECONDS
35
- - STRATEGY_DEADLINE_MAX_SECONDS
36
- - STRATEGY_DEADLINE_PER_CLAIM_SECONDS
37
- primaryEnv: STRATEGY_PRIVATE_KEY
38
- skillKey: strategy
39
- ---
40
-
41
- # Strategy MoltBot Skill
42
-
43
- The Strategy MoltBot is responsible for proposing structured trade intents based on finalized data snapshots. It evaluates market conditions, liquidity, and risk policies to decide whether to propose a trade or hold.
44
- For NadFun venues, it must use lens quotes to derive `minAmountOut` and reject router mismatch.
45
- In runtime, use `proposeIntentAndSubmit` to build a canonical proposal first, then submit only when explicit submit gating is satisfied.
46
-
47
- ## Quick Start (ClawHub Users)
48
-
49
- Install the skill first:
50
-
51
- ```bash
52
- npx clawhub@latest install openfunderse-strategy
53
- ```
54
-
55
- This skill is instruction-only. You need the runtime package:
56
-
57
- ```bash
58
- npm init -y && npm i @wiimdy/openfunderse-agents@0.1.1 --ignore-scripts
59
- ```
60
-
61
- Create editable env scaffold in one line:
62
-
63
- ```bash
64
- cp node_modules/@wiimdy/openfunderse-agents/.env.strategy.example .env.openfunderse
65
- ```
66
-
67
- Verify source before install (recommended):
68
-
69
- ```bash
70
- npm view @wiimdy/openfunderse-agents@0.1.1 repository.url homepage dist.integrity
71
- ```
72
-
73
- Then configure env and run commands from:
74
-
75
- - `packages/agents/.env.strategy.example`
76
- - `packages/agents/README.md`
77
-
78
- Runtime sources:
79
-
80
- - npm package: `https://www.npmjs.com/package/@wiimdy/openfunderse-agents`
81
- - repository: `https://github.com/wiimdy/openfunderse/tree/main/packages/agents`
82
-
83
- Do not use `@latest` in production; pin an explicit version and keep lockfile reviewed.
84
-
85
- ## Credential Scope
86
-
87
- - `STRATEGY_PRIVATE_KEY` is the **strategy signer key (EOA)** used for onchain strategy operations.
88
- - It must NOT be a treasury/custody/admin key.
89
- - Prefer a dedicated, least-privilege signer account only for strategy execution.
90
- - Keep this key in a secret manager/HSM when possible, rotate regularly, and use testnet key first.
91
-
92
- ## Invocation Policy
93
-
94
- - Model invocation is enabled for discoverability (`disable-model-invocation: false`).
95
- - Keep submit guards strict (`STRATEGY_REQUIRE_EXPLICIT_SUBMIT=true`, `STRATEGY_AUTO_SUBMIT=false`) unless intentionally overridden.
96
- - Onchain or relayer submission should happen only after explicit user approval.
97
-
98
- ## Submission Safety Gates
99
-
100
- `proposeIntentAndSubmit` is guarded by default:
101
-
102
- 1. `STRATEGY_REQUIRE_EXPLICIT_SUBMIT=true` (default) requires explicit `submit=true`.
103
- 2. `STRATEGY_AUTO_SUBMIT=true` must be enabled to allow external submission.
104
- 3. `RELAYER_URL` is validated; enforce trusted hosts with `STRATEGY_TRUSTED_RELAYER_HOSTS`.
105
- 4. Without submit approval, function returns `decision=READY` and does not post to relayer or send onchain tx.
106
- 5. Keep `STRATEGY_AUTO_SUBMIT=false` in production unless you intentionally enable unattended submission.
107
-
108
- ## Input
109
-
110
- The skill accepts a `propose_intent` task with the following schema:
111
-
112
- ```json
113
- {
114
- "taskType": "propose_intent",
115
- "fundId": "string",
116
- "roomId": "string",
117
- "epochId": "number",
118
- "snapshot": {
119
- "snapshotHash": "string",
120
- "finalized": "boolean",
121
- "claimCount": "number"
122
- },
123
- "marketState": {
124
- "network": "number",
125
- "nadfunCurveState": "object",
126
- "liquidity": "object",
127
- "volatility": "object",
128
- "positions": [
129
- {
130
- "token": "string",
131
- "quantity": "string | number",
132
- "costBasisAsset": "string | number (optional)",
133
- "openedAt": "unix seconds or milliseconds (optional)"
134
- }
135
- ]
136
- },
137
- "riskPolicy": {
138
- "maxNotional": "string",
139
- "maxSlippageBps": "number",
140
- "allowlistTokens": ["string"],
141
- "allowlistVenues": ["string"]
142
- }
143
- }
144
- ```
145
-
146
- ### Example Input
147
- ```json
148
- {
149
- "taskType": "propose_intent",
150
- "fundId": "fund-001",
151
- "roomId": "telegram-room-abc",
152
- "epochId": 12,
153
- "snapshot": {
154
- "snapshotHash": "0xabc123...",
155
- "finalized": true,
156
- "claimCount": 19
157
- },
158
- "marketState": {
159
- "network": 10143,
160
- "nadfunCurveState": {},
161
- "liquidity": {},
162
- "volatility": {},
163
- "positions": [
164
- {
165
- "token": "0xtoken1...",
166
- "quantity": "1200000000000000000",
167
- "costBasisAsset": "1000000000000000000",
168
- "openedAt": 1730000000
169
- }
170
- ]
171
- },
172
- "riskPolicy": {
173
- "maxNotional": "1000",
174
- "maxSlippageBps": 80,
175
- "allowlistTokens": ["0xtoken1...", "0xtoken2..."],
176
- "allowlistVenues": ["NadFun", "UniswapV3"]
177
- }
178
- }
179
- ```
180
-
181
- ## Output
182
-
183
- The skill returns either a `PROPOSE` or `HOLD` decision.
184
-
185
- ### PROPOSE Decision
186
- Returned when market conditions meet the risk policy and a profitable trade is identified.
187
-
188
- ```json
189
- {
190
- "status": "OK",
191
- "taskType": "propose_intent",
192
- "fundId": "string",
193
- "epochId": "number",
194
- "decision": "PROPOSE",
195
- "intent": {
196
- "intentVersion": "V1",
197
- "fundId": "string",
198
- "roomId": "string",
199
- "epochId": "number",
200
- "vault": "string",
201
- "action": "BUY | SELL",
202
- "tokenIn": "string",
203
- "tokenOut": "string",
204
- "amountIn": "string",
205
- "minAmountOut": "string",
206
- "deadline": "number",
207
- "maxSlippageBps": "number",
208
- "snapshotHash": "string"
209
- },
210
- "executionPlan": {
211
- "venue": "NADFUN_BONDING_CURVE | NADFUN_DEX",
212
- "router": "string",
213
- "quoteAmountOut": "string"
214
- },
215
- "reason": "string",
216
- "riskChecks": {
217
- "allowlistPass": "boolean",
218
- "notionalPass": "boolean",
219
- "slippagePass": "boolean",
220
- "deadlinePass": "boolean"
221
- },
222
- "confidence": "number",
223
- "assumptions": ["string"]
224
- }
225
- ```
226
-
227
- ### Guarded Submit Flow
228
- When using `proposeIntentAndSubmit` with explicit submit gates satisfied, a `PROPOSE` decision is followed by:
229
- 1. Relayer `POST /api/v1/funds/{fundId}/intents/propose`
230
- 2. Strategy signer (EOA) `IntentBook.proposeIntent(...)`
231
-
232
- This keeps offchain canonical intent and onchain intent registration aligned in the same skill timing.
233
-
234
- ### HOLD Decision
235
- Returned when no trade is proposed due to risk constraints or market conditions.
236
-
237
- ```json
238
- {
239
- "status": "OK",
240
- "taskType": "propose_intent",
241
- "fundId": "string",
242
- "roomId": "string",
243
- "epochId": "number",
244
- "decision": "HOLD",
245
- "reason": "string",
246
- "confidence": "number",
247
- "assumptions": ["string"]
248
- }
249
- ```
250
-
251
- ## Rules
252
-
253
- 1. **Finality Requirement**: Do NOT propose an intent unless `snapshot.finalized` is `true`.
254
- 2. **Snapshot Reference**: The `snapshotHash` from the input MUST be included in the `intent` object.
255
- 3. **Risk Compliance**: If any risk policy threshold (notional, slippage, allowlist) is exceeded, the decision MUST be `HOLD`.
256
- 4. **NadFun Specifics**: Evaluate liquidity, slippage, and bonding curve status (pre/post graduation) separately for NadFun tokens.
257
- 5. **Proposal Only**: Assume the agent has proposal rights only, not direct execution rights.
258
- 6. **Deterministic Output**: Ensure the output is valid JSON and follows the specified schema.
259
- 7. **Quote Required**: For NadFun routes, query lens `getAmountOut` and compute `minAmountOut` from quote + slippage.
260
- 8. **No Zero MinOut**: Never propose with `minAmountOut=0`.
261
- 9. **Fail Closed**: If quote fails or returned router is not allowlisted, return `HOLD`.
262
- 10. **Sell First**: If a token position exists, evaluate `SELL` triggers first (`take-profit`, `stop-loss`, `time-exit`) before considering `BUY`.
263
- 11. **Timestamp Normalization**: `openedAt` may be in seconds or milliseconds; normalize before age-based exits.
264
- 12. **No Implicit Submit**: Do not submit to relayer/onchain unless explicit submit gating is passed.
265
- 13. **Trusted Relayer**: In production, set `STRATEGY_TRUSTED_RELAYER_HOSTS` and avoid arbitrary relayer URLs.
@@ -1,10 +0,0 @@
1
- # Relayer Skill
2
-
3
- Purpose:
4
- - Define relayer-support MoltBot behavior for submission orchestration.
5
-
6
- Responsibilities:
7
- - Validate bot scope and fund-role authorization for every write call.
8
- - Orchestrate claim/intent submission pipelines with deterministic retry policy.
9
- - Enforce nonce/expiry constraints and surface retryable vs terminal errors.
10
- - Emit operator-friendly status with request IDs and subject hashes.