Firebird

Firebird swap routing compared pool liquidity with RFQ offers in its 2022 API beta

Firebird swap routing searched decentralized exchange pools and, in its 2022 API beta, available RFQ offers for a token exchange. Pool routes derived prices from liquidity and pool rules. An RFQ, or request for quote, brought a market maker's signed offer into the comparison. The selected tokens, input amount, network, and executable terms determined which path could serve the trade. A quote described an expected exchange; completion depended on successful on-chain execution and delivery to the destination account. The former main website now displays a domain sale page, so the old instructions don't establish a working swap interface today.

Updated

Key takeaway: A Firebird RFQ offer fixed quoted terms, while the selected route's execution conditions determined whether the exchange could settle.

Liquidity depth and token transfers shaped the quote

The amount offered for exchange mattered relative to the liquidity available along a pool route. In constant-product pools, a larger trade consumed more of the available reserves and moved the exchange price further. Other trades also changed those reserves between quotation and execution. A rate that suited a smaller input therefore couldn't simply scale into an identical rate for a larger input.

Token transfers added another constraint. A token that deducted a fee during transfer could deliver less than the nominal amount sent. The route needed a compatible execution method that accounted for that behavior. Identifying the input token and destination token by their contracts also distinguished assets that shared a ticker. Available liquidity and the amounts that actually arrived jointly determined the exchange that the route could complete.

Route, quote, and fill described different parts of the swap

A route identified the liquidity path, a quote estimated its exchange amounts, and a fill described execution. An automated market maker, or AMM, calculated prices from a pool's rules and balances. RFQ pricing supplied an offer from a market maker. Firebird's aggregation brought these pricing methods into the same search without making their execution conditions identical.

Route, quote, and fill described different parts of the swap (Firebird swap routing)

Open full-size image

Input amount meant the tokens offered for exchange. Quoted output meant the expected destination tokens. Minimum output expressed an execution constraint, while received output described the completed transfer. Gas paid for blockchain computation. Keeping these meanings separate prevented a successful quotation or wallet authorization from becoming mistaken evidence of a completed swap.

Pool pricing followed the liquidity model

Firebird's pool search included reserve-based pools, stable-swap markets, and concentrated liquidity. Their balances and formulas determined the amounts available for exchange. A large pool balance alone didn't describe every model's usable liquidity.

Reserve-based prices changed with trade size

Constant-product pricing related the reserves of the two pool assets. Exchanging tokens changed their balance ratio, which changed the marginal price along the trade. The fee that the pool charged also affected the output. A route through several pools needed a usable exchange at each connection.

A fixed input determined the output estimate

A fixed-input comparison asked how many destination tokens a specified starting amount could buy, given the pool depth and fees. The acceptable output floor supplied a separate condition for execution.

A fixed output determined the required input

A fixed-output comparison asked how many starting tokens an intended destination amount required, with a maximum input as its spending boundary. These directions described different questions, even when the same pools connected the assets.

Stable-swap components connected related pool assets

Firebird's earlier OneSwap contracts included a stable-swap router and factory. The router exposed calculations and swaps involving a base pool and another pool. Those calls identified the input and output through token indexes and supplied an input amount. The execution methods also accepted a minimum output and deadline. A token index identified an asset within the selected pool; it wasn't a universal identifier across pools.

Concentrated liquidity operated within price ranges

Uniswap v3 liquidity providers allocated funds to chosen price ranges. Only positions covering the current price supplied active liquidity there. As a swap crossed a range boundary, the active liquidity could change. This made the liquidity available along the price movement more informative than a pool's total deposits alone.

Firebird's October 2022 beta added RFQ support through an initial Hashflow integration, expanding the liquidity that its routing could consider. It didn't turn every selected path into an RFQ trade.

Hashflow's RFQ model required market makers to cryptographically sign their price quotes. Market makers priced assets off-chain and supplied offers for on-chain settlement, using market information that could extend beyond an AMM reserve formula. The signed offer bound the quoted terms, so another transaction changing an AMM pool's reserves didn't itself rewrite that offer.

The signed price protected the applicable RFQ offer against price manipulation through transaction ordering. Such ordering opportunities formed part of maximal extractable value, or MEV. Pool routes followed their own pricing behavior and output constraints, and the signed offer still required successful settlement.

A usable offer still needed executable terms and sufficient liquidity. The routing comparison therefore concerned both the offered amount and the path capable of delivering it. Pool depth and trading fees could favor a pool route for a particular exchange.

Network coverage followed the beta rollout

The October 2022 beta announcement covered Arbitrum, Avalanche, BNB Chain, Ethereum, Polygon, and Optimism. Ethereum testing preceded the planned full deployment, and the team tied wider API access to integration stability. Availability across several networks didn't establish a bridge operation for each swap; the network and contracts involved determined the exchange's scope.

Minimum output and partial fills used different tests

The Ethereum FireBirdRouter verified in August 2022 applied its aggregation minimum to the recipient's balance increase, with different tests for ordinary and partial fills.

The ordinary fill used an output floor

Without its partial-fill flag, that router required the received output to meet the specified minimum return. A lower return reverted the call.

The partial fill used a proportional condition

With its partial-fill flag, the router scaled the minimum return to the portion of the requested input actually spent.

A smaller fill could therefore return less total output, without requiring the transaction to spend the entire requested input.

Token allowances belonged to a particular spender

