Skip to content

A very simple router to exchange tokens for the best price on any UniswapV2 like AMM.

License

Notifications You must be signed in to change notification settings

dialecticch/router

Repository files navigation

Router

This repository contains SwapRouter, a very simple router to exchange tokens for the best price on any UniswapV2 like AMM.

Usage is simple, all one needs to do is import the library and call the following function:

import "@dialecticch/router/contracts/SwapRouter.sol";
import "@dialecticch/router/contracts/Interfaces/UniswapV2.sol";

contract SwapRouterMock {

    function swap(
        UniswapV2[] memory swaps,
        address[] memory path,
        uint256 amount,
        uint256 slippage
    ) external returns (uint256) {
        return SwapRouter.swap(swaps, path, amount, slippage);
    }

}

The slippage should be provided as a basis point, so 2% slippage would be 20.

About

A very simple router to exchange tokens for the best price on any UniswapV2 like AMM.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published