Skip to content

Commit d79e47e

Browse files
Hiksangclaude
andcommitted
fix: TUI duplicate exchange/position display + add all exchanges to delta-neutral default
Deduplicate primaryAdapter in fetchExchangeBalances and fetchAllPositions when it already exists in extraAdapters. Default exchanges now include all 4: pacifica, lighter, hyperliquid, aster. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 6add3dc commit d79e47e

2 files changed

Lines changed: 7 additions & 3 deletions

File tree

src/bot/engine.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -519,7 +519,9 @@ async function fetchExchangeBalances(
519519
): Promise<import("./tui/index.js").ExchangeBalance[]> {
520520
const adapters: [string, ExchangeAdapter][] = [[primaryAdapter.name, primaryAdapter]];
521521
if (extraAdapters) {
522-
for (const [name, a] of extraAdapters) adapters.push([name, a]);
522+
for (const [name, a] of extraAdapters) {
523+
if (name !== primaryAdapter.name) adapters.push([name, a]);
524+
}
523525
}
524526
const results: import("./tui/index.js").ExchangeBalance[] = [];
525527
await Promise.all(adapters.map(async ([name, a]) => {
@@ -601,7 +603,9 @@ async function fetchAllPositions(
601603
): Promise<import("./tui/index.js").Position[]> {
602604
const adapters: [string, ExchangeAdapter][] = [[primaryAdapter.name, primaryAdapter]];
603605
if (extraAdapters) {
604-
for (const [name, a] of extraAdapters) adapters.push([name, a]);
606+
for (const [name, a] of extraAdapters) {
607+
if (name !== primaryAdapter.name) adapters.push([name, a]);
608+
}
605609
}
606610
const all: import("./tui/index.js").Position[][] = [];
607611
await Promise.all(adapters.map(async ([name, a]) => {

src/commands/bot.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ export function registerBotCommands(
251251
bot
252252
.command("delta-neutral")
253253
.description("Spot-long + perp-short delta-neutral funding rate farming")
254-
.option("--exchanges <list>", "Comma-separated perp exchange names", "lighter,aster")
254+
.option("--exchanges <list>", "Comma-separated perp exchange names", "pacifica,lighter,hyperliquid,aster")
255255
.option("--min-rate <pct>", "Min annualized rate to enter (%)", "10")
256256
.option("--close-rate <pct>", "Close when avg rate drops below (%)", "2")
257257
.option("--size <usd>", "Position size per leg ($)", "50")

0 commit comments

Comments
 (0)