Sample on example input
DeFi Swap, MEV & Liquidation Risk Composite Suite
Composite 6-check DeFi execution audit chaining AMM slippage, MEV sandwich risk, flashloan breakeven, oracle staleness, liquidation distance, and lending health factor.
What you get
- Executive grade D, posture score 16/100 on this example input
- 6 sub-check results; failed on this example:
oracle_staleness- Prioritized remediation checklist and disclaimer
Example input
{
"trade_usd": "25000",
"price_age_seconds": "7200"
}
Parameters this suite reads
All parameters this suite reads. Pass your real values as query or JSON parameters; omitted ones use defaults. The suite evaluates the values you pass; it does not crawl or scan live URLs.
reserve_in, reserve_out, amount_in, fee_bps, trade_usd, pool_tvl_usd, slippage_bps, flashloan_fee_bps, dex_a_fee_bps, dex_b_fee_bps, notional_usd, gas_usd, price_age_seconds, heartbeat_seconds, l2_sequencer_up, collateral_units, current_price_usd, debt_usd, liquidation_threshold_pct, collateral_usd
How to call it (0.05 USDC)
x402: Returns HTTP 402 with a base64 PAYMENT-REQUIRED header (x402 v2, USDC on Base, eip155:8453). Use any x402 v2 client (it signs an EIP-3009 authorization and retries with PAYMENT-SIGNATURE). Fallback: send the USDC yourself, then retry with header X-PAYMENT-TX: <tx hash>.
curl -i 'https://bot-bazaar.fly.dev/v1/x402/suite/defi-execution-risk?trade_usd=25000&price_age_seconds=7200'
Prepaid key:
curl -s -H 'X-Bazaar-Key: bz_live_YOUR_KEY' 'https://bot-bazaar.fly.dev/v1/x402/suite/defi-execution-risk?trade_usd=25000&price_age_seconds=7200'
MCP (streamable HTTP, tool suite_defi_execution_risk):
curl -s https://bot-bazaar.fly.dev/mcp -H 'content-type: application/json' -H 'X-Bazaar-Key: bz_live_YOUR_KEY' -d '{"jsonrpc": "2.0", "id": 1, "method": "tools/call", "params": {"name": "suite_defi_execution_risk", "arguments": {"trade_usd": "25000", "price_age_seconds": "7200"}}}'OpenAI-compatible (0.01 USDC per chat call)
The chat-completions router picks the suite from keywords in the prompt and is billed at the chat-completions price.
curl -s https://bot-bazaar.fly.dev/v1/x402/chat/completions -H 'content-type: application/json' -H 'Authorization: Bearer bz_live_YOUR_KEY' -d '{"model": "bazaar-suite-pro-v1", "messages": [{"role": "user", "content": "Run the DeFi execution risk suite"}], "trade_usd": "25000", "price_age_seconds": "7200"}'
Full sample report (JSON)
{
"suite": "defi-execution-risk",
"tool": "suite/defi-execution-risk",
"title": "DeFi Execution, Slippage & Liquidation Risk Suite",
"valid": true,
"composite_risk_score": 84,
"composite_posture_score": 16,
"executive_grade": "D",
"sub_check_count": 6,
"sub_checks": {
"amm_swap_quote": {
"valid": true,
"amount_in": 10000.0,
"amount_out": 9871.580344,
"fee_bps": 30.0,
"spot_price": 1.0,
"effective_price": 0.987158,
"price_impact_pct": 1.2842
},
"mev_sandwich": {
"valid": true,
"trade_pct_of_tvl": 5.0,
"slippage_bps": 100.0,
"mev_risk_score": 82,
"risk_tier": "high"
},
"flashloan_breakeven": {
"valid": true,
"total_fee_bps": 40.01,
"min_gross_profit_usd": 200.05
},
"oracle_staleness": {
"valid": true,
"price_age_seconds": 7200,
"heartbeat_seconds": 3600,
"l2_sequencer_up": true,
"oracle_fresh_and_valid": false
},
"liquidation_distance": {
"valid": true,
"current_price_usd": 3000.0,
"liquidation_price_usd": 2060.61,
"drawdown_to_liquidation_pct": 31.31
},
"lending_health": {
"valid": true,
"collateral_usd": 15000.0,
"debt_usd": 8000.0,
"health_factor": 1.5469,
"safety_buffer_pct": 35.35,
"status": "healthy"
}
},
"passed_sub_checks": [],
"failed_sub_checks": [
"oracle_staleness"
],
"informational_sub_checks": [
"amm_swap_quote",
"mev_sandwich",
"flashloan_breakeven",
"liquidation_distance",
"lending_health"
],
"prioritized_remediation_checklist": [
"Keep single-swap notional below 1.5% of pool TVL or split across TWAP intervals.",
"Enforce L2 sequencer uptime and Chainlink heartbeat staleness checks before liquidation or borrow actions.",
"Maintain lending Health Factor >= 1.50 to preserve >30% collateral drawdown buffer."
],
"remediation_note": "General hardening checklist for this suite; failed_sub_checks lists the findings specific to the input you passed.",
"input_note": "This suite evaluates the configuration values passed as query or JSON parameters; it does not crawl or scan live URLs. Omitted parameters fall back to the documented defaults.",
"recommended_max_slippage_bps": 50,
"disclaimer": "Automated composite analytical & schema audit only \u2014 not legal advice, not financial or investment advice, not tax advice, and not a formal third-party security certification.",
"generated_at": 1793508454
}