0

I am doing arbitration with some measure of success; but I suspect I am running into edge cases where the available reserve size is less than what I am trying to buy or sell.

Something like this:

function kyberToUniSwapArb(address fromAddress,address toAddress, uint ethAmount) public payable returns (uint256){
 
    uint256 cryptoAmountPurchased = buyCryptoOnKyber( ethAmount , fromAddress);

     sellCryptoOnUniswap(cryptoAmountPurchased , toAddress);

    }

AND

function uniSwapToKyberArb(address fromAddress,address toAddress, uint256 ethAmount) public payable {

    uint256 cryptoAmountPurchased = buyCryptoOnUniswap( ethAmount , fromAddress);

     sellCryptoOnKyber(cryptoAmountPurchased , toAddress);

    }

QUESTION

Are there any methods in Uniswap(V2) and Kyber exchanges that I can use to determine the reserve size before buying a given amount of a token or selling a given amount.

Thanks a lot

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.