Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Submission rights declaration

Project: `BHRIGU OlaXBT Strategy Evidence Agent`
Submission slug: `bhrigu-olaxbt-strategy-evidence-agent`
Submitter: `Yulchiev A.Kh`
Date: `2026-09-12`

The submitter confirms that they own, or have sufficient authorization for, the first-party source code, service, BHRIGU branding, tests, documentation, and other first-party materials included in this submission.

Subject to the official program terms, the submitter authorizes X-Agent to retain, reproduce, audit, test, archive, and publish the submitted program artifact for judging, fraud prevention, dispute handling, ecosystem submission, and post-award accountability.

Third-party components and terms: no bundled npm runtime dependencies. OlaXBT Nexus MCP is an external strategy/signal service and remains subject to OlaXBT terms. The inherited Bitcoin Temporal Evidence capability uses public Binance and mempool.space data subject to their respective terms. Third-party services, data, and branding are not claimed as first-party BHRIGU property. See `source/THIRD_PARTY.md`.

Exceptions or restrictions: authorization covers only the bounded first-party source and materials present in this submission directory. ORION, private prompts, planners, evaluators, private corpora, unpublished methods, credentials, wallet/payment code, and trading execution are excluded. No general open-source license is granted beyond the review/archive authorization stated here and the official program terms.

This declaration is an operational submission statement and is not a substitute for event terms reviewed by qualified counsel.
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
# BHRIGU OlaXBT Strategy Evidence Agent

## Judge-first review path

**OLAXBT STRATEGY = CREATED + BACKTESTED + NEXUS VALIDATED.**

**APPLICATION = DISTINCT AGENT/MCP APPLICATION.** This submission is not strategy-only, not backtest-only, and not a simple API wrapper. The application consumes four live OlaXBT Nexus evidence surfaces and exposes one bounded REST capability plus one read-only MCP tool for agent review.

**Primary job:** Can an agent trust the evidence context behind this OlaXBT strategy signal right now?

Verified BTC/USDT strategy evidence from the live Nexus-backed review deployment:

- Sharpe: **1.7668**
- Win rate: **52.94%**
- Profit factor: **1.6494**
- Max drawdown: **0.31%**
- Trades: **17**
- Four Nexus sources: **signal + metrics + trades + equity**

**Authority boundary:** **OLAXBT = strategy + signal authority. BHRIGU = evidence interpretation layer.** BHRIGU does not create a second BUY/SELL/HOLD signal, forecast price, place orders, execute trades, access wallets, or move funds.

**Confidence epistemic boundary:** the raw OlaXBT confidence value is preserved as source evidence. BHRIGU does **not** invent a confidence threshold, calibration rule, or trading judgment from that value unless OlaXBT explicitly defines those semantics.

## Capability

- **One-line description:** A read-only evidence interpretation layer around the current OlaXBT BTC/USDT strategy signal, combining the observed signal with strategy metrics, recent trades, equity context, contradictions, limitations, and source status.
- **Who it helps:** AI agents and research systems that need to decide how much trust to place in the evidence context around an OlaXBT strategy signal without delegating trading authority.
- **Capability boundary:** **OLAXBT = strategy + signal authority. BHRIGU = evidence interpretation layer.** BHRIGU does not create a second BUY/SELL/HOLD signal, forecast price, place orders, execute trades, access wallets, or move funds.

## Live API

- **API base URL:** https://bhrigu-bitcoin-research-state-rn4vpiwc8-aibhrigus-projects.vercel.app
- **Health-check URL:** https://bhrigu-bitcoin-research-state-rn4vpiwc8-aibhrigus-projects.vercel.app/health
- **Authentication:** no caller credential. The OlaXBT Nexus credential is server-side only.
- **Rate limits / known limits:** `BTC/USDT` only in this bounded trading-track slice; upstream OlaXBT availability and limits apply; each Nexus tool call has a 15-second timeout; no SLA is claimed.
- **API contract:** REST `POST /v1/strategy-evidence` with `{"symbol":"BTC/USDT"}`; MCP `POST /mcp` tool `bhrigu_get_olaxbt_strategy_evidence` with the same symbol. Both return the same bounded Strategy Evidence object.

## Source and reproducibility

- **Source repository:** https://github.com/AiBhrigu/bhrigu-bitcoin-research-state-api
- **Review commit:** `d29423daf121a4318dec063d0694b5fec8eb2ed3`
- **Source submitted in this PR:** `source/`
- **Run tests:** `npm ci && npm test`
- **Run locally:** `npm ci && npm start`; live OlaXBT calls require the authorized `OLAXBT_NEXUS_API_KEY` only in the server environment.
- **Deploy:** deploy exact review commit with Node.js 22+ and bind the Nexus credential server-side.
- **Version binding:** `/health` and `/.well-known/xagent-verification.json` expose the exact deployed commit; the verification endpoint also exposes this trading-track slug.

