Uniswap compatible interface

Only for volatile pairs

Uniswap compatible interface for volatile pairs

Velocore supports a Uniswap-compatible interface. The difference is that Velocore doesn't use WETH internally. Use address(0) in place of ETH.

  • This is a wrapper function for the direct execute function for easy swap integration. You could check the exact code how it is wrapped in the repo here.

  • This only supports volatile pools. Can't swap on, for example, USDC-USDT pools with this interface.

  • Like all the other functions on Velocore, you could call Vault contract to use this function.


    function swapExactTokensForTokens(
        uint256 amountIn,
        uint256 amountOutMin,
        address[] calldata path,
        address to,
        uint256 deadline
    ) external returns (uint256[] memory amounts);
    function swapTokensForExactTokens(
        uint256 amountOut,
        uint256 amountInMax,
        address[] calldata path,
        address to,
        uint256 deadline
    ) external returns (uint256[] memory amounts);
    function swapExactETHForTokens(uint256 amountOutMin, address[] calldata path, address to, uint256 deadline)
        external
        payable
        returns (uint256[] memory amounts);
    function swapTokensForExactETH(
        uint256 amountOut,
        uint256 amountInMax,
        address[] calldata path,
        address to,
        uint256 deadline
    ) external returns (uint256[] memory amounts);
    function swapExactTokensForETH(
        uint256 amountIn,
        uint256 amountOutMin,
        address[] calldata path,
        address to,
        uint256 deadline
    ) external returns (uint256[] memory amounts);
    function swapETHForExactTokens(uint256 amountOut, address[] calldata path, address to, uint256 deadline)
        external
        payable
        returns (uint256[] memory amounts);

    function getAmountsOut(uint256 amountIn, address[] calldata path) external returns (uint256[] memory amounts);
    function getAmountsIn(uint256 amountOut, address[] calldata path) external returns (uint256[] memory amounts);


    function getPair(address t0, address t1) external view returns (address);

    function allPairs(uint256 i) external view returns (address);

    function allPairsLength() external view returns (uint256);
```

Last updated