1Branch0Tags
GL
glucryptoAdopt opentool 0.19.8
1f37f4912 days ago17Commits
typescript
import { z } from "zod"; export const configSchema = z.object({ platform: z.literal("hyperliquid").optional(), signalType: z.literal("twap").optional(), allocationMode: z.literal("fixed").optional(), marketSymbol: z.string().min(1).optional(), amountUsd: z.number().positive().optional(), schedule: z .object({ cron: z.string().min(1).optional(), enabled: z.boolean().optional(), notifyEmail: z.boolean().optional(), }) .optional(), twap: z .object({ side: z.enum(["buy", "sell"]).optional(), minutes: z.number().int().min(1).max(1440).optional(), randomize: z.boolean().optional(), }) .optional(), execution: z .object({ enabled: z.boolean().optional(), environment: z.enum(["mainnet", "testnet"]).optional(), leverage: z.number().positive().optional(), }) .optional(), }); export const TEMPLATE_CONFIG_SCHEMA = { type: "object", properties: { configVersion: { type: "number" }, platform: { type: "string", enum: ["hyperliquid"] }, signalType: { type: "string", enum: ["twap"] }, allocationMode: { type: "string", enum: ["fixed"] }, marketSymbol: { type: "string" }, amountUsd: { type: "number" }, schedule: { type: "object", properties: { cron: { type: "string" }, enabled: { type: "boolean" }, notifyEmail: { type: "boolean" }, }, }, twap: { type: "object", properties: { side: { type: "string", enum: ["buy", "sell"] }, minutes: { type: "number" }, randomize: { type: "boolean" }, }, }, execution: { type: "object", properties: { enabled: { type: "boolean" }, environment: { type: "string", enum: ["mainnet", "testnet"] }, leverage: { type: "number" }, }, }, }, } as const;