Skip to main content
In a Sauce program, swap with @sauce/router’s function for the venue (uniswapV2, uniswapV3, uniswapV4, curve, balancerV2, …; Slipstream, PancakeSwap V3 and Algebra pools through uniswapV3), with a minimum output and, where the pool takes one, a price limit (the @sauce/router reference; several pools under one limit, the distributed swap).
Concentrated-liquidity AMM on Arc, forked from Uniswap V3 with native USDC in place of WETH9.

Notes

  • Pools call back unitFlowV3SwapCallback, not uniswapV3SwapCallback, so a contract that swaps against a pool directly must implement the renamed callback
  • The GitHub README lists testnet addresses; these mainnet addresses are the defaults in UnitFlow’s own app build
  • From a Pot program, @sauce/router’s uniswapV3 uses the paired execution Router’s swapV3 and unitFlowV3SwapCallback. potRouterUpdate(client, pot) returns an owner-signed update when the Pot differs from its Kitchen’s current Router. Compare addresses with v12RouterAddress(); Router releases are content-addressed, not generation-numbered.
  • uniswapV3 is exact input: the Router caps what the callback may take at amountIn

Its names in a program

On Arc, UnitflowV3 is a namespace: its contracts need no import.

Deployments

ABI

Where a line says what an address it returns is, a program that calls the function through its namespace calls that contract’s methods on the result directly: <Namespace>.<Contract>.<function>(...).<method>(...). A token’s methods are the ERC-20 functions, and its writes are SafeERC20.

UnitFlowV3FactoryABI

import UnitFlowV3FactoryABI from "./protocols/unitflow-v3/UnitFlowV3FactoryABI.json"; Speaks for: factory.
  • getPool(address tokenA, address tokenB, uint24 fee) view returns (address pool): the address is a UnitflowV3.Pool
  • feeAmountTickSpacing(uint24 fee) view returns (int24)

UnitFlowV3PoolABI

import UnitFlowV3PoolABI from "./protocols/unitflow-v3/UnitFlowV3PoolABI.json";
  • slot0() view returns (uint160 sqrtPriceX96, int24 tick, uint16 observationIndex, uint16 observationCardinality, uint16 observationCardinalityNext, uint8 feeProtocol, bool unlocked)
  • liquidity() view returns (uint128)
  • fee() view returns (uint24)
  • tickSpacing() view returns (int24)
  • token0() view returns (address): the address is a token
  • token1() view returns (address): the address is a token

UnitFlowV3QuoterABI

import UnitFlowV3QuoterABI from "./protocols/unitflow-v3/UnitFlowV3QuoterABI.json"; Speaks for: quoter.
  • quoteExactInputSingle(address tokenIn, address tokenOut, uint24 fee, uint256 amountIn, uint160 sqrtPriceLimitX96) returns (uint256 amountOut)

UnitFlowV3RouterABI

import UnitFlowV3RouterABI from "./protocols/unitflow-v3/UnitFlowV3RouterABI.json"; Speaks for: router.
  • exactInputSingle((address tokenIn, address tokenOut, uint24 fee, address recipient, uint256 deadline, uint256 amountIn, uint256 amountOutMinimum, uint160 sqrtPriceLimitX96) params) payable returns (uint256 amountOut)
  • factory() view returns (address): the address is a UnitflowV3.Factory

Next steps