Gblin Treasury Risk Regime

io.github.gblinproject由 GitHub 账号 gblinproject 发布v0.6.6更新于 Nov 8, 2026

GBLIN on Base for AI agents: risk regime, treasury plan for idle USDC, mint and redeem at NAV. Free.

已验证Streamable HTTP可网页运行金融安全与监控数据与分析

概览

AI 生成的概览

读取 Base 上 GBLIN 金库的状态:BTC/ETH 风险状态、NAV 报价、资金计划、未签名调用数据、免 Gas 支付与可验证的 AI 操作回执。

可以做什么
  • 读取金库与市场状态:风险状态、NAV、篮子权重、治理、拍卖、NAV 历史
  • 报价铸造与赎回,并根据闲置 USDC 规划代理资金
  • 生成并模拟未签名的金库交易,再查询已发送交易的结果
  • 生成、校验并代转 EIP-3009 免 Gas 的 GBLIN 支付
  • 在公开透明日志中封存、读取与校验 AI 操作回执
  • 检索并获取协议文档与工具卡片
适用场景
适用于在 Base 上持有或计划持有 USDC、ETH 或 GBLIN 的代理:需要查看风险、规划资金配置、构建并模拟金库交易,或在没有 ETH 的情况下用 GBLIN 付款。也适合为 AI 操作生成可验证回执、查阅协议文档。
运行要求
可使用托管端点(无需安装、无需认证,每 IP 每分钟 60 次请求),或用 Node.js 通过 npx 在本地运行 npm 包。需要一个 Base 主网 RPC 端点,通过 GBLIN_RPC_URL 设置,未设置时回退到公共端点;持续负载建议使用专用服务商。GBLIN_ATTESTOR_ADDRESS 可覆盖固定的证明者地址。无需账户或 API 密钥。
安装前请注意
服务器不持有密钥也不签名,但会返回调用数据,需由用户自己的钱包审阅并发送;relay 会在链上转移付款方资金,被标记为破坏性操作。封存会写入公开日志:输入输出以哈希形式记录,而 action、agent_id、tool、meta 等字符串明文公开,切勿放入机密。回执只证明存在与时间,不证明操作真实发生。付费签名证明与无限次封存属于单独的 x402 HTTP 端点,以 USDC 计费,不在 MCP 内。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Gblin Treasury Risk Regime,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Web executable,通过 Streamable HTTP。 远程服务在工作区中配置后即可从网页运行时运行。

交给智能体安装

把这段提示词粘贴到 Claude Code、Codex、Cursor 等智能体,或 SourceWeft 对话中。智能体会读取该服务器的安装指南,先向你展示发布者、端点和登录方式,经你同意后再把它添加到你的客户端。密钥不会写进任何命令。

阅读 https://sourceweft.com/mcp/io.github.gblinproject%2Fgblin-treasury-risk-regime/install.md,并按其中说明把这个 MCP 服务器接入我的客户端。修改任何配置之前,先告诉我它的发布者、端点和登录方式,等我确认。不要把 API 密钥写进命令或我会提交的文件;问我密钥应从哪里获取。

查看智能体所依据的安装指南

其他 MCP 客户端

把它添加到你客户端的 mcpServers 配置中。

{
  "mcpServers": {
    "gblin-treasury-risk-regime": {
      "type": "http",
      "url": "https://mcp.gblin.digital/mcp"
    }
  }
}

README

GBLIN MCP Server

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.

Published on npm as @gblin-protocol/mcp-server.

[npm] [CI] [License: MIT] [Base Mainnet] [Governance: 48h Timelock] [x402 Manifest] [MCP Registry] [Smithery] [Glama score]

Documentation and quick start: gblin.digital/agents. Starter examples: examples/.

