mobiusAMM / mobius-interface

An open source interface for the Mobius protocol
https://mobius.money
GNU General Public License v3.0
5 stars 9 forks source link

Refactor Redux #163

Open d-mooers opened 2 years ago

d-mooers commented 2 years ago

Is your feature request related to a problem? Please describe. Token objects are non-serializable, so when we store them in redux our site takes a performance hit. If we fix this we should see a significant performance improvement

Describe the solution you'd like We can refactor redux to only store token addresses, and then use the token addresses to grab the token object from a separate object. This will mainly involve work in the stableSwap hooks file.

kyscott18 commented 2 years ago

There seems to be a serialize token and serialize pair function, could we use this instead?

kyscott18 commented 2 years ago

Uniswap has a pretty cool redux setup that caches the information related to each contract call. I think we should switch to something like this instead of having a reducer for all our pairs which I think is slowing us down a lot.

kyscott18 commented 2 years ago

There is also a new version of the multicall contract which would be nice to change to