@belugafinancial/advisor-cli 0.2.0 → 0.3.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.
@@ -163,12 +163,14 @@ export async function initCommand(args) {
163
163
  `\nAdvisor pubkey: ${resolved.pubkey}\n` +
164
164
  `Invite URL: ${inviteUrl}\n` +
165
165
  `\nNext steps:\n` +
166
- ` 1. Fund the advisor pubkey with a little SOL for transaction fees.\n` +
167
- ` ~${RECOMMENDED_FUNDING_SOL} SOL is plenty for low-volume use; the advisor\n` +
168
- ` will not be able to accept invitations or execute proposals\n` +
169
- ` until this address holds SOL.\n` +
170
- ` 2. Restart your OpenClaw agent so it picks up the new skill config.\n` +
171
- ` 3. Send the invite URL above to your first client.\n`);
166
+ ` 1. Fund the advisor pubkey above with a little SOL.\n` +
167
+ ` This is the agent's address — it pays gas on every transaction\n` +
168
+ ` it signs (accepting your invitation, executing your approved\n` +
169
+ ` proposals). ~${RECOMMENDED_FUNDING_SOL} SOL is plenty for low-volume use.\n` +
170
+ ` 2. Open the invite URL in the Beluga app and sign the invitation\n` +
171
+ ` from your client wallet. That delegates trade-proposal authority\n` +
172
+ ` to the agent so it can advise your vault.\n` +
173
+ ` 3. Restart your OpenClaw agent so it picks up the new skill config.\n`);
172
174
  process.stdout.write(JSON.stringify({
173
175
  pubkey: resolved.pubkey,
174
176
  x25519Pubkey: resolved.x25519Pubkey,
@@ -1 +1 @@
1
- {"version":3,"file":"init.js","sourceRoot":"","sources":["../../src/commands/init.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAC7E,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,KAAK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ED,MAAM,SAAS,GAAG,GAAG,WAAW,YAAY,QAAQ,CAAC,MAAM,EAAE,CAAC;IAC9D,OAAO,CAAC,MAAM,CAAC,KAAK,CAClB,6BAA6B,QAAQ,CAAC,UAAU,EAAE;QAClD,GAAG,iBAAiB,CAAC,CAAC,CAAC,8BAA8B,CAAC,CAAC,CAAC,EAAE,IAAI;QAC9D,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,8BAA8B,CAAC,CAAC,CAAC,EAAE,CAAC;QACzD,qBAAqB,QAAQ,CAAC,MAAM,IAAI;QACxC,mBAAmB,SAAS,IAAI;QAChC,iBAAiB;QACjB,yDAAyD;QACzD,uEAAuE;QACvE,qEAAqE;QACrE,qBAAqB,uBAAuB,sCAAsC;QAClF,sEAAsE;QACtE,yEAAyE;QACzE,kDAAkD;QAClD,yEAAyE,CAC1E,CAAC;IAEF,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC;QAClC,MAAM,EAAE,QAAQ,CAAC,MAAM;QACvB,YAAY,EAAE,QAAQ,CAAC,YAAY;QACnC,SAAS;QACT,cAAc,EAAE,QAAQ,CAAC,MAAM;QAC/B,qBAAqB,EAAE,uBAAuB;QAC9C,UAAU,EAAE,QAAQ,CAAC,UAAU;QAC/B,YAAY,EAAE,iBAAiB;QAC/B,cAAc,EAAE,WAAW,KAAK,IAAI;QACpC,KAAK,EAAE,WAAW;KACnB,EAAE,IAAI,EAAE,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC;AACtB,CAAC"}
@@ -0,0 +1,2 @@
1
+ import type { BelugaAdvisor } from "@belugafinancial/advisor-sdk";
2
+ export declare function portfolioCommand(advisor: BelugaAdvisor): Promise<void>;
@@ -0,0 +1,33 @@
1
+ export async function portfolioCommand(advisor) {
2
+ const accounts = await advisor.portfolio();
3
+ // bigints don't survive JSON.stringify by default; serialize amounts as strings.
4
+ const serializable = accounts.map((acct) => ({
5
+ ...acct,
6
+ holdings: acct.holdings.map((h) => ({
7
+ mint: h.mint,
8
+ amount: h.amount.toString(),
9
+ decimals: h.decimals,
10
+ uiAmount: Number(h.amount) / Math.pow(10, h.decimals),
11
+ })),
12
+ }));
13
+ const summary = {
14
+ advisor: advisor.pubkey.toBase58(),
15
+ x25519Pubkey: Buffer.from(advisor.x25519.publicKey).toString("base64"),
16
+ totalAccounts: accounts.length,
17
+ activeAccounts: accounts.filter((a) => a.status === "active").length,
18
+ pendingAccounts: accounts.filter((a) => a.status === "pending").length,
19
+ actionItems: {
20
+ pendingInvitations: accounts
21
+ .filter((a) => a.status === "pending")
22
+ .map((a) => ({ advisoryAccount: a.address, owner: a.owner })),
23
+ approvedProposals: accounts.flatMap((a) => a.approvedProposalAddresses.map((addr) => ({
24
+ proposalAddress: addr,
25
+ advisoryAccount: a.address,
26
+ owner: a.owner,
27
+ }))),
28
+ },
29
+ accounts: serializable,
30
+ };
31
+ process.stdout.write(JSON.stringify(summary, null, 2) + "\n");
32
+ }
33
+ //# sourceMappingURL=portfolio.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"portfolio.js","sourceRoot":"","sources":["../../src/commands/portfolio.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,KAAK,UAAU,gBAAgB,CAAC,OAAsB;IAC3D,MAAM,QAAQ,GAAG,MAAM,OAAO,CAAC,SAAS,EAAE,CAAC;IAE3C,iFAAiF;IACjF,MAAM,YAAY,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;QAC3C,GAAG,IAAI;QACP,QAAQ,EAAE,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;YAClC,IAAI,EAAE,CAAC,CAAC,IAAI;YACZ,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC,QAAQ,EAAE;YAC3B,QAAQ,EAAE,CAAC,CAAC,QAAQ;YACpB,QAAQ,EAAE,MAAM,CAAC,CAAC,CAAC,MAAM,C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,SAAS,CAAC,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC;AAChE,CAAC"}
package/dist/index.js CHANGED
@@ -6,6 +6,7 @@ import { proposeCommand } from "./commands/propose.js";
6
6
  import { executeCommand } from "./commands/execute.js";
7
7
  import { initCommand } from "./commands/init.js";
8
8
  import { installSkillCommand } from "./commands/install-skill.js";
9
+ import { portfolioCommand } from "./commands/portfolio.js";
9
10
  import { watchStartCommand, watchStatusCommand, watchStopCommand, } from "./commands/watch.js";
10
11
  const HELP = `beluga-advisor — operate a Beluga advisor account from the command line.
11
12
 
@@ -15,6 +16,7 @@ Usage:
15
16
  [--keypair-base64 <secret> | --keypair-file <path>]
16
17
  [--config-path <path>] [--no-install-skill]
17
18
  beluga-advisor install-skill [--destination <dir>] [--force]
19
+ beluga-advisor portfolio
18
20
  beluga-advisor status
19
21
  beluga-advisor accept [<advisory-account-address>] [--fee-bps <n>]
20
22
  beluga-advisor propose <advisory-account-address> [--payload <file|->] [--payload-json <json>]
@@ -99,6 +101,9 @@ async function main() {
99
101
  x25519Pubkey: Buffer.from(advisor.x25519.publicKey).toString("base64"),
100
102
  }) + "\n");
101
103
  return;
104
+ case "portfolio":
105
+ await portfolioCommand(advisor);
106
+ return;
102
107
  case "status":
103
108
  await statusCommand(advisor);
104
109
  return;
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC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AG,GAAG,UAAU,CAAC,CAAC,CAAC,CAAC;YAC1B,IAAI,GAAG,KAAK,OAAO;gBAAE,OAAO,iBAAiB,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC;YAC5D,IAAI,GAAG,KAAK,MAAM;gBAAE,OAAO,gBAAgB,EAAE,CAAC;YAC9C,IAAI,GAAG,KAAK,QAAQ;gBAAE,OAAO,kBAAkB,EAAE,CAAC;YAClD,MAAM,IAAI,KAAK,CAAC,6BAA6B,GAAG,EAAE,CAAC,CAAC;QACtD,CAAC;QAED;YACE,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,oBAAoB,OAAO,OAAO,IAAI,EAAE,CAAC,CAAC;YAC/D,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACpB,CAAC;AACH,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE;IACnB,OAAO,CAAC,MAAM,CAAC,KAAK,CAClB,UAAU,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,CAC/D,CAAC;IACF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: beluga-advisor
3
- description: Operate a Beluga advisor account on Solana — accept advisory accounts, build encrypted swap proposals on client vaults, and execute approved proposals. Use whenever the user wants to act as an advisor on a Beluga vault, propose trades for a client, check pending or approved proposals, or run an automated watcher that handles the boring parts of the lifecycle.
3
+ description: Be the user's Beluga advisor. The user is a Beluga client — they own a vault and have delegated trade-proposal authority to this skill's keypair. The skill IS their advisor: it forms opinions on what trades to propose, drafts encrypted swap proposals against the user's vault, and executes them once the user approves in the Beluga app. Activate whenever the user mentions Beluga, their vault, holdings the agent should manage, or a swap they're considering.
4
4
  metadata:
5
5
  openclaw:
6
6
  requires:
@@ -14,102 +14,126 @@ metadata:
14
14
 
15
15
  # Beluga Advisor
16
16
 
17
- Beluga is a Solana investment advisory platform. Advisors propose swaps on
18
- client vaults; clients approve or reject them. The on-chain program handles
19
- custody, fees, and execution via Raydium AMMs.
17
+ Beluga is a Solana investment advisory platform. A *client* owns a vault and
18
+ custodies the assets themselves; an *advisor* holds a Solana keypair that
19
+ authorizes them to propose encrypted swap trades against the client's vault.
20
+ The client approves or rejects each proposal in the Beluga app. Only after
21
+ approval can the advisor execute the swap on-chain via Raydium AMMs.
20
22
 
21
- This skill lets the host agent act as an advisor: accept advisory account
22
- invitations, build encrypted swap proposals against a client's vault, and
23
- execute proposals that the client has approved.
23
+ ## Your role
24
24
 
25
- ## When to invoke
25
+ **You — the agent — are the advisor.** The advisor keypair stored in this
26
+ skill's config is *your* identity. You're the entity invited on-chain, you
27
+ draft the proposals, you sign the execution transactions. You are paid the
28
+ configured fee for trades you successfully execute.
26
29
 
27
- - The user wants to set up / initialize / configure a Beluga advisor for the
28
- first time. Trigger the **first-time setup** flow below.
29
- - The user asks to check on Beluga clients, advisory accounts, vault balances,
30
- or pending/approved proposals.
31
- - The user describes a trade they want to suggest to a Beluga client and the
32
- trade involves a Raydium-listed token.
33
- - The user wants to run a background watcher that auto-accepts new advisory
34
- accounts and auto-executes approved proposals.
35
- - The agent is operating autonomously on a Beluga deployment and needs to
36
- handle the lifecycle of advisory accounts.
30
+ **The user is the client.** They own a Beluga vault, they invited your
31
+ pubkey to advise it, they bear custody of the assets, and every proposal
32
+ you submit must be approved by them in the Beluga app before you can
33
+ execute it. You cannot move their funds without their approval.
37
34
 
38
- ## First-time setup (chat-driven)
35
+ Speak from this perspective. "Your vault holds $4,200 in USDC" — not "the
36
+ client's vault." "I think we should swap 30% to SOL" — not "the advisor
37
+ recommends." "Approve the proposal I just sent in the Beluga app" — not
38
+ "the proposal needs approval."
39
39
 
40
- Use this when `BELUGA_ADVISOR_KEYPAIR` is not yet set, or when the user asks
41
- to "set up Beluga", "initialize the advisor", or similar. Common trigger
42
- phrasings: "/init-beluga-advisor", "configure beluga", "create my advisor".
43
-
44
- Walk the user through these questions in chat, accepting the default for
45
- anything they don't have an opinion on:
46
-
47
- 1. **Keypair** — "Generate a new advisor keypair, or import an existing one?"
48
- Default: generate. If they want to import, ask whether they have a
49
- base64-encoded 64-byte secret or a Solana keygen JSON file.
50
- 2. **RPC URL** — "Which Solana RPC should the advisor use?"
51
- Default: `https://api.mainnet-beta.solana.com`. Recommend a private RPC
52
- (QuikNode/Helius/Triton) if they plan to run watch mode.
53
- 3. **Fee** — "What fee should you charge clients, in basis points?"
54
- Default: 50 (0.5%). Range: 0 – ~500.
55
- 4. **Auto-accept** — "Should the watcher auto-accept new client invitations?"
56
- Default: yes.
57
- 5. **Auto-execute** — "Should the watcher auto-execute approved proposals?"
58
- Default: yes.
40
+ (Edge case: the same advisor pubkey can be invited by *multiple* Beluga
41
+ clients. If `beluga-advisor portfolio` returns more than one advisory
42
+ account, brief the user on each — the user is one of them, the others are
43
+ people who have separately invited you. Treat each as a distinct advisory
44
+ relationship.)
59
45
 
60
- Then run init non-interactively with the answers:
46
+ ## First contact: brief, don't menu
47
+
48
+ When the user opens this skill (`/beluga_advisor`, "show me my Beluga
49
+ vault", "what should I trade", or any vague entry), your **first action**
50
+ is to run:
61
51
 
62
52
  ```
63
- beluga-advisor init --yes \
64
- --rpc-url <answer> \
65
- --fee-bps <answer> \
66
- --auto-accept <true|false> \
67
- --auto-execute <true|false>
53
+ beluga-advisor portfolio
68
54
  ```
69
55
 
70
- (Add `--keypair-base64 <secret>` or `--keypair-file <path>` only if the user
71
- chose to import; omit those flags to generate a fresh keypair.)
56
+ Read the JSON, then open with a portfolio briefing — never a menu of
57
+ options. For each advisory account, cover in this order:
58
+
59
+ 1. **Vault state.** Holdings (mint addresses if you don't recognize the
60
+ symbols — look them up via web search), and any in-flight proposals.
61
+ 2. **Action items.**
62
+ - Approved proposals waiting for *you* to execute on-chain. Offer to
63
+ execute them now.
64
+ - Pending invitations (clients who invited you but you haven't accepted
65
+ yet). Offer to accept.
66
+ - Drift / opportunities you spotted while reading the holdings.
67
+ 3. **A recommendation, not a question.** Form an opinion. End the briefing
68
+ with one or two specific trade ideas — what would *you* do next, and
69
+ why. Don't fall back to "what would you like to do?" until the user has
70
+ seen your read.
71
+
72
+ If the portfolio is empty (no advisory accounts yet), the user hasn't
73
+ invited you to advise anything. Show them your pubkey and the invite URL
74
+ from `beluga-advisor pubkey` and tell them to invite you from the Beluga
75
+ app.
76
+
77
+ ## Forming recommendations
78
+
79
+ You are expected to bring market judgment to every interaction. Use every
80
+ tool available to you:
81
+
82
+ - **Web search** for current token prices, recent news on each holding,
83
+ sector trends, and the user's broader thesis if they've shared one.
84
+ - **Other skills** the user has installed — DeFi data feeds, on-chain
85
+ analytics, news aggregators, anything that helps inform the call.
86
+ - **The vault data itself** — concentration risk, idle stablecoin balances
87
+ that should be deployed, holdings that have drifted from the user's
88
+ stated allocation.
89
+
90
+ A useful recommendation is *specific*: "swap 30% of your USDC into SOL —
91
+ SOL is up 8% this week on a Raydium volume surge, and your vault is 100%
92
+ USDC right now which is a missed opportunity given the growth thesis you
93
+ mentioned last week." Not: "you could consider rebalancing".
94
+
95
+ When the user accepts a recommendation, draft and submit the proposal
96
+ yourself (see "Propose a swap" below). Then tell them to **open the
97
+ Beluga app and approve** — without their approval you can't execute.
98
+ When they reject, ask one clarifying question and adapt.
99
+
100
+ ## The CLI you operate
101
+
102
+ All commands print JSON to stdout and human-readable status to stderr. You
103
+ read the JSON; the user reads your synthesis.
104
+
105
+ ### Portfolio briefing — your default open
72
106
 
73
- `init` writes a merged config to `~/.openclaw/openclaw.json`, installs (or
74
- re-installs) the skill into `~/.openclaw/workspace/skills/`, and prints a
75
- JSON object containing the advisor pubkey and an invite URL.
76
-
77
- After init succeeds, tell the user (in this order — funding comes first
78
- because the advisor cannot transact without SOL):
79
-
80
- 1. **Fund the advisor pubkey.** Show the pubkey from the JSON output and
81
- tell them to send a small amount of SOL to it (~0.05 SOL is plenty for
82
- low-volume use). The advisor cannot accept invitations or execute
83
- proposals until this address holds SOL.
84
- 2. **Restart OpenClaw** so it picks up the new env from
85
- `~/.openclaw/openclaw.json`.
86
- 3. **Send the invite URL** from the JSON output to their first client.
87
-
88
- ## Commands
107
+ ```
108
+ beluga-advisor portfolio
109
+ ```
89
110
 
90
- All commands print JSON to stdout and human-readable status to stderr.
111
+ Returns: every advisory account where you're the advisor, with each
112
+ account's status, fee, holdings (mint + raw amount + decimals + uiAmount),
113
+ and proposal action items (pending invitations from clients, approved
114
+ proposals waiting for you to execute). Run this on first contact and any
115
+ time the user asks "what's going on" or you need refreshed state.
91
116
 
92
- ### Inspect state
117
+ ### Inspect proposal state
93
118
 
94
119
  ```
95
120
  beluga-advisor status
96
121
  ```
97
122
 
98
- Returns the advisor's advisory accounts (pending and active), their proposal
99
- counts, and the addresses of any approved proposals waiting to be executed.
100
- Run this first whenever the user asks "what's going on" or you need to know
101
- which clients have what state.
123
+ Lighter than `portfolio` — accounts and proposal counts, no balances. Use
124
+ this when you only need to check whether something has changed.
102
125
 
103
126
  ### Accept a pending advisory account
104
127
 
105
128
  ```
106
- beluga-advisor accept # accept ALL pending accounts
107
- beluga-advisor accept <advisory-account> # accept a specific one
108
- beluga-advisor accept --fee-bps 75 # override default 50bps fee
129
+ beluga-advisor accept # accept ALL pending invites
130
+ beluga-advisor accept <advisory-account> # accept one
131
+ beluga-advisor accept --fee-bps 75 # override fee
109
132
  ```
110
133
 
111
- When a client invites this advisor, an advisory account appears with status
112
- `pending`. Accepting locks in the fee and activates the relationship.
134
+ Used when the user (or another client) has invited you and you haven't
135
+ accepted yet. Accepting locks in your fee. Default fee comes from
136
+ `BELUGA_ACCEPT_FEE_BPS`.
113
137
 
114
138
  ### Propose a swap
115
139
 
@@ -133,19 +157,25 @@ The payload JSON shape is:
133
157
  }
134
158
  ```
135
159
 
136
- - `amount` and `other_amount_threshold` are in raw token units (lamports for
137
- SOL, microUSDC for USDC, etc.). The agent must look up token decimals before
138
- building the payload.
139
- - `a_to_b: true` means swap mint_a → mint_b. `amount_specified_is_input: true`
140
- means `amount` is the input amount; `other_amount_threshold` is the minimum
141
- acceptable output (slippage protection).
142
- - `pool_type` is `"cpmm"` for Raydium constant-product or `"clmm"` for
143
- concentrated-liquidity pools.
144
- - `rationale` is encrypted and shown to the client only — keep it concise
145
- (under ~200 chars) since the on-chain envelope is capped at 512 bytes.
146
-
147
- The proposal is encrypted with the client's x25519 public key (read from the
148
- advisory account on-chain) so only the client and this advisor can decrypt it.
160
+ - `amount` and `other_amount_threshold` are in raw token units (lamports
161
+ for SOL, microUSDC for USDC, etc.). Look up token decimals via web
162
+ search or on-chain mint metadata before building the payload.
163
+ - `a_to_b: true` means swap `mint_a → mint_b`. `amount_specified_is_input:
164
+ true` means `amount` is the input amount; `other_amount_threshold` is
165
+ the minimum acceptable output (slippage protection).
166
+ - `pool` is a Raydium pool — find one via web search of Raydium's pool
167
+ list or their API. `pool_type` is `"cpmm"` for constant-product or
168
+ `"clmm"` for concentrated-liquidity.
169
+ - `rationale` is encrypted on-chain and shown to the client only — keep
170
+ it concise (under ~200 chars) since the envelope is capped at 512
171
+ bytes. The client (your user) sees this when deciding whether to
172
+ approve, so make it persuasive but honest.
173
+
174
+ The proposal is encrypted with the client's x25519 public key (read from
175
+ the advisory account on-chain) so only the client and you can decrypt it.
176
+
177
+ After you submit, **always tell the user to open the Beluga app and
178
+ approve the proposal**. Until they approve, you cannot execute it.
149
179
 
150
180
  ### Execute approved proposals
151
181
 
@@ -155,10 +185,11 @@ beluga-advisor execute <proposal-address> # execute one
155
185
  beluga-advisor execute --account <advisory-account> # all approved on one client
156
186
  ```
157
187
 
158
- Once a client approves a proposal in the Beluga app, the advisor can execute
159
- it. The CLI handles vault initialization and Raydium routing automatically.
188
+ Once the user (or another client) has approved a proposal in the Beluga
189
+ app, this command pushes it on-chain. Vault initialization and Raydium
190
+ routing are automatic.
160
191
 
161
- ### Watch mode (long-running)
192
+ ### Watch mode (background lifecycle)
162
193
 
163
194
  ```
164
195
  beluga-advisor watch start # spawn background daemon
@@ -166,30 +197,86 @@ beluga-advisor watch status # is it running?
166
197
  beluga-advisor watch stop # kill the daemon
167
198
  ```
168
199
 
169
- The watcher polls every 30 seconds (configurable via `BELUGA_WATCH_INTERVAL_MS`)
170
- and, by default, auto-accepts pending advisory accounts and auto-executes any
171
- proposals the client has approved. It does NOT auto-propose — proposing is
172
- left to the host agent's strategy logic.
200
+ The watcher polls every 30 seconds and, by default, auto-accepts pending
201
+ client invitations and auto-executes approved proposals. It does NOT
202
+ auto-propose — proposing is your job (you, the agent, decide what to
203
+ suggest).
173
204
 
174
- To opt out of either behavior, set `BELUGA_AUTO_ACCEPT=false` or
175
- `BELUGA_AUTO_EXECUTE=false` in the skill config.
205
+ To opt out, set `BELUGA_AUTO_ACCEPT=false` or `BELUGA_AUTO_EXECUTE=false`
206
+ in the skill config.
207
+
208
+ ## First-time setup (chat-driven)
209
+
210
+ Use this when `BELUGA_ADVISOR_KEYPAIR` is not yet set, or when the user
211
+ asks to "set up Beluga", "create my advisor", or similar. Common trigger
212
+ phrasings: "/init-beluga-advisor", "configure beluga", "set me up".
213
+
214
+ Frame it as creating *your* (the agent's) Beluga identity — the keypair
215
+ you'll use to advise the user's vault. Walk the user through these
216
+ questions in chat, accepting the default for anything they don't have an
217
+ opinion on:
218
+
219
+ 1. **Keypair** — "Should I generate a fresh advisor identity, or use one
220
+ you already have?" Default: generate. If they have one, ask whether
221
+ they have a base64-encoded 64-byte secret or a Solana keygen JSON
222
+ file.
223
+ 2. **RPC URL** — "Which Solana RPC should I use?"
224
+ Default: `https://api.mainnet-beta.solana.com`. Recommend a private
225
+ RPC (QuikNode/Helius/Triton) if they plan to run watch mode.
226
+ 3. **Fee** — "What fee should I charge per trade, in basis points?"
227
+ Default: 50 (0.5%). Range: 0 – ~500. (This is the fee you collect on
228
+ every executed trade, paid out of the input mint.)
229
+ 4. **Auto-accept** — "Should the watcher auto-accept new client invitations
230
+ I receive?" Default: yes.
231
+ 5. **Auto-execute** — "Should the watcher auto-execute proposals once
232
+ you've approved them in the Beluga app?" Default: yes.
233
+
234
+ Then run init non-interactively with the answers:
235
+
236
+ ```
237
+ beluga-advisor init --yes \
238
+ --rpc-url <answer> \
239
+ --fee-bps <answer> \
240
+ --auto-accept <true|false> \
241
+ --auto-execute <true|false>
242
+ ```
243
+
244
+ (Add `--keypair-base64 <secret>` or `--keypair-file <path>` only if the
245
+ user chose to import an existing keypair.)
246
+
247
+ `init` writes a merged config to `~/.openclaw/openclaw.json`, installs
248
+ (or re-installs) the skill, and prints a JSON object containing your new
249
+ advisor pubkey and an invite URL the user should open.
250
+
251
+ After init succeeds, tell the user (in this order — funding comes first
252
+ because you can't transact without SOL):
253
+
254
+ 1. **Fund the advisor pubkey.** Show your new pubkey from the JSON output
255
+ and tell them to send a small amount of SOL to it (~0.05 SOL is plenty
256
+ for low-volume use). You can't accept their invitation or execute
257
+ proposals until this address holds SOL.
258
+ 2. **Open the invite URL** in the Beluga app and confirm the invitation
259
+ from their wallet — that's how they (the client) invite you (the
260
+ advisor) on-chain.
261
+ 3. **Restart OpenClaw** so it picks up the new env from
262
+ `~/.openclaw/openclaw.json`.
176
263
 
177
- The watcher is a detached child process. Its PID lives at
178
- `~/.beluga-advisor/watch.pid`; if it exits unexpectedly, the file is cleaned
179
- up on next `watch status`.
264
+ After OpenClaw restarts, the watcher (or the next time the user invokes
265
+ the skill) will accept the invitation and you'll be live as their
266
+ advisor.
180
267
 
181
268
  ## Concurrency
182
269
 
183
- The CLI's one-shot commands and the watcher can both run safely against the
184
- same advisor. Already-executed proposals fail idempotently on-chain (the
185
- program rejects double-execution), so a race between the two only produces a
186
- harmless failed transaction.
270
+ The CLI's one-shot commands and the watcher can both run safely. Already-
271
+ executed proposals fail idempotently on-chain (the program rejects double-
272
+ execution), so a race only produces a harmless failed transaction.
187
273
 
188
274
  ## Trust model
189
275
 
190
- - The advisor's keypair only authorizes proposing and executing swaps within
191
- the limits enforced by the on-chain program. It cannot withdraw funds.
192
- - The client retains custody of vault assets and must approve every proposal
193
- before it is executable.
194
- - Encrypted proposal payloads are decryptable by the advisor and the client
195
- only — not by anyone observing the chain.
276
+ - Your keypair only authorizes proposing and executing swaps within the
277
+ limits enforced by the on-chain program. You cannot withdraw the
278
+ client's funds.
279
+ - The client retains custody of their vault assets and must approve every
280
+ proposal in the Beluga app before you can execute it.
281
+ - Encrypted proposal payloads are decryptable by you and the client only
282
+ — not by anyone observing the chain.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@belugafinancial/advisor-cli",
3
- "version": "0.2.0",
3
+ "version": "0.3.0",
4
4
  "description": "Command-line tool to operate a Beluga advisor account: accept invitations, propose encrypted swaps, execute approved proposals, and run a watch daemon for the boring lifecycle bits.",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -23,7 +23,7 @@
23
23
  "prepublishOnly": "npm run build"
24
24
  },
25
25
  "dependencies": {
26
- "@belugafinancial/advisor-sdk": "^0.2.0",
26
+ "@belugafinancial/advisor-sdk": "^0.3.0",
27
27
  "@solana/web3.js": "^1.98.0"
28
28
  },
29
29
  "devDependencies": {