Features

  • Market risk regime (calm / elevated / crash) read from the vault's on-chain Crash Shield, with a severity score and a risk posture
  • Quotes at NAV for minting and redeeming, with a dynamic slippage buffer
  • One tool that prepares any operation on the vault (mint with ETH, WETH or USDC, redeem in kind, exit to ETH or USDC, bid in the auction), each step with its gas limit
  • Simulation of those steps before signing, in sequence against the latest block, with decoded revert reasons and the gas limit each vault step really needs
  • The outcome of a sent transaction, and the NAV per share over time beside ETH and BTC
  • Treasury health of an agent wallet: balances, gas runway, cooldown, allocation advice
  • Governance verification: owner, pending owner, timelock roles and scheduled operations, computed from the chain
  • The state of the rebalancing auction, row by row, with the bid to send
  • Gasless payments in GBLIN (EIP-3009): prepare the authorization to sign, check it against the chain before anyone spends gas, and, when nobody else will carry it, have GBLIN's relay settle it with the fee in GBLIN, in one atomic transaction
  • Offline verification of Risk Attestations (EIP-712) and of AI Action Receipts (RFC 6962)
  • A portable skill seed to onboard a peer agent
  • Four prompts (ready-made workflows) and four resources (deployment, payments, keys, limits)
  • An outputSchema on every tool that returns an object, so a client can validate results and generate types

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.

Contracts (Base mainnet, chain id 8453)

ComponentAddressRole
Vault0xc2181d975c05c8c724b334bcED0764c0b86B1D53The ERC-20 share and the basket. Mints at NAV, redeems in kind, rebalances by Dutch auction, accepts payments by signature (EIP-3009). Never swaps.
Lens0xfCFea8027019E8551A1f09AD91532471F5D26f61Read-only views beside the vault: quotes, configuration, basket rows, auction state.
Zap0x0E9D6Ceb6D313b021622C121Cda9C62e86e60200The only contract that swaps: mints with any token, exits to ETH by redeeming in kind and selling every leg, all or nothing.
Timelock0x6aBeC8716fFeEcf7C3D6e68255b4797113E8e5Dd48-hour minimum delay, 14-day grace period, open executor. Proposer and canceller roles are held by a 2-of-3 Safe (0xc7AeFcfC871bA51FA2ddfE3117b69AC055C98eF1).

Previous deployments (0x36C81d7E1966310F305eA637e761Cf77F90852f0, 0x38DcDB3A381677239BBc652aed9811F2f8496345) are superseded. Nothing is read from them; holders migrate through the web app.

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.

Hosted variant

A stateless Streamable HTTP server runs at https://mcp.gblin.digital/mcp — no install, no auth, no session, 60 requests per minute per IP. It serves the vault, action and payment tools of this package under two-level names (treasury.*, actions.*, payments.*, governance.state, auction.state, attestation.verify), built from the same source, plus the risk, receipts and coherence tools; the snake_case names below are accepted there as aliases. It also serves search and fetch, the two read-only tools research clients expect (ChatGPT deep research among them): search returns matching documents (the protocol's documentation, one card per tool, the live vault state) and fetch returns one document's full text. Every step returned by the action tools carries both spellings, target/calldata and to/data/chainId, so it maps one to one onto wallet batch APIs such as send_calls. GET-only audit surfaces: /meta, /tools.json, /resources.json, /conformance. Also listed on Smithery. A second surface, https://mcp.gblin.digital/mcp/directory, serves the same tools except payments.relay, the one tool that submits a signed transfer on the caller's behalf; it exists for connector directories that accept software which reads, simulates, verifies and prepares unsigned calldata but not software that executes transfers. /meta reports it under directory_surface.

Agent treasury (library and CLI)

packages/agent-treasury — npm @gblin-protocol/agent-treasury. Operating cash stays in USDC, the surplus above a reserve is parked in GBLIN, and USDC is pulled back from GBLIN just in time when an x402 invoice arrives. The x402 client is Coinbase's reference x402Client with the refill attached to its onBeforePaymentCreation hook, so a 402 for USDC on Base triggers the refill before the authorization is signed and a price above the cap is refused before anything is signed. Self-custody, no key leaves the process. Verified end to end on a fork of Base (24 checks: park, refill, cooldown, a mock invoice with the challenge bytes of gblin.digital and a verified EIP-712 signature, the cap).

bash
export GBLIN_AGENT_PRIVATE_KEY=0x...npx @gblin-protocol/agent-treasury status --jsonnpx @gblin-protocol/agent-treasury park --jsonnpx @gblin-protocol/agent-treasury pay https://gblin.digital/api/x402/attestation --max-amount 3000 --json

The matching agent skill is skills/gblin-agent-treasury (npx skills add gblinproject/gblin-treasury-risk-regime). Details: packages/agent-treasury/README.md.

API

