Badger-Finance / badger-utils

Library that keeps shared code for badger project
MIT License
2 stars 2 forks source link

[Testing-utils]: Asset Distribution from swaps #6

Closed sajanrajdev closed 1 year ago

sajanrajdev commented 3 years ago

Asset Distribution from swaps

A function should be developed to swap and distribute test assets by swapping the ETH (BNB, MATIC, AVAX or any other native asset) provided by the ganache test environment (usually around 20 ETH per test account), through a DEX (Uniswap, Sushiswap, Curve, Quickswap, PancakeSwap, etc). Different exchanges (and their contracts) should be mapped by network as well as the most popular assets supported by these DEXes.

sajanrajdev commented 3 years ago

Tool to fetch largest holders: https://github.com/iamdefinitelyahuman/brownie-token-tester/blob/master/brownie_tokens/forked.py#L28-L52

SHAKOTN commented 3 years ago

Will split this issue into 2 separate, because implementation can be quite big for each of two items listed

sajanrajdev commented 3 years ago

This function is used generate test LP assets from the Curve protocol, it can serve you as a starting point or reference. You will notice that the pool config is passed as an object, for a more general application it might be better to have the necessary configuration passed as individual parameters. Do as you find fit and don't hesitate to ask me if you have question regarding Curve or other protocol's infrastructure:

https://github.com/Badger-Finance/strategy-convex-staking-optimizer/blob/main/helpers/test/test_utils.py