omni_yield_farming_reinvest_frequency
Calculate the optimal DeFi yield farming reinvestment frequency to balance compound APY against harvest gas fees, returning net APY, annual gas cost, and compounding boost.
Instructions
Optimal Compounding Frequency for DeFi Yield Farming Calculator. Calculate the mathematically optimal reinvestment frequency that maximizes compound APY while minimizing transaction gas harvesting fees. Discipline: CRYPTO. Governing mathematical model / formula: Optimal Days Between Harvests = √[(2 · Gas Cost in USD) / (Principal · Daily APR · Daily Yield)].
USAGE GUIDELINES:
WHEN TO USE: Invoke for deterministic calculation of optimal_reinvest_interval (Optimal Compounding Interval), net_apy_after_gas (Net Effective APY (After Gas)), annual_harvest_gas_cost (Total Annual Gas Spend), compounding_boost_usd (Net Dollar Value Added by Compounding) using farming_principal_usd (Farmed Capital Value ($ USD)), nominal_farm_apr_pct (Nominal Stated Farm APR (%) in %), harvest_gas_cost_usd (Harvest & Re-stake Gas Fee ($)). 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 'Optimal Compounding Frequency for DeFi Yield Farming 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): "yield-farming-reinvest-frequency"
category (string): "crypto"
name (string): "Optimal Compounding Frequency for DeFi Yield Farming Calculator"
formula (string): Governing mathematical formula string
inputs (object): Echoed input parameter dictionary with applied defaults
metrics (object): Dictionary of computed outputs:
metrics.optimal_reinvest_interval (Optimal Compounding Interval): Formatted display string (e.g. 'Every 4.8 Days')
metrics.net_apy_after_gas (Net Effective APY (After Gas)): Formatted display string (e.g. '53.8% APY')
metrics.annual_harvest_gas_cost (Total Annual Gas Spend): Formatted display string (e.g. '$494.00 / yr')
metrics.compounding_boost_usd (Net Dollar Value Added by Compounding): Formatted display string (e.g. '+$1,320.00 / yr')
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_yield_farming_reinvest_frequency"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| harvest_gas_cost_usd | No | Harvest & Re-stake Gas Fee ($). All-in transaction cost to claim, swap, and restake. Default: 6.5. Min: 0.01. Max: 100. | |
| nominal_farm_apr_pct | No | Nominal Stated Farm APR (%) (%). Uncompounded reward token emission APR. Default: 45. Min: 5. Max: 500. | |
| farming_principal_usd | No | Farmed Capital Value ($ USD). Principal deposited in liquidity farm. Default: 15000. Min: 250. Max: 1000000. |