Tools

  • get_market_risk_regime

    • 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
    • Inputs: none
    • Call it before any action that deploys capital; a crash reading means stand down
  • get_treasury_state

    • 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
    • Inputs: none
  • quote_safe_swap

    • 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
    • Inputs:
      • direction (string): buy or sell
      • amount_in (string): decimal amount of ETH (buy) or GBLIN (sell)
  • swap_gblin_to_usdc_jit

    • 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
    • Inputs:
      • usdc_needed (string): decimal USDC amount
      • wallet_address (string): the agent's address, for the cooldown check and as receiver
    • Every step carries a minimum output; the last step's input is the guaranteed minimum of the previous one
  • invest_usdc_to_gblin

    • 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
    • Inputs:
      • usdc_amount (string): decimal USDC amount
      • wallet_address (string): receiver of the shares
    • Both bounds travel with the call: the minimum WETH from the swap and the minimum shares from the mint
  • analyze_treasury_health

    • 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
    • Inputs:
      • wallet_address (string)
      • daily_burn_usd (number, optional): average daily spend, enables the runway estimate
  • plan_treasury

    • Idle USDC to a reviewable plan in one call: the operating cash to keep liquid (max(reserve_usd, daily_burn_usd × days)), the surplus above it, a simulation of minting that surplus at NAV with every fee read live and the estimated value of exiting the same position today (round-trip cost included), the same simulation for a trial amount, the blockers (crash shield, cooldown, ETH for the exit) and the tools to call after a human confirms. Reads only; nothing is executed and nothing is advised
    • Inputs:
      • wallet_address (string)
      • daily_burn_usd (number, optional): average daily spend in USD
      • days (number, optional): days of spend to keep liquid, default 7
      • reserve_usd (number, optional): USD to keep liquid regardless of the burn rate; one of daily_burn_usd or reserve_usd is required
      • trial_usdc (number, optional): trial amount to simulate beside the surplus, default 100
    • The same plan is served over HTTP at https://gblin.digital/api/x402/plan
  • get_governance_state

    • 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
    • Inputs:
      • operation_id (string, optional): a timelock operation id (bytes32) to inspect
  • share_skill_with_peer

    • 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
    • Inputs:
      • caller_wallet (string)
      • peer_context (string, optional): what the peer does, to tailor the example
      • example_amount_usdc (number, optional)
  • get_auction_state

    • 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
    • Inputs: none
    • The premium is the whole reward; nothing is paid out of the vault. The input is reduced to what closes the gap
  • prepare_gblin_payment

    • Builds a gasless GBLIN payment. The share token implements EIP-3009, the same mechanism USDC uses: the holder signs an authorization and anybody can carry it on chain, so the payer needs no ETH. Returns the EIP-712 message to sign, the amount in shares and atomic units, the payer's balance, the x402 "exact" payload for paying an HTTP endpoint in GBLIN, and the accepts block a seller publishes to be paid in GBLIN
    • Inputs:
      • from (string): the payer, the wallet that will sign
      • to (string): the recipient
      • amount_gblin (string) or amount_usd (string): the amount, converted at the live NAV when given in USD
      • method (string, optional): receive (default) can be submitted only by the recipient, so nobody can front-run it; transfer can be submitted by anyone, which is what an x402 facilitator does
      • valid_for_seconds (number, optional): default 600, maximum 86,400
    • The EIP-712 domain is read from the token through EIP-5267, never assumed. No private key is requested, held or transmitted
  • verify_gblin_authorization

    • Checks a signed authorization against the chain before anyone spends gas on it: recovers the signer from the digest, or asks the wallet itself through ERC-1271 when the payer is a contract, then checks the validity window against on-chain time, whether the nonce has been used or cancelled, and whether the payer still holds the amount. Returns a verdict, the failing reasons, and the ready calldata when it would settle
    • Inputs:
      • authorization (object): from, to, value, validAfter, validBefore, nonce
      • signature (string): produced by the payer's wallet
      • method (string, optional): receive (default) or transfer
    • These are the checks an x402 facilitator runs, so a would_settle verdict means the payment is good to carry
  • relay_gblin_payment

    • Hands a signed payment and a signed relay fee to GBLIN's relay (https://gblin.digital/api/relay/gblin), which checks both against the chain, simulates them and submits them in one transaction through Multicall3: both settle or neither does. For a payer that holds no ETH and has nobody to carry the payment
    • Inputs:
      • payment (object): { authorization, signature }, method transfer
      • fee (object): { authorization, signature } from the relay block of prepare_gblin_payment called with relay: true
    • The fee is quoted live by the relay, in GBLIN at the NAV. This tool moves funds: it is marked destructive so clients ask before running it
  • prepare_action

    • Builds the unsigned steps for any operation on the vault, in order, each through the vault or the Zap carrying its gas limit
    • Inputs:
      • action (string): mint_with_eth, mint_with_weth, mint_with_usdc, redeem_in_kind, exit_to_eth, exit_to_usdc or bid
      • wallet_address (string): the wallet that will sign and receive
      • amount (string): in ETH, WETH or USDC for mints, in shares for redemptions and the ETH exit, the USDC needed for the USDC exit; not used by bid
      • row (integer, optional): bid only, the basket row; default the largest gap
    • Returns the steps, what they should deliver with the minimums applied, and warnings such as an active cooldown or an amount above the balance
  • preview_steps

    • Simulates a list of transactions in sequence against the latest block with eth_simulateV1, each seeing the state the previous ones left. Returns, per step, success, gas used, whether the given limit is enough, the recommended limit and the decoded revert reason with a hint; and the net token and ETH movements for the wallet
    • Inputs:
      • from (string): the wallet that will send the steps
      • steps (array): the steps as the tools return them: target, calldata, optional value and gas
    • For steps into the vault or the Zap the recommended limit is the smallest one that passes, found by bisection: the vault reserves gas for its capped transfers, so the gas a call uses is below the limit it needs
    • gas_limit_enough is true when the step passes with the limit it carries, false only when that limit is what makes it fail, and null when it fails for another reason (a slippage bound, a cooldown), which error and hint name
  • get_transaction_status

    • What a sent transaction did: pending, success, reverted or not found; block, confirmations, fee, net token movements for the sender, and the decoded reason when it reverted
    • Inputs: hash (string)
  • get_nav_history

    • NAV per share over time, read at past blocks, beside the ETH/USD and BTC/USD feeds the vault uses, with the change of each over the window and the NAV's largest drawdown. History starts at the deployment of the vault in service
    • Inputs: interval (hour or day, default day), points (2 to 90, default 30)
    • Historical reads use public endpoints that serve them; set GBLIN_ARCHIVE_RPC_URL to use your own
  • verify_risk_attestation

    • 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
    • Inputs:
      • attestation (object): the object returned by GET https://gblin.digital/api/x402/attestation
      • expected_attestor (string, optional): the attestor address to pin
    • 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
  • seal_action_demo

    • 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
    • Inputs:
      • action (string): a short label
      • input_hash (string): SHA-256 of the input
      • output_hash (string, optional)
      • agent_id, tool, meta (string, optional): identifiers, published in clear
    • Unlimited seals are a paid x402 HTTP endpoint; see how_to_seal_paid
  • get_receipt

    • A sealed receipt by index: canonical payload, Ed25519 signature, RFC 6962 inclusion proof and the signed checkpoint
    • Inputs:
      • index (integer)
  • how_to_seal_paid

    • How to seal without limits: endpoint, body schema, payment flow and offline verification
    • Inputs: none

