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

ERC20BridgeSampler Curve #2483

Merged
merged 9 commits into from
Feb 15, 2020
Merged

Conversation

dekz
Copy link
Member

@dekz dekz commented Feb 13, 2020

Description

Samples the CurveBridge

#2480

@dekz dekz requested a review from dorothy-zbornak February 13, 2020 03:07
@dekz dekz changed the title ERC20BBridgeSampler Curve ERC20BridgeSampler Curve Feb 13, 2020
@dekz dekz changed the base branch from development to feature/asset-proxy/curve February 13, 2020 03:08
return samplerOperations.getKyberSellQuotes(makerToken, takerToken, takerFillAmounts);
batchedOperation = samplerOperations.getKyberSellQuotes(makerToken, takerToken, takerFillAmounts);
} else if (source === ERC20BridgeSource.Curve) {
// TODO(dekz) best way to pass this data around, in the world of multiple curves at once?
Copy link
Member Author

Choose a reason for hiding this comment

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

Not happy with this at the moment, there can be multiple Curve sources with the same tokens, like right now there is USDC/DAI and USDT/USDC/DAI. So it is not easy to tell the create_order which curveAddress should be used.

@dorothy-zbornak any thoughts on the right abstraction here? Pass it through DexSample? What will PLP look like as well?

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.

Seems legit! Just small changes then g2g.

contracts/erc20-bridge-sampler/test/mainnet_tests.ts Outdated Show resolved Hide resolved
.sampleSellsFromCurve(curveAddress, daiTokenIdx, usdcTokenIdx, [toBaseUnitAmount(1)])
.callAsync();
expect(samples.length).to.be.bignumber.greaterThan(0);
expect(samples[0]).to.be.bignumber.greaterThan(0);
Copy link
Contributor

Choose a reason for hiding this comment

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

I guess one of the things I get paranoid about is whether these endpoints are expressing the correct units. So maybe we can check that samples[0] > 0 && samples[0] < toBaseUnitAmount(2, 6)

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.1%) to 79.563% when pulling 3088f99 on feature/sampler/curve into 5b26c0c on feature/asset-proxy/curve.

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.

Still good

@dekz dekz merged commit bd7a24b into feature/asset-proxy/curve Feb 15, 2020
@dekz dekz deleted the feature/sampler/curve branch February 15, 2020 04:43
dekz added a commit that referenced this pull request Feb 15, 2020
* ERC20Sampler Curve

* Use Bridge Sources for each Curve

* Support multiple versions of the Curve contract

* CHANGELOG and redeployed Curve (mainnet)

* Fix Market ops utils test

* Added Curve DAI USDC USDT TUSD

* Bump sampler gas limit default

* Decode the Curve in tests

* Disable Curve in Buy tests
dekz added a commit that referenced this pull request Feb 15, 2020
* Curve ERC20Bridge

* ERC20BridgeSampler Curve (#2483)

* ERC20Sampler Curve

* Use Bridge Sources for each Curve

* Support multiple versions of the Curve contract

* CHANGELOG and redeployed Curve (mainnet)

* Fix Market ops utils test

* Added Curve DAI USDC USDT TUSD

* Bump sampler gas limit default

* Decode the Curve in tests

* Disable Curve in Buy tests

* blockchainTests.fork.resets Curve and Sampler
dorothy-zbornak pushed a commit that referenced this pull request Feb 27, 2020
* Curve ERC20Bridge

* ERC20BridgeSampler Curve (#2483)

* ERC20Sampler Curve

* Use Bridge Sources for each Curve

* Support multiple versions of the Curve contract

* CHANGELOG and redeployed Curve (mainnet)

* Fix Market ops utils test

* Added Curve DAI USDC USDT TUSD

* Bump sampler gas limit default

* Decode the Curve in tests

* Disable Curve in Buy tests

* blockchainTests.fork.resets Curve and Sampler
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