{"id":50168036,"url":"https://github.com/gblinproject/gblin_plugin","last_synced_at":"2026-05-24T22:01:06.108Z","repository":{"id":360061523,"uuid":"1248316152","full_name":"gblinproject/GBLIN_PLUGIN","owner":"gblinproject","description":"ElizaOS plugin for GBLIN Protocol — park idle USDC in MEV-protected Base index, JIT-swap to USDC for x402 invoices.","archived":false,"fork":false,"pushed_at":"2026-05-24T20:13:56.000Z","size":406,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-24T21:23:15.532Z","etag":null,"topics":["ai-agent","base-mainnet","defi","elizaos","elizaos-plugin","elizaos-plugins","gblin","treasury","usdc","x402"],"latest_commit_sha":null,"homepage":"https://gblin.digital","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gblinproject.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-05-24T13:37:25.000Z","updated_at":"2026-05-24T20:11:03.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/gblinproject/GBLIN_PLUGIN","commit_stats":null,"previous_names":["gblinproject/gblin_plugin"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/gblinproject/GBLIN_PLUGIN","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gblinproject%2FGBLIN_PLUGIN","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gblinproject%2FGBLIN_PLUGIN/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gblinproject%2FGBLIN_PLUGIN/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gblinproject%2FGBLIN_PLUGIN/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gblinproject","download_url":"https://codeload.github.com/gblinproject/GBLIN_PLUGIN/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gblinproject%2FGBLIN_PLUGIN/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33452033,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-24T19:21:36.376Z","status":"ssl_error","status_checked_at":"2026-05-24T19:21:10.562Z","response_time":57,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai-agent","base-mainnet","defi","elizaos","elizaos-plugin","elizaos-plugins","gblin","treasury","usdc","x402"],"created_at":"2026-05-24T22:00:45.536Z","updated_at":"2026-05-24T22:01:06.085Z","avatar_url":"https://github.com/gblinproject.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# plugin-gblin\n\n**ElizaOS plugin** — gasless treasury management for AI agents on Base mainnet.\n\nPark idle USDC into the [GBLIN](https://gblin.digital) MEV-protected index (cbBTC / WETH / USDC),\nJIT-swap back to USDC to pay x402 invoices, and monitor treasury health —\nall from inside your ElizaOS agent.\n\n[![npm](https://img.shields.io/npm/v/plugin-gblin)](https://www.npmjs.com/package/plugin-gblin)\n[![ElizaOS](https://img.shields.io/badge/elizaos-v1-blue)](https://elizaos.ai)\n[![Base](https://img.shields.io/badge/chain-Base%20mainnet-0052ff)](https://base.org)\n\n---\n\n## What it does\n\n| Action | Trigger phrases | Cost |\n|---|---|---|\n| `CHECK_GBLIN_TREASURY_HEALTH` | \"check my treasury\", \"wallet status\" | $0.002 USDC |\n| `INVEST_IDLE_USDC_GBLIN` | \"park USDC in GBLIN\", \"buy GBLIN\", \"invest 10 USDC\" | $0.002 USDC |\n| `RESCUE_USDC_FROM_GBLIN` | \"need USDC\", \"sell GBLIN\", \"JIT swap\", \"pay invoice\" | $0.005 USDC |\n\nThe **Provider** (`GBLIN_TREASURY_CONTEXT`) injects live NAV, basket weights, and\nCrash Shield status into every agent loop ($0.001 USDC per call).\n\nAll payments are gasless for the agent: the Coinbase CDP facilitator pays on-chain\ngas; the agent only signs an EIP-3009 `transferWithAuthorization`.\n\n---\n\n## Install\n\n```bash\n# with npm\nnpm install plugin-gblin\n\n# with bun (elizaos default)\nbun add plugin-gblin\n```\n\nOr via the ElizaOS CLI:\n\n```bash\nelizaos plugins add gblin\n```\n\n---\n\n## Configuration\n\nAdd to your agent's `.env`:\n\n```env\n# Required\nEVM_PRIVATE_KEY=0x_your_agent_hot_wallet_private_key\n\n# Optional — override defaults\nGBLIN_BASE_URL=https://gblin.digital\nGBLIN_RPC_URL=https://base-rpc.publicnode.com\n```\n\n\u003e **Security**: use a **dedicated hot wallet** for the agent with only the\n\u003e USDC/GBLIN it needs. Never use a founder or treasury wallet here.\n\u003e The maximum a malicious endpoint could drain in one run is $0.005 USDC.\n\n---\n\n## Add to your character\n\n```typescript\n// character.ts\nimport { type Character } from \"@elizaos/core\";\n\nexport const character: Character = {\n  name: \"TreasuryAgent\",\n  plugins: [\n    \"@elizaos/plugin-sql\",\n    \"@elizaos/plugin-bootstrap\",\n    // Add GBLIN only if private key is set\n    ...(process.env.EVM_PRIVATE_KEY?.trim() ? [\"plugin-gblin\"] : []),\n  ],\n  // ...\n};\n```\n\nOr in `character.json`:\n\n```json\n{\n  \"name\": \"TreasuryAgent\",\n  \"plugins\": [\"plugin-gblin\"],\n  \"settings\": {\n    \"secrets\": {\n      \"EVM_PRIVATE_KEY\": \"0x...\"\n    }\n  }\n}\n```\n\n---\n\n## How it works\n\n```\nAgent LLM decides \"I have idle USDC\"\n  ↓\ntriggers INVEST_IDLE_USDC_GBLIN action\n  ↓\nplugin sends GET /api/x402/invest?usdc=10 (preflight → 402)\n  ↓\nplugin signs EIP-3009 transferWithAuthorization ($0.002 USDC)\n  ↓\nplugin retries with PAYMENT-SIGNATURE header\n  ↓\nGBLIN API returns {steps: [{target, calldata}, {target, calldata}]}\n  ↓\nplugin broadcasts step 1 (USDC approve) → waits confirmation\n  ↓\nplugin broadcasts step 2 (buyGBLINWithToken) → waits confirmation\n  ↓\ncallback: \"✅ Invested $10 USDC → GBLIN. tx: 0xab12...\"\n```\n\n---\n\n## Endpoints consumed\n\nAll calls go to `https://gblin.digital/api/x402/*`. Each is a paid x402 v2\nendpoint on Base mainnet (chain id 8453, USDC `0x8335...`).\n\n| Path | Price | Returns |\n|---|---|---|\n| `GET /api/x402/treasury-state` | $0.001 | NAV, basket, Crash Shield |\n| `GET /api/x402/health?wallet=` | $0.002 | balances, gas runway, recommendation |\n| `GET /api/x402/invest?usdc=` | $0.002 | sequential tx calldata |\n| `GET /api/x402/jit?usdc=\u0026wallet=` | $0.005 | atomic swap calldata |\n\nDiscovery manifest: [gblin.digital/api/x402/llms.txt](https://gblin.digital/api/x402/llms.txt)\n\n---\n\n## Protocol\n\n- **Contract**: [`0x38DcDB3A381677239BBc652aed9811F2f8496345`](https://basescan.org/address/0x38DcDB3A381677239BBc652aed9811F2f8496345) (Base mainnet)\n- **Owner**: [48h Timelock](https://basescan.org/address/0x6aBeC8716fFeEcf7C3D6e68255b4797113E8e5Dd) — every parameter change takes 48 hours on-chain\n- **Basket**: 45% cbBTC + 45% WETH + 10% USDC (rebalances with on-chain Crash Shield)\n- **MCP Server**: [`@gblin-protocol/mcp-server`](https://www.npmjs.com/package/@gblin-protocol/mcp-server) — free alternative for Claude Desktop / Cursor\n\n---\n\n## License\n\nMIT © GBLIN Protocol\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgblinproject%2Fgblin_plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgblinproject%2Fgblin_plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgblinproject%2Fgblin_plugin/lists"}