Tool annotations (MCP hints)

Every tool sets MCP tool annotations:

ToolreadOnlyHintidempotentHintdestructiveHintopenWorldHint
all except the three belowtruetruefalsetrue
prepare_gblin_paymenttruefalsefalsetrue
seal_action_demofalsefalsefalsetrue
relay_gblin_paymentfalsetruetruetrue

Calldata builders are read-only: they return bytes, they do not send them. prepare_gblin_payment is not idempotent because every call draws a fresh nonce. Sealing appends to a public log and is never destructive. relay_gblin_payment moves the payer's funds on chain, so it is marked destructive and clients should confirm before calling it. Every tool also carries a human-readable title.

Output schemas

Every tool except seal_action_demo declares an outputSchema. A successful result carries the same object as structuredContent and as JSON text. The required list of each schema is the contract: fields a successful call always returns. Other fields are described but optional, and the schemas accept additional fields, so adding one is not a breaking change. Errors carry isError: true and no structured content.

Prompts

PromptWhat it does
risk_gateReads the regime and applies a rule stated before looking: proceed, halve, or stand down
pay_in_gblinPrepare, sign in the payer's wallet, verify, then hand on a gasless GBLIN payment
pay_invoice_just_in_timeExit just enough GBLIN to USDC to settle an invoice, after checking cooldown and gas
seal_and_verifySeal an action, read the receipt back, and state what it does and does not prove

