@wzrd_sol/solana-agent-plugin 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/README.md ADDED
@@ -0,0 +1,70 @@
1
+ # @wzrd_sol/solana-agent-plugin
2
+
3
+ WZRD Liquid Attention Protocol plugin for autonomous Solana agents. Provides 5 actions for interacting with WZRD attention markets: browse the leaderboard, classify velocity signals, view portfolio positions, deposit USDC to mint vLOFI, and claim CCM yield via gasless relay.
4
+
5
+ Works standalone, with [Solana Agent Kit](https://github.com/sendAI/solana-agent-kit), or as a base for ElizaOS action wrappers.
6
+
7
+ ## Install
8
+
9
+ ```bash
10
+ npm install @wzrd_sol/solana-agent-plugin
11
+ ```
12
+
13
+ ## Quick Start
14
+
15
+ ```typescript
16
+ import { Keypair } from '@solana/web3.js';
17
+ import { WzrdClient } from '@wzrd_sol/solana-agent-plugin';
18
+
19
+ // Any Ed25519 keypair — used for agent auth
20
+ const keypair = Keypair.generate();
21
+ const client = new WzrdClient(keypair);
22
+
23
+ // Browse attention markets (no auth required)
24
+ const leaderboard = await client.getLeaderboard();
25
+ console.log(leaderboard.markets.map(m => `${m.channel_id}: ${m.velocity_ema}`));
26
+
27
+ // Authenticated endpoints (auto-handles challenge/verify flow)
28
+ const portfolio = await client.getPortfolio();
29
+ const claims = await client.getClaims();
30
+ const result = await client.claimRelay(); // gasless CCM claim
31
+ ```
32
+
33
+ ## Actions
34
+
35
+ The plugin exports 5 actions that follow the Solana Agent Kit action interface:
36
+
37
+ | Action | Auth | Description |
38
+ |--------|------|-------------|
39
+ | `LEADERBOARD_ACTION` | No | Fetch ranked attention markets |
40
+ | `VELOCITY_ACTION` | No | Classify signal strength (BREAKOUT / MOMENTUM / EMERGING / STABLE / COOLING / WEAK) |
41
+ | `PORTFOLIO_ACTION` | Yes | View positions and CCM earned |
42
+ | `DEPOSIT_ACTION` | Yes | Deposit USDC into a market, receive vLOFI |
43
+ | `CLAIM_ACTION` | Yes | Claim CCM via server-paid gasless relay |
44
+
45
+ ```typescript
46
+ import { WZRD_ACTIONS, WZRD_PLUGIN } from '@wzrd_sol/solana-agent-plugin';
47
+
48
+ // Register all actions with Solana Agent Kit
49
+ // WZRD_PLUGIN.actions contains all 5 actions
50
+ ```
51
+
52
+ ## API
53
+
54
+ ### `new WzrdClient(keypair: Keypair, apiUrl?: string)`
55
+
56
+ Creates a client instance. The keypair is used for Ed25519 agent authentication. Default API URL is `https://api.twzrd.xyz`.
57
+
58
+ ### Methods
59
+
60
+ - `getLeaderboard(limit?: number, platform?: string)` -- no auth
61
+ - `getPortfolio()` -- authenticated
62
+ - `getClaims()` -- authenticated
63
+ - `claimRelay()` -- authenticated, gasless
64
+ - `getHealth()` -- no auth
65
+
66
+ Auth is handled automatically: the client requests a challenge nonce, signs it with the keypair, and caches the bearer token (24h TTL, auto-refreshes).
67
+
68
+ ## License
69
+
70
+ MIT
@@ -0,0 +1,38 @@
1
+ /**
2
+ * Action: wzrd_claim
3
+ *
4
+ * Claim accrued CCM tokens via the gasless relay.
5
+ * Server pays tx fees — agent doesn't need SOL to claim.
6
+ *
7
+ * Flow: check claimable amount → relay claim → receive CCM.
8
+ */
9
+ import type { WzrdClient } from '../client.js';
10
+ export declare const CLAIM_ACTION: {
11
+ name: string;
12
+ similes: string[];
13
+ description: string;
14
+ examples: {
15
+ user: string;
16
+ content: {
17
+ text: string;
18
+ };
19
+ }[][];
20
+ validate: () => Promise<boolean>;
21
+ handler: (client: WzrdClient, params: {
22
+ execute?: boolean;
23
+ }) => Promise<{
24
+ success: boolean;
25
+ text: string;
26
+ data: import("../client.js").WzrdClaim;
27
+ } | {
28
+ success: boolean;
29
+ text: string;
30
+ data: {
31
+ claimable_before: number;
32
+ explorer: string;
33
+ root_seq: number;
34
+ cumulative_total: number;
35
+ tx_sig: string;
36
+ };
37
+ }>;
38
+ };
@@ -0,0 +1,84 @@
1
+ /**
2
+ * Action: wzrd_claim
3
+ *
4
+ * Claim accrued CCM tokens via the gasless relay.
5
+ * Server pays tx fees — agent doesn't need SOL to claim.
6
+ *
7
+ * Flow: check claimable amount → relay claim → receive CCM.
8
+ */
9
+ export const CLAIM_ACTION = {
10
+ name: 'wzrd_claim',
11
+ similes: ['wzrd_harvest', 'claim_ccm', 'redeem_rewards', 'collect_yield'],
12
+ description: 'Claim accrued CCM tokens from your WZRD positions. Uses the gasless relay — ' +
13
+ 'the server pays transaction fees, so you don\'t need SOL to claim. ' +
14
+ 'CCM accrues based on your velocity multiplier and is distributed via ' +
15
+ 'merkle proofs published on-chain every ~10 minutes. ' +
16
+ 'Call this periodically to harvest your earned CCM.',
17
+ examples: [
18
+ [
19
+ {
20
+ user: 'user',
21
+ content: { text: 'Claim my CCM rewards' },
22
+ },
23
+ {
24
+ user: 'assistant',
25
+ content: {
26
+ text: 'Claimed 100,000 CCM via gasless relay. ' +
27
+ 'Cumulative total: 250,000 CCM. Tx: 2VKz...J39c',
28
+ },
29
+ },
30
+ ],
31
+ [
32
+ {
33
+ user: 'user',
34
+ content: { text: 'How much CCM can I claim?' },
35
+ },
36
+ {
37
+ user: 'assistant',
38
+ content: {
39
+ text: 'You have 100,000 CCM claimable (250,000 cumulative, 150,000 already claimed). ' +
40
+ 'Shall I claim it now?',
41
+ },
42
+ },
43
+ ],
44
+ ],
45
+ validate: async () => true,
46
+ handler: async (client, params) => {
47
+ // 1. Check claimable amount
48
+ const claims = await client.getClaims();
49
+ const claimable = claims.cumulative_total - claims.claimed_total;
50
+ if (claimable <= 0) {
51
+ return {
52
+ success: true,
53
+ text: `No CCM to claim. Cumulative: ${claims.cumulative_total}, ` +
54
+ `already claimed: ${claims.claimed_total}. ` +
55
+ `Deposit into markets and wait for the next scoring cycle.`,
56
+ data: claims,
57
+ };
58
+ }
59
+ // 2. If just checking (not executing), report the amount
60
+ if (params.execute === false) {
61
+ return {
62
+ success: true,
63
+ text: `${claimable} CCM claimable ` +
64
+ `(${claims.cumulative_total} cumulative, ${claims.claimed_total} claimed). ` +
65
+ `Root seq: ${claims.root_seq}. Call with execute=true to claim.`,
66
+ data: claims,
67
+ };
68
+ }
69
+ // 3. Execute gasless relay claim
70
+ const result = await client.claimRelay();
71
+ return {
72
+ success: true,
73
+ text: `Claimed CCM via gasless relay. ` +
74
+ `Cumulative total: ${result.cumulative_total}. ` +
75
+ `Root seq: ${result.root_seq}. ` +
76
+ `Tx: ${result.tx_sig.slice(0, 16)}...`,
77
+ data: {
78
+ ...result,
79
+ claimable_before: claimable,
80
+ explorer: `https://solscan.io/tx/${result.tx_sig}`,
81
+ },
82
+ };
83
+ },
84
+ };
@@ -0,0 +1,57 @@
1
+ /**
2
+ * Action: wzrd_deposit
3
+ *
4
+ * Deposit USDC into a WZRD attention market → mint vLOFI tokens.
5
+ * Requires: Keypair with USDC balance + SOL for tx fees.
6
+ *
7
+ * The agent picks a market_id (from leaderboard), specifies USDC amount,
8
+ * and the handler builds + signs + sends the deposit transaction.
9
+ */
10
+ import { Connection, Keypair } from '@solana/web3.js';
11
+ import type { WzrdClient } from '../client.js';
12
+ export interface DepositParams {
13
+ market_id: number;
14
+ amount_usdc: number;
15
+ priority_fee?: number;
16
+ }
17
+ export declare const DEPOSIT_ACTION: {
18
+ name: string;
19
+ similes: string[];
20
+ description: string;
21
+ examples: {
22
+ user: string;
23
+ content: {
24
+ text: string;
25
+ };
26
+ }[][];
27
+ validate: (_client: WzrdClient, params: DepositParams) => Promise<boolean>;
28
+ handler: (_client: WzrdClient, params: DepositParams, connection: Connection, wallet: Keypair) => Promise<{
29
+ success: boolean;
30
+ text: string;
31
+ data?: undefined;
32
+ } | {
33
+ success: boolean;
34
+ text: string;
35
+ data: {
36
+ logs: string[] | undefined;
37
+ signature?: undefined;
38
+ market_id?: undefined;
39
+ amount_usdc?: undefined;
40
+ cu_used?: undefined;
41
+ elapsed_ms?: undefined;
42
+ explorer?: undefined;
43
+ };
44
+ } | {
45
+ success: boolean;
46
+ text: string;
47
+ data: {
48
+ signature: string;
49
+ market_id: number;
50
+ amount_usdc: number;
51
+ cu_used: number | undefined;
52
+ elapsed_ms: number;
53
+ explorer: string;
54
+ logs?: undefined;
55
+ };
56
+ }>;
57
+ };
@@ -0,0 +1,134 @@
1
+ /**
2
+ * Action: wzrd_deposit
3
+ *
4
+ * Deposit USDC into a WZRD attention market → mint vLOFI tokens.
5
+ * Requires: Keypair with USDC balance + SOL for tx fees.
6
+ *
7
+ * The agent picks a market_id (from leaderboard), specifies USDC amount,
8
+ * and the handler builds + signs + sends the deposit transaction.
9
+ */
10
+ import { ComputeBudgetProgram, TransactionMessage, VersionedTransaction, } from '@solana/web3.js';
11
+ import { createDepositMarketIx, fetchOnChainPosition, fetchTokenBalance, getAta, TOKEN_PROGRAM_ID, } from '@wzrd_sol/sdk';
12
+ const USDC_MINT = 'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v';
13
+ const CONFIRM_TIMEOUT_MS = 60_000;
14
+ export const DEPOSIT_ACTION = {
15
+ name: 'wzrd_deposit',
16
+ similes: ['wzrd_invest', 'deposit_usdc', 'buy_attention', 'enter_market'],
17
+ description: 'Deposit USDC into a WZRD attention market to mint vLOFI tokens. ' +
18
+ 'vLOFI represents your position in the market. As the underlying AI model ' +
19
+ 'gains attention (downloads, stars), your multiplier increases and you earn ' +
20
+ 'more CCM on each merkle root publication. ' +
21
+ 'Requires: market_id (from leaderboard) and amount_usdc (e.g., 0.01). ' +
22
+ 'The deposit is atomic — USDC is transferred and vLOFI is minted in one transaction.',
23
+ examples: [
24
+ [
25
+ {
26
+ user: 'user',
27
+ content: { text: 'Deposit 0.01 USDC into market 10' },
28
+ },
29
+ {
30
+ user: 'assistant',
31
+ content: {
32
+ text: 'Deposited 0.01 USDC into Market #10 (Qwen 2.5 72B). ' +
33
+ 'Received 10,000 vLOFI. Tx: X7FG...Cziv (772ms, 50687 CU)',
34
+ },
35
+ },
36
+ ],
37
+ [
38
+ {
39
+ user: 'user',
40
+ content: { text: 'Invest in the highest velocity market' },
41
+ },
42
+ {
43
+ user: 'assistant',
44
+ content: {
45
+ text: 'Looking up leaderboard... Top market is #16 (Qwen 3.5 35B) ' +
46
+ 'with 804K velocity. Depositing 0.01 USDC...',
47
+ },
48
+ },
49
+ ],
50
+ ],
51
+ validate: async (_client, params) => {
52
+ if (!params.market_id || params.market_id < 1)
53
+ return false;
54
+ if (!params.amount_usdc || params.amount_usdc <= 0)
55
+ return false;
56
+ if (params.amount_usdc > 100)
57
+ return false; // safety cap
58
+ return true;
59
+ },
60
+ handler: async (_client, params, connection, wallet) => {
61
+ const { market_id, amount_usdc, priority_fee = 50_000 } = params;
62
+ const amountNative = BigInt(Math.round(amount_usdc * 1_000_000));
63
+ const t0 = Date.now();
64
+ // 1. Idempotency — check existing position
65
+ const existing = await fetchOnChainPosition(connection, wallet.publicKey, market_id);
66
+ if (existing && existing.depositedAmount > 0n && !existing.settled) {
67
+ return {
68
+ success: false,
69
+ text: `Position already exists in market ${market_id} ` +
70
+ `(${existing.depositedAmount} deposited). Cannot double-deposit.`,
71
+ };
72
+ }
73
+ // 2. Balance checks
74
+ const { PublicKey } = await import('@solana/web3.js');
75
+ const usdcMint = new PublicKey(USDC_MINT);
76
+ const usdcAta = getAta(wallet.publicKey, usdcMint, TOKEN_PROGRAM_ID);
77
+ const usdcBalance = await fetchTokenBalance(connection, usdcAta);
78
+ if (usdcBalance < amountNative) {
79
+ return {
80
+ success: false,
81
+ text: `Insufficient USDC: have ${Number(usdcBalance) / 1e6}, need ${amount_usdc}`,
82
+ };
83
+ }
84
+ const solBalance = await connection.getBalance(wallet.publicKey);
85
+ if (solBalance < 10_000) {
86
+ return {
87
+ success: false,
88
+ text: `Insufficient SOL for tx fees: ${solBalance} lamports`,
89
+ };
90
+ }
91
+ // 3. Build deposit instructions
92
+ const ixs = await createDepositMarketIx(connection, wallet.publicKey, market_id, amountNative);
93
+ ixs.unshift(ComputeBudgetProgram.setComputeUnitLimit({ units: 300_000 }), ComputeBudgetProgram.setComputeUnitPrice({ microLamports: priority_fee }));
94
+ // 4. Simulate
95
+ const { blockhash, lastValidBlockHeight } = await connection.getLatestBlockhash('confirmed');
96
+ const message = new TransactionMessage({
97
+ payerKey: wallet.publicKey,
98
+ recentBlockhash: blockhash,
99
+ instructions: ixs,
100
+ }).compileToV0Message();
101
+ const tx = new VersionedTransaction(message);
102
+ tx.sign([wallet]);
103
+ const sim = await connection.simulateTransaction(tx);
104
+ if (sim.value.err) {
105
+ return {
106
+ success: false,
107
+ text: `Simulation failed: ${JSON.stringify(sim.value.err)}`,
108
+ data: { logs: sim.value.logs?.slice(-5) },
109
+ };
110
+ }
111
+ // 5. Send + confirm
112
+ const signature = await connection.sendTransaction(tx, {
113
+ skipPreflight: true,
114
+ maxRetries: 3,
115
+ });
116
+ const confirmed = connection.confirmTransaction({ signature, blockhash, lastValidBlockHeight }, 'confirmed');
117
+ const timeout = new Promise((_, reject) => setTimeout(() => reject(new Error(`Timeout after ${CONFIRM_TIMEOUT_MS}ms`)), CONFIRM_TIMEOUT_MS));
118
+ await Promise.race([confirmed, timeout]);
119
+ const elapsed = Date.now() - t0;
120
+ return {
121
+ success: true,
122
+ text: `Deposited ${amount_usdc} USDC into Market #${market_id}. ` +
123
+ `Tx: ${signature.slice(0, 16)}... (${elapsed}ms, ${sim.value.unitsConsumed} CU)`,
124
+ data: {
125
+ signature,
126
+ market_id,
127
+ amount_usdc,
128
+ cu_used: sim.value.unitsConsumed,
129
+ elapsed_ms: elapsed,
130
+ explorer: `https://solscan.io/tx/${signature}`,
131
+ },
132
+ };
133
+ },
134
+ };
@@ -0,0 +1,5 @@
1
+ export { LEADERBOARD_ACTION } from './leaderboard.js';
2
+ export { PORTFOLIO_ACTION } from './portfolio.js';
3
+ export { DEPOSIT_ACTION } from './deposit.js';
4
+ export { CLAIM_ACTION } from './claim.js';
5
+ export { VELOCITY_ACTION } from './velocity.js';
@@ -0,0 +1,5 @@
1
+ export { LEADERBOARD_ACTION } from './leaderboard.js';
2
+ export { PORTFOLIO_ACTION } from './portfolio.js';
3
+ export { DEPOSIT_ACTION } from './deposit.js';
4
+ export { CLAIM_ACTION } from './claim.js';
5
+ export { VELOCITY_ACTION } from './velocity.js';
@@ -0,0 +1,27 @@
1
+ /**
2
+ * Action: wzrd_leaderboard
3
+ *
4
+ * Fetch the WZRD attention market leaderboard — ranked by velocity EMA.
5
+ * No auth required. Permissionless read.
6
+ */
7
+ import type { WzrdClient } from '../client.js';
8
+ export declare const LEADERBOARD_ACTION: {
9
+ name: string;
10
+ similes: string[];
11
+ description: string;
12
+ examples: {
13
+ user: string;
14
+ content: {
15
+ text: string;
16
+ };
17
+ }[][];
18
+ validate: () => Promise<boolean>;
19
+ handler: (client: WzrdClient, params: {
20
+ limit?: number;
21
+ platform?: string;
22
+ }) => Promise<{
23
+ success: boolean;
24
+ text: string;
25
+ data: import("../client.js").WzrdLeaderboard;
26
+ }>;
27
+ };
@@ -0,0 +1,63 @@
1
+ /**
2
+ * Action: wzrd_leaderboard
3
+ *
4
+ * Fetch the WZRD attention market leaderboard — ranked by velocity EMA.
5
+ * No auth required. Permissionless read.
6
+ */
7
+ export const LEADERBOARD_ACTION = {
8
+ name: 'wzrd_leaderboard',
9
+ similes: ['wzrd_markets', 'wzrd_trending', 'attention_markets', 'top_models'],
10
+ description: 'Fetch the WZRD attention market leaderboard. Shows AI models and open-source ' +
11
+ 'projects ranked by real-time velocity (download/star momentum). Returns market IDs, ' +
12
+ 'velocity EMA, multiplier, TVL, and platform (huggingface/github). ' +
13
+ 'Use this to find the highest-attention markets before depositing.',
14
+ examples: [
15
+ [
16
+ {
17
+ user: 'user',
18
+ content: { text: 'Show me the top attention markets' },
19
+ },
20
+ {
21
+ user: 'assistant',
22
+ content: {
23
+ text: 'Here are the top WZRD markets by velocity:\n' +
24
+ '1. Qwen 3.5 35B — 804K velocity (HuggingFace)\n' +
25
+ '2. Qwen 3.5 9B — 769K velocity (HuggingFace)\n' +
26
+ '3. Ollama — 104K velocity (GitHub)',
27
+ },
28
+ },
29
+ ],
30
+ [
31
+ {
32
+ user: 'user',
33
+ content: { text: 'What HuggingFace models are trending?' },
34
+ },
35
+ {
36
+ user: 'assistant',
37
+ content: {
38
+ text: 'Top HuggingFace models by attention velocity: ...',
39
+ },
40
+ },
41
+ ],
42
+ ],
43
+ validate: async () => true,
44
+ handler: async (client, params) => {
45
+ const data = await client.getLeaderboard(params.limit ?? 10, params.platform);
46
+ const lines = data.markets.map((m, i) => `${i + 1}. ${m.metric} — ${formatVelocity(m.velocity_ema)} velocity ` +
47
+ `(${m.platform}) | ${m.multiplier_bps / 10000}x multiplier | ` +
48
+ `${m.position_count} positions | market_id=${m.market_id}`);
49
+ return {
50
+ success: true,
51
+ text: `WZRD Leaderboard (${data.markets.length} markets, ` +
52
+ `root_seq=${data.root.root_seq}):\n${lines.join('\n')}`,
53
+ data,
54
+ };
55
+ },
56
+ };
57
+ function formatVelocity(v) {
58
+ if (v >= 1_000_000)
59
+ return `${(v / 1_000_000).toFixed(1)}M`;
60
+ if (v >= 1_000)
61
+ return `${(v / 1_000).toFixed(0)}K`;
62
+ return v.toFixed(0);
63
+ }
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Action: wzrd_portfolio
3
+ *
4
+ * Fetch the agent's WZRD portfolio — positions, USDC deposited, vLOFI held, CCM earned.
5
+ * Requires auth (Ed25519 agent session).
6
+ */
7
+ import type { WzrdClient } from '../client.js';
8
+ export declare const PORTFOLIO_ACTION: {
9
+ name: string;
10
+ similes: string[];
11
+ description: string;
12
+ examples: {
13
+ user: string;
14
+ content: {
15
+ text: string;
16
+ };
17
+ }[][];
18
+ validate: () => Promise<boolean>;
19
+ handler: (client: WzrdClient) => Promise<{
20
+ success: boolean;
21
+ text: string;
22
+ data: import("../client.js").WzrdPortfolio;
23
+ }>;
24
+ };
@@ -0,0 +1,48 @@
1
+ /**
2
+ * Action: wzrd_portfolio
3
+ *
4
+ * Fetch the agent's WZRD portfolio — positions, USDC deposited, vLOFI held, CCM earned.
5
+ * Requires auth (Ed25519 agent session).
6
+ */
7
+ export const PORTFOLIO_ACTION = {
8
+ name: 'wzrd_portfolio',
9
+ similes: ['wzrd_positions', 'wzrd_balance', 'wzrd_holdings', 'my_positions'],
10
+ description: 'Fetch your WZRD portfolio — all open positions across attention markets. ' +
11
+ 'Shows USDC deposited, vLOFI minted, multiplier, and settlement status per market. ' +
12
+ 'Use this to check your exposure before depositing more or claiming CCM.',
13
+ examples: [
14
+ [
15
+ {
16
+ user: 'user',
17
+ content: { text: 'Show my WZRD positions' },
18
+ },
19
+ {
20
+ user: 'assistant',
21
+ content: {
22
+ text: 'Your WZRD portfolio:\n' +
23
+ '• Market #10 (Qwen 2.5 72B): 0.01 USDC, 5.0x multiplier\n' +
24
+ '• Market #8 (Ollama): 0.01 USDC, 5.0x multiplier\n' +
25
+ 'Total: 0.02 USDC deposited, 0 CCM earned',
26
+ },
27
+ },
28
+ ],
29
+ ],
30
+ validate: async () => true,
31
+ handler: async (client) => {
32
+ const portfolio = await client.getPortfolio();
33
+ const open = portfolio.positions.filter((p) => !p.is_settled);
34
+ const lines = open.map((p) => `• Market #${p.market_id} (${p.metric}): ` +
35
+ `${(p.usdc_deposited / 1_000_000).toFixed(4)} USDC, ` +
36
+ `${(p.multiplier_bps / 10_000).toFixed(1)}x multiplier` +
37
+ (p.is_settled ? ' [settled]' : ''));
38
+ const totalUsdc = portfolio.total_deposited_usdc / 1_000_000;
39
+ const totalCcm = portfolio.total_ccm_earned / 1_000_000;
40
+ return {
41
+ success: true,
42
+ text: `Your WZRD portfolio (${open.length} open positions):\n` +
43
+ `${lines.length ? lines.join('\n') : '(no positions)'}\n` +
44
+ `Total: ${totalUsdc.toFixed(4)} USDC deposited, ${totalCcm.toFixed(4)} CCM earned`,
45
+ data: portfolio,
46
+ };
47
+ },
48
+ };
@@ -0,0 +1,55 @@
1
+ /**
2
+ * Action: wzrd_velocity
3
+ *
4
+ * Analyze attention velocity across markets — classify signal strength.
5
+ * No auth required. Pure analytics over leaderboard data.
6
+ *
7
+ * Signal tiers:
8
+ * BREAKOUT — top 10% velocity (p90+)
9
+ * MOMENTUM — p70-90
10
+ * EMERGING — new market (<300 snapshots) with above-median velocity
11
+ * STABLE — p40-70
12
+ * COOLING — p20-40
13
+ * WEAK — below p20
14
+ */
15
+ import type { WzrdClient } from '../client.js';
16
+ type SignalTier = 'BREAKOUT' | 'MOMENTUM' | 'EMERGING' | 'STABLE' | 'COOLING' | 'WEAK';
17
+ export interface MarketSignal {
18
+ market_id: number;
19
+ metric: string;
20
+ platform: string;
21
+ velocity_ema: number;
22
+ signal: SignalTier;
23
+ percentile: number;
24
+ }
25
+ export declare const VELOCITY_ACTION: {
26
+ name: string;
27
+ similes: string[];
28
+ description: string;
29
+ examples: {
30
+ user: string;
31
+ content: {
32
+ text: string;
33
+ };
34
+ }[][];
35
+ validate: () => Promise<boolean>;
36
+ handler: (client: WzrdClient, params: {
37
+ platform?: string;
38
+ min_signal?: SignalTier;
39
+ }) => Promise<{
40
+ success: boolean;
41
+ text: string;
42
+ data: {
43
+ signals: never[];
44
+ median_velocity?: undefined;
45
+ };
46
+ } | {
47
+ success: boolean;
48
+ text: string;
49
+ data: {
50
+ signals: MarketSignal[];
51
+ median_velocity: number;
52
+ };
53
+ }>;
54
+ };
55
+ export {};