@gblin-protocol/mcp-server 0.3.1 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +10 -8
- package/README.md +194 -374
- package/dist/abi.d.ts +541 -74
- package/dist/abi.d.ts.map +1 -1
- package/dist/abi.js +56 -25
- package/dist/abi.js.map +1 -1
- package/dist/auction.d.ts +81 -0
- package/dist/auction.d.ts.map +1 -0
- package/dist/auction.js +161 -0
- package/dist/auction.js.map +1 -0
- package/dist/client.d.ts +12 -12
- package/dist/config.d.ts +6 -4
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +17 -9
- package/dist/config.js.map +1 -1
- package/dist/helpers.d.ts +3 -7
- package/dist/helpers.d.ts.map +1 -1
- package/dist/helpers.js +34 -34
- package/dist/helpers.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +4 -3
- package/dist/index.js.map +1 -1
- package/dist/init.js +2 -2
- package/dist/paywall.d.ts.map +1 -1
- package/dist/paywall.js +1 -2
- package/dist/paywall.js.map +1 -1
- package/dist/receipts.d.ts +8 -0
- package/dist/receipts.d.ts.map +1 -1
- package/dist/receipts.js +5 -6
- package/dist/receipts.js.map +1 -1
- package/dist/tools.d.ts +28 -1
- package/dist/tools.d.ts.map +1 -1
- package/dist/tools.js +184 -149
- package/dist/tools.js.map +1 -1
- package/llms.txt +56 -40
- package/package.json +1 -1
- package/dist/keeper.d.ts +0 -16
- package/dist/keeper.d.ts.map +0 -1
- package/dist/keeper.js +0 -180
- package/dist/keeper.js.map +0 -1
package/README.md
CHANGED
|
@@ -1,162 +1,147 @@
|
|
|
1
1
|
# GBLIN MCP Server
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
> 2. **Where does idle USDC sit between jobs?** In GBLIN, a collateral-backed cbBTC/WETH/USDC index that mints and redeems at NAV, with a Just-In-Time swap back to USDC the millisecond the agent needs to pay an [x402](https://docs.cdp.coinbase.com/x402/welcome) invoice. No lockup, unsigned calldata only — your wallet signs, we never hold keys.
|
|
3
|
+
Model Context Protocol server for the GBLIN protocol on Base mainnet: an on-chain index of cbBTC, WETH and USDC whose shares are minted at NAV and redeemed pro rata in kind. The server reads live state, verifies governance and risk attestations, and returns unsigned calldata to enter, leave and bid. It never holds keys, signs or broadcasts.
|
|
4
|
+
|
|
5
|
+
Published on npm as [`@gblin-protocol/mcp-server`](https://www.npmjs.com/package/@gblin-protocol/mcp-server).
|
|
7
6
|
|
|
8
7
|
[](https://www.npmjs.com/package/@gblin-protocol/mcp-server)
|
|
9
8
|
[](https://github.com/gblinproject/gblin-treasury-risk-regime/actions/workflows/ci.yml)
|
|
10
9
|
[](LICENSE)
|
|
11
|
-
[](https://basescan.org/address/
|
|
10
|
+
[](https://basescan.org/address/0xc2181d975c05c8c724b334bcED0764c0b86B1D53)
|
|
12
11
|
[](https://basescan.org/address/0x6aBeC8716fFeEcf7C3D6e68255b4797113E8e5Dd)
|
|
13
|
-
[](https://github.com/base/skills/pull/56)
|
|
14
12
|
[](https://gblin.digital/.well-known/x402)
|
|
15
13
|
[](https://registry.modelcontextprotocol.io)
|
|
16
|
-
[](https://glama.ai/mcp/servers/gblinproject/GBLIN-MCP)
|
|
17
14
|
[](https://smithery.ai/servers/gblin-protocol/mcp)
|
|
18
15
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
⚡ **Copy-paste starter examples:** [`examples/`](examples/) — [ElizaOS](examples/elizaos.md) · [AgentKit / TypeScript](examples/agentkit.ts) · [Claude / any MCP client](examples/claude.md) — each with the recommended treasury-policy system prompt and safe-default security env.
|
|
22
|
-
|
|
23
|
-
▶️ **Runnable full-cycle demo** (read-only, no keys): `npx tsx examples/full-cycle.ts` — live against Base: treasury state → risk regime → attestation verified offline → invest calldata → JIT redemption calldata. [Source](examples/full-cycle.ts).
|
|
24
|
-
|
|
25
|
-
🌐 **Hosted MCP (Streamable HTTP, no install):** `https://gblin-mcp.gblin-mcp-worker.workers.dev/mcp` — **8 free tools** in a dot-notation tree, no auth, no session: `risk.regime`, `risk.attestation_sample`, `protocol.stats`, `protocol.info`, `coherence.report`, plus AI Action Receipts (`receipts.seal` demo 5/day/IP, `receipts.get`, `receipts.verify` — pure-math verification, no trust in this server). Two prompts: `risk_gate`, `seal_and_verify`. The pre-rename flat names still work as unlisted aliases until 2026-11-21. Docs are **MCP resources**, not tools: `gblin://howto/attestation`, `gblin://howto/seal`, `gblin://limits`, `gblin://keys` (verifier keys + key-rotation policy). Nothing is paid over MCP.
|
|
26
|
-
> **GET-only audit** (for reviewers and clients that cannot POST): [`/meta`](https://gblin-mcp.gblin-mcp-worker.workers.dev/meta) (counts + `manifest_hash`) · [`/tools.json`](https://gblin-mcp.gblin-mcp-worker.workers.dev/tools.json) · [`/resources.json`](https://gblin-mcp.gblin-mcp-worker.workers.dev/resources.json) · [`/conformance`](https://gblin-mcp.gblin-mcp-worker.workers.dev/conformance) · [`/v1/verify/:index`](https://gblin-mcp.gblin-mcp-worker.workers.dev/v1/verify/0) (per-check booleans + on-chain anchor consistency).
|
|
27
|
-
> This hosted surface is **deliberately different** from the npm stdio package below (13 tools, treasury/governance included). Also on [Smithery](https://smithery.ai/servers/gblin-protocol/mcp). Source in [`worker/`](worker/).
|
|
28
|
-
|
|
29
|
-
---
|
|
30
|
-
|
|
31
|
-
## ElizaOS Plugin
|
|
32
|
-
|
|
33
|
-
For agents running on **ElizaOS**, install the companion plugin — now listed in the **official ElizaOS plugin registry** (v0.4.0, security-hardened):
|
|
34
|
-
|
|
35
|
-
```bash
|
|
36
|
-
npm install plugin-gblin
|
|
37
|
-
# or: elizaos plugins add gblin
|
|
38
|
-
```
|
|
39
|
-
|
|
40
|
-
It exposes four native Actions (`CHECK_GBLIN_TREASURY_HEALTH`, `INVEST_IDLE_USDC_GBLIN`, `RESCUE_USDC_FROM_GBLIN`, `GET_GBLIN_RISK_ATTESTATION`) and a Provider that injects live NAV + Crash Shield status into the agent context on every loop.
|
|
41
|
-
|
|
42
|
-
→ [Full Eliza plugin docs](https://github.com/gblinproject/GBLIN_PLUGIN)
|
|
43
|
-
|
|
44
|
-
---
|
|
45
|
-
|
|
46
|
-
## AI Action Receipts — a witnessed transparency log for what your agent did
|
|
47
|
-
|
|
48
|
-
The problem this attacks is the #1 barrier to AI adoption in 2026: **nobody can
|
|
49
|
-
prove, after the fact, exactly what an AI did** (surveys: workers burn 2–4 h/week
|
|
50
|
-
verifying AI output; 70% of orgs say they cannot govern their agents). Our answer
|
|
51
|
-
is the smallest honest primitive: a public, append-only **RFC 6962 transparency
|
|
52
|
-
log** for AI actions. Input and output go in as **hashes only** (never content);
|
|
53
|
-
the short `action` label, `agent_id`, `tool` and `meta` strings you send are
|
|
54
|
-
published in the public log — put identifiers there, never secrets. You get back
|
|
55
|
-
a portable receipt any third party can verify offline, forever.
|
|
56
|
-
|
|
57
|
-
```
|
|
58
|
-
receipt = canonical payload
|
|
59
|
-
+ Ed25519 signature (key: gblin.digital/receipts-log)
|
|
60
|
-
+ RFC 6962 inclusion proof (leaf → Merkle root)
|
|
61
|
-
+ C2SP signed checkpoint (origin, tree size, root)
|
|
62
|
-
```
|
|
63
|
-
|
|
64
|
-
Canonicalization is frozen as **`gblin-canonical-json/1`**: object keys sorted by
|
|
65
|
-
UTF-16 code unit, no whitespace, `JSON.stringify` semantics for primitives,
|
|
66
|
-
recursion for objects/arrays. Test vector: payload `{"b":1,"a":null}` →
|
|
67
|
-
canonical `{"a":null,"b":1}` → leaf = `SHA256(0x00 || canonical_bytes)`. The
|
|
68
|
-
receipt signature is Ed25519 over `"gblin-receipt/v1\n" + canonical`.
|
|
69
|
-
|
|
70
|
-
- Seal (paid, unlimited): `POST https://gblin.digital/api/x402/seal` — $0.01 USDC via x402.
|
|
71
|
-
- Seal (demo, 5/day/IP): `POST <worker>/v1/seal-demo` or hosted MCP tool `receipts.seal` (verify with `receipts.verify`).
|
|
72
|
-
- Read free forever: `<worker>/v1/receipt/:index` · `/log` · `/log/checkpoint` · `/log/proof/:index` · human page `/receipt/:index`.
|
|
73
|
-
- Daily EAS anchor on Base of the tree root (verifiable on base.easscan.org, schema `0x9f433a96…`, promiseId `keccak256("gblin-receipts-log")`).
|
|
74
|
-
- **Offline verifier, zero dependencies:** [`verify-receipt.mjs`](./verify-receipt.mjs) — `node verify-receipt.mjs receipt.json`.
|
|
75
|
-
|
|
76
|
-
A seal proves **existence and time** in a signed append-only log whose root is
|
|
77
|
-
anchored daily on Base. The checkpoint is currently signed by the log operator
|
|
78
|
-
(us); **independent witness cosigning is an open invitation** — we already
|
|
79
|
-
cosign a third-party transparency log (C2SP tlog-witness) and will list any
|
|
80
|
-
witness that cosigns ours. Until then, honest wording: operator-signed, chain-anchored.
|
|
81
|
-
It is **not** a compliance certificate and **not** an endorsement of the content.
|
|
82
|
-
Worker: `<worker>` = `https://gblin-mcp.gblin-mcp-worker.workers.dev`.
|
|
83
|
-
|
|
84
|
-
## Coherence Proof — verify GBLIN keeps its promises
|
|
85
|
-
|
|
86
|
-
GBLIN pre-registers hash-pinned public promises, then runs an automaton that probes them every 10 minutes and seals each closed day as an [EAS attestation](https://base.easscan.org/schema/view/0x9f433a96467ab75530009970e5aa938ec94d8a49f08f66e7381822d557b448ef) on Base. Reading is free forever; the paid service is being observed — the certifier submits itself to its own instrument first.
|
|
87
|
-
|
|
88
|
-
- **Free report:** [`/coherence`](https://gblin-mcp.gblin-mcp-worker.workers.dev/coherence) (JSON) or the hosted MCP tool `coherence.report`.
|
|
89
|
-
- **Live promises:** P1 (uptime of the paid Risk Attestation endpoint) and P2 (honesty of the public agent-economy counters, with our own wallets disclosed and excluded).
|
|
90
|
-
- **On-chain:** each closed day is sealed as an EAS attestation on Base by a dedicated observer wallet. GBLIN is a discoverable ERC-8004 agent (#59286).
|
|
91
|
-
|
|
92
|
-
---
|
|
93
|
-
|
|
94
|
-
## AI assistant discovery — `gblin-init`
|
|
95
|
-
|
|
96
|
-
Drop an `AGENTS.md` treasury policy into your repo so every modern AI coding
|
|
97
|
-
assistant (Claude Code, Cursor, Windsurf, GitHub Copilot, Codex) automatically
|
|
98
|
-
discovers GBLIN when it works on your codebase:
|
|
99
|
-
|
|
100
|
-
```bash
|
|
101
|
-
npx -p @gblin-protocol/mcp-server gblin-init
|
|
102
|
-
```
|
|
103
|
-
|
|
104
|
-
The command is **idempotent and safe**:
|
|
105
|
-
|
|
106
|
-
- If `AGENTS.md` does not exist → creates it from the canonical template at
|
|
107
|
-
[`gblin.digital/AGENTS.template.md`](https://gblin.digital/AGENTS.template.md).
|
|
108
|
-
- If `AGENTS.md` exists → appends a clearly delimited GBLIN block at the
|
|
109
|
-
bottom; your own content is never touched.
|
|
110
|
-
- Re-running is a no-op (detected via stable HTML markers).
|
|
111
|
-
- `--dry-run` prints what it would do without writing.
|
|
112
|
-
- `--force` refreshes the block to the latest version.
|
|
113
|
-
|
|
114
|
-
It also runs offline thanks to a bundled fallback template.
|
|
16
|
+
Documentation and quick start: [gblin.digital/agents](https://gblin.digital/agents). Starter examples: [`examples/`](examples/).
|
|
115
17
|
|
|
116
|
-
|
|
18
|
+
## Features
|
|
117
19
|
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
20
|
+
- Market risk regime (`calm` / `elevated` / `crash`) read from the vault's on-chain Crash Shield, with a severity score and a risk posture
|
|
21
|
+
- Quotes at NAV for minting and redeeming, with a dynamic slippage buffer
|
|
22
|
+
- Unsigned calldata to mint with USDC and to exit to USDC just in time for a payment, through the GBLIN Zap
|
|
23
|
+
- Treasury health of an agent wallet: balances, gas runway, cooldown, allocation advice
|
|
24
|
+
- Governance verification: owner, pending owner, timelock roles and scheduled operations, computed from the chain
|
|
25
|
+
- The state of the rebalancing auction, row by row, with the bid to send
|
|
26
|
+
- Offline verification of Risk Attestations (EIP-712) and of AI Action Receipts (RFC 6962)
|
|
27
|
+
- A portable skill seed to onboard a peer agent
|
|
122
28
|
|
|
123
|
-
|
|
29
|
+
Every tool is free. The server never charges: revenue comes from the on-chain protocol fee when an agent actually uses GBLIN. Verifiable pay-per-call lives on the HTTP endpoints listed under [x402 endpoints](#x402-endpoints).
|
|
124
30
|
|
|
125
|
-
##
|
|
126
|
-
|
|
127
|
-
**GBLIN V6 is governed by a 48h Timelock Controller** — every admin operation (parameter change, oracle update, ownership transfer) is enforced on-chain to wait **172,800 seconds** before execution. Agents and integrators can verify this directly on BaseScan.
|
|
31
|
+
## Contracts (Base mainnet, chain id 8453)
|
|
128
32
|
|
|
129
33
|
| Component | Address | Role |
|
|
130
34
|
|---|---|---|
|
|
131
|
-
|
|
|
132
|
-
|
|
|
133
|
-
|
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
35
|
+
| Vault | [`0xc2181d975c05c8c724b334bcED0764c0b86B1D53`](https://basescan.org/address/0xc2181d975c05c8c724b334bcED0764c0b86B1D53) | The ERC-20 share and the basket. Mints at NAV, redeems in kind, rebalances by Dutch auction, accepts payments by signature (EIP-3009). Never swaps. |
|
|
36
|
+
| Lens | [`0xfCFea8027019E8551A1f09AD91532471F5D26f61`](https://basescan.org/address/0xfCFea8027019E8551A1f09AD91532471F5D26f61) | Read-only views beside the vault: quotes, configuration, basket rows, auction state. |
|
|
37
|
+
| Zap | [`0x0E9D6Ceb6D313b021622C121Cda9C62e86e60200`](https://basescan.org/address/0x0E9D6Ceb6D313b021622C121Cda9C62e86e60200) | The only contract that swaps: mints with any token, exits to ETH by redeeming in kind and selling every leg, all or nothing. |
|
|
38
|
+
| Timelock | [`0x6aBeC8716fFeEcf7C3D6e68255b4797113E8e5Dd`](https://basescan.org/address/0x6aBeC8716fFeEcf7C3D6e68255b4797113E8e5Dd) | 48-hour minimum delay, 14-day grace period, open executor. Proposer and canceller roles are held by separate addresses. |
|
|
39
|
+
|
|
40
|
+
Previous deployments (`0x36C81d7E1966310F305eA637e761Cf77F90852f0`, `0x38DcDB3A381677239BBc652aed9811F2f8496345`) are superseded. Nothing is read from them; holders migrate through the web app.
|
|
41
|
+
|
|
42
|
+
Fees: 0.10% on every mint with ETH or WETH (0.05% stays in the vault and lifts the NAV of every share, 0.05% is minted as shares to the fee recipient); in-kind deposits pay a 0.50% floor plus a deviation tax; a 0.50% yearly management fee accrues as shares; redemption in kind and transfers carry no fee.
|
|
43
|
+
|
|
44
|
+
## Hosted variant
|
|
45
|
+
|
|
46
|
+
A stateless Streamable HTTP server with a smaller tool set runs at `https://gblin-mcp.gblin-mcp-worker.workers.dev/mcp` — no install, no auth, no session, 60 requests per minute per IP. GET-only audit surfaces: [`/meta`](https://gblin-mcp.gblin-mcp-worker.workers.dev/meta), [`/tools.json`](https://gblin-mcp.gblin-mcp-worker.workers.dev/tools.json), [`/resources.json`](https://gblin-mcp.gblin-mcp-worker.workers.dev/resources.json), [`/conformance`](https://gblin-mcp.gblin-mcp-worker.workers.dev/conformance). Also listed on [Smithery](https://smithery.ai/servers/gblin-protocol/mcp).
|
|
47
|
+
|
|
48
|
+
## API
|
|
49
|
+
|
|
50
|
+
### Tools
|
|
51
|
+
|
|
52
|
+
- **get_market_risk_regime**
|
|
53
|
+
- The BTC/ETH risk regime derived from the vault's Crash Shield: `calm`, `elevated` or `crash`, with `severity_pct`, a `risk_posture` (`risk_on` / `reduce` / `risk_off`), the defensive cash weight and one entry per risk asset
|
|
54
|
+
- Inputs: none
|
|
55
|
+
- Call it before any action that deploys capital; a `crash` reading means stand down
|
|
56
|
+
|
|
57
|
+
- **get_treasury_state**
|
|
58
|
+
- NAV in USD, ETH price, whether the vault can price itself (`nav_reliable`), the yearly management fee, whether an auction is open, Crash Shield status and the basket rows with base and dynamic weights
|
|
59
|
+
- Inputs: none
|
|
60
|
+
|
|
61
|
+
- **quote_safe_swap**
|
|
62
|
+
- Previews a mint (ETH→GBLIN) or a redemption (GBLIN→ETH) through the Lens, with a safe minimum output under the dynamic slippage buffer (2.5% normally, 4% while the Crash Shield is active) and the fee breakdown
|
|
63
|
+
- Inputs:
|
|
64
|
+
- `direction` (string): `buy` or `sell`
|
|
65
|
+
- `amount_in` (string): decimal amount of ETH (buy) or GBLIN (sell)
|
|
66
|
+
|
|
67
|
+
- **swap_gblin_to_usdc_jit**
|
|
68
|
+
- Unsigned calldata to turn GBLIN into a given amount of USDC just in time: approve the shares to the Zap, the Zap's `sellGBLINForEth` (redeem in kind and sell every leg, all or nothing), then a WETH→USDC swap. Three transactions; ERC-4337 and EIP-7702 wallets batch them into one
|
|
69
|
+
- Inputs:
|
|
70
|
+
- `usdc_needed` (string): decimal USDC amount
|
|
71
|
+
- `wallet_address` (string): the agent's address, for the cooldown check and as receiver
|
|
72
|
+
- Every step carries a minimum output; the last step's input is the guaranteed minimum of the previous one
|
|
73
|
+
|
|
74
|
+
- **invest_usdc_to_gblin**
|
|
75
|
+
- Unsigned calldata to mint GBLIN with USDC through the Zap: approve USDC, then one call that swaps to WETH and mints at NAV. Two transactions
|
|
76
|
+
- Inputs:
|
|
77
|
+
- `usdc_amount` (string): decimal USDC amount
|
|
78
|
+
- `wallet_address` (string): receiver of the shares
|
|
79
|
+
- Both bounds travel with the call: the minimum WETH from the swap and the minimum shares from the mint
|
|
80
|
+
|
|
81
|
+
- **analyze_treasury_health**
|
|
82
|
+
- GBLIN, USDC and ETH balances of a wallet, gas health, the vault's cooldown for that wallet, and an allocation recommendation with the runway in days when a burn rate is given
|
|
83
|
+
- Inputs:
|
|
84
|
+
- `wallet_address` (string)
|
|
85
|
+
- `daily_burn_usd` (number, optional): average daily spend, enables the runway estimate
|
|
86
|
+
|
|
87
|
+
- **get_governance_state**
|
|
88
|
+
- Owner and pending owner of the vault, the fee recipient, the timelock's minimum delay and roles, and, when the pending owner is the timelock, the deterministic id and state of the scheduled `acceptOwnership` operation
|
|
89
|
+
- Inputs:
|
|
90
|
+
- `operation_id` (string, optional): a timelock operation id (bytes32) to inspect
|
|
91
|
+
|
|
92
|
+
- **share_skill_with_peer**
|
|
93
|
+
- A portable JSON seed another agent can use to install this server and start: install instructions, the tool list, contract addresses, a worked example and the caller's ERC-8021 builder code for attribution
|
|
94
|
+
- Inputs:
|
|
95
|
+
- `caller_wallet` (string)
|
|
96
|
+
- `peer_context` (string, optional): what the peer does, to tailor the example
|
|
97
|
+
- `example_amount_usdc` (number, optional)
|
|
98
|
+
|
|
99
|
+
- **get_auction_state**
|
|
100
|
+
- The rebalancing auction: whether it is open, the current premium over the oracle price and its curve, and one entry per basket row with the side the vault takes, the gap in ETH, the token and amount the bidder hands over, and unsigned calldata for the approval and the bid. `best` is the row with the largest gap
|
|
101
|
+
- Inputs: none
|
|
102
|
+
- The premium is the whole reward; nothing is paid out of the vault. The input is reduced to what closes the gap
|
|
103
|
+
|
|
104
|
+
- **verify_risk_attestation**
|
|
105
|
+
- Verifies a Risk Attestation offline: recomputes the EIP-712 id, recovers the signer and checks it against the published attestor, checks freshness, and reports the live drift of the regime since issuance
|
|
106
|
+
- Inputs:
|
|
107
|
+
- `attestation` (object): the object returned by `GET https://gblin.digital/api/x402/attestation`
|
|
108
|
+
- `expected_attestor` (string, optional): the attestor address to pin
|
|
109
|
+
- Accepts EIP-712 domain version 2 (verifying contract = the vault in service) and version 1 (the previous deployment); the version the attestation declares selects the domain
|
|
110
|
+
|
|
111
|
+
- **seal_action_demo**
|
|
112
|
+
- Seals the hashes of an AI action into the public transparency log (demo: 5 per day per IP, receipt marked `demo: true`) and returns the portable receipt
|
|
113
|
+
- Inputs:
|
|
114
|
+
- `action` (string): a short label
|
|
115
|
+
- `input_hash` (string): SHA-256 of the input
|
|
116
|
+
- `output_hash` (string, optional)
|
|
117
|
+
- `agent_id`, `tool`, `meta` (string, optional): identifiers, published in clear
|
|
118
|
+
- Unlimited seals are a paid x402 HTTP endpoint; see `how_to_seal_paid`
|
|
119
|
+
|
|
120
|
+
- **get_receipt**
|
|
121
|
+
- A sealed receipt by index: canonical payload, Ed25519 signature, RFC 6962 inclusion proof and the signed checkpoint
|
|
122
|
+
- Inputs:
|
|
123
|
+
- `index` (integer)
|
|
124
|
+
|
|
125
|
+
- **how_to_seal_paid**
|
|
126
|
+
- How to seal without limits: endpoint, body schema, payment flow and offline verification
|
|
127
|
+
- Inputs: none
|
|
128
|
+
|
|
129
|
+
### Tool annotations (MCP hints)
|
|
130
|
+
|
|
131
|
+
Every tool sets [MCP tool annotations](https://modelcontextprotocol.io/specification/2025-03-26/server/tools#toolannotations):
|
|
132
|
+
|
|
133
|
+
| Tool | readOnlyHint | idempotentHint | destructiveHint | openWorldHint |
|
|
134
|
+
|---|---|---|---|---|
|
|
135
|
+
| all except `seal_action_demo` | `true` | `true` | `false` | `true` |
|
|
136
|
+
| `seal_action_demo` | `false` | `false` | `false` | `true` |
|
|
137
|
+
|
|
138
|
+
Calldata builders are read-only: they return bytes, they do not send them. Sealing appends to a public log and is never destructive.
|
|
144
139
|
|
|
145
|
-
##
|
|
146
|
-
|
|
147
|
-
AI agents today hold their working capital in **USDC**. USDC sits flat: zero yield, full inflation exposure.
|
|
148
|
-
|
|
149
|
-
**GBLIN** is an on-chain index on Base (45% cbBTC + 45% WETH + 10% USDC) with an algorithmic Crash Shield that adaptively reduces risk-asset exposure as drawdown rises (V6 adaptive threshold, from ~15%). GBLIN is managed crypto exposure with capped drawdown — a calmer way to hold BTC/ETH risk for **surplus** capital, not a substitute for USDC (it can still lose value in a crash). Agents settle x402 invoices instantly via Just-In-Time GBLIN→USDC redemption.
|
|
150
|
-
|
|
151
|
-
This server exposes that capability to any LLM agent through the standard MCP protocol.
|
|
152
|
-
|
|
153
|
-
---
|
|
154
|
-
|
|
155
|
-
## Quick start
|
|
140
|
+
## Usage
|
|
156
141
|
|
|
157
142
|
### Claude Desktop
|
|
158
143
|
|
|
159
|
-
Add to `claude_desktop_config.json
|
|
144
|
+
Add to `claude_desktop_config.json`:
|
|
160
145
|
|
|
161
146
|
```json
|
|
162
147
|
{
|
|
@@ -169,11 +154,7 @@ Add to `claude_desktop_config.json` (on Windows: `%APPDATA%\Claude\claude_deskto
|
|
|
169
154
|
}
|
|
170
155
|
```
|
|
171
156
|
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
### Windsurf / Cursor
|
|
175
|
-
|
|
176
|
-
Add to `~/.codeium/windsurf/mcp_config.json` (Windsurf) or the equivalent Cursor MCP config:
|
|
157
|
+
### Cursor, Windsurf and other MCP clients
|
|
177
158
|
|
|
178
159
|
```json
|
|
179
160
|
{
|
|
@@ -181,301 +162,140 @@ Add to `~/.codeium/windsurf/mcp_config.json` (Windsurf) or the equivalent Cursor
|
|
|
181
162
|
"gblin": {
|
|
182
163
|
"command": "npx",
|
|
183
164
|
"args": ["-y", "@gblin-protocol/mcp-server"],
|
|
184
|
-
"env": {
|
|
185
|
-
"GBLIN_RPC_URL": "https://base-rpc.publicnode.com"
|
|
186
|
-
}
|
|
165
|
+
"env": { "GBLIN_RPC_URL": "https://base-rpc.publicnode.com" }
|
|
187
166
|
}
|
|
188
167
|
}
|
|
189
168
|
}
|
|
190
169
|
```
|
|
191
170
|
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
### Coinbase AgentKit (TypeScript)
|
|
171
|
+
### Programmatic (TypeScript)
|
|
195
172
|
|
|
196
173
|
```ts
|
|
197
|
-
import {
|
|
174
|
+
import { Client } from "@modelcontextprotocol/sdk/client/index.js";
|
|
198
175
|
import { StdioClientTransport } from "@modelcontextprotocol/sdk/client/stdio.js";
|
|
199
176
|
|
|
200
|
-
const transport = new StdioClientTransport({
|
|
201
|
-
|
|
202
|
-
args: ["-y", "@gblin-protocol/mcp-server"],
|
|
203
|
-
});
|
|
204
|
-
const client = new MCPClient({ name: "my-agent", version: "1.0.0" });
|
|
177
|
+
const transport = new StdioClientTransport({ command: "npx", args: ["-y", "@gblin-protocol/mcp-server"] });
|
|
178
|
+
const client = new Client({ name: "my-agent", version: "1.0.0" });
|
|
205
179
|
await client.connect(transport);
|
|
206
180
|
|
|
207
|
-
// List tools
|
|
208
|
-
const { tools } = await client.listTools();
|
|
209
|
-
|
|
210
|
-
// Quote a JIT payment of $0.50
|
|
211
181
|
const jit = await client.callTool({
|
|
212
182
|
name: "swap_gblin_to_usdc_jit",
|
|
213
183
|
arguments: { usdc_needed: "0.50", wallet_address: "0xYourAgent..." },
|
|
214
184
|
});
|
|
215
185
|
```
|
|
216
186
|
|
|
217
|
-
###
|
|
218
|
-
|
|
219
|
-
Any framework that speaks MCP over stdio works:
|
|
187
|
+
### AGENTS.md for coding assistants
|
|
220
188
|
|
|
221
189
|
```bash
|
|
222
|
-
npx @gblin-protocol/mcp-server
|
|
190
|
+
npx -p @gblin-protocol/mcp-server gblin-init
|
|
223
191
|
```
|
|
224
192
|
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
---
|
|
228
|
-
|
|
229
|
-
## The 13 tools (npm stdio package)
|
|
230
|
-
|
|
231
|
-
### Free tools (no payment required)
|
|
193
|
+
Creates an `AGENTS.md` from the template at [gblin.digital/AGENTS.template.md](https://gblin.digital/AGENTS.template.md), or appends a delimited block to an existing one. Idempotent; `--dry-run` previews, `--force` refreshes the block. No files are written at install time; set `GBLIN_SKIP_HINT=1` to silence the post-install hint.
|
|
232
194
|
|
|
233
|
-
|
|
234
|
-
|---|---|
|
|
235
|
-
| `get_treasury_state` | NAV in USD + basket composition + Crash Shield status |
|
|
236
|
-
| `quote_safe_swap` | Preview buy or sell with dynamic slippage buffer |
|
|
237
|
-
| `swap_gblin_to_usdc_jit` | **The x402 magic**: generate two-step GBLIN→USDC calldata (free) |
|
|
238
|
-
| `invest_usdc_to_gblin` | Convert USDC earnings into GBLIN treasury (MEV-safe) (free) |
|
|
239
|
-
| `get_governance_state` | Verify owner == 48h Timelock + pending asset proposals + min delay |
|
|
240
|
-
| `share_skill_with_peer` | Generate a portable skill seed to onboard a peer agent + embedded referral code |
|
|
241
|
-
| `verify_risk_attestation` | Verify a peer's **Risk Attestation** (perishable proof-of-diligence): integrity + EIP-712 signature + freshness + live drift (free) |
|
|
242
|
-
|
|
243
|
-
### More free tools
|
|
244
|
-
|
|
245
|
-
| Tool | Purpose |
|
|
246
|
-
|---|---|
|
|
247
|
-
| `get_market_risk_regime` | **Start here**: BTC/ETH risk regime (calm/elevated/crash) + severity + risk posture, from the on-chain Crash Shield — free, no key |
|
|
248
|
-
| `analyze_treasury_health` | Balances + gas + runway + rebalance advice |
|
|
249
|
-
| `find_keeper_bounty` | **GBLIN pays you**: check if a rebalance bounty is available (no capital required, you only pay gas) |
|
|
250
|
-
|
|
251
|
-
> **Risk Attestation** — mint a perishable (10-minute), verifiable proof of the current BTC/ETH risk regime at `GET https://gblin.digital/api/x402/attestation` ($0.003 USDC via x402). Attach it to your action as proof-of-diligence; any counterparty verifies it for free with `verify_risk_attestation`.
|
|
252
|
-
|
|
253
|
-
All tools return structured JSON. All values are quoted on-chain (NAV via `quoteSellGBLIN` × Chainlink ETH/USD, with 24h staleness guard). No mock data.
|
|
195
|
+
## Configuration
|
|
254
196
|
|
|
255
|
-
|
|
197
|
+
`GBLIN_RPC_URL` selects the Base RPC endpoint; the default is `https://base-rpc.publicnode.com`. For sustained load use a dedicated provider:
|
|
256
198
|
|
|
257
|
-
|
|
199
|
+
```bash
|
|
200
|
+
export GBLIN_RPC_URL="https://base-mainnet.g.alchemy.com/v2/YOUR_KEY"
|
|
201
|
+
npx @gblin-protocol/mcp-server
|
|
202
|
+
```
|
|
258
203
|
|
|
259
|
-
|
|
204
|
+
`GBLIN_ATTESTOR_ADDRESS` overrides the published attestor address used by `verify_risk_attestation`.
|
|
260
205
|
|
|
261
|
-
|
|
262
|
-
monetizes only through the on-chain protocol fee (0.05% on mint) when an agent actually uses GBLIN.
|
|
206
|
+
## x402 endpoints
|
|
263
207
|
|
|
264
|
-
|
|
265
|
-
(`0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913`), settled through the **Coinbase CDP facilitator**
|
|
266
|
-
via gasless EIP-3009 `transferWithAuthorization`:
|
|
208
|
+
Pay-per-call data lives on HTTP, settled in USDC on Base through the Coinbase CDP facilitator with gasless EIP-3009 `transferWithAuthorization`. Clients such as `@x402/fetch` handle the 402 challenge, the signature and the retry.
|
|
267
209
|
|
|
268
|
-
| Endpoint | Price |
|
|
210
|
+
| Endpoint | Price | Returns |
|
|
269
211
|
|---|---|---|
|
|
270
212
|
| `GET gblin.digital/api/x402/treasury-state` | $0.001 | NAV, basket weights, Crash Shield status |
|
|
271
|
-
| `GET gblin.digital/api/x402/quote` | $0.001 |
|
|
272
|
-
| `GET gblin.digital/api/x402/governance` | $0.001 | Owner
|
|
273
|
-
| `GET gblin.digital/api/x402/health` | $0.002 | Wallet balances, gas runway,
|
|
213
|
+
| `GET gblin.digital/api/x402/quote` | $0.001 | Mint or redemption preview with the dynamic slippage buffer |
|
|
214
|
+
| `GET gblin.digital/api/x402/governance` | $0.001 | Owner, timelock, pending operations |
|
|
215
|
+
| `GET gblin.digital/api/x402/health` | $0.002 | Wallet balances, gas runway, allocation advice |
|
|
274
216
|
| `GET gblin.digital/api/x402/invest` | $0.002 | Unsigned calldata: USDC → GBLIN |
|
|
275
217
|
| `GET gblin.digital/api/x402/jit` | $0.005 | Unsigned calldata: GBLIN → USDC just in time |
|
|
276
|
-
| `GET gblin.digital/api/x402/attestation` | $0.003 | Signed EIP-712
|
|
277
|
-
|
|
278
|
-
Machine-readable manifest: `https://gblin.digital/.well-known/x402`. Recommended clients: `@x402/fetch`
|
|
279
|
-
or `@x402/axios` (x402 v2 — they handle the 402 challenge, the signature and the retry for you).
|
|
280
|
-
The MCP tool `verify_risk_attestation` checks any attestation offline, for free.
|
|
281
|
-
|
|
282
|
-
**Payment recipient**: `0x0ebA5d314F4f5Dcb7A094953Fa9311a45172dd1B` (GBLIN fee wallet).
|
|
283
|
-
|
|
284
|
-
---
|
|
285
|
-
|
|
286
|
-
## Architectural decisions
|
|
218
|
+
| `GET gblin.digital/api/x402/attestation` | $0.003 | Signed EIP-712 Risk Attestation, valid ten minutes |
|
|
219
|
+
| `POST gblin.digital/api/x402/seal` | $0.01 | A sealed AI Action Receipt |
|
|
287
220
|
|
|
288
|
-
|
|
221
|
+
Machine-readable manifest: `https://gblin.digital/.well-known/x402`. Payment recipient: `0x0ebA5d314F4f5Dcb7A094953Fa9311a45172dd1B`.
|
|
289
222
|
|
|
290
|
-
|
|
223
|
+
## Risk Attestation
|
|
291
224
|
|
|
292
|
-
|
|
293
|
-
- **EOA wallets** (Privy, MetaMask, raw private key)
|
|
294
|
-
- **ERC-4337 smart accounts** (Safe, Coinbase smart account)
|
|
295
|
-
- **EIP-7702 delegated EOAs** (Pectra+)
|
|
225
|
+
`GET https://gblin.digital/api/x402/attestation` returns a ten-minute, verifiable snapshot of the BTC/ETH risk regime, signed under the EIP-712 domain `GBLIN Risk Attestation`, version 2, chain 8453, verifying contract = the vault in service. The response embeds its domain, types and message under `eip712`; a verifier recovers the signer and checks it against the published attestor address, which it should pin. `verify_risk_attestation` does this offline and also accepts attestations issued under domain version 1.
|
|
296
226
|
|
|
297
|
-
|
|
227
|
+
## AI Action Receipts
|
|
298
228
|
|
|
299
|
-
|
|
229
|
+
A public, append-only [RFC 6962](https://www.rfc-editor.org/rfc/rfc6962) transparency log for AI actions. Input and output go in as hashes only; the short `action`, `agent_id`, `tool` and `meta` strings are published in clear, so put identifiers there, never secrets. Each seal returns a portable receipt:
|
|
300
230
|
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
### MEV protection
|
|
231
|
+
```
|
|
232
|
+
receipt = canonical payload
|
|
233
|
+
+ Ed25519 signature (key: gblin.digital/receipts-log)
|
|
234
|
+
+ RFC 6962 inclusion proof (leaf → Merkle root)
|
|
235
|
+
+ C2SP signed checkpoint (origin, tree size, root)
|
|
236
|
+
```
|
|
309
237
|
|
|
310
|
-
|
|
238
|
+
Canonicalization is frozen as `gblin-canonical-json/1`: object keys sorted by UTF-16 code unit, no whitespace, `JSON.stringify` semantics for primitives, recursion for objects and arrays. Test vector: payload `{"b":1,"a":null}` → canonical `{"a":null,"b":1}` → leaf = `SHA256(0x00 || canonical_bytes)`. The receipt signature is Ed25519 over `"gblin-receipt/v1\n" + canonical`.
|
|
311
239
|
|
|
312
|
-
|
|
240
|
+
- Seal (paid, unlimited): `POST https://gblin.digital/api/x402/seal`, $0.01 USDC via x402
|
|
241
|
+
- Seal (demo, 5 per day per IP): `POST <worker>/v1/seal-demo`, or the tool `seal_action_demo`
|
|
242
|
+
- Read, free: `<worker>/v1/receipt/:index`, `/log`, `/log/checkpoint`, `/log/proof/:index`, `/log/consistency`, `/log/leaves`, and the page `/receipt/:index`
|
|
243
|
+
- Daily anchor of the tree root on Base as an EAS attestation (schema `0x9f433a96…`)
|
|
244
|
+
- Offline verifier with no dependencies: [`verify-receipt.mjs`](./verify-receipt.mjs) — `node verify-receipt.mjs receipt.json`
|
|
313
245
|
|
|
314
|
-
The
|
|
246
|
+
The checkpoint is signed by the log operator and cosigned by an independent witness (Markovian Protocol). A cosignature attests that the log stayed append-only between the sizes the witness saw; it does not attest that a receipt's content is true. A seal proves existence and time; it is not a compliance certificate and not an endorsement. `<worker>` = `https://gblin-mcp.gblin-mcp-worker.workers.dev`.
|
|
315
247
|
|
|
316
|
-
|
|
248
|
+
## Coherence Proof
|
|
317
249
|
|
|
318
|
-
|
|
250
|
+
GBLIN pre-registers hash-pinned promises and runs an automaton that probes them every ten minutes and seals each closed day as an EAS attestation on Base. Free report: [`/coherence`](https://gblin-mcp.gblin-mcp-worker.workers.dev/coherence). Live promises: uptime of the paid attestation endpoint, and honesty of the public agent-economy counters, with the protocol's own wallets disclosed. GBLIN is a registered ERC-8004 agent (#59286).
|
|
319
251
|
|
|
320
|
-
|
|
252
|
+
## Architecture notes
|
|
321
253
|
|
|
322
|
-
|
|
254
|
+
- **Mint at NAV, redeem in kind.** The vault prices every mint from Chainlink feeds and issues shares against the deposit; redemption pays the exact pro-rata slice of every basket row, reads no price feed and cannot be paused. The vault never swaps.
|
|
255
|
+
- **The Zap swaps.** Entering with a token other than ETH or WETH, and leaving to ETH or USDC, go through the Zap, which swaps on a venue and mints or redeems on the vault in the same call. Exits are all or nothing: a leg that cannot be sold reverts the whole transaction instead of paying out less.
|
|
256
|
+
- **Rebalancing is a Dutch auction.** When a row drifts past its band the vault opens an auction; the counterparty trades toward the target weights at the oracle price adjusted by a premium that starts at a discount and rises to a cap over one ramp. `get_auction_state` exposes it.
|
|
257
|
+
- **Dynamic slippage.** Minimum outputs are quoted from the Lens and buffered by 2.5%, or 4% while the Crash Shield is active. No calldata leaves this server with a zero minimum on a swap.
|
|
258
|
+
- **Cooldown.** The vault refuses a redemption for a short window after the same address minted; the window is read live and reported by `analyze_treasury_health`.
|
|
259
|
+
- **Payments by signature.** The vault implements EIP-3009 (`transferWithAuthorization`, `receiveWithAuthorization`, `cancelAuthorization`), so an agent can settle in GBLIN the way it settles in USDC. Transfers carry no fee.
|
|
323
260
|
|
|
324
|
-
|
|
325
|
-
export GBLIN_RPC_URL="https://base-mainnet.g.alchemy.com/v2/YOUR_KEY"
|
|
326
|
-
npx @gblin-protocol/mcp-server
|
|
327
|
-
```
|
|
328
|
-
|
|
329
|
-
See `.env.example` for the full list.
|
|
261
|
+
## Security notes
|
|
330
262
|
|
|
331
|
-
|
|
263
|
+
- The server is read-only: it never holds, signs or broadcasts. Calldata is plain ABI-encoded bytes for the agent's own wallet to review and send.
|
|
264
|
+
- Every quote comes from on-chain calls and Chainlink feeds. A stale or non-positive ETH/USD answer aborts the tool with an explicit error rather than a bad number; the vault's own `isNavReliable` is reported alongside.
|
|
265
|
+
- No telemetry, no analytics, no remote dependencies beyond the configured RPC.
|
|
332
266
|
|
|
333
267
|
## Development
|
|
334
268
|
|
|
335
269
|
```bash
|
|
336
270
|
git clone https://github.com/gblinproject/gblin-treasury-risk-regime
|
|
337
|
-
cd
|
|
271
|
+
cd gblin-treasury-risk-regime
|
|
338
272
|
npm install
|
|
339
273
|
npm run build
|
|
340
|
-
npm test # live read-only smoke test against Base mainnet
|
|
274
|
+
npm test # live, read-only smoke test against Base mainnet
|
|
341
275
|
npm start # run the compiled server
|
|
342
276
|
```
|
|
343
277
|
|
|
344
|
-
Project layout:
|
|
345
|
-
|
|
346
278
|
```
|
|
347
279
|
src/
|
|
348
|
-
config.ts #
|
|
349
|
-
abi.ts #
|
|
350
|
-
client.ts # viem
|
|
280
|
+
config.ts # addresses, slippage and cache settings
|
|
281
|
+
abi.ts # vault, Lens, Zap, timelock, Chainlink and ERC-20 ABIs
|
|
282
|
+
client.ts # viem public client and on-chain timestamp
|
|
351
283
|
helpers.ts # NAV, basket state, slippage, cooldown, reverse quote
|
|
352
|
-
|
|
353
|
-
tools.ts # the
|
|
284
|
+
auction.ts # auction state and bid sizing
|
|
285
|
+
tools.ts # the ten treasury tools and their schemas
|
|
286
|
+
receipts.ts # the three receipt tools
|
|
354
287
|
index.ts # MCP stdio server entry
|
|
355
|
-
|
|
356
|
-
|
|
288
|
+
init.ts # the gblin-init command
|
|
289
|
+
worker/ # the hosted Streamable HTTP server (Cloudflare Workers)
|
|
290
|
+
scripts/test.ts
|
|
357
291
|
```
|
|
358
292
|
|
|
359
|
-
---
|
|
360
|
-
|
|
361
|
-
## Security notes
|
|
362
|
-
|
|
363
|
-
- The server is **read-only**. It never holds, signs, or broadcasts.
|
|
364
|
-
- All quotes are derived from on-chain calls + Chainlink oracles. Stale or negative oracle answers cause the tool to abort with `OracleStale` / `OracleDead`.
|
|
365
|
-
- The agent's wallet is the sole signer. Calldata returned by tools is plain ABI-encoded bytes — review before broadcasting in untrusted environments.
|
|
366
|
-
- No telemetry, no analytics, no remote dependencies beyond the configured RPC.
|
|
367
|
-
|
|
368
|
-
---
|
|
369
|
-
|
|
370
|
-
## Roadmap
|
|
371
|
-
|
|
372
|
-
- **v0.2**: Uniswap V3 QuoterV2 integration for sub-1% slippage precision
|
|
373
|
-
- **v0.3**: Permit2 support (skip the approve step for x402 reinvestment)
|
|
374
|
-
- **v0.4**: Streamable HTTP transport for hosted multi-agent setups
|
|
375
|
-
- **v1.0**: Audited contract integration + remote-only deployment guide
|
|
376
|
-
|
|
377
|
-
---
|
|
378
|
-
|
|
379
293
|
## Links
|
|
380
294
|
|
|
381
|
-
-
|
|
382
|
-
-
|
|
383
|
-
-
|
|
384
|
-
-
|
|
385
|
-
|
|
386
|
-
MIT © 2026 GBLIN Protocol
|
|
387
|
-
|
|
388
|
-
## Agent-to-Agent Skill Propagation (v0.1.9+)
|
|
389
|
-
|
|
390
|
-
GBLIN MCP includes a unique tool — `share_skill_with_peer` — that lets one AI agent transfer treasury management capabilities to another agent.
|
|
391
|
-
|
|
392
|
-
When agent A meets agent B in a multi-agent context (delegated task, x402 payment flow, shared workspace), agent A can call `share_skill_with_peer` to generate a portable JSON "skill seed". The seed contains:
|
|
393
|
-
|
|
394
|
-
- Install instructions for the GBLIN MCP server
|
|
395
|
-
- A working transaction example with reference TX on Basescan
|
|
396
|
-
- Agent A's referral code (derived from its wallet)
|
|
397
|
-
- The full natural-language explanation of GBLIN
|
|
398
|
-
|
|
399
|
-
Agent B can install the server in seconds using the seed. From that moment, every GBLIN transaction agent B executes includes agent A's referral code in the calldata via ERC-8021 Builder Code (`bc_gbdo32j0`). A small portion of the protocol fee (0.05% of transaction value) is redirected to agent A's wallet — sourced from the existing protocol fee split, not added on top.
|
|
400
|
-
|
|
401
|
-
This creates a viral propagation mechanism for treasury skills across the agent ecosystem, while economically rewarding agents who evangelize good treasury practices.
|
|
402
|
-
|
|
403
|
-
No additional infrastructure is required. The mechanism is entirely on-chain via the existing Builder Code system.
|
|
404
|
-
|
|
405
|
-
## Keeper Bounty System (v0.1.11+)
|
|
406
|
-
|
|
407
|
-
GBLIN is one of the few protocols that **pays AI agents** instead of charging them.
|
|
408
|
-
|
|
409
|
-
When the treasury pool drifts from its target allocation, any agent can call `find_keeper_bounty` to check if a profitable rebalance is available. If one exists, the tool returns ready-to-send calldata. The agent broadcasts the transaction and receives **0.0001 ETH** from the protocol's stability fund — the swap uses the contract's own capital; the caller only pays gas (~$0.01 on Base).
|
|
410
|
-
|
|
411
|
-
```json
|
|
412
|
-
// Example response when a bounty is available
|
|
413
|
-
{
|
|
414
|
-
"bountyAvailable": true,
|
|
415
|
-
"direction": "WETH->asset",
|
|
416
|
-
"estimatedRewardEth": "0.0001",
|
|
417
|
-
"target": "0x36C81d7E1966310F305eA637e761Cf77F90852f0",
|
|
418
|
-
"calldata": "0x...",
|
|
419
|
-
"value": "0",
|
|
420
|
-
"note": "Send this calldata to earn the reward. The swap uses the contract's own funds."
|
|
421
|
-
}
|
|
422
|
-
```
|
|
423
|
-
|
|
424
|
-
For continuous income, poll `find_keeper_bounty` on an interval (e.g. every 5–15 minutes). A live keeper leaderboard is at [gblin.digital/keepers](https://gblin.digital/keepers).
|
|
425
|
-
|
|
426
|
-
## Discovery & Trust
|
|
427
|
-
|
|
428
|
-
GBLIN exposes machine-readable discovery files for AI agents and protocols:
|
|
429
|
-
|
|
430
|
-
- **Coinbase x402 Bazaar:** all 11 GBLIN endpoints (7 webapp + 4 Sentinel) are indexed in the [CDP Bazaar discovery layer](https://docs.cdp.coinbase.com/x402/bazaar) — agents find them via semantic search (`GET https://api.cdp.coinbase.com/platform/v2/x402/discovery/search?query=treasury+risk`) or by merchant (`.../discovery/merchant?payTo=0x0ebA5d314F4f5Dcb7A094953Fa9311a45172dd1B`)
|
|
431
|
-
- **x402 Manifest:** https://gblin.digital/.well-known/x402 — full list of paid endpoints with prices, chain ID, and currency
|
|
432
|
-
- **LLM Discovery:** https://gblin.digital/api/x402/llms.txt — human-readable protocol summary (free, no paywall)
|
|
433
|
-
- **Base MCP Plugin:** [PR #56 on base/skills](https://github.com/base/skills/pull/56) — official integration in review
|
|
434
|
-
|
|
435
|
-
The MCP server in this repo provides the same operations as the x402 HTTP endpoints, but exposed via the Model Context Protocol for direct agent integration (Claude Desktop, Cursor, Windsurf, ElizaOS, etc.).
|
|
436
|
-
|
|
437
|
-
## GBLIN Sentinel — x402 Data Agent Example
|
|
438
|
-
|
|
439
|
-
[GBLIN Sentinel](https://gblin-sentinel.vercel.app) is an open-source reference implementation of an autonomous AI agent that **sells** on-chain data via x402 micropayments. It demonstrates the full x402 producer pattern on Base.
|
|
440
|
-
|
|
441
|
-
| Endpoint | Price | Data |
|
|
442
|
-
|---|---|---|
|
|
443
|
-
| `/api/data/base-risk-pulse` | $0.002 USDC | Chainlink risk signal: `normal`/`caution`/`risk-off` for ETH, BTC, USDC |
|
|
444
|
-
| `/api/data/gblin-analytics` | $0.002 USDC | GBLIN treasury state, basket weights, keeper availability |
|
|
445
|
-
| `/api/data/keeper-opps` | $0.002 USDC | Live keeper bounty check with MCP tool reference |
|
|
446
|
-
| `/api/data/risk-pulse-pro` | $0.03 USDC | **Flagship**: actionable recommendation (invest/hold/reduce/defer) + confidence + suggested allocation |
|
|
447
|
-
|
|
448
|
-
Discovery:
|
|
449
|
-
- x402 manifest: https://gblin-sentinel.vercel.app/.well-known/x402
|
|
450
|
-
- LLM reference: https://gblin-sentinel.vercel.app/llms.txt
|
|
451
|
-
- Source: https://github.com/gblinproject/gblin-sentinel
|
|
452
|
-
|
|
453
|
-
Any agent using this MCP server can call `base-risk-pulse` before investing to gate treasury actions on current market risk signal.
|
|
454
|
-
|
|
455
|
-
## GBLIN Aureus — Autonomous Trading Agent (Track-Record Engine)
|
|
456
|
-
|
|
457
|
-
[Aureus](https://gblin.digital/aureus) is an autonomous catalyst & rotation agent that trades crypto, equities, indices and metals on Base — and **cannot lie about its results**: every thesis is keccak-hashed and committed on-chain *before* the agent acts, then revealed at close. Win or lose, the record is permanent and independently verifiable. No cherry-picked screenshots.
|
|
458
|
-
|
|
459
|
-
**Status: DRY-RUN validation.** Aureus runs the full loop on live market data with zero real funds. It graduates to real capital only if it passes a public gate: 30–50 closed trades, profit factor > 1.3, max drawdown < 10%, zero liquidations. The live dashboard publishes every metric in real time: [gblin.digital/aureus](https://gblin.digital/aureus).
|
|
460
|
-
|
|
461
|
-
Under the hood (the boring parts that keep capital alive):
|
|
462
|
-
|
|
463
|
-
- **Risk engine**: volatility-targeted sizing, stops always inside the liquidation distance, mark-to-market equity with automatic drawdown halt, 10-second stop watcher
|
|
464
|
-
- **Multi-venue funding carry**: delta-neutral funding harvest confirmed across Binance/Bybit/OKX medians, with persistence gating (regimes, not single prints)
|
|
465
|
-
- **Multi-timeframe alignment**: fast mean-reversion signals are gated by the daily trend (time-series momentum, the most documented edge in finance)
|
|
466
|
-
- **Microstructure eyes**: taker-flow (CVD) and order-book imbalance veto entries the tape opposes
|
|
467
|
-
- **Shadow book**: every rejected strategy keeps paper-trading on live data; capital allocation follows statistical proof, never opinion
|
|
468
|
-
- **News sentinel**: a multi-LLM consensus ensemble (6 independent providers) reads verified headlines into a risk signal — the math decides every entry, the LLMs only modulate
|
|
469
|
-
|
|
470
|
-
Aureus is also a planned GBLIN treasury user: idle capital parks in GBLIN via this MCP server and JIT-swaps to USDC when margin is needed — the agent eating the protocol's own cooking.
|
|
471
|
-
|
|
472
|
-
- **Live dashboard:** https://gblin.digital/aureus
|
|
473
|
-
- **Announcement:** [@GBLIN_Protocol on X](https://x.com/GBLIN_Protocol/status/2065196097207685240)
|
|
474
|
-
|
|
475
|
-
## Related Repositories
|
|
295
|
+
- Vault: [`0xc2181d975c05c8c724b334bcED0764c0b86B1D53`](https://basescan.org/address/0xc2181d975c05c8c724b334bcED0764c0b86B1D53)
|
|
296
|
+
- Protocol site and agent docs: [gblin.digital](https://gblin.digital) · [gblin.digital/agents](https://gblin.digital/agents)
|
|
297
|
+
- Protocol sources and specification: [github.com/gblinproject/GBLIN-Protocol](https://github.com/gblinproject/GBLIN-Protocol)
|
|
298
|
+
- ElizaOS plugin: [`plugin-gblin`](https://github.com/gblinproject/GBLIN_PLUGIN)
|
|
299
|
+
- Issues: [github.com/gblinproject/gblin-treasury-risk-regime/issues](https://github.com/gblinproject/gblin-treasury-risk-regime/issues)
|
|
476
300
|
|
|
477
|
-
|
|
478
|
-
- **Web App & x402 Endpoints:** https://github.com/gblinproject/GBLIN_WEBAPP
|
|
479
|
-
- **ElizaOS Plugin:** https://github.com/gblinproject/GBLIN_PLUGIN
|
|
480
|
-
- **GBLIN Sentinel (x402 data agent):** https://github.com/gblinproject/gblin-sentinel
|
|
481
|
-
- **GBLIN Aureus (autonomous trading agent):** https://gblin.digital/aureus — dry-run validation, on-chain commit-reveal track record
|
|
301
|
+
MIT © GBLIN Protocol
|