Skip to main content
    Education only. Not financial, tax or legal advice. We never ask for wallet keys or seed phrases.Canadian rules dated October 2026
    Advanced, educationalRuns in your browser

    Flash-loan arithmetic: why most spreads vanish

    A flash loan lends funds that must be borrowed and repaid within a single blockchain transaction. This calculator checks whether a price spread survives the flash-loan fee, swap fees and gas, and shows the spread needed to break even, which is usually larger than the spreads that appear on screen.

    Mitey the yeti talking things through with an older yeti holding a notebook, with a chain block
    Mitey: Everything happens in one block or not at all. The fees still add up.

    Hypothetical transaction

    Net result before price impact
    −$290.00

    The gap needs to exceed 0.69% just to cover fees and gas — before price impact, competition and failed transactions.

    Gross gap vs the costs$400Gross gap−$50Flash fee−$600Swap fees−$40Gas−$290Net

    Estimates from the inputs you enter, calculated in your browser; nothing is sent anywhere unless you choose to email results below. Example values are illustrative, not quotes or forecasts. Not financial advice, and not a recommendation of any protocol, token or platform. Formulas checked 2026-10-30.

    How to use it

    1. Enter the amount borrowed, in CAD.
    2. Enter the price spread you observe, as a percentage.
    3. Enter the flash-loan fee, the swap fee per trade and the number of swaps.
    4. Enter the gas cost of the transaction in CAD.
    5. Read the net result and the breakeven spread.

    What makes a flash loan different

    An ordinary loan needs collateral because the borrower might not repay. A flash loan needs none because the loan, whatever is done with the funds, and the repayment all happen inside one atomic transaction. If the repayment plus fee is not there at the end, the whole transaction reverts as if it never happened, and the only cost is the gas spent on the failed attempt.

    Flash loans are used for arbitrage, for refinancing collateral from one position to another and for liquidations. They have also been used in attacks that manipulate thinly traded prices; the defence against those is sound price-feed design, covered in oracle risk. This calculator covers only the fee arithmetic.

    Worked example

    Illustrative inputs: borrow $100,000, observe a 0.4% spread between two pools, pay a 0.05% flash-loan fee and two swaps at 0.3% each, and spend $40 on gas.

    The swap fees alone come to 0.6% of the amount, more than the spread. Borrowing ten times as much does not help: at $1,000,000 the result is −$2,540 and the breakeven spread is still about 0.65%, because every cost except gas grows with size.

    Illustrative inputs only.
    ItemCAD
    Gross spread (0.4% of $100,000)+$400.00
    Flash-loan fee (0.05%)−$50.00
    Swap fees (2 × 0.3%)−$600.00
    Gas−$40.00
    Net result−$290.00
    Breakeven spread0.69%

    Why visible spreads usually disappear

    Most apparent spreads are smaller than the round-trip cost of fees. The few that are not do not last: automated traders scan for them continuously and compete to be included first in a block, often by paying higher priority fees, which raises gas for everyone in the race.

    The calculator also treats the quoted spread as if it could be captured on the full amount. In reality, trading a large amount through a pool moves its price against you, so the spread shrinks as size grows. The MEV calculator shows how fast price impact grows in a constant-product pool.

    Atomic means all or nothing, not risk-freeAtomic execution protects the lender, not the person submitting the transaction. Failed attempts still cost gas, and the contracts written to run these transactions can contain bugs. See smart contract risk.

    What the calculator leaves out

    It does not model price impact, competing transactions, priority fees, failure rates, or the cost of writing and reviewing contract code. It charges each swap on the full borrowed amount. Treat a positive result as a reason to check more inputs, not as a profit.

    Fee levels differ between lending protocols and can be changed by governance decisions; the inputs here are illustrative only.

    For most people, the practical lesson concerns the protocols they deposit into rather than flash loans themselves. Because anyone can borrow a very large amount for the length of one transaction, a protocol that values assets from a single pool's momentary price can be pushed off balance within that transaction. When assessing where to deposit, look at how a protocol sources its prices; oracle risk explains what to check.

    Canadian context

    CRA weighs how often you transact, how long you hold, your knowledge of crypto markets and the time you spend when deciding whether gains are business income. Repeated arbitrage of this kind is more likely to be treated as business income than as capital gains; see capital vs business income.

    Even one transaction can contain several trades of one crypto-asset for another, each of which can be a disposition with its own CAD value to record.

    Questions people ask

    Why is the illustrative result negative?

    Two swaps at 0.3% cost 0.6% of the amount, more than the 0.4% spread, before the flash-loan fee and gas.

    Does borrowing more help?

    Barely. Fees grow with the amount, so only the fixed gas is diluted; in the example the breakeven spread falls from 0.69% to about 0.65%.

    What happens if the loan is not repaid?

    The whole transaction reverts and nothing changes on-chain, except that the gas spent on the attempt is lost.

    Are flash loans only used for attacks?

    No. They are also used for arbitrage, collateral swaps and liquidations. Protocols defend against manipulation mainly through robust price feeds.

    How would profits be taxed in Canada?

    Frequent, short-term trading activity is more likely to be business income under CRA's factors. Get advice for your situation.

    Save Your Results

    Email yourself these calculations or get notified about updates to this calculator.

    We respect your privacy. View our privacy policy.

    Sources and dates

    1. Canada Revenue Agency — Reporting income from crypto-asset transactionsDate modified 2025-12-02; checked 2026-10-30
    2. Canadian Securities Administrators — Crypto Assets (investor tools)Date modified 2025-10-22; checked 2026-10-30