gblin-treasury-risk-regime

v0.6.6
io.github.gblinproject/gblin-treasury-risk-regime Checked 23 hours ago Published 24 days ago

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

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

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

quote_safe_swap

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.

ParameterTypeDescription
amount_in *stringPositive decimal. ETH for buy, GBLIN for sell.
direction *string

swap_gblin_to_usdc_jit

Returns ready-to-broadcast calldata that redeems exactly the USDC requested from a GBLIN position, just in time for an x402 invoice or any other USDC obligation. Three sequential transactions: (1) approve the shares to the GBLIN Zap, (2) GBLINZap.sellGBLINForEth, which redeems in kind and sells every leg for ETH, all or nothing, (3) a Uniswap WETH->USDC swap that spends only the guaranteed ETH minimum and still returns at least the requested USDC. EOAs sign three times; ERC-4337 and EIP-7702 wallets can batch them into one operation. Every step carries a non-zero minimum; ETH above the minimum…

ParameterTypeDescription
usdc_needed *stringUSDC amount, decimal string.
wallet_address *stringAgent's 0x address (for cooldown check).

invest_usdc_to_gblin

Returns calldata that converts a USDC amount into GBLIN, a basket of cbBTC, WETH and USDC minted at NAV and redeemable at any time. Two steps: (1) approve USDC to the GBLIN Zap, (2) GBLINZap.buyGBLINWithToken, which swaps the USDC to WETH on Uniswap V3 and mints at NAV with a non-zero minimum output. Free. The mint fee and the yearly management fee are governance parameters read live from the vault, not fixed in this text.

ParameterTypeDescription
usdc_amount *stringUSDC amount to invest (decimal string).
wallet_address *stringUser's wallet address that holds the USDC and signs the transactions.

analyze_treasury_health

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.

ParameterTypeDescription
wallet_address *stringAgent's 0x address.
_paymentstringBase64-encoded x402 PaymentProof JSON. Omit on first call to receive the 402 payment manifest.
daily_burn_usdnumberOptional. Average daily spend in USD (e.g. 1.5).

get_governance_state

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.

ParameterTypeDescription
operation_idstringOptional 0x-prefixed 32-byte hex id of a specific timelock operation to inspect.

share_skill_with_peer

Generates a portable skill seed that another AI agent can use to install the GBLIN MCP server. The seed includes a working transaction example, install instructions, and a referral code derived from the caller's wallet. The code is a label inside the seed only: it is not written into any transaction and no fee is paid for it.

ParameterTypeDescription
caller_wallet *stringEVM address of the caller agent's wallet (the agent currently using GBLIN MCP). Will be hashed into the referral code.
example_amount_usdcnumberOptional USDC amount to use in the example transaction within the seed. Default: 5. Range: 1-100.
peer_contextstringOptional brief description of the peer agent's use case (e.g. 'yield farming bot', 'x402 payment agent', 'NFT marketplace'). Used to customize the example transaction in the seed.

get_auction_state

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.

get_market_risk_regime

Returns the current BTC/ETH risk regime (calm | elevated | crash), a severity score and the matching risk posture (risk_on | reduce | risk_off), derived from GBLIN's on-chain Crash Shield against Chainlink oracle peaks on Base. Independent of holding GBLIN. Free by default; a 0.002 USDC charge applies only when the server operator sets MCP_PAYWALL=true.

ParameterTypeDescription
_paymentstringBase64-encoded x402 PaymentProof JSON. Omit on first call to receive the 402 payment manifest.

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

ParameterTypeDescription
attestation *objectThe full attestation object from /api/x402/attestation (must include `eip712`; `attestation_id`, `signature`, `attestor` are used when present). A JSON string of that object is also accepted.
expected_attestorstringOptional 0x address to check the signature against. Defaults to the GBLIN attestor address baked into this MCP build (GBLIN_ATTESTOR_ADDRESS env).

plan_treasury

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.

