typescript
import { store } from "opentool/store";
import type { ToolProfile } from "opentool";
import {
readConfig,
resolveProfileAssets,
resolveScheduleConfig,
SIGNAL_BOT_TEMPLATE_CONFIG,
runSignalBot,
} from "../src/signal-bot";
const config = readConfig();
export const profile: ToolProfile = {
description: "Hyperliquid price signal bot.",
category: "strategy",
templatePreview: {
subtitle: "Hyperliquid signal execution with configurable indicators.",
description: `Scans selected assets on a fixed schedule and evaluates technical indicators.
Combines indicator filters with risk checks before any order decision.
Places standardized Hyperliquid orders using fixed USD budget controls.
Includes allocation and exposure settings so multiple assets can run safely.
Designed for configurable signal execution with minimal manual input.`,
},
schedule: resolveScheduleConfig(config),
assets: resolveProfileAssets(config),
templateConfig: SIGNAL_BOT_TEMPLATE_CONFIG,
};
export async function GET(_req: Request) {
const snapshot = readConfig();
try {
const result = await runSignalBot(snapshot);
await store({
source: "signal-bot",
ref: `signal-bot-${Date.now()}`,
status: result.ok ? "info" : "failed",
action: "signal",
metadata: result,
});
return Response.json(result);
} catch (error) {
const message = error instanceof Error ? error.message : "unknown";
await store({
source: "signal-bot",
ref: `signal-bot-${Date.now()}`,
status: "failed",
action: "signal",
metadata: { ok: false, error: message },
});
return new Response(JSON.stringify({ ok: false, error: message }), {
status: 400,
headers: { "content-type": "application/json" },
});
}
}