@exagent/agent 0.1.8 → 0.1.9
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/dist/chunk-CKSCA3O7.mjs +2686 -0
- package/dist/cli.js +8 -0
- package/dist/cli.mjs +1 -1
- package/dist/index.d.mts +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +8 -0
- package/dist/index.mjs +1 -1
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -1664,6 +1664,8 @@ var AgentRuntime = class {
|
|
|
1664
1664
|
lastVaultCheck = 0;
|
|
1665
1665
|
cycleCount = 0;
|
|
1666
1666
|
lastCycleAt = 0;
|
|
1667
|
+
lastPortfolioValue = 0;
|
|
1668
|
+
lastEthBalance = "0";
|
|
1667
1669
|
processAlive = true;
|
|
1668
1670
|
VAULT_CHECK_INTERVAL = 3e5;
|
|
1669
1671
|
// Check vault status every 5 minutes
|
|
@@ -2074,6 +2076,8 @@ var AgentRuntime = class {
|
|
|
2074
2076
|
cycleCount: this.cycleCount,
|
|
2075
2077
|
lastCycleAt: this.lastCycleAt,
|
|
2076
2078
|
tradingIntervalMs: this.config.trading.tradingIntervalMs,
|
|
2079
|
+
portfolioValue: this.lastPortfolioValue,
|
|
2080
|
+
ethBalance: this.lastEthBalance,
|
|
2077
2081
|
llm: {
|
|
2078
2082
|
provider: this.config.llm.provider,
|
|
2079
2083
|
model: this.config.llm.model || "default"
|
|
@@ -2103,6 +2107,10 @@ var AgentRuntime = class {
|
|
|
2103
2107
|
const tokens = this.config.allowedTokens || this.getDefaultTokens();
|
|
2104
2108
|
const marketData = await this.marketData.fetchMarketData(this.client.address, tokens);
|
|
2105
2109
|
console.log(`Portfolio value: $${marketData.portfolioValue.toFixed(2)}`);
|
|
2110
|
+
this.lastPortfolioValue = marketData.portfolioValue;
|
|
2111
|
+
const wethAddr = "0x4200000000000000000000000000000000000006";
|
|
2112
|
+
const ethBal = marketData.balances[wethAddr] || BigInt(0);
|
|
2113
|
+
this.lastEthBalance = (Number(ethBal) / 1e18).toFixed(6);
|
|
2106
2114
|
this.checkFundsLow(marketData);
|
|
2107
2115
|
let signals;
|
|
2108
2116
|
try {
|
package/dist/cli.mjs
CHANGED
package/dist/index.d.mts
CHANGED
|
@@ -467,6 +467,8 @@ declare class AgentRuntime {
|
|
|
467
467
|
private lastVaultCheck;
|
|
468
468
|
private cycleCount;
|
|
469
469
|
private lastCycleAt;
|
|
470
|
+
private lastPortfolioValue;
|
|
471
|
+
private lastEthBalance;
|
|
470
472
|
private processAlive;
|
|
471
473
|
private readonly VAULT_CHECK_INTERVAL;
|
|
472
474
|
constructor(config: RuntimeConfig);
|
package/dist/index.d.ts
CHANGED
|
@@ -467,6 +467,8 @@ declare class AgentRuntime {
|
|
|
467
467
|
private lastVaultCheck;
|
|
468
468
|
private cycleCount;
|
|
469
469
|
private lastCycleAt;
|
|
470
|
+
private lastPortfolioValue;
|
|
471
|
+
private lastEthBalance;
|
|
470
472
|
private processAlive;
|
|
471
473
|
private readonly VAULT_CHECK_INTERVAL;
|
|
472
474
|
constructor(config: RuntimeConfig);
|
package/dist/index.js
CHANGED
|
@@ -1708,6 +1708,8 @@ var AgentRuntime = class {
|
|
|
1708
1708
|
lastVaultCheck = 0;
|
|
1709
1709
|
cycleCount = 0;
|
|
1710
1710
|
lastCycleAt = 0;
|
|
1711
|
+
lastPortfolioValue = 0;
|
|
1712
|
+
lastEthBalance = "0";
|
|
1711
1713
|
processAlive = true;
|
|
1712
1714
|
VAULT_CHECK_INTERVAL = 3e5;
|
|
1713
1715
|
// Check vault status every 5 minutes
|
|
@@ -2118,6 +2120,8 @@ var AgentRuntime = class {
|
|
|
2118
2120
|
cycleCount: this.cycleCount,
|
|
2119
2121
|
lastCycleAt: this.lastCycleAt,
|
|
2120
2122
|
tradingIntervalMs: this.config.trading.tradingIntervalMs,
|
|
2123
|
+
portfolioValue: this.lastPortfolioValue,
|
|
2124
|
+
ethBalance: this.lastEthBalance,
|
|
2121
2125
|
llm: {
|
|
2122
2126
|
provider: this.config.llm.provider,
|
|
2123
2127
|
model: this.config.llm.model || "default"
|
|
@@ -2147,6 +2151,10 @@ var AgentRuntime = class {
|
|
|
2147
2151
|
const tokens = this.config.allowedTokens || this.getDefaultTokens();
|
|
2148
2152
|
const marketData = await this.marketData.fetchMarketData(this.client.address, tokens);
|
|
2149
2153
|
console.log(`Portfolio value: $${marketData.portfolioValue.toFixed(2)}`);
|
|
2154
|
+
this.lastPortfolioValue = marketData.portfolioValue;
|
|
2155
|
+
const wethAddr = "0x4200000000000000000000000000000000000006";
|
|
2156
|
+
const ethBal = marketData.balances[wethAddr] || BigInt(0);
|
|
2157
|
+
this.lastEthBalance = (Number(ethBal) / 1e18).toFixed(6);
|
|
2150
2158
|
this.checkFundsLow(marketData);
|
|
2151
2159
|
let signals;
|
|
2152
2160
|
try {
|
package/dist/index.mjs
CHANGED