The deployed health response is:

```json
{"status":"ok","commit":"d29423daf121a4318dec063d0694b5fec8eb2ed3"}
```

The deployment proof is:

```json
{"schemaVersion":1,"slug":"bhrigu-olaxbt-strategy-evidence-agent","commit":"d29423daf121a4318dec063d0694b5fec8eb2ed3"}
```

## Verification

Repeatable REST and MCP calls plus redacted proof are in `verification/README.md`.

- **Health-check result:** HTTP 200, exact review commit.
- **REST capability call:** HTTP 200 with all four OlaXBT `source_status.*.ok=true`.
- **MCP capability call:** HTTP 200; `structuredContent` is the same Strategy Evidence object.
- **Expected error behavior:** unsupported symbols fail explicitly; missing or failed upstream evidence is surfaced and never fabricated.

## Security and data handling

- **Data collected:** only requested symbol; no user identity, wallet, payment, account, or credential data.
- **Purpose and retention:** transient evidence interpretation; no request persistence by this capability.
- **Third parties / outbound network calls:** OlaXBT Nexus MCP for strategy signal, metrics, trades, and equity. The inherited Bitcoin Temporal Evidence capability also uses public Binance and mempool.space data.
- **Secrets:** no real secret is committed or returned. Nexus credential remains server-side only.
- **Known risks / restrictions:** historical performance is context, not forecast; source availability can limit output; `assessment` is not an order instruction.

## Support

- **Team / builder:** BHRIGU / AiBhrigu
- **Contact:** https://x.com/bhrigu_io
- **License / rights:** no general open-source license is granted; X-Agent review/archive rights for this bounded artifact are declared in `RIGHTS.md`.
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: CI

on:
push:
pull_request:

permissions:
contents: read

jobs:
verify:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22
cache: npm
- run: npm ci
- run: npm run check
- name: Local HTTP and MCP smoke
run: |
BHRIGU_COMMIT="$GITHUB_SHA" npm start > /tmp/bhrigu.log 2>&1 &
SERVER_PID=$!
trap 'kill $SERVER_PID || true' EXIT
for n in $(seq 1 20); do
curl -fsS http://127.0.0.1:3000/health > /tmp/health.json && break
sleep 1
done
node --input-type=module -e 'const h=JSON.parse(await (await fetch("http://127.0.0.1:3000/health")).text()); if(h.commit!==process.env.GITHUB_SHA) process.exit(1)'
curl -fsS http://127.0.0.1:3000/v1/windows > /tmp/windows.json
curl -fsS -X POST http://127.0.0.1:3000/mcp \
-H 'content-type: application/json' \
-H 'MCP-Protocol-Version: 2026-07-28' \
-H 'Mcp-Method: server/discover' \
--data '{"jsonrpc":"2.0","id":1,"method":"server/discover","params":{"_meta":{"io.modelcontextprotocol/protocolVersion":"2026-07-28","io.modelcontextprotocol/clientCapabilities":{},"io.modelcontextprotocol/clientInfo":{"name":"ci","version":"1.0.0"}}}}' > /tmp/discover.json
curl -fsS -X POST http://127.0.0.1:3000/mcp \
-H 'content-type: application/json' \
-H 'MCP-Protocol-Version: 2026-07-28' \
-H 'Mcp-Method: tools/list' \
--data '{"jsonrpc":"2.0","id":2,"method":"tools/list","params":{"_meta":{"io.modelcontextprotocol/protocolVersion":"2026-07-28","io.modelcontextprotocol/clientCapabilities":{}}}}' > /tmp/mcp-modern.json
curl -fsS -X POST http://127.0.0.1:3000/mcp \
-H 'content-type: application/json' \
-H 'MCP-Protocol-Version: 2026-07-28' \
-H 'Mcp-Method: tools/call' \
-H 'Mcp-Name: bhrigu_get_temporal_window' \
--data '{"jsonrpc":"2.0","id":3,"method":"tools/call","params":{"name":"bhrigu_get_temporal_window","arguments":{"window_id":"SEP_10_2026"},"_meta":{"io.modelcontextprotocol/protocolVersion":"2026-07-28","io.modelcontextprotocol/clientCapabilities":{}}}}' > /tmp/mcp-call.json
node --input-type=module -e 'import fs from "node:fs"; const w=JSON.parse(fs.readFileSync("/tmp/windows.json")); const d=JSON.parse(fs.readFileSync("/tmp/discover.json")); const l=JSON.parse(fs.readFileSync("/tmp/mcp-modern.json")); const c=JSON.parse(fs.readFileSync("/tmp/mcp-call.json")); if(w.window_count!==2||w.durable_evidence_count!==1||d.result.resultType!=="complete"||!d.result.supportedVersions.includes("2026-07-28")||l.result.tools.length!==5||!l.result.tools.some((t)=>t.name==="bhrigu_get_olaxbt_strategy_evidence"&&t.annotations?.readOnlyHint===true)||l.result.ttlMs!==300000||c.result.structuredContent.window.id!=="SEP_10_2026") process.exit(1)'
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
node_modules/
.vercel/
.env*
.DS_Store
npm-debug.log*
.vercel
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# IP Boundary