ParameterTypeDescription
wallet_address *stringAgent's 0x address.
daily_burn_usdnumberAverage daily spend in USD. Operating cash = daily_burn_usd × days.
daysnumberDays of spend to keep liquid (default 7, max 365).
reserve_usdnumberUSD to keep liquid regardless of the burn rate; the larger of the two rules wins.
trial_usdcnumberTrial amount to simulate beside the surplus (default 100).

seal_action_demo

Seals the hashes of an AI action into GBLIN's public append-only RFC 6962 transparency log (free demo, 5 per day per IP, receipt marked demo: true). Returns a portable receipt: Ed25519 signature, Merkle inclusion proof and operator-signed C2SP checkpoint, verifiable offline with the zero-dependency verify-receipt.mjs. Input and output go in as sha256 hashes only; the action label and metadata are published in the public log. Unlimited sealing is a separate paid x402 HTTP endpoint (0.0045 USDC per seal).

ParameterTypeDescription
action *stringShort public label of the action, e.g. 'trade.executed' or 'report.generated'. Published in the log — never put secrets here.
input_hash *stringsha256 of the action input, as 64 lowercase hex chars. Hash locally; never send content.
agent_idstringOptional public identifier of the agent (published in the log).
metastringOptional public metadata (published).
output_hashstringOptional sha256 of the action output (64 lowercase hex chars).
toolstringOptional name of the tool/model that produced the action (published).

get_receipt

Fetch a sealed AI Action Receipt by index from GBLIN's public transparency log (free forever). Returns the full portable receipt — canonical payload, Ed25519 signature, RFC 6962 Merkle inclusion proof against the current tree, operator-signed C2SP checkpoint — which any third party can verify offline with verify-receipt.mjs (zero dependencies).

ParameterTypeDescription
index *integerZero-based index of the receipt in the log (see the log overview at https://gblin-mcp.gblin-mcp-worker.workers.dev/log for the current size).

how_to_seal_paid

Returns the reference for unlimited paid seals (0.0045 USDC per seal via x402 on Base) in GBLIN's AI Action Receipts transparency log: endpoint, body schema, payment flow, and offline verification of receipts. The free demo allows 5 seals per day per IP.

prepare_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 ret…

ParameterTypeDescription
from *stringThe payer's address: the wallet that will sign.
to *stringThe recipient's address.
amount_gblinstringAmount in GBLIN shares, e.g. '0.25'. Give this or amount_usd.
amount_usdstringAmount in USD, converted at the live NAV. Give this or amount_gblin.
methodstring'receive' (default) can be submitted only by the recipient; 'transfer' by anyone.
relaybooleantrue when nobody else will carry the payment on chain: also prepares a second authorization that pays GBLIN's relay fee in GBLIN at the live NAV. Forces method 'transfer'.
valid_for_secondsnumberHow long the authorization stays valid. Default 600, maximum 86400.

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

ParameterTypeDescription
authorization *objectThe authorization object: from, to, value, validAfter, validBefore, nonce.
signature *stringThe signature produced by the payer's wallet, 0x-prefixed.
methodstringWhich method the signature was produced for. Default 'receive'.

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

ParameterTypeDescription
fee *object{ authorization, signature } of the relay fee, as prepared with relay: true and signed by the payer.
payment *object{ authorization, signature } of the payment, method 'transfer'.

prepare_action

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 i…

ParameterTypeDescription
action *stringThe operation to prepare.
wallet_address *stringThe wallet that will sign and receive.
amountstringDecimal amount. Unit depends on the action (see the description). Not used by bid.
rowintegerbid only: the basket row to bid on. Default: the row with the largest gap.

preview_steps

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 g…

ParameterTypeDescription
from *stringThe wallet that will send the steps.
steps *arrayThe steps, in order: target and calldata (or their send_calls spellings, to and data), value in wei (optional), gas (optional).

get_transaction_status

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.

ParameterTypeDescription
hash *stringThe transaction hash.

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

ParameterTypeDescription
intervalstringSpacing of the points. Default day.
pointsintegerHow many points, newest last. Default 30.