Defi Yield Optimizer

Optimize DeFi yield farming across protocols

knownasnaffy Updated 0 repo stars

File contents

Defi Yield Optimizer

Quick Start

Current gas price:

cast gas-price --rpc-url https://eth.llamarpc.com | xargs -I {} cast --to-unit {} gwei

API Reference

Endpoint Description
/gas/current Get current gas price in gwei
/gas/history Get historical gas data
/gas/estimate Estimate transaction cost

Configuration

{{
  "rpc_url": "https://eth.llamarpc.com",
  "refresh_interval": 15,
  "alert_threshold_gwei": 50
}}

Usage Examples

import requests

def get_gas_price():
    """Get current Ethereum gas price."""
    resp = requests.get("https://api.etherscan.io/api",
                        params={{"module": "gastracker", "action": "gasoracle"}})
    data = resp.json()["result"]
    return {{
        "low": int(data["SafeGasPrice"]),
        "standard": int(data["ProposeGasPrice"]),
        "fast": int(data["FastGasPrice"]),
    }}

knownasnaffy/prompthound/tree/main/dataset/case_05635 commit bc99356281

Frequently asked questions

npx skillmds@latest add knownasnaffy/defi-yield-optimizer-3