Blog Post #8

With regards to the progress of the exchange I have been working on the development of a liquidity pool contract to emulate and abstract the decentralized complexities of this application. So far I have been able to put together a simplified contract that can exchange token pairs in Wei which is a very small fraction of an ETH – Ethereum. The token pairs as of now interact with predefined sets of values and some of the advantages and disadvantages of this, is that because the values are preset I do not have to deal with floating point errors – since there are no floats in solidity – however, as one might guess the cons of this is that the user doesn’t have much freedom when it comes to choosing the quantity of the tokens the user would like to exchange. This makes it quite difficult since I have to manage not only a field of user input but accommodate the contract to not error when processing the latter. I am hoping that when larger Wei settings are added the probability of hitting a floating point number reduces significantly, however, this is something that has yet to be tested. Additionally sometimes token pairs yield floats on conversion for example 1 USDC isn’t quite 1$ but like 1.0000001 and because of this modifications must be made. I am hoping I can incorporate the latter changes to further better the user experience in the coming days.

Leave a comment

Your email address will not be published. Required fields are marked *