UniswapV3 [TKR-4] (#197)

* add balancer v2

* fetch balancer v2 pools from subgraph

* feat: initial stab at a Balancer V2 Sampler WIP

* feat: add sampling for buys and fix build issues WIP [untested]

* fix: BalancerV2Sampler implementation issues, works on Kovan

* chore: BalancerV2 sampling boilerplate

* fix: update Balancer V2 mainnet address

* fix: consolidate differences between the 2 working branches

* fix: use mainnet Balancer V2 subgraph

* fix: stack too deep by minimizing and inline Balancer V2 vault interface

* fix: address review comments and clean up

* fix: sampler vault interface and pools cache assuming a pool has swaps

* address more review comments

* fix: TS type issues and add a comment about deadline argument

* fix: pools_cache_tests incorrect token addresses, prettier incompat

* fix: make ERC20BridgeSampler support BalancerV2 non view sampler fns

* fix: use a struct for passing encoded bridge data for Balancer V2

* chore: add changelog entries

* fix: improve gas accuracy of gas schedule for Balancer V2 & Maker Psm

* fix: don't exclude sources with stale caches & wait for cache refresh

* rebase

* `@0x/asset-swapper`: Fix stack too deep errors in sampler

* `@0x/asset-swapper`: Add uniswap V3 sampler.

* `@0x/contracts-zero-ex`: Add UniswapV3 support to FQT

* `@0x/protocol-utils`: Update BridgeProtocols.
`@0x/asset-swapper`: Add sell integration for UniswapV3.

* `@0x/asset-swapper`: Remove unnecessary swap quote consumer constructor arg.
`@0x/asset-swapper`: Enable UniswapV3 on ropsten.

* `@0x/asset-swapper`: UniswapV3 fixes

* `@0x/asset-swapper`: Fix stuff based on latest deployed testnet contracts

* `@0x/asset-swapper`: Remove UniV3 from mainnet sources for now

* `@0x/asset-swapper`: Tweak univ3 gas schedule

* fix CI?

* `@0x/contracts-test-utils`: Set default ganache gas limit to 100e6

Co-authored-by: xianny <xianny@gmail.com>
Co-authored-by: Kim Persson <kimpersson88@gmail.com>
Co-authored-by: Lawrence Forman <me@merklejerk.com>
Co-authored-by: Jacob Evans <jacob@dekz.net>
This commit is contained in:
Lawrence Forman
2021-05-05 05:44:17 -04:00
committed by GitHub
parent f9a794af93
commit a2d42b07b5
54 changed files with 937 additions and 354 deletions

View File

@@ -5,6 +5,10 @@
{
"note": "Add BalancerV2, remove Smoothy, Component and Saddle in BridgeProtocol enum",
"pr": 206
},
{
"note": "Add UniswapV3 bridge protocol IDs and remove invalid ones",
"pr": 197
}
]
},

View File

@@ -41,7 +41,7 @@
},
"homepage": "https://github.com/0xProject/protocol/tree/main/packages/protocol-utils",
"devDependencies": {
"@0x/dev-utils": "^4.2.6",
"@0x/dev-utils": "^4.2.7",
"@0x/ts-doc-gen": "^0.0.28",
"@0x/tslint-config": "^4.1.4",
"@0x/types": "^3.3.3",
@@ -62,13 +62,13 @@
"web3-provider-engine": "14.0.6"
},
"dependencies": {
"@0x/assert": "^3.0.26",
"@0x/assert": "^3.0.27",
"@0x/contract-addresses": "^6.0.0",
"@0x/contract-wrappers": "^13.16.0",
"@0x/json-schemas": "^6.1.2",
"@0x/subproviders": "^6.5.2",
"@0x/utils": "^6.4.2",
"@0x/web3-wrapper": "^7.5.2",
"@0x/json-schemas": "^6.1.3",
"@0x/subproviders": "^6.5.3",
"@0x/utils": "^6.4.3",
"@0x/web3-wrapper": "^7.5.3",
"chai": "^4.0.1",
"ethereumjs-util": "^7.0.10",
"ethers": "~4.0.4",

View File

@@ -127,6 +127,7 @@ export enum BridgeProtocol {
Nerve,
MakerPsm,
BalancerV2,
UniswapV3,
}
// tslint:enable: enum-naming