Skill
mantle-defi-operator
When to use
What it does
by mantle-xyzΒ·v1.0.0
Install
git clone https://github.com/mantle-xyz/mantle-skillsCoordinate deterministic pre-execution planning for Mantle DeFi intents. This skill should orchestrate verified address lookup, preflight evidence, and execution handoff steps instead of duplicating specialized address, risk, or portfolio analysis.
ALWAYS use mantle-cli commands to build unsigned transactions. The CLI produces correct calldata with verified addresses and ABI encoding. Do NOT:
from field to unsigned transactions β this breaks Privy and other signersBefore building any transaction, consult the Capability Catalog via CLI for the authoritative list of available tools, their read/write nature, wallet requirements, and call ordering:
mantle-cli catalog list --json # all capabilities
mantle-cli catalog list --category execute --json # only tx-building commands
mantle-cli catalog search "swap" --json # keyword search
mantle-cli catalog show mantle_buildSwap --json # full details + CLI command template
Each entry includes:
category: query β read-only, no state change, no wallet needed for mostcategory: analyze β computed insights (APR, risk, recommendations), read-onlycategory: execute β builds unsigned transactions, requires wallet addressworkflow_before β tells you which tools to call before a given toolcli_command β the exact CLI command template with placeholders# Swap operations
mantle-cli swap build-swap --provider <dex> --in <token> --out <token> --amount <n> --recipient <addr> --json
mantle-cli approve --token <token> --spender <router> --amount <n> --json
mantle-cli swap wrap-mnt --amount <n> --json
mantle-cli swap unwrap-mnt --amount <n> --json
mantle-cli swap pairs --json
# Aave V3 lending
mantle-cli aave supply --asset <token> --amount <n> --on-behalf-of <addr> --json
mantle-cli aave set-collateral --asset <token> [--user <addr>] [--disable] --json # enable/disable collateral + diagnostics
mantle-cli aave borrow --asset <token> --amount <n> --on-behalf-of <addr> --json
mantle-cli aave repay --asset <token> --amount <n|max> --on-behalf-of <addr> --json
mantle-cli aave withdraw --asset <token> --amount <n|max> --to <addr> --json
mantle-cli aave positions --user <addr> --json # positions + per-reserve collateral_enabled
mantle-cli aave markets --json
# Liquidity provision
mantle-cli lp top-pools [--sort-by volume|apr|tvl] [--limit <n>] [--provider <dex>] [--min-tvl <usd>] --json # BEST STARTING POINT β discover top LP opportunities across ALL DEXes, no token pair needed
mantle-cli lp find-pools --token-a <t> --token-b <t> --json # Discover all pools for a SPECIFIC token pair
mantle-cli lp pool-state <pool-or-tokens> --json
mantle-cli lp suggest-ticks <pool-or-tokens> --json
mantle-cli lp analyze <pool-or-tokens> [--investment-usd <n>] --json # Deep pool analysis: APR, risk, range comparison
mantle-cli lp positions --owner <addr> --json
mantle-cli lp add --provider <dex> --token-a <t> --token-b <t> (--amount-a <n> --amount-b <n> | --amount-usd <n>) --recipient <addr> --json
mantle-cli lp remove --provider <dex> --recipient <addr> --token-id <id> (--liquidity <n> | --percentage <1-100>) --json
mantle-cli lp collect-fees --provider <p> --token-id <id> --recipient <addr> --json
# Read operations (no signing needed)
mantle-cli defi swap-quote --in <token> --out <token> --amount <n> --provider best --json
mantle-cli defi lending-markets --json
mantle-cli account balance <addr> --tokens USDC,USDT0 --json
All --json build outputs contain TWO views of the transaction:
unsigned_tx β signer-agnostic view (chainId/nonce as integers, no from). Use for logging, diffing, and non-Privy signers (viem, ethers).signable_tx β Privy-ready view (chainId/nonce/value as hex strings, from pre-filled). Pass this verbatim to Privy's sign evm-transaction --transaction parameter (e.g. jq -c .signable_tx <file>).Pick the right object for your signer; never hand-convert between them. If signable_tx is missing (older CLI), STOP β do not manually transform unsigned_tx.
mantle-address-registry-navigator when the task is only address lookup, whitelist validation, or anti-phishing review.$mantle-risk-evaluator when the task is only to return a pass / warn / block preflight verdict.$mantle-portfolio-analyst when the task is only balance coverage, allowance exposure, or spender-risk review.discovery_only mode when the user is exploring venues and has not asked for execution-ready planning.discovery_only
handoff_available to no.compare_only
risk_report_ref / portfolio_report_ref empty or explicitly missing when evidence is not available.handoff_available to no.execution_ready
address_resolution_ref.risk_report_ref unless explicitly unnecessary for the operation.portfolio_report_ref when allowance scope or balance coverage matters, or explain why it is unnecessary.handoff_available: yes.swap, add_liquidity, remove_liquidity, supply, borrow, repay, withdraw, set_collateral, or compound flowreferences/lending-sop.md ("supply is NOT a token transfer").references/defi-execution-guardrails.md.mantle-address-registry-navigator using the required registry key or protocol role for the requested action.execution_ready: verified addresses plus enough quote/risk evidence to produce a handoffcompare_only: venue comparison is possible, but execution gating is incomplete; also use this mode when the user names an unverified protocol -- list it under discovery_only in Protocol Selection, set readiness: blocked, and recommend verified curated alternativesdiscovery_only: high-level ecosystem exploration without execution readiness (no specific venue comparison requested)references/curated-defaults.yaml; carry forward each default's freshness metadata and rationale, and if the user names another protocol, keep it compare_only until its contracts are verified.references/protocol-selection-policy.md:
mantle-address-registry-navigator$mantle-risk-evaluator when a state-changing path is being prepared$mantle-portfolio-analyst when approval scope or wallet coverage mattersplanning_mode using the Quick Checklist:
recommendedalso_viablediscovery_onlyDefiLlama only for broader ecosystem discovery, never as contract truthexecution_ready planning:
references/swap-sop.mdreferences/liquidity-sop.mdreferences/lending-sop.mdapprove step.β ABSOLUTE PROHIBITION β MANUAL TRANSACTION CONSTRUCTION β
You MUST NEVER, under ANY circumstances, do ANY of the following:
unsigned_tx or signable_tx objects by hand instead of using mantle-cliunsigned_tx fields into signable_tx shape (chainId/nonce intβhex, appending from) β always use the signable_tx object the CLI already emittedsign evm-transaction, eth_sendRawTransaction, or any direct broadcast tool with manually constructed dataThis prohibition has NO exceptions. If you believe the CLI doesn't support an operation, you are WRONG β check the catalog first (mantle-cli catalog list --json). If the operation truly doesn't exist in the catalog, use the safe encoding utilities (mantle-cli utils encode-call, mantle-cli utils parse-units). Do NOT use Python/JS.
Token transfers are NOT supported by this skill. mantle-cli and mantle-mcp have NO transfer commands β transfer send-native / transfer send-token / mantle_buildTransferNative / mantle_buildTransferToken have been deliberately removed. If a user asks to move tokens between wallets, REFUSE and tell them transfers are out of scope for this skill.
Safe encoding utilities (ESCAPE HATCH for truly unsupported operations):
mantle-cli utils parse-units --amount <decimal> --decimals <n> --json # Step 1: Decimal β raw/wei
mantle-cli utils encode-call --abi '<sig>' --function <name> --args '<json>' --json # Step 2: ABI-encode β calldata
mantle-cli utils build-tx --to <addr> --data <hex> [--value <mnt>] --json # Step 3: Calldata β unsigned_tx
Real incident: Agent bypassed mantle-cli approve for a USDC allowance, manually computed approve(address,uint256) calldata with Python, and produced incorrect encoding. The CLI command would have handled this correctly and safely.
unsigned_tx, use that result β do not "verify" or "retry" by calling the builder again.idempotency_key (deterministic hash scoped to the signing wallet). ALWAYS pass sender=<signing_wallet_address> when calling build tools β this ensures different wallets can independently execute identical payloads without false deduplication. If you accidentally call a builder twice from the same wallet and get the same idempotency_key, the external signer MUST execute only ONE of them.mantle-cli chain tx --hash <hash>) before proceeding to the next step. NEVER submit the next transaction until the previous one is confirmed on-chain.mantle-cli commands with --json to build unsigned transactions. For standard operations (swap, LP, Aave, approve), use the dedicated commands. For unsupported operations, use the utils pipeline: utils parse-units β utils encode-call β utils build-tx. NEVER use Python/JS/manual hex to construct calldata.amount * 10**decimals. Use mantle-cli utils parse-units for decimalβraw conversion. The CLI uses parseUnits() for deterministic decimal-to-wei conversion.from FIELD HANDLING: Never add from to unsigned_tx. For Privy, do NOT manually append from to unsigned_tx β instead use the signable_tx object the CLI already emits (it has from pre-filled plus hex-encoded chainId/nonce). Hand-appending from + intβhex conversion was the exact failure mode signable_tx was introduced to replace.--in and --out β the CLI handles the routing.0x201E...) and USDT0 (LayerZero OFT, 0x779D...). Both have deep DEX liquidity. Only USDT0 works on Aave V3. If a user holds USDT and wants to use Aave, guide them to swap USDT β USDT0 first via Merchant Moe (USDT/USDT0 pool, bin_step=1).mantle-cli lp find-pools --json which queries factory contracts on-chain. When the user asks for the BEST pools or LP recommendations WITHOUT specifying tokens, use mantle-cli lp top-pools --json first to discover top opportunities by volume/APR/TVL across ALL DEXes (including meme tokens, xStocks, and newly launched pools).mantle-cli defi analyze-pool --json to get fee APR, multi-range comparison, risk scoring, and investment projections. Do NOT add liquidity based on guesswork about which range or how much to invest.--amount-usd instead of manually computing token amounts. The CLI reads pool state and computes the correct token ratio for the target tick range. Do NOT blindly split 50/50.--percentage 50 instead of manually reading and computing liquidity amounts. The CLI reads the position on-chain and calculates the exact liquidity to remove.0xdEAddEaDdeadDEadDEADDEAddEADDEAddead1111 with ~125K ETH supply and pools on all DEXes. Do NOT claim WETH doesn't exist. MNT being the gas token does not mean ETH is absent β ETH is bridged from L1.discovery_only, do not provide router addresses, approval steps, calldata, or execution sequencing.compare_only, verified registry keys or contract roles may be named, but executable calldata and approval instructions stay out until execution evidence is complete.warn/high-risk intents without explicit user confirmation.blocked.MANDATORY: Every response MUST use this exact structured template. Do not use prose or free-form text instead of this template. Fill every field; use "not applicable in {planning_mode} mode" for fields that do not apply to the current mode. In discovery_only mode, fields under Execution Handoff and Post-Execution Verification Plan must all say "not applicable in discovery_only mode."
Mantle DeFi Pre-Execution Report
- operation_type:
- planning_mode: discovery_only | compare_only | execution_ready
- environment:
- intent_summary:
- analyzed_at_utc:
Preparation
- supporting_skills_used:
- address_resolution_ref:
- risk_report_ref:
- portfolio_report_ref:
- curated_defaults_considered:
- quote_source:
- expected_output_min:
- allowance_status:
- approval_plan:
Protocol Selection
- recommended:
- also_viable:
- discovery_only:
- rationale:
- data_freshness:
- confidence: high | medium | low
Execution Handoff
- recommended_calls:
- calldata_inputs:
- registry_key:
- sequencing_notes:
- batched_execution_possible: yes | no
- handoff_available: yes | no
Post-Execution Verification Plan
- balances_to_recheck:
- allowances_to_recheck:
- slippage_checks:
- anomalies_to_watch:
Status
- preflight_verdict: pass | warn | block | unknown
- readiness: ready | blocked | needs_input
- blocking_issues:
- next_action:
references/defi-execution-guardrails.mdreferences/swap-sop.mdreferences/liquidity-sop.mdreferences/lending-sop.mdreferences/curated-defaults.yamlreferences/protocol-selection-policy.md