Skip to article Dodoex

Dodoex AMM V3 lets callers fix either the input or the output amount

Dodoex AMM V3 supports exact-input and exact-output swaps through its router. In the documented single-pool configuration, sqrtPriceLimitX96 is zero. An exact-input swap specifies the spending amount and a minimum output. An exact-output swap specifies the receiving amount and a maximum input. The choice follows which token amount must stay fixed for the exchange.

· last updated

Both forms identify the input token, output token, and pool fee tier, while their different parameters determine which amount varies during execution. Multi-pool swaps use separate router methods: exact-input paths encode tokens from input to output, while exact-output paths reverse that order.

Bottom line: An exact-output input cap limits swap-token spending; network gas remains a separate cost in the selected network’s fee token.

DAI-to-WETH9 calls start with different fixed amounts

The documented single-pool calls exchange DAI for WETH9 using a selected pool fee. Both set sqrtPriceLimitX96 to zero.

With exactInputSingle , the caller specifies DAI as tokenIn and WETH9 as tokenOut . The DAI amount occupies amountIn ; the minimum acceptable WETH9 amount occupies amountOutMinimum . This form matches a task that starts with a defined spending amount. The router returns the output amount when the call succeeds.

The exactOutputSingle call keeps those token directions and changes the amount fields. The requested WETH9 quantity occupies amountOut , and the DAI spending ceiling occupies amountInMaximum . This form matches a task that needs a particular receiving amount. On success, the router returns the input amount that it used.

The selected network needs a deployed pool with liquidity for that token pair and fee tier.

Return values identify the variable side of the swap

exactInputSingle and exactInput return amountOut , the output-token quantity; exactOutputSingle and exactOutput return amountIn , the input-token quantity.

The configured maximum input sets a ceiling, so it needn’t equal the amount that an exact-output swap spends. Likewise, the minimum output sets a floor, while the exact-input return reports the execution’s output.

Amount bounds reject an unacceptable exchange

Exact-input execution checks amountOut >= amountOutMinimum , while exact-output execution checks amountIn <= amountInMaximum . These comparisons act on different tokens. An integration must derive the output floor in output-token units and the spending ceiling in input-token units. Confusing the fields’ meanings can leave the intended economic limit absent, even when the parameter names look similar.

Both bounds constrain execution at the chosen pool or path. A quote describes an expected exchange before execution; the bound expresses the least acceptable receipt or greatest permitted spend. Neither bound specifies a price that the router must wait to reach. The transaction also has its own deadline.

A zero output minimum removes the receipt floor

amountOutMinimum = 0 accepts any nonnegative output under that particular check. The sample exact-input calls use zero for demonstration, and their comments call for a safer production value from an oracle or another data source. A zero floor offers no minimum-quantity protection when the execution price worsens. Other contract conditions still apply, so zero doesn’t make every transaction succeed. This setting also differs from sqrtPriceLimitX96 = 0 , which concerns the single-pool price-limit parameter.

The token pair and fee tier select the single pool

One single-hop call uses the specified token pair and fee tier to identify its AMM V3 pool. The documented tiers of 0.01%, 0.05%, 0.3%, and 1% describe alternative pool fees, not successive charges that every swap pays. The fee field selects the pool’s tier; it doesn’t select exact-input or exact-output behavior.

The fee that a DODO AMM V3 pool charges can’t change after pool creation. A pool’s price and available liquidity affect the exchange, so a smaller fee alone doesn’t establish a larger output for a fixed input. The selected pool must also offer the relevant liquidity on the network where the call executes.

Multi-pool exact-input paths follow the exchange direction

exactInput extends the fixed-input form across a specified path containing multiple pools. That path alternates token addresses with the fees that identify the pools between them. It begins with the input token and ends with the output token, with intermediary tokens connecting adjacent pools. The method still returns the final output quantity and enforces amountOutMinimum against that quantity. The minimum applies to the route’s final output; it isn’t a separately stated minimum for each intermediate token.

Exact-output paths encode the destination token first

