repositories
loading repo index
repositories
loading repo index
repository
loading code, commits, and activity
public Clawd ADK gateway launch mirror
stars
latest
clone command
git clone gitlawb://did:key:z6Mkq5mY...iFZ5/my-project-publ...git clone gitlawb://did:key:z6Mkq5mY.../my-project-publ...2fa351d6docs: add automaton and perps launch sources16d ago| #1 | import { resolveTradingMode } from "./config.js"; |
| #2 | import { ClawdPerpsRuntime } from "./marketMaker.js"; |
| #3 | |
| #4 | export interface PerpsFrontendCard { |
| #5 | title: string; |
| #6 | value: string; |
| #7 | hint?: string; |
| #8 | tone?: "live" | "safe" | "watch" | "infra"; |
| #9 | } |
| #10 | |
| #11 | export interface PerpsFrontendStatus { |
| #12 | mode: string; |
| #13 | modeLabel: string; |
| #14 | headline: string; |
| #15 | subheadline: string; |
| #16 | walletConfigured: boolean; |
| #17 | allowedSymbols: string[]; |
| #18 | trackedMarkets: unknown[]; |
| #19 | vulcan: unknown; |
| #20 | cards: PerpsFrontendCard[]; |
| #21 | } |
| #22 | |
| #23 | function describeMode(mode: string): { modeLabel: string; headline: string; subheadline: string } { |
| #24 | switch (mode) { |
| #25 | case "live": |
| #26 | return { |
| #27 | modeLabel: "Live Circuit Armed", |
| #28 | headline: "Phoenix reads are hot and the route to execution is open.", |
| #29 | subheadline: "Every live path still depends on wallet presence, spread limits, and explicit operator intent.", |
| #30 | }; |
| #31 | case "paper": |
| #32 | return { |
| #33 | modeLabel: "Paper Engine Spinning", |
| #34 | headline: "The stack is animated, quoting, and rehearsing without touching real funds.", |
| #35 | subheadline: "Rise drives the market picture while Vulcan-compatible routes stay ready for dry runs and previews.", |
| #36 | }; |
| #37 | default: |
| #38 | return { |
| #39 | modeLabel: "Observe Mode", |
| #40 | headline: "The perp stack is awake, watching the tape, and refusing reckless motion.", |
| #41 | subheadline: "Safe-by-default reads, catalog-backed execution planning, and no blind live flow.", |
| #42 | }; |
| #43 | } |
| #44 | } |
| #45 | |
| #46 | export function buildPerpsFrontendCards(runtime: ClawdPerpsRuntime): PerpsFrontendCard[] { |
| #47 | const mode = resolveTradingMode(runtime.config); |
| #48 | return [ |
| #49 | { |
| #50 | title: "Exchange Pulse", |
| #51 | value: "Phoenix Perps", |
| #52 | hint: "Rise SDK is the live read plane for tickers, positions, and market posture", |
| #53 | tone: "live", |
| #54 | }, |
| #55 | { |
| #56 | title: "Execution Mood", |
| #57 | value: mode, |
| #58 | hint: "Observe and paper stay default; live only activates when the runtime is intentionally armed", |
| #59 | tone: mode === "live" ? "watch" : "safe", |
| #60 | }, |
| #61 | { |
| #62 | title: "Fallback Rail", |
| #63 | value: "Vulcan CLI", |
| #64 | hint: "Used for compatible paper and live route planning, never as a blind fire-and-forget executor", |
| #65 | tone: "infra", |
| #66 | }, |
| #67 | { |
| #68 | title: "Risk Envelope", |
| #69 | value: `${runtime.config.risk.maxNotionalUsd} USD cap`, |
| #70 | hint: `Allowed: ${runtime.config.risk.allowedSymbols.join(", ")}`, |
| #71 | tone: "watch", |
| #72 | }, |
| #73 | { |
| #74 | title: "Agent Bridge", |
| #75 | value: "Vulcan MCP + CLI", |
| #76 | hint: "Catalog-backed routing for market, trade, position, paper, strategy, and TA command families", |
| #77 | tone: "infra", |
| #78 | }, |
| #79 | { |
| #80 | title: "Operator Posture", |
| #81 | value: runtime.config.wallet ? "Wallet Wired" : "Wallet Missing", |
| #82 | hint: runtime.config.wallet |
| #83 | ? "Runtime can price, preview, and prepare authenticated perp actions" |
| #84 | : "Reads and previews still work, but live execution posture stays intentionally incomplete", |
| #85 | tone: runtime.config.wallet ? "live" : "safe", |
| #86 | }, |
| #87 | ]; |
| #88 | } |
| #89 | |
| #90 | export async function buildPerpsFrontendStatus( |
| #91 | runtime: ClawdPerpsRuntime, |
| #92 | ): Promise<PerpsFrontendStatus> { |
| #93 | const [markets, vulcan] = await Promise.all([ |
| #94 | runtime.listMarkets(), |
| #95 | runtime.getVulcanCatalogSummary(), |
| #96 | ]); |
| #97 | const mode = resolveTradingMode(runtime.config); |
| #98 | const mood = describeMode(mode); |
| #99 | return { |
| #100 | mode, |
| #101 | modeLabel: mood.modeLabel, |
| #102 | headline: mood.headline, |
| #103 | subheadline: mood.subheadline, |
| #104 | walletConfigured: Boolean(runtime.config.wallet), |
| #105 | allowedSymbols: runtime.config.risk.allowedSymbols, |
| #106 | trackedMarkets: markets, |
| #107 | vulcan, |
| #108 | cards: buildPerpsFrontendCards(runtime), |
| #109 | }; |
| #110 | } |
| #111 |