omni_flash_loan_arbitrage_net
Calculate net profit for DeFi flash loan arbitrage by subtracting flash loan protocol fees and execution gas from gross DEX price spread revenue.
Instructions
DeFi Flash Loan Arbitrage Spread vs Net Profitability Calculator. Calculate uncollateralized flash loan protocol fees (Aave 0.05%, Balancer 0%), DEX swap gas, routing slippage, and net transaction profit. Discipline: CRYPTO. Governing mathematical model / formula: Net Profit = Arbitrage Spread ($) - Flash Loan Fee ($) - Total Gas Fees ($).
USAGE GUIDELINES:
WHEN TO USE: Invoke for deterministic calculation of net_atomic_profit_usd (Net Realized Profit), gross_arbitrage_revenue (Gross Arbitrage Revenue), flash_loan_fee_cost (Flash Loan Fee Paid to Protocol), execution_status (Transaction Viability) using flash_borrow_amount_usd (Flash Loan Borrowed Capital ($)), gross_arbitrage_spread_pct (Gross Price Spread Across DEXs (%) in %), flash_protocol_fee_pct (Flash Loan Protocol Fee (%) in %), total_execution_gas_usd (Estimated Atomic Gas Cost ($ USD)). Guarantees exact machine floating-point precision, eliminating LLM arithmetic mistakes and formula hallucinations.
WHEN NOT TO USE: Do not use for qualitative evaluations or unquantified reasoning. All input parameters must be valid numerical values.
DISAMBIGUATION & BOUNDARIES:
Use this dedicated specialist tool for 'DeFi Flash Loan Arbitrage Spread vs Net Profitability Calculator' rather than generic dispatchers like omni_universal_query.
For multi-calculation chained jobs, use 'omni_batch_calculate'.
To inspect schema fields, see 'omni_describe_solver'.
BEHAVIOR & SAFETY:
Pure deterministic computation with machine floating-point precision.
Read-only, idempotent, and stateless. Zero side effects or persistent state mutations.
Input validation: All arguments are validated against physical and domain bounds. Out-of-bounds inputs return a safe diagnostic error status without throwing runtime exceptions.
RETURNS:
Structured JSON object containing:
status (string): "success" on valid execution or "error" if validation fails
calculator (string): "flash-loan-arbitrage-net"
category (string): "crypto"
name (string): "DeFi Flash Loan Arbitrage Spread vs Net Profitability Calculator"
formula (string): Governing mathematical formula string
inputs (object): Echoed input parameter dictionary with applied defaults
metrics (object): Dictionary of computed outputs:
metrics.net_atomic_profit_usd (Net Realized Profit): Formatted display string (e.g. '$915.00')
metrics.gross_arbitrage_revenue (Gross Arbitrage Revenue): Formatted display string (e.g. '$1,125.00')
metrics.flash_loan_fee_cost (Flash Loan Fee Paid to Protocol): Formatted display string (e.g. '$125.00 (0.05%)')
metrics.execution_status (Transaction Viability): Formatted display string (e.g. 'Highly Profitable Arbitrage')
execution_time_ms (number): Latency in milliseconds.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "omni_flash_loan_arbitrage_net"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| flash_protocol_fee_pct | No | Flash Loan Protocol Fee (%) (%). Aave = 0.05% (5 bps), Balancer = 0%, Uniswap v3 = 0.05%. Default: 0.05. Min: 0. Max: 0.1. | |
| flash_borrow_amount_usd | No | Flash Loan Borrowed Capital ($). Principal borrowed in single transaction block. Default: 250000. Min: 10000. Max: 10000000. | |
| total_execution_gas_usd | No | Estimated Atomic Gas Cost ($ USD). Complex multi-DEX swap execution gas. Default: 85. Min: 5. Max: 1000. | |
| gross_arbitrage_spread_pct | No | Gross Price Spread Across DEXs (%) (%). Price difference between Pool A (buy) and Pool B (sell). Default: 0.45. Min: 0.05. Max: 5. |