exactOutput uses a reversed path because the requested final output determines the input that the route needs. Its encoding starts with the output token, then works through pool fees and intermediary tokens toward the input token. The router’s return remains amountIn , and amountInMaximum caps the total input required for that route.

Reversed encoding doesn’t reverse the intended exchange: the caller still supplies the input token and requests the output token. Reusing an exact-input path unchanged gives the exact-output method a different interpretation of its endpoints. A path builder must account for the selected swap family, alongside the pools and their fee tiers.

Token approval and gas sit outside the swap amount bound

An ERC-20 allowance authorizes a spending contract to move an input token up to the permitted amount. Approval and exchange have different effects: granting allowance doesn’t itself exchange tokens or establish the received amount. A successful swap still requires the appropriate token balance and authorization for the actual spending contract.

The exact-output cap limits input-token spending inside that swap; it doesn’t cap the transaction’s network gas charge. Gas requires the fee token for the selected network, while the swap parameters identify the trading tokens. Holding enough input tokens alone doesn’t establish that the wallet can pay the network charge.

An allowance can exceed the amount that one successful call uses. That permission remains distinct from the input ceiling that an exact-output call enforces.

Direct AMM V3 calls differ from aggregated DODOX routes

DODO AMM V3 uses an automated market maker with concentrated liquidity, while DODO V3 uses the Proactive Market Maker (PMM) algorithm. Those product names identify different pool systems, despite sharing a version number.

DODOX can aggregate DODO pools and other liquidity sources through swap routing. An API quote or app selection may describe a broader route than a direct AMM V3 pool call. The low-level router interface alone doesn’t establish which choices a particular app screen exposes. App access carries regional prohibitions, including the United States and its territories.

Diagram: Dodoex: Direct AMM V3 calls differ from aggregated DODOX routes

View full-size image

The trading API can return data for contract execution. Direct AMM V3 integration calls the selected router methods with explicitly constructed parameters. API-driven execution starts with the returned route data, which may describe another pool family or a combination of liquidity sources.

Quick answers about Dodoex

Is an exact-output AMM V3 swap the same as a limit order?

An exact-output AMM V3 swap attempts to obtain a specified token quantity within its input cap. A DODO limit order carries a price condition and an expiration time. The exact-output amount bound doesn’t create a standing order that waits for a future market price.

Which address receives output tokens from an AMM V3 swap?

The recipient parameter determines the address that receives the output tokens. The examples fill it with msg.sender at the point where they construct the parameters. Changing the supplied recipient changes the intended destination; the amount fields don’t select that address. A contract integration must distinguish the recipient from whichever contract handles input-token spending.

Are AMM V2 feeRate values interchangeable with AMM V3 fee values?

The two interfaces use different scales for their fee integers. AMM V2 uses a denominator of 10,000, so feeRate = 30 represents 0.3%. AMM V3 uses 3000 for 0.3% and 100 for 0.01%. Copying the same integer between these versions can identify a different fee or an unavailable pool.

Does swapping through AMM V3 create a liquidity-position NFT?

An AMM V3 token swap doesn’t create a liquidity-position NFT. The position manager’s mint operation creates that NFT when providing liquidity within a selected pool and price range. Choosing a fixed input or fixed output concerns a token exchange; creating an LP position concerns the liquidity that supports exchanges.

How do token decimals affect AMM V3 amount parameters?

The amount parameters use each token’s smallest units. Decimal scaling converts between those integers and the quantities that a wallet displays. Input amounts use the input token’s scale, while output amounts use the output token’s scale. Equal integers therefore needn’t represent equal displayed quantities across different tokens. ERC-20 makes decimals metadata optional, so a missing value doesn’t justify assuming a shared scale.

Can an AMM V3 multi-hop path transfer assets between blockchains?

An AMM V3 multi-hop path connects pools within one network. Its intermediary tokens connect successive pool exchanges; they aren’t bridge transfers. DODOX cross-chain routes incorporate bridge products separately. Including multiple pools in an AMM V3 path doesn’t by itself provide a transfer to a different blockchain.