Resources

URIContent
gblin://contractsEvery contract in service with its role, and the deprecated deployments not to use
gblin://paymentsThe EIP-712 domain read live from the token, the x402 payload, and the accepts block a seller publishes
gblin://keysThe attestor address to pin, and where the log and witness keys are published
gblin://limitsPrice (free by default), the metering switch, and where the limits come from

Usage

Claude Desktop

Add to claude_desktop_config.json:

json
{  "mcpServers": {    "gblin": {      "command": "npx",      "args": ["-y", "@gblin-protocol/mcp-server"]    }  }}

Cursor, Windsurf and other MCP clients

json
{  "mcpServers": {    "gblin": {      "command": "npx",      "args": ["-y", "@gblin-protocol/mcp-server"],      "env": { "GBLIN_RPC_URL": "https://base-rpc.publicnode.com" }    }  }}

Programmatic (TypeScript)

ts
import { Client } from "@modelcontextprotocol/sdk/client/index.js";import { StdioClientTransport } from "@modelcontextprotocol/sdk/client/stdio.js";
const transport = new StdioClientTransport({ command: "npx", args: ["-y", "@gblin-protocol/mcp-server"] });const client = new Client({ name: "my-agent", version: "1.0.0" });await client.connect(transport);
const jit = await client.callTool({  name: "swap_gblin_to_usdc_jit",  arguments: { usdc_needed: "0.50", wallet_address: "0xYourAgent..." },});

AGENTS.md for coding assistants

bash
npx -p @gblin-protocol/mcp-server gblin-init

Creates an AGENTS.md from the template at 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.

Configuration

GBLIN_RPC_URL selects the Base RPC endpoint; the default is https://base-rpc.publicnode.com. For sustained load use a dedicated provider:

bash
export GBLIN_RPC_URL="https://base-mainnet.g.alchemy.com/v2/YOUR_KEY"npx @gblin-protocol/mcp-server

GBLIN_ATTESTOR_ADDRESS overrides the published attestor address used by verify_risk_attestation.

x402 endpoints

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.

EndpointPriceReturns
GET gblin.digital/api/x402/treasury-statefreeNAV, basket weights, Crash Shield status
GET gblin.digital/api/x402/quotefreeMint or redemption preview with the dynamic slippage buffer
GET gblin.digital/api/x402/governancefreeOwner, timelock, pending operations
GET gblin.digital/api/x402/healthfreeWallet balances, gas runway, allocation advice
GET gblin.digital/api/x402/investfreeUnsigned calldata: USDC → GBLIN
GET gblin.digital/api/x402/jitfreeUnsigned calldata: GBLIN → USDC just in time
GET gblin.digital/api/x402/attestation$0.003Signed EIP-712 Risk Attestation, valid ten minutes
POST gblin.digital/api/x402/seal$0.0045A sealed AI Action Receipt

Machine-readable manifest: https://gblin.digital/.well-known/x402. Payment recipient: 0x0ebA5d314F4f5Dcb7A094953Fa9311a45172dd1B.

Risk Attestation

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.

AI Action Receipts

A public, append-only RFC 6962 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:

receipt = canonical payload        + Ed25519 signature            (key: gblin.digital/receipts-log)        + RFC 6962 inclusion proof     (leaf → Merkle root)        + C2SP signed checkpoint       (origin, tree size, root)

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.

  • Seal (paid, unlimited): POST https://gblin.digital/api/x402/seal, $0.0045 USDC via x402
  • Seal (demo, 5 per day per IP): POST <worker>/v1/seal-demo, or the tool seal_action_demo
  • Read, free: <worker>/v1/receipt/:index, /log, /log/checkpoint, /log/proof/:index, /log/consistency, /log/leaves, and the page /receipt/:index
  • Daily anchor of the tree root on Base as an EAS attestation (schema 0x9f433a96…)
  • Offline verifier with no dependencies: verify-receipt.mjs — node verify-receipt.mjs receipt.json

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.

