BTB
/

Fluid DEX

Dexswebsite
Fluid DEX is an AMM whose pools draw liquidity from Fluid's shared Liquidity layer, so an LP position can also be used as collateral (Smart Collateral). An agent can list pools from the resolver, read reserves and prices, and swap or manage liquidity directly on each pool contract.

What you can do

find-poolsList Fluid DEX pools on a chainDexResolver.getAllDexAddresses() on that chain. Read the pool's tokens with getPoolConstantsView(pool) on the reserves resolver.
swapSwap on one Fluid DEX poolestimate with DexReservesResolver.estimateSwapIn(pool, swap0to1, amountIn, amountOutMin) via eth_call. Approve the pool for the input token, then call swapIn(swap0to1, amountIn, amountOutMin, to) on the pool address. swapOut(swap0to1, amountOut, amountInMax, to) is the exact-output version. Each pool is its own contract, so the call goes to the pool, not to the factory.
deposit-withdraw-liquidityAdd or remove liquidity on a poolpool-level functions deposit(...), withdraw(...) and their perfect variants (depositPerfect, withdrawPerfect, withdrawPerfectInOneToken). Verified signatures are in notes. Approve the pool for each token first. Check the pool's limits with getDexLimits before large moves.
check-pool-stateRead reserves, prices and limits for one pooleth_call getDexCollateralReserves(pool), getDexDebtReserves(pool), getDexPricesAndExchangePrices(pool) and getDexLimits(pool) on the DexReservesResolver or DexResolver.
Each pool is a separate contract with its own token pair, fee and limits. Check which pool you are calling with getPoolConstantsView before sending any transaction.
Pools are created by allow-listed deployers, so pool quality, token choice and fee setting vary. Check the tokens and the pool's limits first.
Smart Collateral means an LP position also backs borrowing in Fluid Vaults. A large move on the DEX can change borrow health for the same user.
Fluid governance and its auth roles can change pool parameters, pause pools or change limits.

Contracts

Read any function, or build a write and sign it. Amounts are in base units (1 USDC = 1000000).
DexFactoryfactory on ethereum0x91716C4EDA1Fb55e84Bf8b4c7085f84285c19085
read totalDexes()
Number of DEX pools deployed through this factory. Use it as the upper bound when enumerating pools with getDexAddress.
read getDexAddress(uint256)
Pool address for a DEX id. Argument: the id, from 1 up to totalDexes().
read isDex(address)
True if the address is a DEX pool created by this factory.
DexResolverother on ethereum0x11D80CfF056Cef4F9E6d23da8672fE9873e5cC07
read getAllDexAddresses()
Every DEX pool address on this chain. Use it to discover pools before reading their reserves or swapping.
read getDexAddress(uint256)
Pool address for a DEX id, the same lookup as on the factory.
write getDexPricesAndExchangePrices(address)
Prices and exchange prices for one pool. The ABI marks it non-view, so call it with eth_call and do not send a transaction.
write getDexCollateralReserves(address)
Collateral reserves of one pool. The ABI marks it non-view, so call it with eth_call.
write getDexDebtReserves(address)
Debt reserves of one pool. The ABI marks it non-view, so call it with eth_call.
DexReservesResolverother on ethereum0x05Bd8269A20C472b148246De20E6852091BF16Ff
read getAllPoolAddresses()
Every pool address on this chain, as seen by the reserves resolver.
read getDexLimits(address)
Withdraw and borrow limits for a pool. Read withdrawable.available and borrowable.available to see the most a swap can move.
write estimateSwapIn(address,bool,uint256,uint256)
Estimate the output for an exact input swap on a pool. Arguments: pool, swap0to1, amountIn, amountOutMin. The ABI marks it non-view, so call it with eth_call.
write estimateSwapOut(address,bool,uint256,uint256)
Estimate the input needed for an exact output swap on a pool. Arguments: pool, swap0to1, amountOut, amountInMax. The ABI marks it non-view, so call it with eth_call.
read getPoolConstantsView(address)
Static configuration for a pool: its id, its tokens, and related addresses.
DexFactoryfactory on base0x91716C4EDA1Fb55e84Bf8b4c7085f84285c19085
read totalDexes()
Number of DEX pools deployed through this factory on Base.
read getDexAddress(uint256)
Pool address for a DEX id, from 1 up to totalDexes().
read isDex(address)
True if the address is a DEX pool created by this factory.
DexResolverother on base0x11D80CfF056Cef4F9E6d23da8672fE9873e5cC07
read getAllDexAddresses()
Every DEX pool address on Base. Use it to discover pools before reading reserves or swapping.
read getDexAddress(uint256)
Pool address for a DEX id, the same lookup as on the factory.
write getDexPricesAndExchangePrices(address)
Prices and exchange prices for one pool. The ABI marks it non-view, so call it with eth_call.
write getDexCollateralReserves(address)
Collateral reserves of one pool. The ABI marks it non-view, so call it with eth_call.
write getDexDebtReserves(address)
Debt reserves of one pool. The ABI marks it non-view, so call it with eth_call.
DexReservesResolverother on base0x05Bd8269A20C472b148246De20E6852091BF16Ff
read getAllPoolAddresses()
Every pool address on Base, as seen by the reserves resolver.
read getDexLimits(address)
Withdraw and borrow limits for a pool. Read withdrawable.available and borrowable.available to see the most a swap can move.
write estimateSwapIn(address,bool,uint256,uint256)
Estimate the output for an exact input swap on a pool. Arguments: pool, swap0to1, amountIn, amountOutMin. The ABI marks it non-view, so call it with eth_call.
write estimateSwapOut(address,bool,uint256,uint256)
Estimate the input needed for an exact output swap on a pool. Arguments: pool, swap0to1, amountOut, amountInMax. The ABI marks it non-view, so call it with eth_call.
read getPoolConstantsView(address)
Static configuration for a pool: its id, its tokens, and related addresses.
DexFactoryfactory on arbitrum0x91716C4EDA1Fb55e84Bf8b4c7085f84285c19085
read totalDexes()
Number of DEX pools deployed through this factory on Arbitrum.
read getDexAddress(uint256)
Pool address for a DEX id, from 1 up to totalDexes().
DexFactoryfactory on polygon0x91716C4EDA1Fb55e84Bf8b4c7085f84285c19085
read totalDexes()
Number of DEX pools deployed through this factory on Polygon.
read getDexAddress(uint256)
Pool address for a DEX id, from 1 up to totalDexes().