terminal-fi / swappa

Framework for executing cross-DEX token swaps
MIT License
20 stars 13 forks source link

Introduce registry helper contracts to speed up pair discovery & bulk pair refresh #31

Closed diwu1989 closed 2 years ago

diwu1989 commented 2 years ago

Registry helper to speed up:

Example deployment of earlier draft of this contract, some naming changed, but functionality is the same: Uniswap Helper https://explorer.celo.org/address/0x4d416fE42BA21C59fc853bd887B996D8C05A0e20/contracts Balancer Helper https://explorer.celo.org/address/0xba2d6Ec829d1026B2E8ae93c06112A457918c44e/read-contract

These registry helpers are absolutely necessary to scaling the per-block pair refresh() to 2k+ pairs.

TODO: make it possible for a registry to bulk-refresh all of its pairs with the registry helper contract Probably will create pair specific Snapshot from the on-chain fetched batch data, and use the current restore(snapshot) api to batch initialize / refresh the pairs

zviadm commented 2 years ago

I am going to take over this diff, since I need to integrate the registry helper into the dpeloyer too. Thanks for all the PRs. I finally got around to merging most of them and releasing new version of Swappa too.