Project Description
BUDGET; 150 CAD, OUTSOURCING, SEE CODE ATTACHED
I’m looking for an experienced blockchain developer to review, debug, and fully fix an existing codebase involving advanced DeFi mechanisms, including flash loans and a custom “flash bets” system integrated with ultra-fast, short-resolution markets.
Project Context
This system is designed to interact with instant-resolution betting markets and prediction markets, where outcomes resolve in seconds. The strategy focuses on arbitrage opportunities where pricing inefficiencies allow for risk-minimized profit when executed correctly and atomically.
Important: The current system is not functioning correctly, and part of this job is to identify why (especially flash loans failing) and ensure everything works end-to-end in real conditions.
Scope of Work
Review the entire codebase for bugs, vulnerabilities, and inefficiencies
Debug and fix critical issues preventing execution, especially:
Flash loan failures (reverts, incorrect callbacks, repayment issues)
Flash bets not executing or resolving properly
Transaction flow breaking before completion
Ensure all core features function correctly:
Flash loan execution (borrow → execute → repay within one transaction)
Flash bets execution with strict requirement that bets are placed and resolved within the same transaction (atomic execution)
Flash Loan Logic (Critical Fix Required)
Diagnose and fix why flash loans are currently failing
Ensure proper integration with liquidity providers (e.g., correct interfaces, callbacks, approvals)
Implement and/or refine logic to:
Analyze wallet/contract balance prior to execution
Determine and request the maximum viable flash loan size based on that balance
Ensure repayment (including fees) is always satisfied within the same transaction
Ensure:
Capital is sourced from external liquidity pools/providers (deep liquidity)
Strategy does not rely on personal funds beyond gas/fees
Routing prioritizes high-liquidity pools to support larger position sizes
Arbitrage Engine (Core Requirement)
Implement, validate, and debug logic that:
Detects arbitrage opportunities using implied probability calculations
Confirms opportunities only when:
Combined implied probability of all outcomes is < 100%
Example logic to support:
Convert odds to implied probability:
Positive odds: 100 / (odds + 100)
Negative odds: |odds| / (|odds| + 100)
Identify arbitrage when total probability < 100%
Dynamically calculate bet sizing across outcomes to:
Balance returns across all possible outcomes
Target consistent profit regardless of result (subject to execution conditions)
Ensure:
Bet sizing integrates with flash loan amount
Entire arbitrage cycle (loan → bets → settlement → repayment) executes atomically
Flash Bets + Market Execution
Debug and ensure flash bets:
Actually trigger and execute reliably
Resolve within the same transaction where possible
Do not fail due to timing, state changes, or external calls
Must support:
In-play instant markets
Flash markets (micro-events)
Prediction market pre-resolution opportunities
Optimization & Risk Handling
Optimize for:
Execution speed
Gas efficiency
Reliable transaction inclusion
Identify and mitigate:
Slippage risks
Liquidity constraints
Oracle delays or inconsistencies
MEV risks (frontrunning, sandwiching)
Critical Requirements
All logic must execute atomically in a single transaction
Flash loans must be:
Fully functional (no silent failures or partial execution)
Properly repaid within the same transaction
Sized dynamically using wallet balance + liquidity availability
System must:
Connect to deep liquidity providers
Maximize usable capital per trade
Execute arbitrage opportunities with balanced outcomes
Deliverables
Fully working, debugged, tested, and optimized code
Clear fix for why flash loans were failing and how it was resolved
Verified atomic execution of:
Flash loans
Flash bets
Arbitrage strategy
Working arbitrage detection + bet sizing logic
Summary of issues found and fixes applied
Recommendations for further improvements
To Apply
Please include:
Experience debugging broken smart contract systems (not just building new ones)
Experience with flash loan integrations and troubleshooting failures
Examples of arbitrage bots or DeFi execution systems
Your approach to identifying and fixing execution issues
Timeline and rate