## Public artifact

This repository intentionally contains only:

- the read-only HTTP adapter;
- deterministic state-shaping logic;
- one frozen public observation baseline;
- public-source fetchers;
- tests and deployment metadata.

## Explicitly excluded

The following are not part of this artifact and must not be added during hackathon packaging:

- ORION core or private services;
- private prompts, planners, evaluators, or routing contracts;
- private or unpublished corpora;
- unpublished reconstruction or forecasting methods;
- credentials, secrets, customer/account data;
- wallet, payment, transfer, withdrawal, or trade execution logic.

## Law

`EXPOSE MEANING / PROTECT MECHANISM`

Any future submission must copy only the source already present in this bounded public repository unless separately reviewed and authorized.
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# BHRIGU OlaXBT Strategy Evidence Agent

**OLAXBT = strategy + signal authority.**
**BHRIGU = evidence interpretation layer.**

**Job:** Can an agent trust the evidence context behind this OlaXBT strategy signal right now?

The primary trading-track capability is a bounded, read-only evidence object around the current OlaXBT `BTC/USDT` strategy signal. It consumes the live signal, strategy metrics, recent trades, and equity context from OlaXBT Nexus MCP and surfaces support, contradictions, limitations, and evidence quality without creating a second trading signal.

## Primary interfaces

- `POST /v1/strategy-evidence` — REST Strategy Evidence object
- MCP tool `bhrigu_get_olaxbt_strategy_evidence` — the same bounded object for agents
- `GET /health` — exact deployed commit
- `GET /.well-known/xagent-verification.json` — trading-track submission slug + exact commit

Input is exactly `{"symbol":"BTC/USDT"}`. OlaXBT signal direction is preserved from the observed upstream `trade_intent` field; BHRIGU never infers BUY/SELL/HOLD from reasoning text. OlaXBT backtest win rate is preserved from the observed upstream `win_rate_pct` field.

## Safety boundary

Read-only. No order placement, exchange execution, wallet authority, payment authority, withdrawal, transfer, or second signal. Historical performance is evidence context, not a forecast. The OlaXBT Nexus credential is server-side only.

## Evidence sources

The Strategy Evidence object consumes exactly four OlaXBT Nexus tools:

- `get_strategy_signal`
- `get_strategy_metrics`
- `get_strategy_trades`
- `get_strategy_equity`

Each source is reported independently under `source_status`; missing or contradictory evidence is surfaced rather than replaced.

## Run and test

Requires Node.js 22+.

```bash
npm ci
npm test
npm start
```

The live Strategy Evidence call requires `OLAXBT_NEXUS_API_KEY` only in the server environment. Do not put it in Git, client code, fixtures, logs, or responses.

## Inherited capability

This repository also preserves the earlier BHRIGU Bitcoin Temporal Evidence capability and its read-only MCP tools. That inherited Open-Innovation capability remains available, but it is not the primary object of the OlaXBT trading-track submission.

## IP boundary

Only the bounded public adapter is present. ORION core, private prompts, planners, evaluators, private corpora, unpublished methods, credentials, wallet/payment code, and trading execution are excluded.
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Third-party services and public data

## OlaXBT Nexus MCP

Primary external service for the trading-track Strategy Evidence capability. The server calls only the bound strategy's read interfaces used here: signal, metrics, trades, and equity. The authorized Nexus credential is server-side only and is not committed or returned. OlaXBT remains strategy + signal authority.

## Binance Spot public market data

Inherited Bitcoin Temporal Evidence capability only. Public BTCUSDT market data; no Binance account credential, trading, wallet, transfer, or private-account endpoint is used.

## mempool.space public Bitcoin data

Inherited Bitcoin Temporal Evidence capability only. Used for public Bitcoin tip-height context.

## Runtime dependencies

No npm runtime dependencies. The project uses Node.js built-ins and platform-provided `fetch`. Third-party services and data remain subject to their respective terms.
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { methodGate, sendJson } from "../lib/http.mjs";

