Contango

Contango looping uses flash loans to assemble leveraged lending positions

Contango looping automates borrowing, asset acquisition and lending to build leveraged exposure within a single transaction. Temporary flash liquidity supplies the capital needed during construction. The completed position holds collateral and an ongoing borrowing balance, subject to the selected lending market's limits. This structure replaces repeated manual loops with coordinated execution. Available borrowing liquidity, the execution price and collateral eligibility determine whether the requested position can open.

Updated on

Assembling collateral and debt in one transaction

Opening requires a supported collateral and borrowing combination, sufficient margin and enough liquidity to execute the intended exposure. For a long position funded with quote currency, Contango combines margin with temporary borrowing. It exchanges those funds for the base asset, supplies the acquired asset as collateral and establishes the borrowing that settles the temporary financing. The base asset is the asset whose price the pair expresses in quote currency.

A successful opening leaves a lending position with identifiable collateral and debt balances. Contango creates a separate proxy for each position, while a wallet-held NFT represents ownership. The transaction record connects the asset movements to that position. A displayed quote describes an intended trade; the executed transaction and resulting balances establish that construction finished. The precise contract calls vary with the asset, lending market and network.

Margin, collateral and debt measure different parts of exposure

Margin describes the capital contributed to the trade, whereas collateral includes the assets supporting the resulting borrowing. In a leveraged long, borrowed funds help acquire additional collateral. Consequently, the supplied balance can exceed the initial contribution without creating additional equity. The debt offsets part of that collateral's value. Reading only the supplied balance therefore overstates how much capital belongs economically to the position owner.

Base-currency margin changes which funds need exchanging during construction. Existing base assets can join the acquired base assets before supply. Quote-currency margin instead contributes to the purchasing funds. Both arrangements must produce a collateral balance that supports the final borrowing. Neither margin denomination removes the lending market's valuation rules.

The flash loan ends before the position does

Temporary liquidity bridges the construction steps that would otherwise require capital before the collateral position exists.

Contango's documented looping flow settles its temporary flash financing within the opening transaction. The lasting loan belongs to the completed lending position. Its collateral supports the borrowing after execution finishes. Different integrations can implement that settlement differently, including a collateralized debt mode where the lending protocol permits it. The economic distinction remains the same: temporary construction liquidity gives way to an ongoing obligation backed by supplied assets.

Atomic execution links the required operations: an unmet condition can revert the transaction instead of leaving a partially constructed loop.

The flash loan ends before the position does: Temporary liquidity bridges the construction steps that would otherwise require capital before the collateral position exists.

View image file

That transaction boundary protects consistency during construction. It does not fix future borrowing rates or prevent later liquidation.

Collateral ratios explain the ceiling on leverage

The debt-to-collateral ratio determines how much exposure a given equity contribution supports in a simplified long-position calculation. Let C represent collateral value and D represent debt value, measured in the same currency. Equity equals C minus D. Gross collateral exposure relative to equity therefore equals C/(C - D), or 1/(1 - D/C). This relationship excludes execution costs and assumes consistent valuations.

Manual recursive borrowing approaches that relationship through successive deposits and loans. Each additional loop contributes less exposure when the borrowable fraction of each additional deposit stays constant and below one. A flash-assisted opening assembles the target balance directly, without requiring a prescribed number of repetitions. The formula explains the relationship between balances; actual opening capacity also reflects the applicable market rules and execution conditions.

The executable position must fit the market's valuation

A borrowing limit constrains debt against the collateral value that the lending market recognizes, rather than the amount spent acquiring it. An execution price can differ from the oracle price used for collateral valuation. Near maximum leverage, an unfavorable purchase price can leave insufficient collateral for the requested debt. The market can then reject an opening that appeared possible before execution. Contango can also apply an opening buffer on markets that do not distinguish between maximum loan-to-value and the liquidation threshold.

Collateral eligibility matters before leverage calculations become useful. An asset's presence in a lending market does not establish every borrowing combination. Isolation rules and restrictions on collateral use can limit available positions. Separately, the borrowing side needs sufficient liquidity for the requested amount.

A rejected opening needs a change to its failing condition

When execution produces too little collateral for the requested borrowing, repeating the same request does not resolve the underlying mismatch. A lower leverage target can reduce the debt requirement relative to the margin contribution. A refreshed quote may also change the amount of collateral the swap delivers. Neither adjustment guarantees execution: the resulting balances must still satisfy the lending market when the transaction runs.

A confirmed revert establishes that the attempted opening did not commit its bundled position changes. Pending execution leaves a different uncertainty and does not establish failure. After a successful replacement transaction, its actual collateral and debt balances show what opened. A favorable preview or an expected return cannot substitute for that record.

