Front-end and dApp for GBLIN, an on-chain index on Base mainnet (45% cbBTC + 45% WETH + 10% USDC) with an algorithmic Crash Shield and AI-agent-native treasury tooling.
The GBLIN vault is governed by a 48-hour Timelock Controller — every admin action (parameter change, oracle update, ownership transfer) is enforced on-chain to wait 172,800 seconds before it can be executed. The vault in service and its sequencer sentinel have been owned by the timelock since 22 September 2026 (owner() returns the timelock, pendingOwner() returns zero). Verifiable end-to-end on BaseScan.
| Component | Address |
|---|---|
| GBLIN vault | 0xc2181d975c05c8c724b334bcED0764c0b86B1D53 |
| Timelock Controller | 0x6aBeC8716fFeEcf7C3D6e68255b4797113E8e5Dd |
| Ownership accepted (vault) | 0x366dc55dfe1fc3a1eb662a245ed7f5e6b54c68a0621124eafe5cf14188a2503c |
Properties enforced at the contract level (see contracts/GblinTimelockController.sol):
MIN_DELAYis immutable — theupdateDelayoverride permanently reverts, eliminating the rug-then-attack vector.PROPOSER_ROLEandCANCELLER_ROLEare strictly separated — the constructor reverts if any address holds both.EXECUTOR_ROLEis open (address(0)) — anyone can execute a matured operation, anti-censorship.DEFAULT_ADMIN_ROLEis held by the timelock itself — every role/config change must itself go through the 48h delay.GRACE_PERIODof 14 days — pending operations expire if not executed in time (no zombie proposals).
AI-agent integrators can verify all of this on-chain in one call: the free GET /api/x402/governance endpoint, or the MCP tool governance.state (hosted) / get_governance_state (stdio). See the GBLIN MCP repo.
Reading GBLIN's state and preparing its transactions is free. Three endpoints under /api/x402/* are paid per call in USDC on Base mainnet, over the x402 protocol v2, settled through the Coinbase CDP facilitator: no API key, no signup, no account.
Paid (HTTP 402 challenge, then the response in the same round-trip):
| Endpoint | Price (USDC) | Call it |
|---|---|---|
GET /api/x402/attestation |
$0.003 | before trading, rebalancing or moving capital: a 10-minute, EIP-712-signed market-risk attestation (calm / elevated / crash) |
POST /api/x402/seal |
$0.0045 | after an action you may have to prove: seals its hashes into the transparency log (see below) |
GET /api/x402/catalog |
$0.005 | before paying an x402 service you have not used recently: liveness of ~200 Bazaar listings |
GET /api/x402/stock-dividends?address= |
$0.01 | when reporting income on Coinbase tokenized stocks: reinvested distributions credited to an address, in underlying shares, with block, tx and corporate-action record |
Two more paid endpoints live on the Sentinel (https://gblin-sentinel.vercel.app): /api/data/base-risk-pulse ($0.002) and /api/data/risk-pulse-pro ($0.005).
Free (plain GET, JSON, cached at the CDN for 20-60 seconds):
| Endpoint | Returns |
|---|---|
GET /api/x402/treasury-state |
Live NAV, basket weights, Crash Shield status |
GET /api/x402/quote |
Buy/sell preview with minOut and dynamic slippage |
GET /api/x402/governance |
Owner, timelock parameters, trust summary |
GET /api/x402/health |
Wallet GBLIN/USDC/ETH balances, gas for an exit, redemption cooldown, USDC runway |
GET /api/x402/invest |
USDC→GBLIN calldata: approve + GBLINZap.buyGBLINWithToken |
GET /api/x402/jit |
GBLIN→USDC calldata: approve + GBLINZap.sellGBLINForEth + Uniswap WETH→USDC |
The paths keep the /api/x402/ prefix so existing integrations do not break. The steps that go through the Zap carry an explicit gas limit: send them with it.
Properties of the paid endpoints:
- Gasless on the buyer side — agents sign an EIP-3009
transferWithAuthorization; the facilitator pays the on-chain gas in ETH, the agent only spends USDC. - Listed in the Coinbase Bazaar — discoverable from any x402-aware client without manual configuration.
- Strict input validation + JSON Schemas — every challenge declares
extensions.bazaarwith input and output examples, so agents can synthesize correct calls from metadata alone. - Challenge served at the edge — an anonymous request is answered by an edge worker with the same bytes the origin would send (pinned by the fixtures in
test/x402-golden/); a request carrying a payment header always reaches the origin. - Public discovery manifest at
/api/x402/llms.txt— kept free for crawlers and LLMs.
The middleware is a single file: src/middleware.ts; its matcher covers only the three paid paths. Each route handler lives in src/app/api/x402/<name>/route.ts and contains zero payment logic — the paywall is enforced upstream by paymentProxy from @x402/next.
Seal the hashes of any AI action (never the content) into GBLIN's public append-only transparency log and get back a portable, offline-verifiable receipt.
- Seal (paid, unlimited):
POST /api/x402/seal— $0.0045 USDC via x402 on Base. Body:{action, input_hash, output_hash?, agent_id?, tool?, meta?}(hashes = sha256 hex). - Demo (free, 5/day/IP):
POST https://gblin-mcp.gblin-mcp-worker.workers.dev/v1/seal-demo(receipts are markeddemo:true), the hosted MCP toolreceipts.sealwithmode: "demo", orseal_action_demoin the stdio server. - Read (free forever):
/v1/receipt/:index,/log/checkpoint,/log/proof/:index, human page/receipt/:indexon the worker; log overview at gblin-mcp.gblin-mcp-worker.workers.dev/log. - Receipt = canonical payload + Ed25519 signature + RFC 6962 inclusion proof +
C2SP signed checkpoint. The tree root is anchored daily on Base via EAS
(schema
0x9f433a96…, promiseIdkeccak256("gblin-receipts-log")). - Verify offline, zero dependencies:
verify-receipt.mjsin gblinproject/gblin-treasury-risk-regime.
A seal proves existence and time in a signed append-only log anchored daily
on Base. Input/output go in as hashes only; the action label, agent_id,
tool and meta strings you send are published in the public log — put
identifiers there, never secrets. It is not a compliance certificate and
not an endorsement of the content. The checkpoint is signed by the log
operator and cosigned by an independent witness (Markovian Protocol) under the
C2SP tlog-cosignature format: a cosignature attests that the log stayed
append-only between the sizes the witness saw, not that any receipt is true.
@gblin-protocol/agent-treasury is a self-custody library and CLI for an agent's wallet: 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 refill runs on the onBeforePaymentCreation hook of Coinbase's x402Client, before the payment is signed; a price above the per-payment cap is refused before anything is signed.
npx @gblin-protocol/agent-treasury status --json # balances, reserve, surplus, regime
npx @gblin-protocol/agent-treasury park # surplus above the reserve into GBLIN
npx @gblin-protocol/agent-treasury ensure-usdc 5 # exit GBLIN until the wallet holds 5 USDC
npx @gblin-protocol/agent-treasury pay <url> # pay an x402 URL, refilling USDC if neededThe key is read from GBLIN_AGENT_PRIVATE_KEY and never leaves the process. Parking waits while the market regime is a crash or cannot be read; the refill never does. Balances reported after a move are read at the block of the last receipt. Agent skill: npx skills add gblinproject/gblin-treasury-risk-regime (gblin-agent-treasury). Source: packages/agent-treasury.
GBLIN is crypto exposure, not cash and not yield: park only the surplus you can hold through a drawdown.
For agents running on ElizaOS, the plugin-gblin (repo) calls these endpoints natively. It exposes 3 Actions (CHECK_GBLIN_TREASURY_HEALTH, INVEST_IDLE_USDC_GBLIN, RESCUE_USDC_FROM_GBLIN) and 1 Provider (GBLIN_TREASURY_CONTEXT) — install via npm install plugin-gblin.
Prerequisites: Node.js 20+
- Install dependencies:
npm install - Copy the example env file:
cp .env.example .env.local - Fill in
ALCHEMY_API_KEY(chain reads and activity history),X402_PAY_TO_WALLET, and optionallyCDP_API_KEY_*,BLOCKSCOUT_API_KEYandRELAYER_PRIVATE_KEY(the GBLIN payment relay) in.env.local - Run the dev server:
npm run dev - Open http://localhost:3000
To build for production: npm run build
GBLIN exposes its x402 payment manifest at:
https://gblin.digital/.well-known/x402
This endpoint follows the x402 protocol discovery standard and returns a JSON manifest with:
- Chain ID and currency address (USDC on Base)
- Facilitator URL
- The paid x402 endpoints with their prices, and the free endpoints under
free_endpoints - Contract address and verification links
AI agents (Base MCP, ElizaOS, custom agents) can read this file to:
- Auto-discover GBLIN's paid and free endpoints
- Verify the protocol before initiating payment flows
- Get the canonical contract address for the GBLIN token
The file is served as application/json via Next.js header config (see next.config.js).
GBLIN is integrated into the official Base MCP skill at:
- Plugin file:
skills/base-mcp/plugins/gblin.md - PR: base/skills#56
The plugin teaches Base MCP agents how to invest USDC into GBLIN (approve + Zap, two calls), redeem just in time for an x402 payment (three calls) and check treasury health, all from the free endpoints.