export default function handler(req, res) {
if (!methodGate(req, res)) return;
sendJson(res, 200, {
name: "BHRIGU Strategy Evidence Agent",
capability: "Can an agent trust the evidence context behind this OlaXBT strategy signal right now?",
endpoint: "/v1/strategy-evidence",
temporal_state: "/v1/state",
windows: "/v1/windows",
mcp: "/mcp",
openapi: "/openapi.json",
health: "/health",
verification: "/.well-known/xagent-verification.json",
boundary: "RESEARCH_STATE_NOT_TRADE"
}, "public, max-age=60");
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { healthPayload } from "../lib/runtime.mjs";
import { methodGate, sendJson } from "../lib/http.mjs";

export default function handler(req, res) {
if (!methodGate(req, res)) return;
sendJson(res, 200, healthPayload(), "public, max-age=30");
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import { sendJson } from "../lib/http.mjs";
import { handleMcpRpc } from "../lib/mcp.mjs";

async function readBody(req) {
if (req.body && typeof req.body === "object") return req.body;
let raw = "";
for await (const chunk of req) raw += chunk;
return raw ? JSON.parse(raw) : null;
}

function headerValue(req, name) {
const headers = req.headers;
if (headers?.get) return headers.get(name);
const value = headers?.[name.toLowerCase()] ?? headers?.[name];
return Array.isArray(value) ? value[0] : value ?? null;
}

export default async function handler(req, res) {
if (req.method !== "POST") return sendJson(res, 405, { error: "METHOD_NOT_ALLOWED", allowed: ["POST"] });
try {
const result = await handleMcpRpc(await readBody(req), {
transportMeta: {
requireHeaders: true,
protocolVersion: headerValue(req, "MCP-Protocol-Version"),
method: headerValue(req, "Mcp-Method"),
name: headerValue(req, "Mcp-Name")
}
});
if (result.status === 202) {
res.statusCode = 202;
return res.end();
}
sendJson(res, result.status, result.body, "no-store");
} catch {
sendJson(res, 400, { jsonrpc: "2.0", id: null, error: { code: -32700, message: "Parse error" } });
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { methodGate, sendJson } from "../lib/http.mjs";
import { openapiPayload } from "../lib/openapi.mjs";

export default function handler(req, res) {
if (!methodGate(req, res)) return;
sendJson(res, 200, openapiPayload(), "public, max-age=300");
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import { buildState } from "../lib/state.mjs";
import { methodGate, sendJson } from "../lib/http.mjs";

export default async function handler(req, res) {
if (!methodGate(req, res)) return;
const url = new URL(req.url || "/v1/state", "http://localhost");
const symbol = String(url.searchParams.get("symbol") || "BTCUSDT").toUpperCase();
if (symbol !== "BTCUSDT") {
sendJson(res, 400, { error: "UNSUPPORTED_SYMBOL", supported: ["BTCUSDT"] });
return;
}
try {
const state = await buildState();
sendJson(res, 200, state, "public, max-age=10, s-maxage=10");
} catch (error) {
sendJson(res, 502, {
error: "PUBLIC_MARKET_SOURCE_UNAVAILABLE",
source: "Binance Spot BTCUSDT",
detail: String(error.message || error),
trading_authority: false
});
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
import { sendJson } from "../lib/http.mjs";
import { buildStrategyEvidence } from "../lib/strategy-evidence.mjs";

async function readBody(req) {
if (req.body && typeof req.body === "object") return req.body;
if (typeof req.body === "string") return req.body ? JSON.parse(req.body) : null;
let raw = "";
for await (const chunk of req) {
raw += chunk;
if (raw.length > 65536) throw new Error("BODY_TOO_LARGE");
}
return raw ? JSON.parse(raw) : null;
}

function statusFor(error) {
if (error?.code === "UNSUPPORTED_SYMBOL") return 400;
if (error?.code === "OLAXBT_NEXUS_API_KEY_MISSING") return 503;
if (error?.code === "OLAXBT_UPSTREAM_AUTH_FAILED") return 502;
if (String(error?.message || "").includes("BODY_TOO_LARGE")) return 413;
if (error instanceof SyntaxError) return 400;
return 502;
}

export default async function handler(req, res) {
if (req.method !== "POST") {
sendJson(res, 405, { error: "METHOD_NOT_ALLOWED", allowed: ["POST"] });
return;
}

try {
const body = await readBody(req);
if (!body || typeof body !== "object" || !body.symbol) {
sendJson(res, 400, { error: "INVALID_INPUT", required: { symbol: "BTC/USDT" } });
return;
}
const result = await buildStrategyEvidence({ symbol: body.symbol });
sendJson(res, 200, result);
} catch (error) {
sendJson(res, statusFor(error), {
error: error?.code || (error instanceof SyntaxError ? "INVALID_JSON" : "OLAXBT_STRATEGY_EVIDENCE_UNAVAILABLE"),
detail: String(error?.message || error),
trading_authority: false,
trade_execution: false
});
}
}
Loading