Skip to content
This repository has been archived by the owner on Jul 9, 2021. It is now read-only.

ERC20BridgeSampler: Additional Buy support #2551

Merged
merged 11 commits into from
Apr 21, 2020
Merged

Conversation

dekz
Copy link
Member

@dekz dekz commented Apr 14, 2020

Description

Samples Curve with the get_dx_underlying now available on all Curves.

Samples Kyber and PLP by walking up to the sellAmount by delta * 1.0005 increments from the previous sample. Allows for 0.0005 slippage from the target buy amount. Interpolates the price up/down from the last (close-ish) sample. These options are configurable by the caller.

@dekz dekz changed the title ERC20BridgeSampler: Sample Curve Buy ERC20BridgeSampler: Additional Buy support Apr 16, 2020
@dekz dekz force-pushed the feature/curve/sample-buys branch from a848839 to cb6ba5d Compare April 16, 2020 06:46
@coveralls
Copy link

coveralls commented Apr 16, 2020

Coverage Status

Coverage decreased (-0.3%) to 79.487% when pulling 34fd9d6 on feature/curve/sample-buys into 110e1af on development.

@dekz dekz requested review from dorothy-zbornak and moodlezoup and removed request for dorothy-zbornak April 16, 2020 21:49
@dekz dekz marked this pull request as ready for review April 17, 2020 02:53
@dekz dekz force-pushed the feature/curve/sample-buys branch 6 times, most recently from 763516b to 9375947 Compare April 18, 2020 03:08
@dekz dekz force-pushed the feature/curve/sample-buys branch from 9375947 to f08a76f Compare April 18, 2020 03:11
Copy link
Contributor

@dorothy-zbornak dorothy-zbornak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

THOUGHTS

contracts/erc20-bridge-sampler/CHANGELOG.json Outdated Show resolved Hide resolved
Comment on lines +25 to +32
ERC20BridgeSource.Uniswap,
ERC20BridgeSource.Eth2Dai,
ERC20BridgeSource.Kyber,
// All Curve sources
ERC20BridgeSource.CurveUsdcDai,
ERC20BridgeSource.CurveUsdcDaiUsdt,
ERC20BridgeSource.CurveUsdcDaiUsdtBusd,
ERC20BridgeSource.CurveUsdcDaiUsdtTusd,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔥

packages/asset-swapper/src/utils/quote_simulation.ts Outdated Show resolved Hide resolved
packages/asset-swapper/test/market_operation_utils_test.ts Outdated Show resolved Hide resolved
Copy link
Contributor

@dorothy-zbornak dorothy-zbornak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@dekz dekz merged commit a458e81 into development Apr 21, 2020
@dekz dekz deleted the feature/curve/sample-buys branch April 21, 2020 03:26
feuGeneA pushed a commit that referenced this pull request Apr 21, 2020
* ERC20BridgeSampler: Sample Curve Buy

* Fake Buy Kyber/PLP

* Deploy mainnet

* Add Kyber rates for buy tests

* CHANGELOGs

* Provide maxIterations and targetSlippage as options

* Cleanup ERC20BridgeSampler for re-use

* Redeploy Mainnet Kovan

* Feedback fixes

* Handle OOG/revert 0s

* Redeploy Mainnet refactor
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants