@t2000/cli 0.14.1 → 0.15.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
|
@@ -105,9 +105,9 @@ t2000 init
|
|
|
105
105
|
❯ t2000 portfolio
|
|
106
106
|
Investment Portfolio
|
|
107
107
|
─────────────────────────────────────────────────────
|
|
108
|
-
SUI 105.26000000 Avg: $0.95 Now: $0.97 +$2.10 (+2.1%)
|
|
109
|
-
BTC 0.00512820 Avg: $97,500 Now: $98,200 +$3.59 (+0.7%)
|
|
110
|
-
ETH 0.10526316 Avg: $1,900 Now: $1,920 +$2.11 (+1.1%)
|
|
108
|
+
SUI 105.26000000 Avg: $0.95 Now: $0.97 APY: 2.10% +$2.10 (+2.1%)
|
|
109
|
+
BTC 0.00512820 Avg: $97,500 Now: $98,200 — +$3.59 (+0.7%)
|
|
110
|
+
ETH 0.10526316 Avg: $1,900 Now: $1,920 APY: 1.85% +$2.11 (+1.1%)
|
|
111
111
|
─────────────────────────────────────────────────────
|
|
112
112
|
Total invested: $800.00
|
|
113
113
|
Current value: $807.80
|
|
@@ -195,8 +195,10 @@ t2000 init
|
|
|
195
195
|
| Command | Description |
|
|
196
196
|
|---------|-------------|
|
|
197
197
|
| `t2000 invest buy <amount> <asset>` | Buy crypto with USDC (e.g. `t2000 invest buy 500 BTC`, `t2000 invest buy 200 ETH`) |
|
|
198
|
-
| `t2000 invest sell <amount\|all> <asset>` | Sell crypto back to USDC |
|
|
199
|
-
| `t2000
|
|
198
|
+
| `t2000 invest sell <amount\|all> <asset>` | Sell crypto back to USDC (auto-withdraws if earning) |
|
|
199
|
+
| `t2000 invest earn <asset>` | Deposit invested asset into best-rate lending for yield |
|
|
200
|
+
| `t2000 invest unearn <asset>` | Withdraw from lending, keep in portfolio |
|
|
201
|
+
| `t2000 portfolio` | View investment portfolio with cost-basis P&L (shows APY when earning) |
|
|
200
202
|
|
|
201
203
|
Supported assets: SUI, BTC, ETH. Dollar-denominated — `amount` is in USD.
|
|
202
204
|
|
|
@@ -21374,12 +21374,12 @@ function registerWriteTools(server, agent) {
|
|
|
21374
21374
|
const investAssets = Object.keys(INVESTMENT_ASSETS);
|
|
21375
21375
|
server.tool(
|
|
21376
21376
|
"t2000_invest",
|
|
21377
|
-
"Buy or
|
|
21377
|
+
"Buy, sell, earn yield, or stop earning on investment assets. Actions: buy (invest USD), sell (convert to USDC), earn (deposit into best-rate lending for yield), unearn (withdraw from lending, keep in portfolio). Amount required for buy/sell only.",
|
|
21378
21378
|
{
|
|
21379
|
-
action: external_exports.enum(["buy", "sell"]).describe("'buy' to invest
|
|
21379
|
+
action: external_exports.enum(["buy", "sell", "earn", "unearn"]).describe("'buy' to invest, 'sell' to liquidate, 'earn' to deposit into lending for yield, 'unearn' to withdraw from lending"),
|
|
21380
21380
|
asset: external_exports.enum(investAssets).describe("Asset to invest in"),
|
|
21381
|
-
amount: external_exports.union([external_exports.number(), external_exports.literal("all")]).describe(
|
|
21382
|
-
slippage: external_exports.number().optional().describe("Max slippage percent (default: 3)"),
|
|
21381
|
+
amount: external_exports.union([external_exports.number(), external_exports.literal("all")]).optional().describe("USD amount (required for buy/sell, ignored for earn/unearn)"),
|
|
21382
|
+
slippage: external_exports.number().optional().describe("Max slippage percent (default: 3, for buy/sell only)"),
|
|
21383
21383
|
dryRun: external_exports.boolean().optional().describe("Preview without signing (default: false)")
|
|
21384
21384
|
},
|
|
21385
21385
|
async ({ action, asset, amount, slippage, dryRun }) => {
|
|
@@ -21401,9 +21401,12 @@ function registerWriteTools(server, agent) {
|
|
|
21401
21401
|
preview: true,
|
|
21402
21402
|
action,
|
|
21403
21403
|
asset,
|
|
21404
|
-
amount: amount === "all" ? position?.currentValue ?? 0 : amount,
|
|
21404
|
+
amount: amount === "all" ? position?.currentValue ?? 0 : amount ?? position?.totalAmount ?? 0,
|
|
21405
21405
|
currentBalance: balance.available,
|
|
21406
|
-
currentPosition: position ?? null
|
|
21406
|
+
currentPosition: position ?? null,
|
|
21407
|
+
earning: position?.earning ?? false,
|
|
21408
|
+
earningProtocol: position?.earningProtocol ?? null,
|
|
21409
|
+
earningApy: position?.earningApy ?? null
|
|
21407
21410
|
})
|
|
21408
21411
|
}]
|
|
21409
21412
|
};
|
|
@@ -21413,10 +21416,16 @@ function registerWriteTools(server, agent) {
|
|
|
21413
21416
|
if (typeof amount !== "number") throw new Error("Buy amount must be a number");
|
|
21414
21417
|
const result = await mutex.run(() => agent.investBuy({ asset, usdAmount: amount, maxSlippage }));
|
|
21415
21418
|
return { content: [{ type: "text", text: JSON.stringify(result) }] };
|
|
21416
|
-
} else {
|
|
21419
|
+
} else if (action === "sell") {
|
|
21417
21420
|
const usdAmount = amount === "all" ? "all" : amount;
|
|
21418
21421
|
const result = await mutex.run(() => agent.investSell({ asset, usdAmount, maxSlippage }));
|
|
21419
21422
|
return { content: [{ type: "text", text: JSON.stringify(result) }] };
|
|
21423
|
+
} else if (action === "earn") {
|
|
21424
|
+
const result = await mutex.run(() => agent.investEarn({ asset }));
|
|
21425
|
+
return { content: [{ type: "text", text: JSON.stringify(result) }] };
|
|
21426
|
+
} else {
|
|
21427
|
+
const result = await mutex.run(() => agent.investUnearn({ asset }));
|
|
21428
|
+
return { content: [{ type: "text", text: JSON.stringify(result) }] };
|
|
21420
21429
|
}
|
|
21421
21430
|
} catch (err) {
|
|
21422
21431
|
return errorResult(err);
|
|
@@ -21655,6 +21664,7 @@ ${context}
|
|
|
21655
21664
|
"- Expected annual yield on the recommended amount",
|
|
21656
21665
|
"- If they should rebalance existing savings (t2000_rebalance with dryRun: true)",
|
|
21657
21666
|
"- Whether investing in SUI or other assets could complement their savings strategy",
|
|
21667
|
+
'- Note: investment assets (SUI, ETH) can also earn yield via t2000_invest action: "earn"',
|
|
21658
21668
|
"",
|
|
21659
21669
|
"If they want to proceed, use t2000_save to deposit. Always preview first."
|
|
21660
21670
|
].join("\n")
|
|
@@ -21682,9 +21692,13 @@ ${context}
|
|
|
21682
21692
|
"- Portfolio allocation assessment (what % is in checking vs savings vs investment)",
|
|
21683
21693
|
"- Whether current positions are performing well or need adjustment",
|
|
21684
21694
|
"- If idle checking funds should be invested or saved for yield",
|
|
21695
|
+
'- Whether invested assets should earn yield (t2000_invest action: "earn") \u2014 this deposits the asset into the best lending protocol',
|
|
21696
|
+
"- If a position is earning, mention the APY and protocol",
|
|
21685
21697
|
"- Risk assessment \u2014 concentration, unrealized losses, cost basis vs current price",
|
|
21686
21698
|
"",
|
|
21687
|
-
"If they want to invest, use t2000_invest with dryRun: true to preview first."
|
|
21699
|
+
"If they want to invest, use t2000_invest with dryRun: true to preview first.",
|
|
21700
|
+
'If they want to earn yield on investments, use t2000_invest action: "earn".',
|
|
21701
|
+
'If they want to stop earning, use t2000_invest action: "unearn".'
|
|
21688
21702
|
].join("\n")
|
|
21689
21703
|
}
|
|
21690
21704
|
}]
|
|
@@ -21710,4 +21724,4 @@ async function startMcpServer(opts) {
|
|
|
21710
21724
|
export {
|
|
21711
21725
|
startMcpServer
|
|
21712
21726
|
};
|
|
21713
|
-
//# sourceMappingURL=dist-
|
|
21727
|
+
//# sourceMappingURL=dist-TXXQC3NH.js.map
|