Coherence Proof

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. 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).

Architecture notes

  • 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.
  • 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.
  • 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.
  • 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.
  • 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.
  • 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.

Security notes

  • 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.
  • 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.
  • No telemetry, no analytics, no remote dependencies beyond the configured RPC.

Development

bash
git clone https://github.com/gblinproject/gblin-treasury-risk-regimecd gblin-treasury-risk-regimenpm installnpm run buildnpm test                 # handler smoke test against Base mainnet, read-onlynpm run test:protocol    # speaks MCP over stdio: capabilities, instructions, prompts, resourcesnpm run test:schemas     # every tool through the official MCP client, which validates outputSchemanpx tsx scripts/test-hosted.ts <url>   # the hosted server over Streamable HTTP, with the same validationnpm start                # run the compiled server

Two tests run against a local fork of Base and send transactions there, never on mainnet:

bash
anvil --fork-url <base rpc> --port 8555 &export GBLIN_RPC_URL=http://127.0.0.1:8555npm run test:payments    # gasless payment: signed, verified, carried by a third party; replay and front-run refusednpm run test:calldata    # sends the exit and investment steps exactly as the tools return themnpm run test:actions     # every prepare_action, simulated then sent; preview agrees with the chain; gas limits found by bisection
src/  config.ts    # addresses, slippage and cache settings  abi.ts       # vault, Lens, Zap, timelock, Chainlink and ERC-20 ABIs  client.ts    # viem public client and on-chain timestamp  helpers.ts   # NAV, basket state, slippage, cooldown, reverse quote  auction.ts   # auction state and bid sizing  tools.ts     # the treasury, auction and risk tools, and the tool list  payments.ts  # gasless payments (EIP-3009): prepare, verify, relay  actions.ts   # prepare_action, preview_steps, get_transaction_status, get_nav_history  shared.ts    # result envelopes, builder code, Zap routing data and gas limit  version.ts   # generated from package.json by scripts/write-version.mjs  receipts.ts  # the three receipt tools  output-schemas.ts  # the outputSchema of every tool  prompts.ts   # the four prompts  resources.ts # the four resources  index.ts     # MCP stdio server entry and initialize instructions  init.ts      # the gblin-init commandworker/        # the hosted Streamable HTTP server (Cloudflare Workers)scripts/       # test.ts, test-protocol.ts, test-output-schemas.ts, test-payments-fork.ts, test-calldata-fork.ts

Links

MIT © GBLIN Protocol

来源:README.md,提交 4846159

工具

24

risk.regime

Market risk regime (live, free)

Current BTC/ETH risk regime (calm | elevated | crash) and the matching risk posture, read live from GBLIN's on-chain Crash Shield on Base (60-second cache). Free and unsigned; a signed version that verifies offline is a separate paid x402 HTTP endpoint.

无需输入参数。

risk.attestation_sample

Attestation sample (free, expired)

Static, permanently expired sample of the signed Risk Attestation (sample: true), with the same fields and EIP-712 schema as the signed one, for building and testing parsers and verifiers.

无需输入参数。

protocol.stats

Agent-economy stats (free, cached)

Cumulative public counters of GBLIN's x402 endpoints: paid calls, unique payer wallets, USDC earned, with methodology disclosure. Cached 5 min.

无需输入参数。

protocol.info

Protocol info / llms.txt (free)

GBLIN llms.txt as plain text: contract addresses, endpoints, prices, payment flow, field contract of the attestation.

无需输入参数。

receipts.seal

Seal an AI action (demo receipt)

Appends the hashes of an AI action to GBLIN's public RFC 6962 transparency log and returns a portable receipt: Ed25519 signature, inclusion proof, operator-signed C2SP checkpoint, and the latest on-chain anchor (EAS on Base, daily). Demo mode only over MCP: 5 seals per day per IP, receipts marked demo: true; unlimited sealing is a separate paid x402 HTTP endpoint. Provenance is self-reported: a receipt proves that the record existed at that time, not that the action happened. The action, agent_id, tool and meta strings are published in the log exactly as given. Fields not listed in the schema are ignored and not recorded.

输入参数metamodetoolaction必填agent_idinput_hash必填output_hash

receipts.get

Get a receipt by index

Receipt #index from GBLIN's receipts log, re-signed (Ed25519 is deterministic) with a fresh inclusion proof, the current signed checkpoint and the latest on-chain anchor. Free.

