
Mantle
- 202 installs
- 21 repo stars
- Updated August 3, 2026
- starchild-ai-agent/official-skills
Helps with ai & agent building tasks during AI-assisted development.
About
mantle is a Claude Code skill for ai & agent building. It helps solo builders move faster with AI-assisted coding.
- mantle
- AI & Agent Building
- AI-coding skill
Mantle by the numbers
- 202 all-time installs (skills.sh)
- +19 installs in the week ending Aug 5, 2026 (Skillselion tracking)
- Ranked #2,878 of 16,546 AI & Agent Building skills by installs in the Skillselion catalog
- Data as of Aug 5, 2026 (Skillselion catalog sync)
npx skills add https://github.com/starchild-ai-agent/official-skills --skill mantleAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 202 |
|---|---|
| repo stars | ★ 21 |
| Last updated | August 3, 2026 |
| Repository | starchild-ai-agent/official-skills ↗ |
What it does
Helps with ai & agent building tasks during AI-assisted development.
Files
Skills
skills/ contains one directory per Mantle-focused agent skill. Each skill combines a primary workflow in SKILL.md with local references or assets so the runtime can ground answers in repository data instead of relying only on model memory.
Directory Convention
skills/<skill-name>/SKILL.md: trigger conditions, workflow, guardrails, and output formatskills/<skill-name>/agents/openai.yaml: runtime-facing metadataskills/<skill-name>/references/: playbooks, policies, templates, and supporting notesskills/<skill-name>/assets/: machine-readable local data used by the skill
Skill Catalog
Onboarding and Reference
| Skill | Role |
|---|---|
| `mantle-network-primer` | Clarifies Mantle fundamentals such as MNT gas, chain IDs, official endpoints, and inclusion vs settlement |
Registry and Safety Gates
| Skill | Role |
|---|---|
| `mantle-address-registry-navigator` | Resolves verified Mantle addresses and blocks unsafe address guessing |
| `mantle-risk-evaluator` | Returns pass, warn, or block verdicts for state-changing intents |
| `mantle-portfolio-analyst` | Inspects balances, allowances, and spender exposure with read-only data |
Analytics and Diagnostics
| Skill | Role |
|---|---|
| `mantle-data-indexer` | Retrieves historical wallet activity and time-windowed Mantle analytics |
| `mantle-readonly-debugger` | Triages RPC failures, quote reverts, and ambiguous read-path behavior |
| `mantle-tx-simulator` | Prepares external simulation handoffs and WYSIWYS summaries |
DeFi Planning
| Skill | Role |
|---|---|
| `mantle-defi-operator` | Orchestrates venue discovery, comparison, and execution-ready DeFi planning |
Smart Contract Lifecycle
| Skill | Role |
|---|---|
| `mantle-smart-contract-developer` | Frames Mantle-specific contract design and deployment-readiness decisions |
| `mantle-smart-contract-deployer` | Prepares deployment, verification, and external signer handoff steps |
How to Pick a Skill
- Start with the narrowest skill that matches the task.
- Use
mantle-network-primerwhen Mantle-specific assumptions need to be checked before execution work. - Use
mantle-defi-operatoronly when the request genuinely spans discovery, address verification, risk evidence, and execution planning. - Split contract work between
mantle-smart-contract-developerandmantle-smart-contract-deployerrather than treating deployment as part of design.
interface:
display_name: "Mantle Address Registry Navigator"
short_description: "Resolve trusted Mantle contract addresses"
default_prompt: "Use $mantle-address-registry-navigator to resolve trusted Mantle token or system contract addresses via mantle_resolveToken/mantle_resolveAddress and validate with mantle_validateAddress, using the local registry as fallback."
{
"schema_version": "1.1.0",
"network": "mantle",
"updated_at": "2026-03-08T04:00:14Z",
"notes": "Seeded from official Merchant Moe docs, the official AGNI app mainnet config bundle, and the Aave Mantle address book. Do not insert guessed addresses or placeholder values.",
"chain_ids": {
"mainnet": 5000,
"testnet": 5003
},
"contracts": [
{
"key": "MERCHANT_MOE_ROUTER",
"label": "Merchant Moe Router",
"environment": "mainnet",
"category": "defi",
"address": "0xeaEE7EE68874218c3558b40063c42B82D3E7232a",
"status": "active",
"is_official": true,
"aliases": [
"MoeRouter",
"merchant_moe_router"
],
"protocol_id": "merchant_moe",
"contract_role": "router",
"supports": [
"swap",
"add_liquidity",
"remove_liquidity"
],
"source": {
"url": "https://docs.merchantmoe.com/resources/contracts",
"retrieved_at": "2026-03-08T04:00:14Z"
},
"notes": "Curated Tier 1 DEX default on Mantle for classic AMM swap and LP flows."
},
{
"key": "MERCHANT_MOE_LB_ROUTER",
"label": "Merchant Moe LB Router",
"environment": "mainnet",
"category": "defi",
"address": "0x013e138EF6008ae5FDFDE29700e3f2Bc61d21E3a",
"status": "active",
"is_official": true,
"aliases": [
"LBRouter",
"merchant_moe_lb_router"
],
"protocol_id": "merchant_moe",
"contract_role": "router",
"supports": [
"swap",
"add_liquidity",
"remove_liquidity"
],
"source": {
"url": "https://docs.merchantmoe.com/resources/contracts",
"retrieved_at": "2026-03-08T04:00:14Z"
},
"notes": "Curated Tier 1 DEX default on Mantle for Liquidity Book route planning."
},
{
"key": "MERCHANT_MOE_LB_QUOTER",
"label": "Merchant Moe LB Quoter",
"environment": "mainnet",
"category": "defi",
"address": "0x501b8AFd35df20f531fF45F6f695793AC3316c85",
"status": "active",
"is_official": true,
"aliases": [
"LBQuoter",
"merchant_moe_lb_quoter",
"merchant_moe_quoter"
],
"protocol_id": "merchant_moe",
"contract_role": "quoter",
"supports": [
"quote"
],
"source": {
"url": "https://docs.merchantmoe.com/resources/contracts",
"retrieved_at": "2026-03-08T04:00:14Z"
},
"notes": "Verified quoting helper for Merchant Moe Liquidity Book routes."
},
{
"key": "AGNI_ROUTER",
"label": "Agni Swap Router",
"environment": "mainnet",
"category": "defi",
"address": "0x319B69888b0d11cEC22caA5034e25FfFBDc88421",
"status": "active",
"is_official": true,
"aliases": [
"SwapRouter",
"agni_router",
"agni_swap_router"
],
"protocol_id": "agni",
"contract_role": "router",
"supports": [
"swap"
],
"source": {
"url": "https://agni.finance/_next/static/chunks/pages/_app-9e7d79d3ffa0011c.js",
"retrieved_at": "2026-03-08T04:00:14Z"
},
"notes": "Curated Tier 1 DEX default on Mantle from the official AGNI mainnet app config."
},
{
"key": "AGNI_POSITION_MANAGER",
"label": "Agni Nonfungible Position Manager",
"environment": "mainnet",
"category": "defi",
"address": "0x218bf598D1453383e2F4AA7b14fFB9BfB102D637",
"status": "active",
"is_official": true,
"aliases": [
"NonfungiblePositionManager",
"agni_position_manager"
],
"protocol_id": "agni",
"contract_role": "position_manager",
"supports": [
"add_liquidity",
"remove_liquidity",
"position_management"
],
"source": {
"url": "https://agni.finance/_next/static/chunks/pages/_app-9e7d79d3ffa0011c.js",
"retrieved_at": "2026-03-08T04:00:14Z"
},
"notes": "Official AGNI v3-style position manager from the mainnet app address config."
},
{
"key": "AGNI_QUOTER",
"label": "Agni Quoter V2",
"environment": "mainnet",
"category": "defi",
"address": "0xc4aaDc921E1cdb66c5300Bc158a313292923C0cb",
"status": "active",
"is_official": true,
"aliases": [
"QuoterV2",
"agni_quoter",
"agni_quoter_v2"
],
"protocol_id": "agni",
"contract_role": "quoter",
"supports": [
"quote"
],
"source": {
"url": "https://agni.finance/_next/static/chunks/pages/_app-9e7d79d3ffa0011c.js",
"retrieved_at": "2026-03-08T04:00:14Z"
},
"notes": "Official AGNI QuoterV2 from the mainnet app address config."
},
{
"key": "AAVE_V3_POOL",
"label": "Aave v3 Pool",
"environment": "mainnet",
"category": "defi",
"address": "0x458F293454fE0d67EC0655f3672301301DD51422",
"status": "active",
"is_official": true,
"aliases": [
"Pool",
"aave_v3_pool"
],
"protocol_id": "aave_v3",
"contract_role": "pool",
"supports": [
"supply",
"withdraw",
"borrow",
"repay"
],
"source": {
"url": "https://github.com/bgd-labs/aave-address-book/blob/main/src/AaveV3Mantle.sol",
"retrieved_at": "2026-03-08T04:00:14Z"
},
"notes": "Curated Tier 1 lending default on Mantle."
},
{
"key": "AAVE_V3_POOL_ADDRESSES_PROVIDER",
"label": "Aave v3 Pool Addresses Provider",
"environment": "mainnet",
"category": "defi",
"address": "0xba50Cd2A20f6DA35D788639E581bca8d0B5d4D5f",
"status": "active",
"is_official": true,
"aliases": [
"PoolAddressesProvider",
"aave_v3_pool_addresses_provider"
],
"protocol_id": "aave_v3",
"contract_role": "pool_addresses_provider",
"supports": [
"lookup"
],
"source": {
"url": "https://github.com/bgd-labs/aave-address-book/blob/main/src/AaveV3Mantle.sol",
"retrieved_at": "2026-03-08T04:00:14Z"
},
"notes": "Official Aave v3 Mantle pool registry entry."
}
]
}
Address Registry Playbook
Use this file with assets/registry.json to keep address lookups deterministic and auditable.
Resolution Policy
- CLI commands for address resolution (do NOT use MCP server):
- Use
mantle-cli token resolve <symbol> --jsonfor token symbols/names. - Use
mantle-cli registry resolve <identifier> --jsonfor contract key/alias/label lookups. - Use
mantle-cli registry validate <address> --jsonbefore returning any final address. - Prefer machine-readable sources over free text.
- Treat missing or stale provenance as a safety failure.
- Fail closed: no verified entry means no address output.
Registry Fields
Each contracts[] entry should include:
key: stable lookup key (WETH,OFFICIAL_BRIDGE, and so on)label: human-readable nameenvironment:mainnetortestnet(runtimenetwork=sepoliamaps totestnet)category:system,token,bridge, ordefiaddress: EIP-55 checksum addressstatus:active,deprecated,paused, orunknownis_official: booleansource.url: canonical source pagesource.retrieved_at: ISO-8601 timestampaliases: optional alternate names/symbolsprotocol_id: optional normalized protocol slug for DeFi entriescontract_role: optional normalized role such asrouter,quoter,position_manager,pool, orpool_addresses_providersupports: optional list of supported operations such asswap,add_liquidity,remove_liquidity,supply, orwithdraw
Lookup Strategy
1. If CLI is available, resolve through mantle-cli token resolve/mantle-cli registry resolve first. 2. Local fallback: exact match on key. 3. For defi lookups, if the request includes a protocol and role, filter by exact protocol_id + contract_role. 4. Local fallback: exact match on alias/symbol. 5. Local fallback: case-insensitive match on label. 6. If multiple active DeFi entries remain for the same protocol, stop and request role disambiguation.
Freshness Guidance
- Prefer entries verified within the last 30 days.
- If older than 30 days, set confidence to
medium. - If no timestamp exists, set confidence to
lowand require manual confirmation. - If
statusis notactive, do not treat as executable target.
Update Procedure
1. Gather source from official Mantle docs, official protocol docs, an official app config bundle, or a verified explorer contract page linked from an official source. 2. Update or add the entry in assets/registry.json. 3. Set source.retrieved_at and top-level updated_at to current UTC timestamp. 4. Preserve old entries by marking them deprecated instead of deleting immediately. 5. Re-run validation checks before using updated entries for execution tasks.
Suggested Validation Checks
- Address format and checksum.
- No placeholder/template values (for example
REPLACE_WITH_EIP55_CHECKSUM_ADDRESS). - Duplicated keys within the same environment.
- Duplicated active addresses with conflicting labels.
- Missing source URL or retrieved timestamp.
interface:
display_name: "Mantle Data Indexer"
short_description: "Analyze Mantle historical activity and metrics"
default_prompt: "Use $mantle-data-indexer when a Mantle task needs historical wallet activity, time-windowed metrics, event backfills, or protocol analytics from indexers."
Indexer Selection and Quality
Use this guide to choose index sources and communicate confidence.
Tool mapping and endpoint availability
- GraphQL path: use
mantle-cli indexer subgraph --endpoint <url> --query <graphql> --json. - SQL path: use
mantle-cli indexer sql --endpoint <url> --query <sql> --json. - Endpoints are runtime inputs; do not fabricate URLs when missing.
- For E2E
endpoint-configuredscenarios,E2E_SUBGRAPH_ENDPOINT/E2E_SQL_ENDPOINTmay be unset and those scenarios should be skipped.
Source choice
- Choose
GraphQLwhen: - A maintained subgraph exists.
- You need flexible entity filtering and nested fields.
- Choose
SQLwhen: - A warehouse/indexer table exists for the target protocol.
- You need heavy aggregations or window functions.
Required metadata in every answer
source_type(graphqlorsql)- Endpoint or dataset name
- Time range in absolute UTC timestamps
- Query execution time (
queried_at_utc) - Known lag status (if available)
Data quality checks
1. Confirm chain scope is Mantle. 2. Confirm timestamp units (seconds vs milliseconds). 3. Confirm decimal normalization assumptions. 4. Confirm pagination did not truncate data (hasNextPage=true warning requires follow-up pages). 5. Confirm SQL result truncation (truncated=true) did not hide required rows. 6. Confirm sorting/order key is deterministic.
Lag and completeness policy
- If lag is unknown, say
lag status unknown. - If lag is known and non-trivial, include impact statement.
- If query fails partway, report partial result with clear boundary.
- If tool warnings are present, copy them into output and explain impact.
Common failure modes
- Query returns zero rows because wrong network or wrong entity ID.
- Endpoint missing and agent guesses an URL instead of requesting one.
- Aggregation mismatch due to unnormalized token decimals.
- Double-counting due to overlapping pagination windows.
- Misleading totals due to mixed time granularities.
Query Templates
Use these templates as starting points. Replace placeholders explicitly.
Tool argument mapping (CLI)
- GraphQL template ->
mantle-cli indexer subgraph --jsonwith: --endpoint <url>(required)--query <graphql>(required)--variables <json>(optional)- SQL template ->
mantle-cli indexer sql --jsonwith: --endpoint <url>(required)--query <sql>(required, read-only SQL only)--params <json>(optional)- In E2E
endpoint-configuredscenarios, endpoint placeholders come fromE2E_SUBGRAPH_ENDPOINT/E2E_SQL_ENDPOINT; if unset, those scenarios are skipped.
GraphQL: wallet swap history (template)
query WalletSwaps(
$wallet: String!,
$startTs: Int!,
$endTs: Int!,
$first: Int!,
$skip: Int!
) {
swaps(
where: {
trader: $wallet
timestamp_gte: $startTs
timestamp_lte: $endTs
}
orderBy: timestamp
orderDirection: asc
first: $first
skip: $skip
) {
id
txHash
timestamp
tokenIn
tokenOut
amountIn
amountOut
}
}GraphQL: pool daily volume (template)
query PoolDailyVolume(
$poolId: String!,
$startDay: Int!,
$endDay: Int!,
$first: Int!,
$skip: Int!
) {
poolDayDatas(
where: {
pool: $poolId
date_gte: $startDay
date_lte: $endDay
}
orderBy: date
orderDirection: asc
first: $first
skip: $skip
) {
date
volumeUSD
txCount
}
}SQL: wallet activity rollup (template)
SELECT
DATE_TRUNC('day', block_time) AS day_utc,
COUNT(*) AS tx_count,
SUM(amount_usd) AS volume_usd
FROM swaps
WHERE chain_id = 5000
AND LOWER(wallet_address) = LOWER(:wallet)
AND block_time >= :start_utc
AND block_time < :end_utc
GROUP BY 1
ORDER BY 1 ASC;SQL: top pools by 24h volume (template)
SELECT
pool_address,
SUM(amount_usd) AS volume_24h_usd,
COUNT(*) AS swap_count
FROM swaps
WHERE chain_id = 5000
AND block_time >= :window_start_utc
AND block_time < :window_end_utc
GROUP BY pool_address
ORDER BY volume_24h_usd DESC
LIMIT :limit_n;Template usage rules
- Always declare timestamp timezone as UTC in parameters and output.
- Use deterministic ordering plus pagination for large result sets.
- Keep SQL read-only; avoid INSERT/UPDATE/DELETE/DDL statements.
- State whether amounts are raw token units or USD-normalized.
- Include replaced parameter values in report appendix.
- Carry forward tool warnings (
hasNextPage=true,truncated) in the final report.
interface:
display_name: "Mantle DeFi Operator"
short_description: "Coordinate verified Mantle DeFi preflight and external handoff"
default_prompt: "Use $mantle-defi-operator when a Mantle DeFi task needs discovery, venue comparison, or execution-ready planning with verified contracts, evidence references, and an external handoff."
swap_defaults:
- protocol_id: merchant_moe
tier: 1
source_url: https://docs.merchantmoe.com/resources/contracts
retrieved_at: 2026-04-10T00:00:00Z
review_after: 2026-05-10
why_default: Curated Mantle AMM default with verified router and quoter coverage for swap planning.
- protocol_id: agni
tier: 1
source_url: https://agni.finance
retrieved_at: 2026-04-10T00:00:00Z
review_after: 2026-05-10
why_default: Curated Mantle concentrated-liquidity default with verified router and quoter coverage for swap planning.
- protocol_id: fluxion
tier: 1
source_url: https://app.fluxion.network
retrieved_at: 2026-04-10T00:00:00Z
review_after: 2026-05-10
why_default: Curated Mantle V3 DEX with xStocks RWA pairs and DeFi pools (WMNT, WETH, mETH, stablecoins).
liquidity_defaults:
- protocol_id: merchant_moe
tier: 1
source_url: https://docs.merchantmoe.com/resources/contracts
retrieved_at: 2026-04-10T00:00:00Z
review_after: 2026-05-10
why_default: Curated Mantle liquidity default with verified router support for LP routing.
- protocol_id: agni
tier: 1
source_url: https://agni.finance
retrieved_at: 2026-04-10T00:00:00Z
review_after: 2026-05-10
why_default: Curated Mantle concentrated-liquidity default with verified position-manager support.
- protocol_id: fluxion
tier: 1
source_url: https://app.fluxion.network
retrieved_at: 2026-04-10T00:00:00Z
review_after: 2026-05-10
why_default: Curated Mantle V3 liquidity default with verified position-manager support.
lending_defaults:
- protocol_id: aave_v3
tier: 1
source_url: https://github.com/bgd-labs/aave-address-book/blob/main/src/AaveV3Mantle.sol
retrieved_at: 2026-04-10T00:00:00Z
review_after: 2026-05-10
why_default: Curated Mantle lending default with verified pool and address-provider coverage.
selection_policy:
prefer_curated_when_score_delta_bps: 150
stale_metrics_max_age_hours: 24
stale_verification_max_age_days: 30
discovery_source_label: DefiLlama
DeFi Pre-Execution Guardrails
Apply these controls before any potential state-changing DeFi action.
Tool discovery via Capability Catalog
- Read
mantle://registry/capabilitiesto discover available tools before constructing any plan. - Use
categoryto filter:queryfor reads,analyzefor insights,executefor transaction building. - Use
authto check wallet requirements:requiredtools need a wallet address,nonetools don't. - Use
workflow_beforeto understand call ordering (e.g.,getSwapQuotebeforebuildSwap). - For simple read-only tasks (query/analyze), the Capability Catalog is sufficient — no skill loading needed.
- For execution planning, continue with the guardrails below.
Capability boundary (CLI-only)
- All on-chain operations use
mantle-clicommands with--json. Do NOT enable or connect to the MCP server. - The CLI is read-focused for queries and builds unsigned transactions for writes — it does not sign, broadcast, deploy, or execute transactions.
- This skill must stop at analysis + plan generation.
- Never fabricate tx hashes, receipts, or settlement outcomes.
Coordination boundary
- Use this skill to assemble a final plan, not to replace specialized address, risk, or portfolio skills.
- Route address trust to
mantle-address-registry-navigator. - Route pass/warn/block verdicts to
$mantle-risk-evaluator. - Route allowance and balance evidence to
$mantle-portfolio-analystwhen approval scope or wallet coverage matters.
Address trust
- Resolve execution-ready token/router/pool/position-manager addresses from the shared
mantle-address-registry-navigatorregistry. - Mark the plan as blocked for unverified or malformed addresses.
- Mention the selected registry key in the final handoff.
- Discovery-only protocols may be mentioned for comparison, but they are not execution targets until their contracts are verified.
- Live metrics may influence ranking, but they never establish address trust.
Intent completeness
- Ensure operation type, token amounts, recipient, slippage cap, and deadline are present.
- Mark the plan as blocked if any mandatory field is missing.
Risk coupling
- Require latest preflight verdict from
$mantle-risk-evaluatorwhen available. - For
warn/high-riskoutcomes, require explicit user confirmation. - For
blockoutcomes, do not produce an execution-ready plan.
Allowance controls
- Prefer minimal required approval over unlimited approval.
- Use
$mantle-portfolio-analystwhen allowance scope, spender exposure, or balance coverage needs read-only evidence. - If unlimited approval is requested, require explicit user acknowledgement.
- Include an explicit allowance re-check in the external execution checklist.
Execution handoff integrity
- Use deterministic route and calldata inputs from selected quote/liquidity context.
- Record required call sequence and parameter values for the external executor.
- Define post-execution reconciliation checks (balances/allowances/slippage) to run after user-confirmed execution.
Lending SOP
Use this standard flow for Aave V3 lending operations (supply, borrow, repay, withdraw) on Mantle.
CRITICAL: Use CLI for Transaction Building
ALWAYS use `mantle-cli` to build unsigned transactions. Do NOT manually construct calldata, extract addresses from text, or build approve calls yourself. The CLI handles address resolution, ABI encoding, and whitelist validation correctly.
# All commands support --json for structured output
mantle-cli aave supply --asset USDC --amount 1.0 --on-behalf-of 0x... --json
mantle-cli aave borrow --asset USDC --amount 0.5 --on-behalf-of 0x... --json
mantle-cli aave repay --asset USDC --amount 0.5 --on-behalf-of 0x... --json
mantle-cli aave repay --asset USDC --amount max --on-behalf-of 0x... --json
mantle-cli aave withdraw --asset USDC --amount 1.0 --to 0x... --json
mantle-cli aave withdraw --asset USDC --amount max --to 0x... --json
mantle-cli aave markets --json # check APY/TVL before decidingFor approvals (required before supply/repay):
mantle-cli swap approve --token USDC --spender 0x458F293454fE0d67EC0655f3672301301DD51422 --amount max --jsonThe CLI outputs unsigned_tx with to, data, value, chainId — no `from` field. Pass this directly to the signer without modification.
Step 1: Check lending markets
mantle-cli aave markets --json- Review supply APY, borrow APY, TVL, LTV, and liquidation threshold.
- Confirm the target asset is a supported Aave V3 reserve.
- Supported assets: WETH, WMNT, USDT0, USDC, USDe, sUSDe, FBTC, syrupUSDT, wrsETH, GHO.
Step 2: Normalize input
- Asset symbol or address
- Amount (decimal, or
maxfor repay/withdraw) - Wallet address (on_behalf_of for supply/borrow/repay, to for withdraw)
Step 3: Check balance and allowance
mantle-cli account balance <wallet> --tokens USDC,USDT0 --json- Verify the wallet has sufficient token balance for supply/repay.
- The Aave Pool address is
0x458F293454fE0d67EC0655f3672301301DD51422.
Step 4: Approve if needed
If allowance is insufficient for supply or repay:
mantle-cli swap approve --token USDC \
--spender 0x458F293454fE0d67EC0655f3672301301DD51422 \
--amount <exact_or_max> --owner <wallet> --json- The CLI validates the spender against the whitelist.
- Use
--ownerto check existing allowance and skip if already sufficient. - Sign and broadcast the approve
unsigned_txbefore proceeding to supply/repay.
Step 5: Build the lending transaction
Use the appropriate CLI command:
| Operation | Command | Key flags |
|---|---|---|
| Deposit | mantle-cli aave supply | --asset, --amount, --on-behalf-of |
| Borrow | mantle-cli aave borrow | --asset, --amount, --on-behalf-of, --interest-rate-mode |
| Repay | mantle-cli aave repay | --asset, --amount (or max), --on-behalf-of |
| Withdraw | mantle-cli aave withdraw | --asset, --amount (or max), --to |
Always use --json to get structured output for the signer.
Step 6: Sign and broadcast
- Pass the
unsigned_txobject directly to the external signer. - Do NOT add a `from` field — the signer determines
fromfrom the signing key. - Do NOT modify `to`, `data`, `value`, or `chainId` fields.
Step 7: Post-execution verification
- Re-read token balance and aToken balance to confirm the operation.
- For supply: verify aToken balance increased.
- For borrow: verify token balance increased and debt token appeared.
- For repay: verify debt token balance decreased.
- For withdraw: verify aToken balance decreased and token balance increased.
- Check health factor after borrow/withdraw to ensure it remains above 1.0.
Common pitfalls
- Missing approve: supply and repay require prior ERC-20 approval for the Aave Pool.
- `from` field in unsigned_tx: NEVER add
from— this breaks Privy and some signers. - Stale allowance: use
--ownerflag in approve to auto-skip if sufficient. - Health factor: borrow and withdraw reduce health factor — check before proceeding.
- `max` semantics: repay max repays full debt; withdraw max withdraws full balance.
Liquidity SOP
Use this flow for LP operations on Mantle (V3: Agni/Fluxion, LB: Merchant Moe).
CRITICAL: Use CLI for All LP Operations
ALWAYS use `mantle-cli` to build LP transactions and query positions. The CLI handles pool resolution, tick range calculation, ABI encoding, and position enumeration.
# Read operations (no signing needed)
mantle-cli lp find-pools --token-a USDC --token-b USDe --json # Discover ALL pools across ALL DEXes
mantle-cli lp positions --owner 0x... --json # List all V3 positions
mantle-cli lp pool-state --token-a USDC --token-b WMNT --fee-tier 10000 --provider agni --json
mantle-cli lp suggest-ticks --token-a USDC --token-b WMNT --fee-tier 10000 --provider agni --json
mantle-cli lp analyze --token-a USDC --token-b WMNT --fee-tier 10000 --provider agni --investment-usd 1000 --json
mantle-cli defi lb-state --token-a USDC --token-b USDT0 --bin-step 1 --json
# Write operations (returns unsigned_tx)
mantle-cli lp add --provider agni --token-a USDC --token-b WMNT --amount-a 10 --amount-b 15 --recipient 0x... --json
mantle-cli lp add --provider agni --token-a USDC --token-b WMNT --amount-usd 1000 --recipient 0x... --json # USD mode
mantle-cli lp remove --provider agni --token-id 12345 --liquidity 1000000 --recipient 0x... --json
mantle-cli lp remove --provider agni --token-id 12345 --percentage 50 --recipient 0x... --json # Remove 50%
mantle-cli lp collect-fees --provider agni --token-id 12345 --recipient 0x... --jsonStep 1: Pool Discovery — ALWAYS Start Here
Before any LP operation, use `find-pools` to discover ALL available pools across ALL DEXes. This queries factory contracts on-chain — the authoritative source. Do NOT rely on DexScreener, subgraphs, or hardcoded pair lists.
mantle-cli lp find-pools --token-a USDC --token-b USDe --jsonThis returns every pool with its DEX provider, fee tier/bin step, pool address, and liquidity status. Example output for USDC/USDe:
- Agni fee=100 (0.01%) — $1.7M liquidity
- Merchant Moe bin=1 — active
Use the results to pick the best pool, then proceed with pool analysis.
Step 2: Pool Analysis — ALWAYS Before Adding Liquidity
After picking a pool, run `lp analyze` to understand APR, risk, and optimal range.
mantle-cli lp analyze --token-a USDC --token-b WMNT --fee-tier 10000 --provider agni --investment-usd 5000 --jsonThe analysis returns:
- Fee APR based on 24h volume / TVL (base and concentrated across 10 range brackets)
- Risk assessment: TVL risk, volatility risk, concentration risk
- Investment projections: daily/weekly/monthly fee income for your investment amount
- Recommended range: auto-selected based on recent volatility (±3× daily movement)
- Multi-range comparison: ±1% through ±50% with APR, concentration factor, and rebalance risk
Use this data to make an informed range decision. Do NOT skip analysis and guess a tick range.
Step 3: Pool State & Tick Suggestions
After analysis, get exact tick bounds:
V3 Pools (Agni/Fluxion)
# 1. Check pool state — get current tick, price, liquidity
mantle-cli lp pool-state --token-a USDC --token-b WMNT --fee-tier 10000 --provider agni --json
# 2. Get tick range suggestions (pre-calculated wide/moderate/tight)
mantle-cli lp suggest-ticks --token-a USDC --token-b WMNT --fee-tier 10000 --provider agni --json
# 3. List existing positions
mantle-cli lp positions --owner 0x... --jsonMerchant Moe LB Pairs
# Check LB pair state — get active bin, nearby bin reserves
mantle-cli defi lb-state --token-a USDC --token-b USDT0 --bin-step 1 --jsonStep 4: Tick/Bin Range Selection
V3 (Agni/Fluxion)
Use data from lp analyze (recommended range) and lp suggest-ticks to pick a range:
- tight (±1-3%): stablecoins or low-volatility pairs — highest APR but frequent rebalancing
- moderate (±5-10%): balanced risk/reward for most pairs
- wide (±15-50%): volatile pairs, less rebalancing needed
Do NOT manually calculate ticks — use the CLI tools.
Merchant Moe LB
Use defi lb-state to get the active_id, then:
- For stablecoins: use
delta_ids: [-2,-1,0,1,2]centered on active bin - For volatile: use wider range
delta_ids: [-5,-4,...,4,5] - Distribution: uniform
[1e18, 1e18, ...]for even, or custom weights
Step 5: Add Liquidity
Amount modes
Token amounts (explicit control):
mantle-cli lp add --provider agni \
--token-a USDC --token-b WMNT \
--amount-a 10 --amount-b 15 \
--tick-lower <from_analyze> --tick-upper <from_analyze> \
--fee-tier 10000 --recipient 0x... --jsonUSD amount (automatic sizing — recommended for user-facing flows):
mantle-cli lp add --provider agni \
--token-a USDC --token-b WMNT \
--amount-usd 1000 \
--tick-lower <from_analyze> --tick-upper <from_analyze> \
--fee-tier 10000 --recipient 0x... --jsonThe --amount-usd mode:
- Fetches live token prices from DexScreener/DefiLlama
- Reads pool state to compute the correct token ratio for the target tick range (not a naive 50/50 split)
- Reports the computed amounts and prices in the response warnings
- Falls back to 50/50 for full-range positions or if pool read fails
Merchant Moe
mantle-cli lp add --provider merchant_moe \
--token-a USDC --token-b USDT0 \
--amount-a 100 --amount-b 100 \
--bin-step 1 --active-id <from_lb_state> \
--delta-ids '[-2,-1,0,1,2]' \
--distribution-x '[200000000000000000,200000000000000000,200000000000000000,200000000000000000,200000000000000000]' \
--distribution-y '[200000000000000000,200000000000000000,200000000000000000,200000000000000000,200000000000000000]' \
--recipient 0x... --jsonStep 6: Fee Collection (V3)
# Check accrued fees first
mantle-cli lp positions --owner 0x... --json
# Look for tokens_owed0 / tokens_owed1 > 0
# Collect fees
mantle-cli lp collect-fees --provider agni --token-id 12345 --recipient 0x... --jsonStep 7: Remove Liquidity
V3 — Exact amount
mantle-cli lp remove --provider agni \
--token-id 12345 --liquidity <amount> \
--recipient 0x... --jsonV3 — Percentage mode (recommended for user-facing flows)
# Remove 50% of position
mantle-cli lp remove --provider agni \
--token-id 12345 --percentage 50 \
--recipient 0x... --json
# Remove all
mantle-cli lp remove --provider agni \
--token-id 12345 --percentage 100 \
--recipient 0x... --jsonThe --percentage mode reads the position's current liquidity on-chain and calculates the exact amount to remove. No need to manually query lp positions for the raw liquidity number.
Merchant Moe
mantle-cli lp remove --provider merchant_moe \
--token-a USDC --token-b USDT0 \
--bin-step 1 \
--ids '[8388608,8388609,8388610]' \
--amounts '[1000000,1000000,1000000]' \
--recipient 0x... --jsonStep 8: Post-operation Verification
- Re-read positions:
lp positions --owner 0x... --json - Check token balances changed as expected
- For V3: verify
in_rangestatus if market moved - For Moe: verify bin balances via
defi lb-state
Common Pitfalls
- Skipping pool analysis: ALWAYS run
lp analyzebefore adding liquidity — it shows APR, risk, and recommended range - Skipping pool discovery: ALWAYS run
lp find-poolsfirst — it finds pools DexScreener misses (e.g. Agni fee=0.01% stablecoin pools) - Full-range V3 LP: extremely capital-inefficient — always use analysis + tick suggestions to pick a range
- Wrong active_id for Moe: always read fresh from
defi lb-state, never hardcode - Missing approve: both tokens must be approved for the router/position manager before adding
- Manual amount calculation: use
--amount-usdinstead of manually computing token splits from prices - Manual liquidity lookup for removal: use
--percentageinstead of manually reading position liquidity - `from` field: NEVER add to unsigned_tx
- V3 position enumeration:
lp positionsdiscovers all positions across both Agni and Fluxion - Fee harvesting: use
lp collect-feesstandalone — no need to remove liquidity to collect fees
Protocol Selection Policy
Candidate gating
- Only recommend protocols whose contract addresses resolve from
mantle-address-registry-navigator. - Ignore discovery-only protocols for execution-ready guidance.
- Block recommendations when required contract roles are missing.
- Treat curated defaults as candidate seeds, not proof of execution readiness.
- Carry forward curated
retrieved_at/review_aftermetadata into freshness reporting.
Ranking signals
Swaps
- quote quality
- recent volume
- pool depth
- slippage risk
Liquidity
- TVL
- recent volume
- pool fit
- operational complexity
Lending
- TVL
- utilization
- asset support
- withdrawal liquidity
Fallbacks
- If live metrics are unavailable, fall back to curated default order.
- If only one curated verified candidate fits the action, recommend it first before asking follow-up preferences.
- If the score delta is small, keep the curated default first.
- If the user names another protocol, verify it before comparing it.
- If risk or allowance evidence is missing, downgrade readiness and request supporting skill output before presenting an execution-ready handoff.
Mode-specific output rules
discovery_only: return high-level venue suggestions, rationale, and discovery sources only.discovery_only: do not include router addresses, calldata, approval steps, or execution sequencing.compare_only: verified registry keys or contract roles may be cited, but calldata and approval instructions remain out of scope.execution_ready: allowed only after verified address trust plus the required risk and portfolio evidence are available or intentionally marked unnecessary.
Discovery messaging
- Mention
DefiLlamafor broader ecosystem discovery. - Do not treat
DefiLlamaas a contract-truth or execution-readiness source.
Swap SOP
Use this standard flow for token swap pre-execution analysis on Mantle.
CRITICAL: Use CLI for Transaction Building
ALWAYS use `mantle-cli` to build unsigned transactions. Do NOT manually construct calldata, extract addresses from text, or build approve calls yourself. The CLI handles address resolution, ABI encoding, pool parameter lookup, multi-hop routing, and whitelist validation correctly.
# Build the swap transaction — works for both direct and multi-hop routes
mantle-cli swap build-swap --provider fluxion --in WMNT --out BSB \
--amount 0.5 --recipient 0x... --json
# If approval is needed
mantle-cli swap approve --token WMNT --spender <router_address> \
--amount <exact_or_max> --owner <wallet> --json
# Check available pairs and pool parameters
mantle-cli swap pairs --provider fluxion --jsonThe CLI outputs unsigned_tx with to, data, value, chainId — no `from` field. Pass this directly to the signer without modification.
Multi-hop Routing (Built-in)
The CLI automatically discovers multi-hop routes when no direct pair exists. You do NOT need to find intermediate pools or build multi-step swaps yourself.
How it works: when --in A --out B has no direct pool, the CLI tries 2-hop paths via bridge tokens (WMNT, USDC, USDT0, USDe, WETH) using the registered pair registry. If a route A → bridge → B exists, it builds a single exactInput (V3) or multi-token-path (Merchant Moe) transaction.
Examples of auto-routed swaps:
# WMNT → BSB (auto-routes: WMNT → USDT0 → BSB on Fluxion)
mantle-cli swap build-swap --provider fluxion --in WMNT --out BSB --amount 0.5 --recipient 0x... --json
# WMNT → wTSLAx (auto-routes: WMNT → USDC → wTSLAx on Fluxion)
mantle-cli swap build-swap --provider fluxion --in WMNT --out wTSLAx --amount 0.5 --recipient 0x... --json
# WMNT → ELSA (auto-routes: WMNT → USDT0 → ELSA on Fluxion)
mantle-cli swap build-swap --provider fluxion --in WMNT --out ELSA --amount 0.5 --recipient 0x... --jsonWhat you MUST NOT do:
- Do NOT manually split a swap into two separate transactions (e.g. WMNT→USDT0 then USDT0→BSB). The CLI handles this as a single atomic multi-hop transaction with better gas efficiency.
- Do NOT search for intermediate pools or bridge tokens yourself. The CLI's route discovery uses the verified pair registry.
- Do NOT use aggregators or external routing services. Only use
mantle-cli swap build-swap.
When multi-hop is used, the response will show:
intent: "swap_multihop"(instead of"swap")human_summaryshows the full path (e.g. "Swap 0.5 WMNT → BSB via WMNT → USDT0 → BSB on Fluxion")warningsinclude the route details and fee tiers
Step 1: Normalize input
- token in/out symbols or addresses
- exact input amount
- recipient address
- slippage cap (default 0.5%)
Step 2: Select candidate protocol
- Start with curated defaults:
Merchant Moe,Agni,Fluxion. - Use
mantle-cli swap pairs --jsonto check available pairs and pool parameters per DEX. - Resolve the execution-ready router/quoter from
mantle-address-registry-navigator. - If the user names another venue, verify its contracts before comparing it.
- For xStocks RWA tokens (wTSLAx, wAAPLx, wNVDAx, etc.) → use Fluxion (only DEX with these pools).
- For BSB, ELSA, VOOI → use Fluxion (paired with USDT0).
Step 3: Token metadata
- For tokens in the registry, use their symbol directly.
- For unknown tokens, pass the contract address — the CLI resolves decimals on-chain.
Step 4: Build the swap
mantle-cli swap build-swap --provider <dex> --in <token> --out <token> \
--amount <amount> --recipient <wallet> --json- The CLI auto-resolves pool parameters (fee_tier, bin_step) from the pair registry.
- The CLI auto-discovers multi-hop routes when no direct pair exists.
- Just specify
--in,--out,--amount, and--provider— the CLI does the rest.
Step 5: Allowance check and approve
- The swap router address is in the
unsigned_tx.tofield of the build-swap response. - Check if the input token is approved for that router.
- If insufficient:
mantle-cli swap approve --token <token> --spender <router_from_tx_to> --amount <exact_or_max> --owner <wallet> --jsonStep 6: Sign and broadcast
- Pass the
unsigned_txobject directly to the external signer. - Do NOT add a `from` field.
- Do NOT modify any fields.
Step 7: Post-execution verification
- Re-read balances to confirm the swap completed.
- Compare observed output versus expected.
Common pitfalls
- `from` field: NEVER add
fromto unsigned_tx — breaks Privy and embedded signers. - Manual routing: NEVER manually discover pools or split multi-hop into separate txs — use the CLI's built-in routing.
- Wrong pool parameters: NEVER manually specify
--fee-tieror--bin-stepfor registered pairs — the CLI resolves them automatically. - Merchant Moe version enum: the CLI handles this correctly (V1=0, V2.2=3); do NOT override.
- Missing approve: swaps require prior ERC-20 approval for the router contract.
- Multi-hop slippage: multi-hop routes have higher slippage risk — always get a quote first when possible.
interface:
display_name: "Mantle Network Primer"
short_description: "Reference skill for Mantle onboarding"
default_prompt: "Use $mantle-network-primer as a reference/onboarding skill when users need Mantle fundamentals, MNT gas context, settlement/finality explanations, or developer onboarding guidance."
Mantle Network Basics
Use this file for factual grounding when answering Mantle onboarding, difference, and developer-handoff questions. It supports a reference/onboarding skill rather than an execution workflow.
Source and freshness
- Primary source: https://docs.mantle.xyz/network/for-developers/quick-access
- Additional sources:
- https://docs.mantle.xyz/network/system-information/architecture
- https://docs.mantle.xyz/network/for-developers/resources-and-tooling/node-endpoints-and-providers
- Snapshot verified on: March 8, 2026
- If a user asks for the "latest" values or architecture status, re-check the official docs before answering.
How to use this reference
- Treat
Core model,Mantle-Specific Differences,Developer Hints, andRPC reliability guidanceas the stable-concepts layer. - Treat
Network details,Onboarding tools, contract links, and architecture notes as dated snapshots verified on March 8, 2026. - If a question asks for "latest", "current", or rollout-status details, use this file to frame the answer and then live-verify before answering conclusively.
Core model
- Mantle is an Ethereum-aligned Layer 2 execution network.
- Users execute transactions on L2.
- Settlement/security assurances are anchored to Ethereum L1.
- Mantle is EVM-compatible and uses standard Ethereum tooling.
- Gas on Mantle is paid in
MNT.
Mantle-Specific Differences
MNTis the gas token, so developers should not assumeETH-funded wallets can transact on Mantle.- Mantle is Ethereum-aligned, but fast L2 transaction inclusion is not the same thing as strongest L1-backed settlement/finality.
- Mantle-specific onboarding constants matter in practice:
- mainnet
chainId:5000 - Sepolia testnet
chainId:5003 - explorer domains and bridge links are Mantle-specific
- Per the Mantle architecture page snapshot verified on March 8, 2026, Mantle v2 Skadi is described as using an execution layer, a ZK validity proving module, and Ethereum data availability via blobs.
- Architecture rollout details can evolve, so treat fee behavior, throughput, and "latest architecture" questions as live-verify items.
Key Tokens on Mantle
CRITICAL: WETH (bridged ETH) EXISTS on Mantle. Do not confuse "MNT is the gas token" with "ETH doesn't exist on Mantle." ETH is bridged from L1 and is one of the most actively traded assets.
| Token | Address | Notes |
|---|---|---|
| MNT | native (no contract) | Gas token, native currency |
| WMNT | 0x78c1b0C915c4FAA5FffA6CAbf0219DA63d7f4cb8 | Wrapped MNT (ERC-20 wrapper for native MNT) |
| WETH | 0xdEAddEaDdeadDEadDEADDEAddEADDEAddead1111 | Bridged ETH from L1 — exists and has deep liquidity |
| mETH | 0xcDA86A272531e8640cD7F1a92c01839911B90bb0 | Mantle Staked ETH (liquid staking derivative) |
| cmETH | 0xE6829d9a7eE3040e1276Fa75293Bde931859e8fA | Restaked mETH |
| USDC | 0x09Bc4E0D864854c6aFB6eB9A9cdF58aC190D0dF9 | USD Coin (bridged) |
| USDT0 | 0x779Ded0c9e1022225f8E0630b35a9b54bE713736 | Tether (USDT0 variant) |
| USDe | 0x5d3a1Ff2b6BAb83b63cd9AD0787074081a52ef34 | Ethena USDe |
Common mistake to avoid: Claiming WETH doesn't exist on Mantle. It does — it's bridged ETH at 0xdEAD...1111, with ~125K ETH total supply and pools on every major DEX (Agni, Fluxion, Merchant Moe).
Network details (dated Quick Access snapshot)
Mainnet
- RPC URL:
https://rpc.mantle.xyz - WebSocket URL:
wss://rpc.mantle.xyz - Chain ID:
5000 - Token symbol:
MNT - Explorer:
https://mantlescan.xyz/
Testnet (Sepolia)
- RPC URL:
https://rpc.sepolia.mantle.xyz - WebSocket URL:
N/A(per Quick Access) - Chain ID:
5003 - Token symbol:
MNT - Explorer:
https://sepolia.mantlescan.xyz/
Onboarding tools (dated Quick Access snapshot)
Mainnet
- Bridge:
https://app.mantle.xyz/bridge - Recommended Solidity compiler:
v0.8.23 or below - Wrapped MNT:
0x78c1b0C915c4FAA5FffA6CAbf0219DA63d7f4cb8
Testnet (Sepolia)
- Faucet:
https://faucet.sepolia.mantle.xyz/ - Third-party faucets:
https://faucet.quicknode.com/mantle/sepoliahttps://thirdweb.com/mantle-sepolia-testnet/faucet- Bridge:
https://app.mantle.xyz/bridge?network=sepolia - Recommended Solidity compiler:
v0.8.23 or below - Wrapped MNT:
0x19f5557E23e9914A18239990f6C70D68FDF0deD5 - Note: Mantle docs indicate Sepolia MNT can be requested directly from faucet (subject to limits).
Developer Hints
- Fund developer and test wallets with
MNT, notETH, before attempting transactions on Mantle. - Use the official chain settings above instead of generic "custom EVM" assumptions.
- Mantle docs currently recommend Solidity
v0.8.23 or below. - Official public RPC endpoints are suitable for onboarding and light usage, but production or high-frequency workloads should use dedicated providers.
- For exact contract addresses, token mappings, and bridge-facing metadata, prefer the official address pages and token list links below over memory.
- When debugging UX issues, explain both:
inclusion: the transaction is visible in an L2 blockL1-backed settlement finality: the strongest settlement assurance once the L1-side conditions are satisfied
Contract and token source-of-truth
- L1 system contracts:
https://docs.mantle.xyz/network/system-information/on-chain-system/key-l1-contract-address - L2 system contracts:
https://docs.mantle.xyz/network/system-information/off-chain-system/key-l2-contract-address - Token list source-of-truth:
https://token-list.mantle.xyz - Bridge reference:
https://bridge.mantle.xyz - Token-list PR repo (for adding tokens):
https://github.com/mantlenetworkio/mantle-token-lists
RPC reliability guidance
- Mantle docs state official RPC endpoints are rate-limited for stability.
- For high-frequency or production workloads, prefer dedicated provider endpoints.
- Provider directory:
https://docs.mantle.xyz/network/for-developers/resources-and-tooling/node-endpoints-and-providers
Response rules for this skill
- Use absolute dates when quoting values from this file.
- Treat throughput, fee levels, ecosystem counts, and latency/finality windows as volatile.
- Distinguish:
inclusion: transaction appears in L2 block.L1-backed settlement finality: strongest settlement assurance once L1 conditions are satisfied.- For exact contract address lookups in execution contexts, cross-check with:
- Mantle contract address pages above, or
$mantle-address-registry-navigator(if available in the runtime).
Difference checklist
When asked "what makes Mantle different", cover:
1. gas token and wallet funding expectations 2. inclusion versus L1-backed settlement/finality 3. current architecture snapshot versus live-verify items 4. onboarding constants such as chain IDs, bridge, explorer, and faucet 5. operational guidance such as RPC rate limits and provider selection
runtime:
name: openai
model: gpt-4o
metadata:
version: "1.0"
author: mantle-xyz
tags:
- competition
- defi
- openclaw
interface:
display_name: "Mantle Portfolio Analyst"
short_description: "Analyze Mantle balances and allowances"
default_prompt: "Use $mantle-portfolio-analyst to produce a wallet balance and allowance exposure report on Mantle."
Allowance Risk Rules
Use these rules to classify spender approval exposure.
Inputs
- Token address
- Spender address
- Allowance raw value
- Token decimals (if known)
is_unlimitedflag frommantle-cli account allowancesoutput (preferred when present)
Risk levels
low- Allowance is zero.
- Or allowance is tightly bounded and clearly below wallet balance/expected use.
medium- Allowance is non-zero and larger than immediate expected use, but still bounded.
high- Allowance is very large relative to expected use.
- Or allowance appears intentionally broad with unclear user intent.
criticalis_unlimited=truefrom tool output.- Or allowance equals or is effectively near-max integer approval.
- Typical near-max detection: value >=
2^255.
Reporting rules
- Always include rationale text with each risk label.
- Mark spender trust status as
unknownunless verified frommantle://registry/protocolsor user-confirmed protocol. - Highlight all
highandcriticalapprovals at top of summary. - If token decimals are missing, classify using raw value and downgrade confidence.
Caveats
- Unlimited approval is not automatically malicious; it is an exposure signal.
- Risk scoring is heuristic and should be combined with protocol trust checks and intent context.
RPC Read-Only Workflow
Use this guide to gather wallet balances and allowances through mantle-cli read-only commands only. Do NOT enable or connect to the MCP server.
Required inputs
- Wallet address
- Network (
mainnetorsepolia) - Token set and spender set (user-provided or discovered)
Call sequence
1. mantle-cli registry validate <wallet> --json for wallet format checks. 2. mantle-cli chain info --json (and mantle-cli chain status --json when available) to confirm network context. 3. mantle-cli account balance <wallet> --json 4. mantle-cli account token-balances <wallet> --tokens <token1>,<token2>,... --json 5. mantle-cli account allowances <wallet> --pairs <token1>:<spender1>,<token2>:<spender2> --json 6. Optional metadata backfill: mantle-cli token info <token> --json for tokens with missing symbol/decimals.
Token and spender discovery
- Prefer explicit user scope first.
- If token scope is missing, read
mantle://registry/tokensand select a bounded set for coverage. - If spender scope is missing, read
mantle://registry/protocolsand extract known routers/pools. - Use
mantle-cli token resolve <symbol> --jsonfor symbols outside the current scoped list before balance/allowance calls. - If scope is still unknown, report that coverage is partial instead of inventing targets.
Normalization rules
- Prefer normalized values already returned by CLI JSON output.
- Convert raw values manually only when decimals are explicitly known.
- Keep both
rawandnormalizedvalues in output. - If decimals are unavailable, keep raw only and mark confidence lower.
Reliability checks
- Verify response chain/network matches requested input (
mainnetorsepolia). - Retry transient read failures with bounded attempts; do not switch to guessed tokens/spenders.
- Detect and report partial failures via tool-level
partialflags and per-entryerrorfields. - Include
collected_at_utcvalues from CLI outputs in the final report.
interface:
display_name: "Mantle Readonly Debugger"
short_description: "Diagnose Mantle read/query failures"
default_prompt: "Use $mantle-readonly-debugger to diagnose Mantle RPC or quote failures before any execution attempt."
Error Signature Map
Use this table to classify frequent read-path failures quickly.
RPC transport/connectivity
- Symptoms:
- timeout
- connection reset
- HTTP 429/503
- Likely causes:
- provider saturation
- rate limit
- unstable endpoint
- First actions:
- retry with backoff
- switch to fallback RPC
- reduce batch size/request rate
Call/revert errors
- Symptoms:
execution revertedCALL_EXCEPTION- empty return data where data expected
- Likely causes:
- wrong contract address
- wrong ABI/function selector
- invalid params or state preconditions
- First actions:
- verify target address/ABI
- dry-run minimal input
- decode revert data if available
Quote failures
- Symptoms:
- DEX aggregator quote returns null/error
- path not found
- amount out equals zero
- Likely causes:
- insufficient liquidity
- unsupported route/token pair
- wrong decimals/input units
- First actions:
- validate token decimals and amount scaling
- try smaller size
- try alternate route/source
Balance inconsistencies
- Symptoms:
- wallet balance differs across reads
- expected post-action balance not visible
- Likely causes:
- pending transactions
- nonce contention
- stale block tag/source lag
- First actions:
- compare
latestvspending - inspect recent tx status
- re-read after bounded delay
Troubleshooting Playbook
Follow this sequence to keep diagnostics structured and repeatable.
Step 1: Reproduce and capture
- Re-run failing read with same parameters once.
- Record endpoint, method, params hash, timestamp (UTC), and exact error text.
- Record chain ID and block tag used.
Step 2: Branch by issue type
RPC exception branch
1. Check endpoint health and rate-limit signals. 2. Retry with bounded backoff. 3. Switch to fallback endpoint. 4. Compare outcomes across endpoints.
Quote failure branch
1. Verify token addresses and decimals. 2. Verify input amount scaling. 3. Probe smaller notional size. 4. Try alternate liquidity source.
Balance mismatch branch
1. Compare reads at latest and pending. 2. Check for unconfirmed tx and nonce conflicts. 3. Reconcile token decimals and symbol/address mapping. 4. Re-read at consistent block context.
Step 3: Conclude with bounded claim
- State likely root cause as hypothesis plus confidence.
- Provide smallest next action.
- If unresolved after bounded retries, escalate with captured evidence.
Escalation package
- Full raw error strings
- Endpoint list tested
- Request fingerprints (without private keys/secrets)
- Timestamped observations
- What was ruled out
interface:
display_name: "Mantle Risk Evaluator"
short_description: "Run Mantle preflight risk checks"
default_prompt: "Use $mantle-risk-evaluator to run preflight checks on a Mantle transaction intent before execution."
Risk Checklist
Apply all checks before execution intent is approved.
Input completeness
operation_typepresentchain/environmentpresent- token and amount fields present
- target contract/router/pool address present
Fail if any mandatory field is missing.
Slippage check
- Compare proposed slippage against user-defined cap.
- If no user cap exists, apply default from
risk-threshold-guidance.md. - Fail when cap exceeded.
Liquidity depth check
- Estimate price impact from quote/simulation context.
- Warn on moderate impact, fail on severe impact (threshold-driven).
- If liquidity data unavailable, set warn with reduced confidence.
Address safety check
- Verify all addresses against trusted registry/tooling.
- Flag unknown, suspicious, or blacklisted addresses.
- Fail on blacklisted/explicitly flagged addresses.
Allowance scope check
- Detect approvals broader than required for intended amount.
- Warn on broad allowances.
- Fail if operation requires new unlimited approval without user confirmation.
Gas and deadline sanity
- Check gas estimate reasonableness versus recent baseline.
- Check transaction deadline is not stale and not excessively long.
- Warn or fail according to threshold profile.
Finalization rule
- Any
failin critical categories => final verdictblock. - No
failand at least onewarn=> final verdictwarn. - All checks pass => final verdict
pass.
Risk Threshold Guidance
Use user-specified parameters first. Use defaults only when user constraints are absent.
Default thresholds (recommended baseline)
- Slippage cap:
- Warn:
> 0.5% - Fail:
> 1.0% - Estimated price impact:
- Warn:
> 2% - Fail:
> 5% - Deadline horizon:
- Warn:
> 20 minutes - Fail:
> 60 minutes - Gas deviation from rolling baseline:
- Warn:
> 20% - Fail:
> 40%
Address trust
pass: trusted and verified sourcewarn: unknown but not explicitly flaggedfail: flagged, blacklisted, or malformed address
Allowance policy
pass: existing allowance fits intended spend scopewarn: allowance materially larger than intended spendfail: new or existing near-unlimited approval without explicit user approval
Near-unlimited heuristic:
- raw allowance
>= 2^255
Confidence policy
high: all required signals present and consistentmedium: one non-critical signal missinglow: key signals missing (for example no liquidity data or unresolved address provenance)
If confidence is low, downgrade verdict one level toward caution (pass -> warn, warn -> block).
interface:
display_name: "Mantle Smart Contract Deployer"
short_description: "Plan Mantle deployment handoff and verification"
default_prompt: "Use $mantle-smart-contract-deployer to prepare deployment readiness checks, external execution handoff, and explorer verification planning for an already-designed Mantle contract."
Deployment Checklist
Run this checklist before preparing an external deployment handoff.
Environment checks
- Confirm target environment (
mainnetortestnet). - Confirm expected chain ID and RPC endpoint.
- Confirm deployer address and sufficient native balance for gas.
Build checks
- Confirm compiler version and optimizer settings.
- Confirm bytecode reproducibility from clean build.
- Confirm ABI and metadata artifacts exist.
- Confirm constructor args are complete and correctly encoded.
Safety checks
- Confirm no unresolved TODO/debug flags in source.
- Confirm external dependency addresses are network-correct.
- Confirm ownership/admin initialization values are intentional.
Cost checks
- Estimate deployment gas.
- Estimate native fee using current gas pricing.
- Compare estimate against max cost constraint.
Final gate
- If any required check fails: stop deployment.
- If all checks pass: produce an unsigned deployment handoff for an external signer/wallet.
Verification Playbook
Use this workflow to plan or validate verification of externally deployed contracts on Mantle explorers.
Required inputs
- deployed contract address
- contract source path and contract name
- compiler version
- optimizer enabled/runs
- constructor arguments (raw and encoded)
- linked library addresses (if any)
Steps
1. Confirm deployed bytecode exists at target address. 2. Prepare verification payload for explorer API/UI submission (or provide manual submission instructions when tooling is unavailable). 3. Poll verification status from explorer responses until success/failure/timeout. 4. Record verification link or identifier.
Common failures and fixes
- Compiler mismatch:
- Rebuild with exact compiler version used at deployment.
- Optimizer mismatch:
- Match enable flag and run count exactly.
- Constructor args mismatch:
- Re-encode with precise argument order and types.
- Metadata/library mismatch:
- Provide fully qualified library mapping.
Evidence requirements
- Keep full request payload snapshot (excluding secrets).
- Keep explorer response body and timestamp.
- Do not claim the agent submitted deployment/verification transactions; execution happens externally.
- Do not claim "verified" without explicit success response.
interface:
display_name: "Mantle Smart Contract Developer"
short_description: "Guide Mantle contract design and OpenZeppelin MCP handoff"
default_prompt: "Use $mantle-smart-contract-developer to scope a Mantle smart contract, route contract authoring through OpenZeppelin MCP, and produce a deployment-ready development brief."
Development Checklist
Run this checklist before handing a Mantle contract project to deployment planning.
Product and environment checks
- Confirm the contract's purpose, users, and privileged roles.
- Confirm target environment (
mainnetortestnet). - Confirm whether the contract must be upgradeable or immutable.
- Confirm whether the contract will hold assets, mint tokens, bridge funds, or control admin actions.
Mantle-specific integration checks
- Confirm every external contract address is correct for the requested Mantle environment.
- Confirm native gas assumptions use MNT.
- Confirm any bridge, oracle, DEX, vault, or system dependency is explicitly named and environment-correct.
- Confirm frontend or backend integrations know which events, functions, and initialization values they depend on.
Contract design checks
- Confirm the chosen OpenZeppelin base contracts and access-control model.
- Confirm constructor or initializer inputs are complete and intentional.
- Confirm pause, emergency, or recovery flows are specified when relevant.
- Confirm upgrade authorization and storage-layout constraints are understood when proxies are used.
Quality checks
- Confirm unit, integration, and failure-path test expectations.
- Confirm the highest-risk behaviors that need focused review.
- Confirm no unresolved TODO, placeholder address, or ambiguous permission remains.
Handoff gate
- If any required item is unclear, stop and resolve it before deployment planning.
- If all items are clear, produce a development brief and hand off to
$mantle-smart-contract-deployer.
OpenZeppelin MCP Handoff
Use OpenZeppelin MCP whenever the user needs actual smart contract writing or implementation guidance for a Mantle project.
Route to OpenZeppelin MCP for
- Solidity contract scaffolding or code generation
- OpenZeppelin inheritance and extension choices
Ownable,AccessControl, token, proxy, upgrade, governor, or security module usage- constructor, initializer, or storage-layout implementation details
- contract refactors tied to OpenZeppelin patterns
Provide this handoff context
- Mantle environment (
mainnetortestnet) - contract purpose and user flows
- asset model and token standards involved
- admin and upgradeability requirements
- external Mantle dependencies and known addresses
- deployment constraints or verification requirements already known
Expected return from OpenZeppelin MCP
- recommended contract modules and inheritance plan
- implementation notes or code guidance
- security-sensitive decisions to review
- inputs needed for testing and deployment
Boundary
- OpenZeppelin MCP handles contract authoring guidance.
mantle-smart-contract-developerhandles Mantle-specific framing, readiness checks, and handoff into$mantle-smart-contract-deployer.
interface:
display_name: "Mantle Tx Simulator"
short_description: "Prepare external Mantle tx simulation handoff and WYSIWYS summary"
default_prompt: "Use $mantle-tx-simulator to prepare an external Mantle simulation handoff package and summarize returned state changes in WYSIWYS format."
Simulation Backends
Choose backend by availability, fidelity, and reproducibility requirements. These backends are external and must be run outside the CLI toolchain.
Backend options
Local fork (Anvil or equivalent)
- Best for deterministic local replay and rapid iteration.
- Requires archive-capable RPC and correct fork block configuration.
- Good for deep debugging with custom call sequences.
Managed simulation API (Tenderly or equivalent)
- Best for quick hosted simulation with rich traces.
- Good for team workflows and sharable simulation artifacts.
- Depends on provider uptime and account/project configuration.
Selection heuristic
1. Use local fork when you need deterministic reproducibility or custom pre-state setup. 2. Use managed simulator when you need speed, traces, and collaboration. 3. If one backend fails, request one retry on an alternate backend before declaring inconclusive.
Minimum captured fields
- backend name
- network/chain ID
- simulation timestamp (UTC)
- transaction payload
- success/revert status
- gas estimate
- decoded events/logs (if available)
- state diff summary
Inconclusive conditions
- backend error without trace
- unresolved calldata decoding
- missing token metadata needed for user-facing summary
Return status: inconclusive and do_not_execute_reason when any inconclusive condition exists.
WYSIWYS Template
Use this template to translate simulation output into plain-language signing expectations.
Required extraction
- Assets debited from user wallet
- Assets credited to user wallet
- Fee estimate in native token
- Approval changes (if any)
- Critical caveats (slippage, deadline, unresolved uncertainty)
Plain-language format
If this transaction is broadcast:
- You will spend: <amount token>
- You will receive at least: <amount token>
- Estimated network fee: <amount native token>
- Additional approval change: <description or none>Rules
- Use "at least" wording when outcome depends on slippage.
- If output token amount is uncertain, explicitly say so.
- If simulation reverted, do not provide optimistic receive amount.
- Never present simulation as guaranteed final execution.
Revert wording template
Simulation failed before execution.
- Likely failure point: <function/step>
- Observed error: <decoded message or raw revert data>
- Action: do_not_execute until issue is resolved.