@wzrd_sol/eliza-plugin 0.1.2 → 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.
- package/README.md +98 -26
- package/dist/actions/claim.d.ts +2 -5
- package/dist/actions/claim.js +33 -30
- package/dist/actions/earn.d.ts +8 -0
- package/dist/actions/earn.js +83 -0
- package/dist/actions/infer.d.ts +8 -0
- package/dist/actions/infer.js +41 -0
- package/dist/actions/intel-preflight.d.ts +5 -0
- package/dist/actions/intel-preflight.js +97 -0
- package/dist/actions/intel-trust.d.ts +7 -0
- package/dist/actions/intel-trust.js +82 -0
- package/dist/actions/report.d.ts +8 -0
- package/dist/actions/report.js +45 -0
- package/dist/actions/rewards.d.ts +5 -0
- package/dist/actions/rewards.js +31 -0
- package/dist/actions/verify-receipt.d.ts +7 -0
- package/dist/actions/verify-receipt.js +44 -0
- package/dist/client-factory.d.ts +14 -0
- package/dist/client-factory.js +40 -0
- package/dist/client.d.ts +91 -3
- package/dist/client.js +136 -16
- package/dist/index.d.ts +26 -9
- package/dist/index.js +25 -9
- package/dist/intel-helpers.d.ts +22 -0
- package/dist/intel-helpers.js +181 -0
- package/dist/paying-fetch.d.ts +9 -0
- package/dist/paying-fetch.js +27 -0
- package/dist/test/plugin-registration.intel.d.ts +1 -0
- package/dist/test/plugin-registration.intel.js +253 -0
- package/package.json +21 -10
- package/dist/actions/deposit.d.ts +0 -2
- package/dist/actions/deposit.js +0 -79
- package/dist/actions/leaderboard.d.ts +0 -3
- package/dist/actions/leaderboard.js +0 -25
- package/dist/actions/portfolio.d.ts +0 -3
- package/dist/actions/portfolio.js +0 -20
- package/dist/actions/velocity.d.ts +0 -3
- package/dist/actions/velocity.js +0 -57
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { getWzrdClient } from '../client.js';
|
|
2
|
-
export const portfolioAction = {
|
|
3
|
-
name: 'WZRD_PORTFOLIO',
|
|
4
|
-
similes: ['WZRD_POSITIONS', 'WZRD_BALANCE', 'MY_POSITIONS'],
|
|
5
|
-
description: 'Fetch your WZRD portfolio — open positions, USDC deposited, CCM earned.',
|
|
6
|
-
examples: [[
|
|
7
|
-
{ name: '{{user1}}', content: { text: 'Show my WZRD portfolio' } },
|
|
8
|
-
{ name: '{{agentName}}', content: { text: 'Your WZRD portfolio has 2 open positions...' } },
|
|
9
|
-
]],
|
|
10
|
-
validate: async () => true,
|
|
11
|
-
handler: async (runtime, _msg, _state, _opt, callback) => {
|
|
12
|
-
const p = await getWzrdClient(runtime).getPortfolio();
|
|
13
|
-
const open = p.positions.filter((x) => !x.is_settled);
|
|
14
|
-
const lines = open.map((x) => `Market #${x.market_id} (${x.metric}): ${(x.usdc_deposited / 1e6).toFixed(4)} USDC, ${(x.multiplier_bps / 1e4).toFixed(1)}x`);
|
|
15
|
-
const text = `Portfolio (${open.length} open):\n${lines.length ? lines.join('\n') : '(none)'}\n` +
|
|
16
|
-
`Total: ${(p.total_deposited_usdc / 1e6).toFixed(4)} USDC, ${(p.total_ccm_earned / 1e6).toFixed(4)} CCM`;
|
|
17
|
-
await callback?.({ text });
|
|
18
|
-
return { success: true, data: p };
|
|
19
|
-
},
|
|
20
|
-
};
|
package/dist/actions/velocity.js
DELETED
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import { getWzrdClient } from '../client.js';
|
|
2
|
-
export const velocityAction = {
|
|
3
|
-
name: 'WZRD_VELOCITY',
|
|
4
|
-
similes: ['WZRD_SIGNAL', 'ATTENTION_SIGNAL', 'VELOCITY_CHECK'],
|
|
5
|
-
description: 'Analyze velocity across WZRD markets. Classifies into BREAKOUT/MOMENTUM/EMERGING/STABLE/COOLING/WEAK.',
|
|
6
|
-
examples: [[
|
|
7
|
-
{ name: '{{user1}}', content: { text: 'Analyze WZRD velocity signals' } },
|
|
8
|
-
{ name: '{{agentName}}', content: { text: 'BREAKOUT: Qwen 3.5 35B (450K velocity, p95)...' } },
|
|
9
|
-
]],
|
|
10
|
-
validate: async () => true,
|
|
11
|
-
handler: async (runtime, _msg, _state, _opt, callback) => {
|
|
12
|
-
const { markets } = await getWzrdClient(runtime).getLeaderboard(50);
|
|
13
|
-
if (!markets.length) {
|
|
14
|
-
await callback?.({ text: 'No markets found.' });
|
|
15
|
-
return { success: true, data: { signals: [] } };
|
|
16
|
-
}
|
|
17
|
-
const sorted = [...markets].sort((a, b) => a.velocity_ema - b.velocity_ema);
|
|
18
|
-
const signals = markets.map((m) => {
|
|
19
|
-
const pct = ((sorted.findIndex((s) => s.market_id === m.market_id) + 1) / sorted.length) * 100;
|
|
20
|
-
return { market_id: m.market_id, metric: m.metric, platform: m.platform,
|
|
21
|
-
velocity_ema: m.velocity_ema, signal: classify(m, pct), percentile: Math.round(pct) };
|
|
22
|
-
});
|
|
23
|
-
const tiers = ['BREAKOUT', 'MOMENTUM', 'EMERGING', 'STABLE', 'COOLING', 'WEAK'];
|
|
24
|
-
const lines = [];
|
|
25
|
-
for (const t of tiers) {
|
|
26
|
-
const g = signals.filter((s) => s.signal === t);
|
|
27
|
-
if (!g.length)
|
|
28
|
-
continue;
|
|
29
|
-
lines.push(`${t}:`);
|
|
30
|
-
g.forEach((s) => lines.push(` ${s.metric} (${fmtV(s.velocity_ema)}, p${s.percentile}) [${s.platform}]`));
|
|
31
|
-
}
|
|
32
|
-
const median = sorted[Math.floor(sorted.length / 2)]?.velocity_ema ?? 0;
|
|
33
|
-
const text = `Velocity analysis (${markets.length} markets, median ${fmtV(median)}):\n${lines.join('\n')}`;
|
|
34
|
-
await callback?.({ text });
|
|
35
|
-
return { success: true, data: { signals, median_velocity: median } };
|
|
36
|
-
},
|
|
37
|
-
};
|
|
38
|
-
function classify(m, p) {
|
|
39
|
-
if (p >= 90)
|
|
40
|
-
return 'BREAKOUT';
|
|
41
|
-
if (p >= 70)
|
|
42
|
-
return 'MOMENTUM';
|
|
43
|
-
if (m.snapshot_count < 300 && p >= 50)
|
|
44
|
-
return 'EMERGING';
|
|
45
|
-
if (p >= 40)
|
|
46
|
-
return 'STABLE';
|
|
47
|
-
if (p >= 20)
|
|
48
|
-
return 'COOLING';
|
|
49
|
-
return 'WEAK';
|
|
50
|
-
}
|
|
51
|
-
function fmtV(v) {
|
|
52
|
-
if (v >= 1e6)
|
|
53
|
-
return `${(v / 1e6).toFixed(1)}M`;
|
|
54
|
-
if (v >= 1e3)
|
|
55
|
-
return `${(v / 1e3).toFixed(0)}K`;
|
|
56
|
-
return v.toFixed(0);
|
|
57
|
-
}
|