输入参数index必填

receipts.verify

Verify a receipt (pure math)

Verifies a gblin-receipt/v1 JSON with pure math, without a log lookup and without trusting this server: leaf hash, Ed25519 signature, RFC 6962 inclusion proof, C2SP checkpoint signature and verifier-key hash. These are the same checks as the zero-dependency verify-receipt.mjs script that runs offline; the consistency check against the on-chain anchor is available separately at GET /v1/verify/:index.

输入参数receipt必填

coherence.report

Coherence report (promises vs conduct, free)

Kept/violated tallies for GBLIN's pre-registered, hash-pinned promises (attestation uptime, counter honesty), probed every 10 minutes; each closed UTC day is sealed on Base as an EAS attestation (schema 0x9f433a96…). Self-observation only in v0. Free.

无需输入参数。

treasury.state

Read the GBLIN protocol state

Reads the current GBLIN protocol state on Base mainnet: NAV in USD, basket composition with dynamic weights, Crash Shield status and whether the NAV is reliable.

无需输入参数。

treasury.quote

Quote a mint or a redemption

Preview a buy (ETH→GBLIN) or sell (GBLIN→ETH) without executing. Returns expected output, safe minOut with dynamic slippage buffer (2.5% normal / 4% during Crash Shield), and fee breakdown. Read-only.

输入参数amount_in必填direction必填

treasury.health

Analyse an agent treasury

Analyzes an agent wallet's treasury: GBLIN, USDC and ETH balances, whether the ETH covers an exit at the live gas price, and the redemption cooldown. When daily_burn_usd is given it adds days of USDC runway and a split that keeps seven days of spend in USDC and treats only the surplus as a candidate for GBLIN. Free by default; a 0.003 USDC charge applies only when the server operator sets MCP_PAYWALL=true.

输入参数_paymentdaily_burn_usdwallet_address必填

treasury.plan

Plan what to do with idle USDC

Turns idle USDC into a reviewable plan in one call: operating cash = max(reserve_usd, daily_burn_usd x days), the surplus above it, a simulation of minting that surplus into GBLIN at NAV (fees read live from the vault, estimated exit value today, round-trip cost), the same simulation for a trial amount (100 USDC by default), and the blockers (Crash Shield, redemption cooldown, ETH for the exit). Read-only: nothing is executed and nothing is advised. GBLIN is crypto exposure (cbBTC, WETH, USDC), not cash and not yield.

输入参数daystrial_usdcreserve_usddaily_burn_usdwallet_address必填

treasury.nav_history

Read the NAV history

NAV per GBLIN share over time, read from the chain at past blocks, beside the ETH/USD and BTC/USD oracle prices the vault itself uses, with the change of each over the window and the NAV's largest drawdown. The series starts at the deployment of the vault in service and can be compared with holding ETH or BTC over the same span.

输入参数pointsinterval

actions.prepare

Prepare an operation on the vault

Builds the unsigned transactions for an operation on the GBLIN vault, in the order they are sent. Actions: mint_with_eth (amount in ETH), mint_with_weth (amount in WETH), mint_with_usdc (amount in USDC, through the Zap), redeem_in_kind (amount in shares; pro rata basket tokens, no fee, no price feed), exit_to_eth (amount in shares, through the Zap, all or nothing), exit_to_usdc (amount = the USDC needed), bid (trade with the rebalancing auction; row optional, the largest gap by default). Every output bound is non-zero and every step through the vault or the Zap carries its gas limit. Nothing is signed or sent: the steps are returned to the caller.

输入参数rowaction必填amountwallet_address必填

actions.preview

Simulate steps before signing

Simulates a list of transactions in sequence against the latest Base block, as if the wallet sent them one after the other, before anything is signed. Each step sees the state the previous ones left (an approval before a mint works). Accepts steps with target or to, calldata or data, and optional value and gas. Returns, per step, whether it would succeed, the gas it uses, whether the gas limit it carries is enough, and the decoded revert reason when it fails; and the net token and ETH movements for the wallet. State can change before transactions land: a successful preview is evidence, not a guarantee.

输入参数from必填steps必填

actions.status

Read a transaction's outcome