An ERC-20 allowance authorized a spender to transfer tokens from an owner's account within a specified amount. It didn't select a liquidity source or establish that the owner had received swap proceeds. Authorization needed to match the token and contract that would spend the input. Approving a different spender supplied no permission to the intended one.

Existing permission could outlast the exchange that prompted it. ERC-20 allowance recorded the remaining authorized amount, and a new approval replaced that allowance. Reviewing an old Firebird allowance therefore concerned the actual token and spender, regardless of the former website's availability. A wallet's token balance and its spending permission answered separate questions.

What proved that a routed exchange had completed?

A successful transaction receipt and the assets actually credited to the intended recipient established the completed exchange. A transaction hash identified the submitted transaction; a pending transaction hadn't yet produced a receipt. Signing the swap transaction authorized submission without proving that the blockchain had executed it.

Ethereum transaction receipts include an execution status and the logs generated by the transaction. For a historical Firebird exchange, the receipt needed to correspond to the swap call. ERC-20 transfer logs identified the token movements and recipient. Intermediate transfers between contracts described the route's internal movement, while the transfer to the final recipient described delivery.

For native-currency output, check the recipient's balance change, accounting separately for any gas that account paid. A wallet's overall balance change could include both trading proceeds and the transaction fee. Treating that change as the swap output alone mixed two different amounts.

Pool fees and gas affected the exchange's cost

Trading fees affected the token exchange, while gas paid for the computation that executed it. Pool fees varied with the selected market and protocol configuration. On Ethereum, the gas used and effective gas price determined the execution fee; more contract work could change that cost without changing the requested token amount.

Comparing routes required consistent units. Destination tokens and the native currency used for gas weren't automatically interchangeable quantities. A cost comparison needed a stated valuation when it combined them. It also needed to distinguish fees already reflected in an output estimate from charges accounted for separately.

A failed on-chain execution could still incur a gas cost. Reverting the swap restored its state changes, while the network charged for computation already performed. Historical cashback and yield-farming returns belonged to separate mechanisms; they weren't the destination tokens received through routing.

Comparing a changed input before continuing

During the beta, increasing the input called for a fresh comparison for the same destination token. The larger amount could change a pool's price impact and the RFQ offer available for that size. Requesting an updated quote exposed that change before authorizing the exchange. Pool reserves shaped a pool candidate's estimated output; an available signed offer specified the RFQ candidate's terms.

  • Keep the network and token contracts consistent when comparing the changed input with the earlier quote.
  • Continue only when the new route's output condition and applicable RFQ terms match the intended exchange.
  • Include the route's trading charges and estimated gas cost when deciding whether its output remains acceptable.
  • Wait while the submitted swap transaction remains pending; a transaction hash doesn't establish destination tokens.
  • Accept completion only after successful execution and delivery to the intended recipient under the route's output condition.
  • Stop if execution fails, the quote no longer applies, or no working service supplies an executable route.

Changing the input could favor a different liquidity path without changing the desired destination asset. Continuing into another exchange required the actual received balance, with any partial fill interpreted under its applicable output condition.

Historical routes and the next exchange decision

Old Firebird routes explain past token exchanges, while new trades require an available quoting and execution service. A stored quote also retains the conditions of the request that produced it; later prices, liquidity, and service availability can differ.

A confirmed historical transaction remains an exchange record regardless of the interface's availability. For another swap, the next decision concerns a service that can quote the exact assets and execute their exchange now. The relevant comparison remains the usable output, execution conditions, and total cost for that request.

Questions people ask about Firebird swap routing

Could Firebird's pool router handle tokens that charged a transfer fee?

Specific exact-input methods in its August 2022 Ethereum router supported fee-on-transfer tokens through balance-based calculations. That support belonged to those methods and didn't establish compatibility for every aggregated or RFQ route.

Would each pool in a Firebird route have required its own wallet approval?

The number of pools didn't determine the number of wallet approvals. ERC-20 permission belonged to the contract that transferred the owner's tokens. A routed exchange could move tokens between pools after that initial transfer, without each pool receiving a separate allowance from the owner.

Why could a raw Firebird output amount look larger than the displayed token balance?

Raw ERC-20 amounts use the token's smallest units. The token's decimal precision determines how an interface converts those integers into a displayed balance. Input and output tokens can use different precision, so comparing raw numbers across assets doesn't establish the exchange rate.

Where did output go when a Firebird aggregation call used a zero destination address?

The August 2022 Ethereum aggregation method treated a zero destination address as the address that called the router. An explicit destination selected that recipient instead. This fallback belonged to that method, so it shouldn't be assumed for every other router function.

Was a OneSwap exchange the same as depositing into a Firebird farm?

OneSwap swaps and Firebird farm deposits involved separate contract operations. The stable-swap contracts exposed exchange and liquidity functions, while farming used other contracts. Receiving tokens from a routed exchange didn't by itself establish a farming position.

Did RFQ pricing hide a Firebird swap's on-chain activity?

Off-chain RFQ pricing didn't hide the on-chain settlement transaction. Ethereum recorded its sender, contract interaction, and execution logs. Signed pricing addressed the offered exchange terms; it didn't make the blockchain transfer anonymous or remove its public transaction record.

Did the early Firebird farming audit cover the later RFQ integration?

The June 2021 HopeChef review covered a farming contract and preceded the October 2022 RFQ beta. Its scope didn't establish coverage of the later aggregation integration. The reviewed contract and version determined what that security assessment examined.