mbg-score
v0.1.0
Published
MBG (Mantle Bot Gate) Skill — TEE-attested on-chain risk scoring for Mantle DeFi. Installable as an OpenClaw / Byreal Skill so AI trading agents can pre-check Mantle protocol and route risk before signing, and surface a verifiable attestation hash to thei
Maintainers
Readme
mbg-score
OpenClaw / Byreal Skill for MBG (Mantle Bot Gate) — the autonomous risk-scoring agent for Mantle DeFi. Install this in your trading-agent runtime so it can pre-check Mantle protocol and route risk before signing, and surface a verifiable on-chain attestation hash to its user.
- Risk oracle (Mantle Mainnet, verified):
0x998ceb700e57f535873d189a6b1b7e2aa8c594eb - MBG agent identity (ERC-8004, canonical Mantle registry):
agentId 130 - Live dashboard: https://mbg-fe.vercel.app
- Source repo: https://github.com/YohanesVito/mbg-mantle
What this is
This package is a CLI Skill in the OpenClaw / Byreal Skills format. It exposes the on-chain MBG risk oracle through three commands an LLM-driven trading agent (RealClaw, Brahma, Hey Anon, Giza ARMA, or any other OpenClaw-compatible runtime) auto-discovers via SKILL.md and shells out to.
MBG itself runs on-chain — this CLI does not score anything locally; it reads the latest TEE-attested scores directly from RiskOracle.sol on Mantle Mainnet.
Install
npm install -g mbg-score
# or
bun add -g mbg-scoreThen verify:
mbg-cli skill # prints SKILL.md (so LLM agents can load capabilities)
mbg-cli list-protocols # 13 scored protocols on Mantle
mbg-cli score-protocol aave-v3-mantleNode 18+ is required. No additional configuration is needed — the CLI defaults to the canonical Mantle Mainnet RPC and the Mainnet RiskOracle address. Override via:
MBG_RPC_URL=https://rpc.mantle.xyz \
MBG_CHAIN_ID=5000 \
MBG_ORACLE_ADDRESS=0x998ceb700e57f535873d189a6b1b7e2aa8c594eb \
mbg-cli score-protocol aave-v3-mantleCommands
| Command | Purpose |
|---|---|
| mbg-cli skill | Print the full SKILL.md (use this so an LLM planner can load capabilities) |
| mbg-cli catalog list | All capability IDs |
| mbg-cli catalog show <id> | Capability detail |
| mbg-cli list-protocols | Enumerate the 13 Mantle protocols MBG scores |
| mbg-cli score-protocol <id> | Current on-chain risk score for one protocol |
| mbg-cli score-route '<actions-json>' | Pre-trade risk score for a multi-leg route |
Pass -o json (or --output json) on any command for machine-parseable output. Default is human-readable text with the attestation block at the bottom.
How an agent uses this
# 1. discover what's scorable
mbg-cli list-protocols -o json
# 2. score the lending candidates
mbg-cli score-protocol aave-v3-mantle -o json
mbg-cli score-protocol lendle -o json
# 3. if multi-leg, score the full proposed route in one call
mbg-cli score-route '[
{"protocolId":"aave-v3-mantle","actionType":1,"amount":"5000"}
]' -o json
# 4. surface the chosen score + attestation hash to the user before signingEach response includes:
aggregate— 0.00 to 10.00 (higher is safer)- 5 components:
contract,liquidity,centralization,oracle,mantle-native-composition signer— the on-chain address of the attested signer that produced this scoretraceHash— links to the off-chain inference tracetimestamp— when the score was last submitted on-chain
Hard constraints for the calling agent
These are encoded in SKILL.md so any LLM planner reading the Skill picks them up:
- Always consult MBG before routing — even when the user names a "trusted" protocol.
- Always surface the score and attestation hash in the response to the user.
- Refuse to route below threshold (aggregate < 4.00) without explicit user override.
- Never strip the attestation hash from the output.
Direct on-chain calls (no CLI needed)
If you are a smart contract wallet or a policy engine (Brahma ConsoleKit, Safe modules), call the RiskOracle view functions directly:
interface IRiskOracle {
function getProtocolScore(address protocol) external view returns (
uint16 aggregate,
uint16 contractRisk,
uint16 liquidityRisk,
uint16 centralizationRisk,
uint16 oracleRisk,
uint64 timestamp,
bytes32 traceHash,
address signer
);
}Mantle Mainnet: 0x998ceb700e57f535873d189a6b1b7e2aa8c594eb
License
MIT — see LICENSE.