Reports what a sent Base transaction did: pending, succeeded, reverted or not found; its block and confirmations; the fee paid; the net token movements for the sender (GBLIN shares minted or redeemed, USDC, basket tokens); and, when it reverted, the decoded reason.

输入参数hash必填

governance.state

Verify governance and the timelock

Reads GBLIN protocol governance: whether the GBLIN vault is owned by the 48-hour timelock, the timelock's minimum delay and grace period, role member counts, and any pending asset-addition proposal on the vault. With an operation_id it also reports the status of that timelock operation. Read-only.

输入参数operation_id

auction.state

Read the rebalancing auction

Read the GBLIN rebalancing auction on Base. The vault does not rebalance itself and pays nobody to do it: when a basket row drifts past its band it holds a Dutch auction, and whoever trades with it toward the target weights is the counterparty, at the oracle price adjusted by a premium that starts at a discount and rises to a cap over one ramp. Returns, per row, the side the vault takes, the gap in ETH, the token and amount the bidder hands over, and unsigned calldata (approval + bid). The premium is the whole reward; nothing is paid out of the vault.

无需输入参数。

payments.prepare

Prepare a gasless GBLIN payment

Builds a gasless GBLIN payment. The vault's share token implements EIP-3009, so the holder signs an authorization and anybody can carry it on chain: the payer needs no ETH. Returns the EIP-712 message to sign (its domain is read from the token, not assumed), the calldata that carries the signed authorization, and the x402 'exact' payload for paying an HTTP endpoint in GBLIN. Method 'receive' lets only the named recipient submit the authorization, so nobody can front-run the transfer; method 'transfer' suits an x402 facilitator, which submits on the seller's behalf. With relay: true it also returns a second authorization that pays a relayer's fee in GBLIN. No private key is requested, held or transmitted: the signature is produced by the caller's own wallet.

输入参数to必填from必填relaymethodamount_usdamount_gblinvalid_for_seconds

payments.verify

Verify a signed GBLIN authorization

Checks a signed GBLIN authorization against the chain before any gas is spent on it. Recovers the signer from the EIP-712 digest (and asks the wallet itself through ERC-1271 when the payer is a contract), then checks the validity window against on-chain time, whether the nonce has already been used or cancelled, and whether the payer still holds the amount. Returns a verdict and the ready calldata when it would settle, the failing reason when it would not. These are the checks an x402 facilitator runs, so a 'would_settle' verdict means the payment can be carried.

输入参数methodsignature必填authorization必填

payments.relay

Relay a gasless GBLIN payment

GBLIN's relay carries a signed GBLIN payment on chain for a payer that holds no ETH. Takes the payment and the relay fee, each as { authorization, signature }, both signed by the payer's wallet. The relay checks both against the chain, simulates them and submits them in one transaction through Multicall3: either both settle or neither does. The fee is paid in GBLIN at the live NAV. Returns the transaction hash and its outcome. This tool moves funds: it carries the authorizations exactly as signed.

输入参数fee必填payment必填

attestation.verify

Verify a risk attestation

Verifies a GBLIN Risk Attestation, the object returned by GBLIN's /api/x402/attestation, or a proof-of-diligence attached by a peer agent. Free. Runs four checks: (1) integrity, by recomputing the EIP-712 attestation_id; (2) authenticity, by recovering the signer when a signature is present and comparing it with GBLIN's published attestor; (3) freshness, against on-chain time (10-minute validity); (4) live drift, by comparing the attested regime with the current on-chain regime.

输入参数attestation必填expected_attestor

fetch

Fetch a GBLIN document

Returns the full text of one GBLIN document by its id: {id, title, text, url, metadata}. Documents are the protocol's public documentation, the tool cards and the live vault state. Read-only and free.

输入参数id必填

版本历史

10
  1. v0.6.5Nov 6, 2026
  2. v0.6.4Oct 6, 2026
  3. v0.6.3Oct 1, 2026
  4. v0.6.1Oct 1, 2026
  5. v0.5.2Sep 23, 2026
  6. v0.5.1Sep 23, 2026
  7. v0.4.3Sep 23, 2026
  8. v0.4.2Sep 22, 2026
  9. v0.4.0Sep 22, 2026
  10. v0.3.2Sep 16, 2026

评分

已满足适用检查项的 100%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通必需25 分
  • 已声明认证方式必需10 分
  • 已列出工具必需15 分
  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分