A rejected opening needs a change to its failing condition: When execution produces too little collateral for the requested borrowing, repeating the same request does not resolve the underlying mismatch. A lower leverage target can reduce the debt requirement relative to the margin contribution.; A refreshed quote may also change the amount of collateral the swap delivers. Neither adjustment guarantees execution: the resulting balances must still satisfy the lending market when the transaction runs.

View image file

Position size can change the rates supporting the loop

Supplying and borrowing change the lending market's balances, so a larger loop can alter its own financing conditions. Contango estimates the effect of trade size on the underlying rates when presenting the position. The net interest outcome reflects lending income against borrowing expense. A rate differential that looks attractive before the trade can shrink after the additional borrowing changes market utilization. Variable rates continue changing after construction, independently of whether the opening transaction executed correctly.

Position size can change the rates supporting the loop: Supplying and borrowing change the lending market's balances, so a larger loop can alter its own financing conditions. Contango estimates the effect of trade size on the underlying rates when presenting the position. The net interest outcome reflects lending income against borrowing expense. A rate differential that looks attractive before the trade can shrink after the additional borrowing changes market utilization. Variable rates continue changing after construction, independently of whether the opening transaction executed correctly.

View image file

Trade direction determines the collateral and debt assets

Long and short positions reverse the roles of the base and quote assets in the lasting lending arrangement. Margin denomination affects construction, while trade direction determines the exposure. The options below describe the documented position forms; their availability still requires support for the selected instrument and market.

Position option Margin asset Supplied collateral Outstanding debt asset
Long with quote margin Quote currency Base currency Quote currency
Long with base margin Base currency Base currency Quote currency
Short with quote margin Quote currency Quote currency Base currency
Short with base margin Base currency Quote currency Base currency

For a short, the protocol sells the borrowed base exposure and supplies quote currency. The remaining base-denominated debt creates sensitivity to a rise in the base asset's price. Margin currency alone therefore does not identify which asset the position owes.

Manual recursion and automated construction share a borrowing constraint

Manual looping builds exposure through separate borrowing, swapping and supply operations, with each repetition adding another increment of collateral and debt. Contango coordinates the construction through temporary liquidity. Automation removes the need to execute each incremental loop separately and can reduce repeated transaction overhead. It does not increase the borrowing fraction that the underlying collateral rules permit.

Separate manual transactions can leave intermediate balances in place between steps. Atomic construction instead requires its bundled operations to succeed together. That difference concerns execution and temporary capital requirements. Both approaches ultimately depend on collateral supporting an outstanding loan, and neither makes additional borrowing equivalent to additional equity.

Contract control and liquidity remain limits after construction

A Contango position combines the lending market's rules with the contracts that manage its proxy and ownership. The main Contango contract mediates actions on the proxy for the linked NFT owner. Collateral committed to that arrangement is not a freely spendable wallet balance. Upgradeable contracts also introduce control risk alongside potential defects in Contango, the lending integration and the assets involved.

Successful opening establishes exposure under the conditions that existed during execution. Later liquidity shortages can affect the ability to unwind it, while price movements and borrowing costs can make the position eligible for liquidation. Flash-loan atomicity does not extend across that holding period. Closing reverses the construction flow, repays the outstanding debt and returns any remaining funds. A completed close leaves no outstanding debt for that position.

Useful questions about Contango looping

Does a single-transaction loop require only one wallet confirmation?

A single construction transaction does not necessarily mean a single wallet confirmation. Token authorization can require a signature or a separate approval transaction, depending on the token and authorization method. Those permissions allow the contracts to use the required funds; they do not themselves establish that the leveraged position has opened.

Can minting replace a market swap during Contango looping?

Contango can use an integrated minting route when it offers a cheaper supported way to obtain the required asset. This depends on the asset's native minting mechanism and the available integration. It changes the acquisition step within construction, while the resulting collateral and borrowing must still satisfy the lending market.

Which opening costs remain when the flash loan has no fee?

A fee-free flash loan does not eliminate trading fees, swap costs or transaction gas. Execution can also involve a spread and market impact. These costs concern building the position, while borrowing interest concerns maintaining its debt afterward. A waived temporary financing charge therefore does not establish the total cost of the loop.

Will closing the browser stop the debt created by a loop?

Closing the browser leaves the on-chain lending position open. Its borrowing balance continues under the lending market's rules, including interest accrual and liquidation conditions. The browser displays and submits actions for that position; keeping it open is not a requirement for the debt to persist.

Are correlated assets necessary for a Contango loop?

Correlated assets are not a requirement for the looping mechanism. Supported non-correlated pairs can create directional exposure, while correlated pairs can support strategies centered on yield or rate differences. Correlation does not remove collateral risk: a change in the assets' relative value can still weaken the borrowing position.