Compare commits

..

50 Commits

Author SHA1 Message Date
Github Actions
859c36cb10 Publish
- @0x/contracts-asset-proxy@3.7.17
 - @0x/contracts-broker@1.1.35
 - @0x/contracts-coordinator@3.1.36
 - @0x/contracts-dev-utils@1.3.34
 - @0x/contracts-erc1155@2.1.35
 - @0x/contracts-erc20@3.3.14
 - @0x/contracts-erc721@3.1.35
 - @0x/contracts-exchange-forwarder@4.2.36
 - @0x/contracts-exchange-libs@4.3.35
 - @0x/contracts-exchange@3.2.36
 - @0x/contracts-extensions@6.2.30
 - @0x/contracts-integrations@2.7.62
 - @0x/contracts-multisig@4.1.36
 - @0x/contracts-staking@2.0.43
 - @0x/contracts-test-utils@5.4.6
 - @0x/contracts-treasury@1.3.0
 - @0x/contracts-utils@4.7.14
 - @0x/contracts-zero-ex@0.27.0
 - @0x/asset-swapper@16.24.0
 - @0x/contract-addresses@6.5.0
 - @0x/contract-wrappers-test@12.2.51
 - @0x/contract-wrappers@13.17.3
 - @0x/migrations@8.0.12
 - @0x/order-utils@10.4.27
 - @0x/protocol-utils@1.8.0
2021-08-06 04:54:38 +00:00
Github Actions
3e34386812 Updated CHANGELOGS & MD docs 2021-08-06 04:54:34 +00:00
Jacob Evans
a35af11981 feat: Clipper (#299)
* feat: Clipper

* feat: Curve tricrypto2 (#302)

* Scope down the token list search space for Clipper

* update deployed addresses
2021-08-06 14:12:43 +10:00
mzhu25
59eabec71e Add proposal 1 and test (#298)
* Add proposal 1 and test

* update changelog
2021-08-05 13:10:36 -07:00
Github Actions
bf4c7e7d50 Publish
- @0x/contracts-integrations@2.7.61
 - @0x/asset-swapper@16.23.1
2021-07-29 15:23:54 +00:00
Github Actions
fd098ca4df Updated CHANGELOGS & MD docs 2021-07-29 15:23:49 +00:00
Lawrence Forman
c360f8d8fd Publish (#296)
- @0x/contracts-integrations@2.7.60
 - @0x/asset-swapper@16.23.0

Co-authored-by: Github Actions <github-actions@github.com>
2021-07-29 10:54:37 -04:00
Github Actions
b358559421 Publish
- @0x/contracts-integrations@2.7.60
 - @0x/asset-swapper@16.23.0
2021-07-16 22:11:44 +00:00
Github Actions
df5aad8e8e Updated CHANGELOGS & MD docs 2021-07-16 22:11:39 +00:00
Andreas Andreakis
8dbf79db59 fix: lint (#289) 2021-07-16 12:24:56 -07:00
Andreas Andreakis
1839608e84 feat: ACryptoS StableSwap (#284) 2021-07-15 15:19:40 -07:00
Github Actions
6e3e795b8b Publish
- @0x/contracts-integrations@2.7.59
 - @0x/asset-swapper@16.22.0
2021-07-13 22:19:54 +00:00
Github Actions
d9c410a7e3 Updated CHANGELOGS & MD docs 2021-07-13 22:19:49 +00:00
Romain Butteaud
609727afe8 feat: Saddle alETH, D4 pools (#283) 2021-07-13 14:22:16 -07:00
Romain Butteaud
8a5c74c0b4 feat: IronSwap (#281)
* feat: IronSwap

* feat: IronSwap, changelog

* feat: IronSwap, prettier
2021-07-13 14:07:45 -07:00
Github Actions
cd93f3b07e Publish
- @0x/contracts-integrations@2.7.58
 - @0x/asset-swapper@16.21.0
2021-07-10 08:00:34 +00:00
Github Actions
8397b12de6 Updated CHANGELOGS & MD docs 2021-07-10 08:00:29 +00:00
Romain Butteaud
3f85acec3a feat: JetSwap (#280)
* feat: JetSwap

* feat: JetSwap, changelog
2021-07-10 00:18:29 -07:00
phil-ociraptor
d6a9e3d600 fix: uncaught type error while logging (#277) 2021-07-07 14:28:42 -05:00
phil-ociraptor
361569ac2f chore: emit a log when a quote is returned that is between 99-100% of quote (#275) 2021-07-06 17:19:41 -05:00
Github Actions
719664c145 Publish
- @0x/contracts-integrations@2.7.57
 - @0x/asset-swapper@16.20.0
2021-07-06 21:34:44 +00:00
Github Actions
f800d6c24c Updated CHANGELOGS & MD docs 2021-07-06 21:34:39 +00:00
Romain Butteaud
a9a81bcafb feat: ShibaSwap (#276) 2021-07-06 13:53:39 -07:00
Github Actions
4280307a15 Publish
- @0x/contracts-integrations@2.7.56
 - @0x/asset-swapper@16.19.1
2021-07-06 04:03:16 +00:00
Github Actions
7b57d3ae51 Updated CHANGELOGS & MD docs 2021-07-06 04:03:11 +00:00
Romain Butteaud
8a8a5bbda0 fix: adding MultiHop for Polygon (#271) 2021-07-06 13:33:41 +10:00
Jacob Evans
76987c8db1 fix: PLP fallback (#272)
* fix: PLP fallback

* CHANGELOG
2021-07-06 13:32:34 +10:00
Github Actions
6f8971cc42 Publish
- @0x/contracts-integrations@2.7.55
 - @0x/asset-swapper@16.19.0
2021-07-02 01:48:13 +00:00
Github Actions
71ab882143 Updated CHANGELOGS & MD docs 2021-07-02 01:48:08 +00:00
Romain Butteaud
5a4961c8d9 fix: KyberDMM pick best pools, Polygon KyberDMM (#269)
* fix: KyberDMM all pools, Polygon KyberDMM

* fix: KyberDMM, remove getPoolsLength interface and revert if no pools found
2021-07-01 18:07:02 -07:00
mzhu25
4c4fb99d87 Add PLP as a source for Polygon (#270)
* Whitelist PLP as a source for Polygon

* changelog
2021-07-01 17:21:23 -07:00
Github Actions
872abf09e9 Publish
- @0x/contracts-integrations@2.7.54
 - @0x/asset-swapper@6.18.3
2021-06-29 17:20:15 +00:00
Github Actions
f10bfe7d04 Updated CHANGELOGS & MD docs 2021-06-29 17:20:11 +00:00
Romain Butteaud
a74d8deff3 feat: Balancer V2 Polygon (#267) 2021-06-29 09:46:17 -07:00
Github Actions
835ee4e8de Publish
- @0x/contracts-integrations@2.7.53
 - @0x/asset-swapper@6.18.2
2021-06-24 19:25:12 +00:00
Github Actions
63ec42303f Updated CHANGELOGS & MD docs 2021-06-24 19:25:07 +00:00
Romain Butteaud
f789aebddc fix: duplicate SOURCE_FLAGS index (#266) 2021-06-24 11:58:05 -07:00
Github Actions
efd83be779 Publish
- @0x/contracts-integrations@2.7.52
 - @0x/asset-swapper@6.18.1
2021-06-22 23:37:28 +00:00
Github Actions
603bc1d51c Updated CHANGELOGS & MD docs 2021-06-22 23:37:23 +00:00
Romain Butteaud
32a930a7fc feat: FirebirdOneSwap, ApeSwap [TKR-182] [TKR-173] (#265)
* fix: removing TITAN and IRON as intermediate tokens

* feat: FirebirdOneSwap, ApeSwap, intermediate tokens update

* chore: changelog
2021-06-22 16:04:09 -07:00
Github Actions
f464bf68d7 Publish
- @0x/contracts-asset-proxy@3.7.16
 - @0x/contracts-broker@1.1.34
 - @0x/contracts-coordinator@3.1.35
 - @0x/contracts-dev-utils@1.3.33
 - @0x/contracts-erc1155@2.1.34
 - @0x/contracts-erc20@3.3.13
 - @0x/contracts-erc721@3.1.34
 - @0x/contracts-exchange-forwarder@4.2.35
 - @0x/contracts-exchange-libs@4.3.34
 - @0x/contracts-exchange@3.2.35
 - @0x/contracts-extensions@6.2.29
 - @0x/contracts-integrations@2.7.51
 - @0x/contracts-multisig@4.1.35
 - @0x/contracts-staking@2.0.42
 - @0x/contracts-test-utils@5.4.5
 - @0x/contracts-treasury@1.2.3
 - @0x/contracts-utils@4.7.13
 - @0x/contracts-zero-ex@0.26.0
 - @0x/asset-swapper@6.18.0
 - @0x/contract-addresses@6.4.0
 - @0x/contract-wrappers-test@12.2.50
 - @0x/contract-wrappers@13.17.2
 - @0x/migrations@8.0.11
 - @0x/order-utils@10.4.26
 - @0x/protocol-utils@1.7.2
2021-06-22 10:03:41 +00:00
Github Actions
ebdc4fb509 Updated CHANGELOGS & MD docs 2021-06-22 10:03:35 +00:00
Kim Persson
7580719586 feat: Lido StETH deposit integration [TKR-90] (#260)
* feat: initial stab at the LidoSampler and the MixinLido

* feat: full integration of lido sampler and mixin

* fix: return pooled Ether amount not shares & properly unwrap WETH

* refactor: clean up Lido sampler and data passing

* fix: lower gas schedule for WETH to stETH deposits

* refactor: remove MixinLido unused ETH code path

* chore: add changelog entries

* fix: lower Lido gas schedule slightly

* fix: revert MixinLido on unsupported token pair

* fix: address review comments, improve early exit if wrong tokens

* fix: add contract addresses to Lido FQT
2021-06-22 11:25:47 +02:00
Github Actions
aba9db2be7 Publish
- @0x/contracts-integrations@2.7.50
 - @0x/asset-swapper@6.17.3
2021-06-16 01:38:55 +00:00
Github Actions
a6680411c8 Updated CHANGELOGS & MD docs 2021-06-16 01:38:51 +00:00
Romain Butteaud
0d0e87de94 QUICK, TITAN, IRON as intermediate tokens, integrating WaultSwap and Polydex for Polygon, Curve renBTC pool (#264) 2021-06-15 18:12:07 -07:00
Github Actions
ccf2000c09 Publish
- @0x/contracts-asset-proxy@3.7.15
 - @0x/contracts-broker@1.1.33
 - @0x/contracts-coordinator@3.1.34
 - @0x/contracts-dev-utils@1.3.32
 - @0x/contracts-erc1155@2.1.33
 - @0x/contracts-erc20@3.3.12
 - @0x/contracts-erc721@3.1.33
 - @0x/contracts-exchange-forwarder@4.2.34
 - @0x/contracts-exchange-libs@4.3.33
 - @0x/contracts-exchange@3.2.34
 - @0x/contracts-extensions@6.2.28
 - @0x/contracts-integrations@2.7.49
 - @0x/contracts-multisig@4.1.34
 - @0x/contracts-staking@2.0.41
 - @0x/contracts-test-utils@5.4.4
 - @0x/contracts-treasury@1.2.2
 - @0x/contracts-utils@4.7.12
 - @0x/contracts-zero-ex@0.25.1
 - @0x/asset-swapper@6.17.2
 - @0x/contract-addresses@6.3.1
 - @0x/contract-wrappers-test@12.2.49
 - @0x/contract-wrappers@13.17.1
 - @0x/migrations@8.0.10
 - @0x/order-utils@10.4.25
 - @0x/protocol-utils@1.7.1
2021-06-11 03:34:49 +00:00
Github Actions
3eb2e0f56a Updated CHANGELOGS & MD docs 2021-06-11 03:34:44 +00:00
Romain Butteaud
d07c7d5b69 feat: Curve V2 (#262)
* feat: Curve V2

* fix: CurveV2 gas schedule, remove unused import from MixinCurveV2

* feat: FQT address update

* chore: Curve V2 exchange_underlying, adding Polygon atricrypto pool

* prettier

* feat: FQT Polygon address update

* feat: FQT address update
2021-06-10 19:01:11 -07:00
Romain Butteaud
adf6684c29 chore: adding Uni v3 as a fee source (#261) 2021-06-08 17:57:49 -07:00
102 changed files with 2643 additions and 284 deletions

View File

@@ -1,4 +1,31 @@
[
{
"timestamp": 1628225642,
"version": "3.7.17",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1624356181,
"version": "3.7.16",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1623382456,
"version": "3.7.15",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1622609597,
"version": "3.7.14",

View File

@@ -5,6 +5,18 @@ Edit the package's CHANGELOG.json file only.
CHANGELOG
## v3.7.17 - _August 6, 2021_
* Dependencies updated
## v3.7.16 - _June 22, 2021_
* Dependencies updated
## v3.7.15 - _June 11, 2021_
* Dependencies updated
## v3.7.14 - _June 2, 2021_
* Dependencies updated

View File

@@ -1,6 +1,6 @@
{
"name": "@0x/contracts-asset-proxy",
"version": "3.7.14",
"version": "3.7.17",
"engines": {
"node": ">=6.12"
},
@@ -52,10 +52,10 @@
"homepage": "https://github.com/0xProject/protocol/tree/main/contracts/protocol",
"devDependencies": {
"@0x/abi-gen": "^5.6.0",
"@0x/contract-wrappers": "^13.17.0",
"@0x/contract-wrappers": "^13.17.3",
"@0x/contracts-gen": "^2.0.38",
"@0x/contracts-test-utils": "^5.4.3",
"@0x/contracts-utils": "^4.7.11",
"@0x/contracts-test-utils": "^5.4.6",
"@0x/contracts-utils": "^4.7.14",
"@0x/dev-utils": "^4.2.7",
"@0x/sol-compiler": "^4.7.3",
"@0x/ts-doc-gen": "^0.0.28",
@@ -80,11 +80,11 @@
},
"dependencies": {
"@0x/base-contract": "^6.4.0",
"@0x/contracts-erc1155": "^2.1.32",
"@0x/contracts-erc20": "^3.3.11",
"@0x/contracts-erc721": "^3.1.32",
"@0x/contracts-exchange-libs": "^4.3.32",
"@0x/order-utils": "^10.4.24",
"@0x/contracts-erc1155": "^2.1.35",
"@0x/contracts-erc20": "^3.3.14",
"@0x/contracts-erc721": "^3.1.35",
"@0x/contracts-exchange-libs": "^4.3.35",
"@0x/order-utils": "^10.4.27",
"@0x/types": "^3.3.3",
"@0x/typescript-typings": "^5.2.0",
"@0x/utils": "^6.4.3",

View File

@@ -1,4 +1,31 @@
[
{
"timestamp": 1628225642,
"version": "1.1.35",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1624356181,
"version": "1.1.34",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1623382456,
"version": "1.1.33",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1622609597,
"version": "1.1.32",

View File

@@ -5,6 +5,18 @@ Edit the package's CHANGELOG.json file only.
CHANGELOG
## v1.1.35 - _August 6, 2021_
* Dependencies updated
## v1.1.34 - _June 22, 2021_
* Dependencies updated
## v1.1.33 - _June 11, 2021_
* Dependencies updated
## v1.1.32 - _June 2, 2021_
* Dependencies updated

View File

@@ -1,6 +1,6 @@
{
"name": "@0x/contracts-broker",
"version": "1.1.32",
"version": "1.1.35",
"engines": {
"node": ">=6.12"
},
@@ -52,14 +52,14 @@
"homepage": "https://github.com/0xProject/protocol/tree/main/contracts/extensions",
"devDependencies": {
"@0x/abi-gen": "^5.6.0",
"@0x/contracts-asset-proxy": "^3.7.14",
"@0x/contracts-erc20": "^3.3.11",
"@0x/contracts-erc721": "^3.1.32",
"@0x/contracts-exchange": "^3.2.33",
"@0x/contracts-exchange-libs": "^4.3.32",
"@0x/contracts-asset-proxy": "^3.7.17",
"@0x/contracts-erc20": "^3.3.14",
"@0x/contracts-erc721": "^3.1.35",
"@0x/contracts-exchange": "^3.2.36",
"@0x/contracts-exchange-libs": "^4.3.35",
"@0x/contracts-gen": "^2.0.38",
"@0x/contracts-test-utils": "^5.4.3",
"@0x/contracts-utils": "^4.7.11",
"@0x/contracts-test-utils": "^5.4.6",
"@0x/contracts-utils": "^4.7.14",
"@0x/sol-compiler": "^4.7.3",
"@0x/ts-doc-gen": "^0.0.28",
"@0x/tslint-config": "^4.1.4",
@@ -85,7 +85,7 @@
},
"dependencies": {
"@0x/base-contract": "^6.4.0",
"@0x/order-utils": "^10.4.24",
"@0x/order-utils": "^10.4.27",
"@0x/typescript-typings": "^5.2.0",
"@0x/utils": "^6.4.3",
"ethereum-types": "^3.5.0"

View File

@@ -1,4 +1,31 @@
[
{
"timestamp": 1628225642,
"version": "3.1.36",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1624356181,
"version": "3.1.35",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1623382456,
"version": "3.1.34",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1622609597,
"version": "3.1.33",

View File

@@ -5,6 +5,18 @@ Edit the package's CHANGELOG.json file only.
CHANGELOG
## v3.1.36 - _August 6, 2021_
* Dependencies updated
## v3.1.35 - _June 22, 2021_
* Dependencies updated
## v3.1.34 - _June 11, 2021_
* Dependencies updated
## v3.1.33 - _June 2, 2021_
* Dependencies updated

View File

@@ -1,6 +1,6 @@
{
"name": "@0x/contracts-coordinator",
"version": "3.1.33",
"version": "3.1.36",
"engines": {
"node": ">=6.12"
},
@@ -53,12 +53,12 @@
"homepage": "https://github.com/0xProject/protocol/tree/main/contracts/extensions",
"devDependencies": {
"@0x/abi-gen": "^5.6.0",
"@0x/contracts-asset-proxy": "^3.7.14",
"@0x/contracts-dev-utils": "^1.3.31",
"@0x/contracts-erc20": "^3.3.11",
"@0x/contracts-asset-proxy": "^3.7.17",
"@0x/contracts-dev-utils": "^1.3.34",
"@0x/contracts-erc20": "^3.3.14",
"@0x/contracts-gen": "^2.0.38",
"@0x/dev-utils": "^4.2.7",
"@0x/order-utils": "^10.4.24",
"@0x/order-utils": "^10.4.27",
"@0x/sol-compiler": "^4.7.3",
"@0x/ts-doc-gen": "^0.0.28",
"@0x/tslint-config": "^4.1.4",
@@ -84,10 +84,10 @@
"dependencies": {
"@0x/assert": "^3.0.27",
"@0x/base-contract": "^6.4.0",
"@0x/contract-addresses": "^6.3.0",
"@0x/contracts-exchange": "^3.2.33",
"@0x/contracts-test-utils": "^5.4.3",
"@0x/contracts-utils": "^4.7.11",
"@0x/contract-addresses": "^6.5.0",
"@0x/contracts-exchange": "^3.2.36",
"@0x/contracts-test-utils": "^5.4.6",
"@0x/contracts-utils": "^4.7.14",
"@0x/json-schemas": "^6.1.3",
"@0x/types": "^3.3.3",
"@0x/typescript-typings": "^5.2.0",

View File

@@ -1,4 +1,31 @@
[
{
"timestamp": 1628225642,
"version": "1.3.34",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1624356181,
"version": "1.3.33",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1623382456,
"version": "1.3.32",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1622609597,
"version": "1.3.31",

View File

@@ -5,6 +5,18 @@ Edit the package's CHANGELOG.json file only.
CHANGELOG
## v1.3.34 - _August 6, 2021_
* Dependencies updated
## v1.3.33 - _June 22, 2021_
* Dependencies updated
## v1.3.32 - _June 11, 2021_
* Dependencies updated
## v1.3.31 - _June 2, 2021_
* Dependencies updated

View File

@@ -1,6 +1,6 @@
{
"name": "@0x/contracts-dev-utils",
"version": "1.3.31",
"version": "1.3.34",
"engines": {
"node": ">=6.12"
},
@@ -43,10 +43,10 @@
"devDependencies": {
"@0x/abi-gen": "^5.6.0",
"@0x/assert": "^3.0.27",
"@0x/contracts-asset-proxy": "^3.7.14",
"@0x/contracts-erc20": "^3.3.11",
"@0x/contracts-asset-proxy": "^3.7.17",
"@0x/contracts-erc20": "^3.3.14",
"@0x/contracts-gen": "^2.0.38",
"@0x/contracts-test-utils": "^5.4.3",
"@0x/contracts-test-utils": "^5.4.6",
"@0x/sol-compiler": "^4.7.3",
"@0x/ts-doc-gen": "^0.0.28",
"@0x/tslint-config": "^4.1.4",

View File

@@ -1,4 +1,31 @@
[
{
"timestamp": 1628225642,
"version": "2.1.35",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1624356181,
"version": "2.1.34",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1623382456,
"version": "2.1.33",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1622609597,
"version": "2.1.32",

View File

@@ -5,6 +5,18 @@ Edit the package's CHANGELOG.json file only.
CHANGELOG
## v2.1.35 - _August 6, 2021_
* Dependencies updated
## v2.1.34 - _June 22, 2021_
* Dependencies updated
## v2.1.33 - _June 11, 2021_
* Dependencies updated
## v2.1.32 - _June 2, 2021_
* Dependencies updated

View File

@@ -1,6 +1,6 @@
{
"name": "@0x/contracts-erc1155",
"version": "2.1.32",
"version": "2.1.35",
"engines": {
"node": ">=6.12"
},
@@ -54,7 +54,7 @@
"devDependencies": {
"@0x/abi-gen": "^5.6.0",
"@0x/contracts-gen": "^2.0.38",
"@0x/contracts-utils": "^4.7.11",
"@0x/contracts-utils": "^4.7.14",
"@0x/dev-utils": "^4.2.7",
"@0x/sol-compiler": "^4.7.3",
"@0x/ts-doc-gen": "^0.0.28",
@@ -81,7 +81,7 @@
},
"dependencies": {
"@0x/base-contract": "^6.4.0",
"@0x/contracts-test-utils": "^5.4.3",
"@0x/contracts-test-utils": "^5.4.6",
"@0x/utils": "^6.4.3",
"@0x/web3-wrapper": "^7.5.3",
"lodash": "^4.17.11"

View File

@@ -1,4 +1,31 @@
[
{
"timestamp": 1628225642,
"version": "3.3.14",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1624356181,
"version": "3.3.13",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1623382456,
"version": "3.3.12",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1622609597,
"version": "3.3.11",

View File

@@ -5,6 +5,18 @@ Edit the package's CHANGELOG.json file only.
CHANGELOG
## v3.3.14 - _August 6, 2021_
* Dependencies updated
## v3.3.13 - _June 22, 2021_
* Dependencies updated
## v3.3.12 - _June 11, 2021_
* Dependencies updated
## v3.3.11 - _June 2, 2021_
* Dependencies updated

View File

@@ -1,6 +1,6 @@
{
"name": "@0x/contracts-erc20",
"version": "3.3.11",
"version": "3.3.14",
"engines": {
"node": ">=6.12"
},
@@ -53,8 +53,8 @@
"devDependencies": {
"@0x/abi-gen": "^5.6.0",
"@0x/contracts-gen": "^2.0.38",
"@0x/contracts-test-utils": "^5.4.3",
"@0x/contracts-utils": "^4.7.11",
"@0x/contracts-test-utils": "^5.4.6",
"@0x/contracts-utils": "^4.7.14",
"@0x/dev-utils": "^4.2.7",
"@0x/sol-compiler": "^4.7.3",
"@0x/ts-doc-gen": "^0.0.28",

View File

@@ -1,4 +1,31 @@
[
{
"timestamp": 1628225642,
"version": "3.1.35",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1624356181,
"version": "3.1.34",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1623382456,
"version": "3.1.33",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1622609597,
"version": "3.1.32",

View File

@@ -5,6 +5,18 @@ Edit the package's CHANGELOG.json file only.
CHANGELOG
## v3.1.35 - _August 6, 2021_
* Dependencies updated
## v3.1.34 - _June 22, 2021_
* Dependencies updated
## v3.1.33 - _June 11, 2021_
* Dependencies updated
## v3.1.32 - _June 2, 2021_
* Dependencies updated

View File

@@ -1,6 +1,6 @@
{
"name": "@0x/contracts-erc721",
"version": "3.1.32",
"version": "3.1.35",
"engines": {
"node": ">=6.12"
},
@@ -54,8 +54,8 @@
"devDependencies": {
"@0x/abi-gen": "^5.6.0",
"@0x/contracts-gen": "^2.0.38",
"@0x/contracts-test-utils": "^5.4.3",
"@0x/contracts-utils": "^4.7.11",
"@0x/contracts-test-utils": "^5.4.6",
"@0x/contracts-utils": "^4.7.14",
"@0x/dev-utils": "^4.2.7",
"@0x/sol-compiler": "^4.7.3",
"@0x/ts-doc-gen": "^0.0.28",

View File

@@ -1,4 +1,31 @@
[
{
"timestamp": 1628225642,
"version": "4.2.36",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1624356181,
"version": "4.2.35",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1623382456,
"version": "4.2.34",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1622609597,
"version": "4.2.33",

View File

@@ -5,6 +5,18 @@ Edit the package's CHANGELOG.json file only.
CHANGELOG
## v4.2.36 - _August 6, 2021_
* Dependencies updated
## v4.2.35 - _June 22, 2021_
* Dependencies updated
## v4.2.34 - _June 11, 2021_
* Dependencies updated
## v4.2.33 - _June 2, 2021_
* Dependencies updated

View File

@@ -1,6 +1,6 @@
{
"name": "@0x/contracts-exchange-forwarder",
"version": "4.2.33",
"version": "4.2.36",
"engines": {
"node": ">=6.12"
},
@@ -53,18 +53,18 @@
"homepage": "https://github.com/0xProject/protocol/tree/main/contracts/extensions",
"devDependencies": {
"@0x/abi-gen": "^5.6.0",
"@0x/contracts-asset-proxy": "^3.7.14",
"@0x/contracts-dev-utils": "^1.3.31",
"@0x/contracts-erc1155": "^2.1.32",
"@0x/contracts-erc20": "^3.3.11",
"@0x/contracts-erc721": "^3.1.32",
"@0x/contracts-exchange": "^3.2.33",
"@0x/contracts-exchange-libs": "^4.3.32",
"@0x/contracts-asset-proxy": "^3.7.17",
"@0x/contracts-dev-utils": "^1.3.34",
"@0x/contracts-erc1155": "^2.1.35",
"@0x/contracts-erc20": "^3.3.14",
"@0x/contracts-erc721": "^3.1.35",
"@0x/contracts-exchange": "^3.2.36",
"@0x/contracts-exchange-libs": "^4.3.35",
"@0x/contracts-gen": "^2.0.38",
"@0x/contracts-test-utils": "^5.4.3",
"@0x/contracts-utils": "^4.7.11",
"@0x/contracts-test-utils": "^5.4.6",
"@0x/contracts-utils": "^4.7.14",
"@0x/dev-utils": "^4.2.7",
"@0x/order-utils": "^10.4.24",
"@0x/order-utils": "^10.4.27",
"@0x/sol-compiler": "^4.7.3",
"@0x/ts-doc-gen": "^0.0.28",
"@0x/tslint-config": "^4.1.4",

View File

@@ -1,4 +1,31 @@
[
{
"timestamp": 1628225642,
"version": "4.3.35",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1624356181,
"version": "4.3.34",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1623382456,
"version": "4.3.33",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1622609597,
"version": "4.3.32",

View File

@@ -5,6 +5,18 @@ Edit the package's CHANGELOG.json file only.
CHANGELOG
## v4.3.35 - _August 6, 2021_
* Dependencies updated
## v4.3.34 - _June 22, 2021_
* Dependencies updated
## v4.3.33 - _June 11, 2021_
* Dependencies updated
## v4.3.32 - _June 2, 2021_
* Dependencies updated

View File

@@ -1,6 +1,6 @@
{
"name": "@0x/contracts-exchange-libs",
"version": "4.3.32",
"version": "4.3.35",
"engines": {
"node": ">=6.12"
},
@@ -81,9 +81,9 @@
},
"dependencies": {
"@0x/base-contract": "^6.4.0",
"@0x/contracts-test-utils": "^5.4.3",
"@0x/contracts-utils": "^4.7.11",
"@0x/order-utils": "^10.4.24",
"@0x/contracts-test-utils": "^5.4.6",
"@0x/contracts-utils": "^4.7.14",
"@0x/order-utils": "^10.4.27",
"@0x/types": "^3.3.3",
"@0x/typescript-typings": "^5.2.0",
"@0x/utils": "^6.4.3",

View File

@@ -1,4 +1,31 @@
[
{
"timestamp": 1628225642,
"version": "3.2.36",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1624356181,
"version": "3.2.35",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1623382456,
"version": "3.2.34",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1622609597,
"version": "3.2.33",

View File

@@ -5,6 +5,18 @@ Edit the package's CHANGELOG.json file only.
CHANGELOG
## v3.2.36 - _August 6, 2021_
* Dependencies updated
## v3.2.35 - _June 22, 2021_
* Dependencies updated
## v3.2.34 - _June 11, 2021_
* Dependencies updated
## v3.2.33 - _June 2, 2021_
* Dependencies updated

View File

@@ -1,6 +1,6 @@
{
"name": "@0x/contracts-exchange",
"version": "3.2.33",
"version": "3.2.36",
"engines": {
"node": ">=6.12"
},
@@ -53,13 +53,13 @@
"homepage": "https://github.com/0xProject/protocol/tree/main/contracts/protocol",
"devDependencies": {
"@0x/abi-gen": "^5.6.0",
"@0x/contracts-asset-proxy": "^3.7.14",
"@0x/contracts-exchange-libs": "^4.3.32",
"@0x/contracts-asset-proxy": "^3.7.17",
"@0x/contracts-exchange-libs": "^4.3.35",
"@0x/contracts-gen": "^2.0.38",
"@0x/contracts-multisig": "^4.1.33",
"@0x/contracts-staking": "^2.0.40",
"@0x/contracts-test-utils": "^5.4.3",
"@0x/contracts-utils": "^4.7.11",
"@0x/contracts-multisig": "^4.1.36",
"@0x/contracts-staking": "^2.0.43",
"@0x/contracts-test-utils": "^5.4.6",
"@0x/contracts-utils": "^4.7.14",
"@0x/dev-utils": "^4.2.7",
"@0x/sol-compiler": "^4.7.3",
"@0x/ts-doc-gen": "^0.0.28",
@@ -89,11 +89,11 @@
},
"dependencies": {
"@0x/base-contract": "^6.4.0",
"@0x/contracts-dev-utils": "^1.3.31",
"@0x/contracts-erc1155": "^2.1.32",
"@0x/contracts-erc20": "^3.3.11",
"@0x/contracts-erc721": "^3.1.32",
"@0x/order-utils": "^10.4.24",
"@0x/contracts-dev-utils": "^1.3.34",
"@0x/contracts-erc1155": "^2.1.35",
"@0x/contracts-erc20": "^3.3.14",
"@0x/contracts-erc721": "^3.1.35",
"@0x/order-utils": "^10.4.27",
"@0x/utils": "^6.4.3",
"lodash": "^4.17.11"
},

View File

@@ -1,4 +1,31 @@
[
{
"timestamp": 1628225642,
"version": "6.2.30",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1624356181,
"version": "6.2.29",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1623382456,
"version": "6.2.28",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1622609597,
"version": "6.2.27",

View File

@@ -5,6 +5,18 @@ Edit the package's CHANGELOG.json file only.
CHANGELOG
## v6.2.30 - _August 6, 2021_
* Dependencies updated
## v6.2.29 - _June 22, 2021_
* Dependencies updated
## v6.2.28 - _June 11, 2021_
* Dependencies updated
## v6.2.27 - _June 2, 2021_
* Dependencies updated

View File

@@ -1,6 +1,6 @@
{
"name": "@0x/contracts-extensions",
"version": "6.2.27",
"version": "6.2.30",
"engines": {
"node": ">=6.12"
},
@@ -53,16 +53,16 @@
"homepage": "https://github.com/0xProject/protocol/tree/main/contracts/extensions",
"devDependencies": {
"@0x/abi-gen": "^5.6.0",
"@0x/contracts-asset-proxy": "^3.7.14",
"@0x/contracts-dev-utils": "^1.3.31",
"@0x/contracts-erc20": "^3.3.11",
"@0x/contracts-erc721": "^3.1.32",
"@0x/contracts-exchange": "^3.2.33",
"@0x/contracts-exchange-libs": "^4.3.32",
"@0x/contracts-asset-proxy": "^3.7.17",
"@0x/contracts-dev-utils": "^1.3.34",
"@0x/contracts-erc20": "^3.3.14",
"@0x/contracts-erc721": "^3.1.35",
"@0x/contracts-exchange": "^3.2.36",
"@0x/contracts-exchange-libs": "^4.3.35",
"@0x/contracts-gen": "^2.0.38",
"@0x/contracts-utils": "^4.7.11",
"@0x/contracts-utils": "^4.7.14",
"@0x/dev-utils": "^4.2.7",
"@0x/order-utils": "^10.4.24",
"@0x/order-utils": "^10.4.27",
"@0x/sol-compiler": "^4.7.3",
"@0x/ts-doc-gen": "^0.0.28",
"@0x/tslint-config": "^4.1.4",
@@ -91,7 +91,7 @@
},
"dependencies": {
"@0x/base-contract": "^6.4.0",
"@0x/contracts-test-utils": "^5.4.3",
"@0x/contracts-test-utils": "^5.4.6",
"@0x/typescript-typings": "^5.2.0",
"ethereum-types": "^3.5.0"
},

View File

@@ -1,6 +1,6 @@
{
"name": "@0x/contracts-integrations",
"version": "2.7.48",
"version": "2.7.62",
"private": true,
"engines": {
"node": ">=6.12"
@@ -53,21 +53,21 @@
"homepage": "https://github.com/0xProject/protocol/tree/main/contracts/extensions",
"devDependencies": {
"@0x/abi-gen": "^5.6.0",
"@0x/contract-addresses": "^6.3.0",
"@0x/contract-wrappers": "^13.17.0",
"@0x/contracts-broker": "^1.1.32",
"@0x/contracts-coordinator": "^3.1.33",
"@0x/contracts-dev-utils": "^1.3.31",
"@0x/contracts-exchange-forwarder": "^4.2.33",
"@0x/contracts-exchange-libs": "^4.3.32",
"@0x/contracts-extensions": "^6.2.27",
"@0x/contract-addresses": "^6.5.0",
"@0x/contract-wrappers": "^13.17.3",
"@0x/contracts-broker": "^1.1.35",
"@0x/contracts-coordinator": "^3.1.36",
"@0x/contracts-dev-utils": "^1.3.34",
"@0x/contracts-exchange-forwarder": "^4.2.36",
"@0x/contracts-exchange-libs": "^4.3.35",
"@0x/contracts-extensions": "^6.2.30",
"@0x/contracts-gen": "^2.0.38",
"@0x/contracts-utils": "^4.7.11",
"@0x/contracts-utils": "^4.7.14",
"@0x/coordinator-server": "^1.0.5",
"@0x/dev-utils": "^4.2.7",
"@0x/migrations": "^8.0.9",
"@0x/order-utils": "^10.4.24",
"@0x/protocol-utils": "^1.7.0",
"@0x/migrations": "^8.0.12",
"@0x/order-utils": "^10.4.27",
"@0x/protocol-utils": "^1.8.0",
"@0x/sol-compiler": "^4.7.3",
"@0x/tslint-config": "^4.1.4",
"@0x/web3-wrapper": "^7.5.3",
@@ -93,17 +93,17 @@
"typescript": "4.2.2"
},
"dependencies": {
"@0x/asset-swapper": "^6.17.1",
"@0x/asset-swapper": "^16.24.0",
"@0x/base-contract": "^6.4.0",
"@0x/contracts-asset-proxy": "^3.7.14",
"@0x/contracts-erc1155": "^2.1.32",
"@0x/contracts-erc20": "^3.3.11",
"@0x/contracts-erc721": "^3.1.32",
"@0x/contracts-exchange": "^3.2.33",
"@0x/contracts-multisig": "^4.1.33",
"@0x/contracts-staking": "^2.0.40",
"@0x/contracts-test-utils": "^5.4.3",
"@0x/contracts-zero-ex": "^0.25.0",
"@0x/contracts-asset-proxy": "^3.7.17",
"@0x/contracts-erc1155": "^2.1.35",
"@0x/contracts-erc20": "^3.3.14",
"@0x/contracts-erc721": "^3.1.35",
"@0x/contracts-exchange": "^3.2.36",
"@0x/contracts-multisig": "^4.1.36",
"@0x/contracts-staking": "^2.0.43",
"@0x/contracts-test-utils": "^5.4.6",
"@0x/contracts-zero-ex": "^0.27.0",
"@0x/subproviders": "^6.5.3",
"@0x/types": "^3.3.3",
"@0x/typescript-typings": "^5.2.0",

View File

@@ -1,4 +1,31 @@
[
{
"timestamp": 1628225642,
"version": "4.1.36",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1624356181,
"version": "4.1.35",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1623382456,
"version": "4.1.34",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1622609597,
"version": "4.1.33",

View File

@@ -5,6 +5,18 @@ Edit the package's CHANGELOG.json file only.
CHANGELOG
## v4.1.36 - _August 6, 2021_
* Dependencies updated
## v4.1.35 - _June 22, 2021_
* Dependencies updated
## v4.1.34 - _June 11, 2021_
* Dependencies updated
## v4.1.33 - _June 2, 2021_
* Dependencies updated

View File

@@ -1,6 +1,6 @@
{
"name": "@0x/contracts-multisig",
"version": "4.1.33",
"version": "4.1.36",
"engines": {
"node": ">=6.12"
},
@@ -50,11 +50,11 @@
"homepage": "https://github.com/0xProject/protocol/tree/main/contracts/multisig",
"devDependencies": {
"@0x/abi-gen": "^5.6.0",
"@0x/contracts-asset-proxy": "^3.7.14",
"@0x/contracts-erc20": "^3.3.11",
"@0x/contracts-asset-proxy": "^3.7.17",
"@0x/contracts-erc20": "^3.3.14",
"@0x/contracts-gen": "^2.0.38",
"@0x/contracts-test-utils": "^5.4.3",
"@0x/contracts-utils": "^4.7.11",
"@0x/contracts-test-utils": "^5.4.6",
"@0x/contracts-utils": "^4.7.14",
"@0x/dev-utils": "^4.2.7",
"@0x/sol-compiler": "^4.7.3",
"@0x/tslint-config": "^4.1.4",

View File

@@ -1,4 +1,31 @@
[
{
"timestamp": 1628225642,
"version": "2.0.43",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1624356181,
"version": "2.0.42",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1623382456,
"version": "2.0.41",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1622609597,
"version": "2.0.40",

View File

@@ -5,6 +5,18 @@ Edit the package's CHANGELOG.json file only.
CHANGELOG
## v2.0.43 - _August 6, 2021_
* Dependencies updated
## v2.0.42 - _June 22, 2021_
* Dependencies updated
## v2.0.41 - _June 11, 2021_
* Dependencies updated
## v2.0.40 - _June 2, 2021_
* Dependencies updated

View File

@@ -1,6 +1,6 @@
{
"name": "@0x/contracts-staking",
"version": "2.0.40",
"version": "2.0.43",
"engines": {
"node": ">=6.12"
},
@@ -54,14 +54,14 @@
"homepage": "https://github.com/0xProject/protocol/tree/main/contracts/tokens",
"devDependencies": {
"@0x/abi-gen": "^5.6.0",
"@0x/contracts-asset-proxy": "^3.7.14",
"@0x/contracts-dev-utils": "^1.3.31",
"@0x/contracts-erc20": "^3.3.11",
"@0x/contracts-exchange-libs": "^4.3.32",
"@0x/contracts-asset-proxy": "^3.7.17",
"@0x/contracts-dev-utils": "^1.3.34",
"@0x/contracts-erc20": "^3.3.14",
"@0x/contracts-exchange-libs": "^4.3.35",
"@0x/contracts-gen": "^2.0.38",
"@0x/contracts-utils": "^4.7.11",
"@0x/contracts-utils": "^4.7.14",
"@0x/dev-utils": "^4.2.7",
"@0x/order-utils": "^10.4.24",
"@0x/order-utils": "^10.4.27",
"@0x/sol-compiler": "^4.7.3",
"@0x/ts-doc-gen": "^0.0.28",
"@0x/tslint-config": "^4.1.4",
@@ -88,7 +88,7 @@
},
"dependencies": {
"@0x/base-contract": "^6.4.0",
"@0x/contracts-test-utils": "^5.4.3",
"@0x/contracts-test-utils": "^5.4.6",
"@0x/typescript-typings": "^5.2.0",
"@0x/utils": "^6.4.3",
"ethereum-types": "^3.5.0",

View File

@@ -1,4 +1,31 @@
[
{
"timestamp": 1628225642,
"version": "5.4.6",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1624356181,
"version": "5.4.5",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1623382456,
"version": "5.4.4",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1622609597,
"version": "5.4.3",

View File

@@ -5,6 +5,18 @@ Edit the package's CHANGELOG.json file only.
CHANGELOG
## v5.4.6 - _August 6, 2021_
* Dependencies updated
## v5.4.5 - _June 22, 2021_
* Dependencies updated
## v5.4.4 - _June 11, 2021_
* Dependencies updated
## v5.4.3 - _June 2, 2021_
* Dependencies updated

View File

@@ -1,6 +1,6 @@
{
"name": "@0x/contracts-test-utils",
"version": "5.4.3",
"version": "5.4.6",
"engines": {
"node": ">=6.12"
},
@@ -44,10 +44,10 @@
"dependencies": {
"@0x/assert": "^3.0.27",
"@0x/base-contract": "^6.4.0",
"@0x/contract-addresses": "^6.3.0",
"@0x/contract-addresses": "^6.5.0",
"@0x/dev-utils": "^4.2.7",
"@0x/json-schemas": "^6.1.3",
"@0x/order-utils": "^10.4.24",
"@0x/order-utils": "^10.4.27",
"@0x/sol-coverage": "^4.0.37",
"@0x/sol-profiler": "^4.1.27",
"@0x/sol-trace": "^3.0.37",

View File

@@ -1,4 +1,32 @@
[
{
"version": "1.3.0",
"changes": [
{
"note": "Added proposal 1 params and test",
"pr": 298
}
],
"timestamp": 1628225642
},
{
"timestamp": 1624356181,
"version": "1.2.3",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1623382456,
"version": "1.2.2",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1622609597,
"version": "1.2.1",

View File

@@ -5,6 +5,18 @@ Edit the package's CHANGELOG.json file only.
CHANGELOG
## v1.3.0 - _August 6, 2021_
* Added proposal 1 params and test (#298)
## v1.2.3 - _June 22, 2021_
* Dependencies updated
## v1.2.2 - _June 11, 2021_
* Dependencies updated
## v1.2.1 - _June 2, 2021_
* Dependencies updated

View File

@@ -1,6 +1,6 @@
{
"name": "@0x/contracts-treasury",
"version": "1.2.1",
"version": "1.3.0",
"engines": {
"node": ">=6.12"
},
@@ -47,12 +47,12 @@
"homepage": "https://github.com/0xProject/protocol/tree/main/contracts/treasury",
"devDependencies": {
"@0x/abi-gen": "^5.6.0",
"@0x/contract-addresses": "^6.3.0",
"@0x/contracts-asset-proxy": "^3.7.14",
"@0x/contracts-erc20": "^3.3.11",
"@0x/contract-addresses": "^6.5.0",
"@0x/contracts-asset-proxy": "^3.7.17",
"@0x/contracts-erc20": "^3.3.14",
"@0x/contracts-gen": "^2.0.38",
"@0x/contracts-staking": "^2.0.40",
"@0x/contracts-test-utils": "^5.4.3",
"@0x/contracts-staking": "^2.0.43",
"@0x/contracts-test-utils": "^5.4.6",
"@0x/sol-compiler": "^4.7.3",
"@0x/ts-doc-gen": "^0.0.28",
"@0x/tslint-config": "^4.1.4",
@@ -73,7 +73,7 @@
},
"dependencies": {
"@0x/base-contract": "^6.4.0",
"@0x/protocol-utils": "^1.7.0",
"@0x/protocol-utils": "^1.8.0",
"@0x/subproviders": "^6.5.3",
"@0x/types": "^3.3.3",
"@0x/typescript-typings": "^5.2.0",

File diff suppressed because one or more lines are too long

View File

@@ -151,4 +151,72 @@ blockchainTests.fork.skip('Treasury proposal mainnet fork tests', env => {
);
});
});
describe('Proposal 1', () => {
it('works', async () => {
const proposal = proposals[1];
let executionEpoch: BigNumber;
if (proposal.executionEpoch) {
executionEpoch = proposal.executionEpoch;
} else {
const currentEpoch = await staking.currentEpoch().callAsync();
executionEpoch = currentEpoch.plus(2);
}
const pools = await querySubgraphAsync(PROPOSER);
const proposeTx = treasury.propose(proposal.actions, executionEpoch, proposal.description, pools);
const calldata = proposeTx.getABIEncodedTransactionData();
logUtils.log('ZrxTreasury.propose calldata:');
logUtils.log(calldata);
const proposalId = await proposeTx.callAsync({ from: PROPOSER });
const receipt = await proposeTx.awaitTransactionSuccessAsync({ from: PROPOSER });
verifyEventsFromLogs(
receipt.logs,
[
{
...proposal,
proposalId,
executionEpoch,
proposer: PROPOSER,
operatedPoolIds: pools,
},
],
ZrxTreasuryEvents.ProposalCreated,
);
await fastForwardToNextEpochAsync();
await fastForwardToNextEpochAsync();
await treasury
.castVote(proposalId, true, VOTER_OPERATED_POOLS)
.awaitTransactionSuccessAsync({ from: VOTER });
await env.web3Wrapper.increaseTimeAsync(votingPeriod.plus(1).toNumber());
await env.web3Wrapper.mineBlockAsync();
const executeTx = await treasury.execute(proposalId, proposal.actions).awaitTransactionSuccessAsync();
verifyEventsFromLogs(
executeTx.logs,
[
{
proposalId,
},
],
ZrxTreasuryEvents.ProposalExecuted,
);
const recipient = '0xab66cc8fd10457ebc9d13b9760c835f0a4cbc487';
verifyEventsFromLogs(
executeTx.logs,
[
{
_from: TREASURY_ADDRESS,
_to: recipient,
_value: new BigNumber(330_813).times('1e18'),
},
{
_from: TREASURY_ADDRESS,
_to: recipient,
_value: new BigNumber(420000).times('1e18'),
},
],
ERC20TokenEvents.Transfer,
);
});
});
});

View File

@@ -1,4 +1,31 @@
[
{
"timestamp": 1628225642,
"version": "4.7.14",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1624356181,
"version": "4.7.13",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1623382456,
"version": "4.7.12",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1622609597,
"version": "4.7.11",

View File

@@ -5,6 +5,18 @@ Edit the package's CHANGELOG.json file only.
CHANGELOG
## v4.7.14 - _August 6, 2021_
* Dependencies updated
## v4.7.13 - _June 22, 2021_
* Dependencies updated
## v4.7.12 - _June 11, 2021_
* Dependencies updated
## v4.7.11 - _June 2, 2021_
* Dependencies updated

View File

@@ -1,6 +1,6 @@
{
"name": "@0x/contracts-utils",
"version": "4.7.11",
"version": "4.7.14",
"engines": {
"node": ">=6.12"
},
@@ -52,9 +52,9 @@
"devDependencies": {
"@0x/abi-gen": "^5.6.0",
"@0x/contracts-gen": "^2.0.38",
"@0x/contracts-test-utils": "^5.4.3",
"@0x/contracts-test-utils": "^5.4.6",
"@0x/dev-utils": "^4.2.7",
"@0x/order-utils": "^10.4.24",
"@0x/order-utils": "^10.4.27",
"@0x/sol-compiler": "^4.7.3",
"@0x/tslint-config": "^4.1.4",
"@0x/types": "^3.3.3",

View File

@@ -1,4 +1,32 @@
[
{
"version": "0.27.0",
"changes": [
{
"note": "Add `Clipper` as a custom liquidity source"
}
],
"timestamp": 1628225642
},
{
"version": "0.26.0",
"changes": [
{
"note": "Add Lido stETH deposit integration",
"pr": 260
}
],
"timestamp": 1624356181
},
{
"timestamp": 1623382456,
"version": "0.25.1",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"version": "0.25.0",
"changes": [

View File

@@ -5,6 +5,18 @@ Edit the package's CHANGELOG.json file only.
CHANGELOG
## v0.27.0 - _August 6, 2021_
* Add `Clipper` as a custom liquidity source
## v0.26.0 - _June 22, 2021_
* Add Lido stETH deposit integration (#260)
## v0.25.1 - _June 11, 2021_
* Dependencies updated
## v0.25.0 - _June 2, 2021_
* Add OtcOrdersFeature (#244)

View File

@@ -25,13 +25,16 @@ import "./BridgeProtocols.sol";
import "./mixins/MixinBalancer.sol";
import "./mixins/MixinBalancerV2.sol";
import "./mixins/MixinBancor.sol";
import "./mixins/MixinClipper.sol";
import "./mixins/MixinCoFiX.sol";
import "./mixins/MixinCurve.sol";
import "./mixins/MixinCurveV2.sol";
import "./mixins/MixinCryptoCom.sol";
import "./mixins/MixinDodo.sol";
import "./mixins/MixinDodoV2.sol";
import "./mixins/MixinKyber.sol";
import "./mixins/MixinKyberDmm.sol";
import "./mixins/MixinLido.sol";
import "./mixins/MixinMakerPSM.sol";
import "./mixins/MixinMooniswap.sol";
import "./mixins/MixinMStable.sol";
@@ -48,13 +51,16 @@ contract BridgeAdapter is
MixinBalancer,
MixinBalancerV2,
MixinBancor,
MixinClipper,
MixinCoFiX,
MixinCurve,
MixinCurveV2,
MixinCryptoCom,
MixinDodo,
MixinDodoV2,
MixinKyber,
MixinKyberDmm,
MixinLido,
MixinMakerPSM,
MixinMooniswap,
MixinMStable,
@@ -71,12 +77,15 @@ contract BridgeAdapter is
MixinBalancer()
MixinBalancerV2()
MixinBancor(weth)
MixinClipper(weth)
MixinCoFiX()
MixinCurve(weth)
MixinCurveV2()
MixinCryptoCom()
MixinDodo()
MixinDodoV2()
MixinKyber(weth)
MixinLido(weth)
MixinMakerPSM()
MixinMooniswap(weth)
MixinMStable()
@@ -107,6 +116,13 @@ contract BridgeAdapter is
sellAmount,
order.bridgeData
);
} else if (protocolId == BridgeProtocols.CURVEV2) {
boughtAmount = _tradeCurveV2(
sellToken,
buyToken,
sellAmount,
order.bridgeData
);
} else if (protocolId == BridgeProtocols.UNISWAPV3) {
boughtAmount = _tradeUniswapV3(
sellToken,
@@ -225,6 +241,20 @@ contract BridgeAdapter is
sellAmount,
order.bridgeData
);
} else if (protocolId == BridgeProtocols.LIDO) {
boughtAmount = _tradeLido(
sellToken,
buyToken,
sellAmount,
order.bridgeData
);
} else if (protocolId == BridgeProtocols.CLIPPER) {
boughtAmount = _tradeClipper(
sellToken,
buyToken,
sellAmount,
order.bridgeData
);
} else {
boughtAmount = _tradeZeroExBridge(
sellToken,

View File

@@ -47,4 +47,7 @@ library BridgeProtocols {
uint128 internal constant BALANCERV2 = 17;
uint128 internal constant UNISWAPV3 = 18;
uint128 internal constant KYBERDMM = 19;
uint128 internal constant CURVEV2 = 20;
uint128 internal constant LIDO = 21;
uint128 internal constant CLIPPER = 22;
}

View File

@@ -0,0 +1,148 @@
// SPDX-License-Identifier: Apache-2.0
/*
Copyright 2021 ZeroEx Intl.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
pragma solidity ^0.6.5;
pragma experimental ABIEncoderV2;
import "@0x/contracts-erc20/contracts/src/v06/LibERC20TokenV06.sol";
import "@0x/contracts-erc20/contracts/src/v06/IERC20TokenV06.sol";
import "@0x/contracts-erc20/contracts/src/v06/IEtherTokenV06.sol";
import "../IBridgeAdapter.sol";
import "../../../vendor/ILiquidityProvider.sol";
contract MixinClipper {
using LibERC20TokenV06 for IERC20TokenV06;
/// @dev Mainnet address of the WETH contract.
IEtherTokenV06 private immutable WETH;
constructor(IEtherTokenV06 weth)
public
{
WETH = weth;
}
function _tradeClipper(
IERC20TokenV06 sellToken,
IERC20TokenV06 buyToken,
uint256 sellAmount,
bytes memory bridgeData
)
internal
returns (uint256 boughtAmount)
{
// We can only use ETH with Clipper, no WETH available
(ILiquidityProvider clipper, bytes memory auxiliaryData) =
abi.decode(bridgeData, (ILiquidityProvider, bytes));
if (sellToken == WETH) {
boughtAmount = _executeSellEthForToken(
clipper,
buyToken,
sellAmount,
auxiliaryData
);
} else if (buyToken == WETH) {
boughtAmount = _executeSellTokenForEth(
clipper,
sellToken,
sellAmount,
auxiliaryData
);
} else {
boughtAmount = _executeSellTokenForToken(
clipper,
sellToken,
buyToken,
sellAmount,
auxiliaryData
);
}
return boughtAmount;
}
function _executeSellEthForToken(
ILiquidityProvider clipper,
IERC20TokenV06 buyToken,
uint256 sellAmount,
bytes memory auxiliaryData
)
private
returns (uint256 boughtAmount)
{
// Clipper requires ETH and doesn't support WETH
WETH.withdraw(sellAmount);
boughtAmount = clipper.sellEthForToken{ value: sellAmount }(
buyToken,
address(this),
1,
auxiliaryData
);
}
function _executeSellTokenForEth(
ILiquidityProvider clipper,
IERC20TokenV06 sellToken,
uint256 sellAmount,
bytes memory auxiliaryData
)
private
returns (uint256 boughtAmount)
{
// Optimization: We can transfer the tokens into clipper rather than
// have an allowance updated
sellToken.compatTransfer(address(clipper), sellAmount);
boughtAmount = clipper.sellTokenForEth(
sellToken,
payable(address(this)),
1,
auxiliaryData
);
// we want WETH for possible future trades
WETH.deposit{ value: boughtAmount }();
}
function _executeSellTokenForToken(
ILiquidityProvider clipper,
IERC20TokenV06 sellToken,
IERC20TokenV06 buyToken,
uint256 sellAmount,
bytes memory auxiliaryData
)
private
returns (uint256 boughtAmount)
{
// Optimization: We can transfer the tokens into clipper rather than
// have an allowance updated
sellToken.compatTransfer(address(clipper), sellAmount);
boughtAmount = clipper.sellTokenForToken(
sellToken,
buyToken,
address(this),
1,
auxiliaryData
);
}
}

View File

@@ -0,0 +1,71 @@
// SPDX-License-Identifier: Apache-2.0
/*
Copyright 2020 ZeroEx Intl.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
pragma solidity ^0.6.5;
pragma experimental ABIEncoderV2;
import "@0x/contracts-utils/contracts/src/v06/errors/LibRichErrorsV06.sol";
import "@0x/contracts-erc20/contracts/src/v06/LibERC20TokenV06.sol";
import "@0x/contracts-erc20/contracts/src/v06/IERC20TokenV06.sol";
import "@0x/contracts-utils/contracts/src/v06/LibSafeMathV06.sol";
contract MixinCurveV2 {
using LibERC20TokenV06 for IERC20TokenV06;
using LibSafeMathV06 for uint256;
using LibRichErrorsV06 for bytes;
struct CurveBridgeDataV2 {
address curveAddress;
bytes4 exchangeFunctionSelector;
int128 fromCoinIdx;
int128 toCoinIdx;
}
function _tradeCurveV2(
IERC20TokenV06 sellToken,
IERC20TokenV06 buyToken,
uint256 sellAmount,
bytes memory bridgeData
)
internal
returns (uint256 boughtAmount)
{
// Decode the bridge data to get the Curve metadata.
CurveBridgeDataV2 memory data = abi.decode(bridgeData, (CurveBridgeDataV2));
sellToken.approveIfBelow(data.curveAddress, sellAmount);
uint256 beforeBalance = buyToken.balanceOf(address(this));
(bool success, bytes memory resultData) =
data.curveAddress.call(abi.encodeWithSelector(
data.exchangeFunctionSelector,
data.fromCoinIdx,
data.toCoinIdx,
// dx
sellAmount,
// min dy
1
));
if (!success) {
resultData.rrevert();
}
return buyToken.balanceOf(address(this)).safeSub(beforeBalance);
}
}

View File

@@ -0,0 +1,70 @@
// SPDX-License-Identifier: Apache-2.0
/*
Copyright 2021 ZeroEx Intl.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
pragma solidity ^0.6.5;
pragma experimental ABIEncoderV2;
import "@0x/contracts-erc20/contracts/src/v06/LibERC20TokenV06.sol";
import "@0x/contracts-erc20/contracts/src/v06/IERC20TokenV06.sol";
import "@0x/contracts-erc20/contracts/src/v06/IEtherTokenV06.sol";
/// @dev Minimal interface for minting StETH
interface ILido {
/// @dev Adds eth to the pool
/// @param _referral optional address for referrals
/// @return StETH Amount of shares generated
function submit(address _referral) external payable returns (uint256 StETH);
/// @dev Retrieve the current pooled ETH representation of the shares amount
/// @param _sharesAmount amount of shares
/// @return amount of pooled ETH represented by the shares amount
function getPooledEthByShares(uint256 _sharesAmount) external view returns (uint256);
}
contract MixinLido {
using LibERC20TokenV06 for IERC20TokenV06;
using LibERC20TokenV06 for IEtherTokenV06;
IEtherTokenV06 private immutable WETH;
constructor(IEtherTokenV06 weth)
public
{
WETH = weth;
}
function _tradeLido(
IERC20TokenV06 sellToken,
IERC20TokenV06 buyToken,
uint256 sellAmount,
bytes memory bridgeData
)
internal
returns (uint256 boughtAmount)
{
(ILido lido) = abi.decode(bridgeData, (ILido));
if (address(sellToken) == address(WETH) && address(buyToken) == address(lido)) {
WETH.withdraw(sellAmount);
boughtAmount = lido.getPooledEthByShares(lido.submit{ value: sellAmount}(address(0)));
} else {
revert("MixinLido/UNSUPPORTED_TOKEN_PAIR");
}
}
}

View File

@@ -1,6 +1,6 @@
{
"name": "@0x/contracts-zero-ex",
"version": "0.25.0",
"version": "0.27.0",
"engines": {
"node": ">=6.12"
},
@@ -43,7 +43,7 @@
"config": {
"publicInterfaceContracts": "IZeroEx,ZeroEx,FullMigration,InitialMigration,IFlashWallet,IERC20Transformer,IOwnableFeature,ISimpleFunctionRegistryFeature,ITransformERC20Feature,FillQuoteTransformer,PayTakerTransformer,PositiveSlippageFeeTransformer,WethTransformer,OwnableFeature,SimpleFunctionRegistryFeature,TransformERC20Feature,AffiliateFeeTransformer,MetaTransactionsFeature,LogMetadataTransformer,BridgeAdapter,LiquidityProviderFeature,ILiquidityProviderFeature,NativeOrdersFeature,INativeOrdersFeature,FeeCollectorController,FeeCollector,CurveLiquidityProvider,BatchFillNativeOrdersFeature,IBatchFillNativeOrdersFeature,MultiplexFeature,IMultiplexFeature,OtcOrdersFeature,IOtcOrdersFeature",
"abis:comment": "This list is auto-generated by contracts-gen. Don't edit manually.",
"abis": "./test/generated-artifacts/@(AffiliateFeeTransformer|BatchFillNativeOrdersFeature|BootstrapFeature|BridgeAdapter|BridgeProtocols|CurveLiquidityProvider|FeeCollector|FeeCollectorController|FillQuoteTransformer|FixinCommon|FixinEIP712|FixinProtocolFees|FixinReentrancyGuard|FixinTokenSpender|FlashWallet|FullMigration|IBatchFillNativeOrdersFeature|IBootstrapFeature|IBridgeAdapter|IERC20Bridge|IERC20Transformer|IFeature|IFlashWallet|ILiquidityProvider|ILiquidityProviderFeature|ILiquidityProviderSandbox|IMetaTransactionsFeature|IMooniswapPool|IMultiplexFeature|INativeOrdersEvents|INativeOrdersFeature|IOtcOrdersFeature|IOwnableFeature|IPancakeSwapFeature|ISimpleFunctionRegistryFeature|IStaking|ITestSimpleFunctionRegistryFeature|ITokenSpenderFeature|ITransformERC20Feature|IUniswapFeature|IUniswapV2Pair|IUniswapV3Feature|IUniswapV3Pool|IZeroEx|InitialMigration|LibBootstrap|LibCommonRichErrors|LibERC20Transformer|LibFeeCollector|LibLiquidityProviderRichErrors|LibMetaTransactionsRichErrors|LibMetaTransactionsStorage|LibMigrate|LibNativeOrder|LibNativeOrdersRichErrors|LibNativeOrdersStorage|LibOtcOrdersStorage|LibOwnableRichErrors|LibOwnableStorage|LibProxyRichErrors|LibProxyStorage|LibReentrancyGuardStorage|LibSignature|LibSignatureRichErrors|LibSimpleFunctionRegistryRichErrors|LibSimpleFunctionRegistryStorage|LibStorage|LibTransformERC20RichErrors|LibTransformERC20Storage|LibWalletRichErrors|LiquidityProviderFeature|LiquidityProviderSandbox|LogMetadataTransformer|MetaTransactionsFeature|MixinBalancer|MixinBalancerV2|MixinBancor|MixinCoFiX|MixinCryptoCom|MixinCurve|MixinDodo|MixinDodoV2|MixinKyber|MixinKyberDmm|MixinMStable|MixinMakerPSM|MixinMooniswap|MixinNerve|MixinOasis|MixinShell|MixinUniswap|MixinUniswapV2|MixinUniswapV3|MixinZeroExBridge|MooniswapLiquidityProvider|MultiplexFeature|NativeOrdersCancellation|NativeOrdersFeature|NativeOrdersInfo|NativeOrdersProtocolFees|NativeOrdersSettlement|OtcOrdersFeature|OwnableFeature|PancakeSwapFeature|PayTakerTransformer|PermissionlessTransformerDeployer|PositiveSlippageFeeTransformer|SimpleFunctionRegistryFeature|TestBridge|TestCallTarget|TestCurve|TestDelegateCaller|TestFeeCollectorController|TestFillQuoteTransformerBridge|TestFillQuoteTransformerExchange|TestFillQuoteTransformerHost|TestFixinProtocolFees|TestFixinTokenSpender|TestFullMigration|TestInitialMigration|TestLibNativeOrder|TestLibSignature|TestLiquidityProvider|TestMetaTransactionsNativeOrdersFeature|TestMetaTransactionsTransformERC20Feature|TestMigrator|TestMintTokenERC20Transformer|TestMintableERC20Token|TestMooniswap|TestNativeOrdersFeature|TestNoEthRecipient|TestOrderSignerRegistryWithContractWallet|TestPermissionlessTransformerDeployerSuicidal|TestPermissionlessTransformerDeployerTransformer|TestRfqOriginRegistration|TestSimpleFunctionRegistryFeatureImpl1|TestSimpleFunctionRegistryFeatureImpl2|TestStaking|TestTokenSpenderERC20Token|TestTransformERC20|TestTransformerBase|TestTransformerDeployerTransformer|TestTransformerHost|TestUniswapV3Factory|TestUniswapV3Feature|TestUniswapV3Pool|TestWeth|TestWethTransformerHost|TestZeroExFeature|TransformERC20Feature|Transformer|TransformerDeployer|UniswapFeature|UniswapV3Feature|WethTransformer|ZeroEx|ZeroExOptimized).json"
"abis": "./test/generated-artifacts/@(AffiliateFeeTransformer|BatchFillNativeOrdersFeature|BootstrapFeature|BridgeAdapter|BridgeProtocols|CurveLiquidityProvider|FeeCollector|FeeCollectorController|FillQuoteTransformer|FixinCommon|FixinEIP712|FixinProtocolFees|FixinReentrancyGuard|FixinTokenSpender|FlashWallet|FullMigration|IBatchFillNativeOrdersFeature|IBootstrapFeature|IBridgeAdapter|IERC20Bridge|IERC20Transformer|IFeature|IFlashWallet|ILiquidityProvider|ILiquidityProviderFeature|ILiquidityProviderSandbox|IMetaTransactionsFeature|IMooniswapPool|IMultiplexFeature|INativeOrdersEvents|INativeOrdersFeature|IOtcOrdersFeature|IOwnableFeature|IPancakeSwapFeature|ISimpleFunctionRegistryFeature|IStaking|ITestSimpleFunctionRegistryFeature|ITokenSpenderFeature|ITransformERC20Feature|IUniswapFeature|IUniswapV2Pair|IUniswapV3Feature|IUniswapV3Pool|IZeroEx|InitialMigration|LibBootstrap|LibCommonRichErrors|LibERC20Transformer|LibFeeCollector|LibLiquidityProviderRichErrors|LibMetaTransactionsRichErrors|LibMetaTransactionsStorage|LibMigrate|LibNativeOrder|LibNativeOrdersRichErrors|LibNativeOrdersStorage|LibOtcOrdersStorage|LibOwnableRichErrors|LibOwnableStorage|LibProxyRichErrors|LibProxyStorage|LibReentrancyGuardStorage|LibSignature|LibSignatureRichErrors|LibSimpleFunctionRegistryRichErrors|LibSimpleFunctionRegistryStorage|LibStorage|LibTransformERC20RichErrors|LibTransformERC20Storage|LibWalletRichErrors|LiquidityProviderFeature|LiquidityProviderSandbox|LogMetadataTransformer|MetaTransactionsFeature|MixinBalancer|MixinBalancerV2|MixinBancor|MixinClipper|MixinCoFiX|MixinCryptoCom|MixinCurve|MixinCurveV2|MixinDodo|MixinDodoV2|MixinKyber|MixinKyberDmm|MixinLido|MixinMStable|MixinMakerPSM|MixinMooniswap|MixinNerve|MixinOasis|MixinShell|MixinUniswap|MixinUniswapV2|MixinUniswapV3|MixinZeroExBridge|MooniswapLiquidityProvider|MultiplexFeature|NativeOrdersCancellation|NativeOrdersFeature|NativeOrdersInfo|NativeOrdersProtocolFees|NativeOrdersSettlement|OtcOrdersFeature|OwnableFeature|PancakeSwapFeature|PayTakerTransformer|PermissionlessTransformerDeployer|PositiveSlippageFeeTransformer|SimpleFunctionRegistryFeature|TestBridge|TestCallTarget|TestCurve|TestDelegateCaller|TestFeeCollectorController|TestFillQuoteTransformerBridge|TestFillQuoteTransformerExchange|TestFillQuoteTransformerHost|TestFixinProtocolFees|TestFixinTokenSpender|TestFullMigration|TestInitialMigration|TestLibNativeOrder|TestLibSignature|TestLiquidityProvider|TestMetaTransactionsNativeOrdersFeature|TestMetaTransactionsTransformERC20Feature|TestMigrator|TestMintTokenERC20Transformer|TestMintableERC20Token|TestMooniswap|TestNativeOrdersFeature|TestNoEthRecipient|TestOrderSignerRegistryWithContractWallet|TestPermissionlessTransformerDeployerSuicidal|TestPermissionlessTransformerDeployerTransformer|TestRfqOriginRegistration|TestSimpleFunctionRegistryFeatureImpl1|TestSimpleFunctionRegistryFeatureImpl2|TestStaking|TestTokenSpenderERC20Token|TestTransformERC20|TestTransformerBase|TestTransformerDeployerTransformer|TestTransformerHost|TestUniswapV3Factory|TestUniswapV3Feature|TestUniswapV3Pool|TestWeth|TestWethTransformerHost|TestZeroExFeature|TransformERC20Feature|Transformer|TransformerDeployer|UniswapFeature|UniswapV3Feature|WethTransformer|ZeroEx|ZeroExOptimized).json"
},
"repository": {
"type": "git",
@@ -56,12 +56,12 @@
"homepage": "https://github.com/0xProject/protocol/tree/main/contracts/zero-ex",
"devDependencies": {
"@0x/abi-gen": "^5.6.0",
"@0x/contract-addresses": "^6.3.0",
"@0x/contracts-erc20": "^3.3.11",
"@0x/contract-addresses": "^6.5.0",
"@0x/contracts-erc20": "^3.3.14",
"@0x/contracts-gen": "^2.0.38",
"@0x/contracts-test-utils": "^5.4.3",
"@0x/contracts-test-utils": "^5.4.6",
"@0x/dev-utils": "^4.2.7",
"@0x/order-utils": "^10.4.24",
"@0x/order-utils": "^10.4.27",
"@0x/sol-compiler": "^4.7.3",
"@0x/ts-doc-gen": "^0.0.28",
"@0x/tslint-config": "^4.1.4",
@@ -83,7 +83,7 @@
},
"dependencies": {
"@0x/base-contract": "^6.4.0",
"@0x/protocol-utils": "^1.7.0",
"@0x/protocol-utils": "^1.8.0",
"@0x/subproviders": "^6.5.3",
"@0x/types": "^3.3.3",
"@0x/typescript-typings": "^5.2.0",

View File

@@ -82,13 +82,16 @@ import * as MetaTransactionsFeature from '../test/generated-artifacts/MetaTransa
import * as MixinBalancer from '../test/generated-artifacts/MixinBalancer.json';
import * as MixinBalancerV2 from '../test/generated-artifacts/MixinBalancerV2.json';
import * as MixinBancor from '../test/generated-artifacts/MixinBancor.json';
import * as MixinClipper from '../test/generated-artifacts/MixinClipper.json';
import * as MixinCoFiX from '../test/generated-artifacts/MixinCoFiX.json';
import * as MixinCryptoCom from '../test/generated-artifacts/MixinCryptoCom.json';
import * as MixinCurve from '../test/generated-artifacts/MixinCurve.json';
import * as MixinCurveV2 from '../test/generated-artifacts/MixinCurveV2.json';
import * as MixinDodo from '../test/generated-artifacts/MixinDodo.json';
import * as MixinDodoV2 from '../test/generated-artifacts/MixinDodoV2.json';
import * as MixinKyber from '../test/generated-artifacts/MixinKyber.json';
import * as MixinKyberDmm from '../test/generated-artifacts/MixinKyberDmm.json';
import * as MixinLido from '../test/generated-artifacts/MixinLido.json';
import * as MixinMakerPSM from '../test/generated-artifacts/MixinMakerPSM.json';
import * as MixinMooniswap from '../test/generated-artifacts/MixinMooniswap.json';
import * as MixinMStable from '../test/generated-artifacts/MixinMStable.json';
@@ -255,13 +258,16 @@ export const artifacts = {
MixinBalancer: MixinBalancer as ContractArtifact,
MixinBalancerV2: MixinBalancerV2 as ContractArtifact,
MixinBancor: MixinBancor as ContractArtifact,
MixinClipper: MixinClipper as ContractArtifact,
MixinCoFiX: MixinCoFiX as ContractArtifact,
MixinCryptoCom: MixinCryptoCom as ContractArtifact,
MixinCurve: MixinCurve as ContractArtifact,
MixinCurveV2: MixinCurveV2 as ContractArtifact,
MixinDodo: MixinDodo as ContractArtifact,
MixinDodoV2: MixinDodoV2 as ContractArtifact,
MixinKyber: MixinKyber as ContractArtifact,
MixinKyberDmm: MixinKyberDmm as ContractArtifact,
MixinLido: MixinLido as ContractArtifact,
MixinMStable: MixinMStable as ContractArtifact,
MixinMakerPSM: MixinMakerPSM as ContractArtifact,
MixinMooniswap: MixinMooniswap as ContractArtifact,

View File

@@ -80,13 +80,16 @@ export * from '../test/generated-wrappers/meta_transactions_feature';
export * from '../test/generated-wrappers/mixin_balancer';
export * from '../test/generated-wrappers/mixin_balancer_v2';
export * from '../test/generated-wrappers/mixin_bancor';
export * from '../test/generated-wrappers/mixin_clipper';
export * from '../test/generated-wrappers/mixin_co_fi_x';
export * from '../test/generated-wrappers/mixin_crypto_com';
export * from '../test/generated-wrappers/mixin_curve';
export * from '../test/generated-wrappers/mixin_curve_v2';
export * from '../test/generated-wrappers/mixin_dodo';
export * from '../test/generated-wrappers/mixin_dodo_v2';
export * from '../test/generated-wrappers/mixin_kyber';
export * from '../test/generated-wrappers/mixin_kyber_dmm';
export * from '../test/generated-wrappers/mixin_lido';
export * from '../test/generated-wrappers/mixin_m_stable';
export * from '../test/generated-wrappers/mixin_maker_p_s_m';
export * from '../test/generated-wrappers/mixin_mooniswap';

View File

@@ -113,13 +113,16 @@
"test/generated-artifacts/MixinBalancer.json",
"test/generated-artifacts/MixinBalancerV2.json",
"test/generated-artifacts/MixinBancor.json",
"test/generated-artifacts/MixinClipper.json",
"test/generated-artifacts/MixinCoFiX.json",
"test/generated-artifacts/MixinCryptoCom.json",
"test/generated-artifacts/MixinCurve.json",
"test/generated-artifacts/MixinCurveV2.json",
"test/generated-artifacts/MixinDodo.json",
"test/generated-artifacts/MixinDodoV2.json",
"test/generated-artifacts/MixinKyber.json",
"test/generated-artifacts/MixinKyberDmm.json",
"test/generated-artifacts/MixinLido.json",
"test/generated-artifacts/MixinMStable.json",
"test/generated-artifacts/MixinMakerPSM.json",
"test/generated-artifacts/MixinMooniswap.json",

View File

@@ -1,4 +1,144 @@
[
{
"version": "16.24.0",
"changes": [
{
"note": "Add `Clipper` as a custom liquidity source",
"pr": 299
},
{
"note": "Added `Curve` `Tricrypto2` and `ESD` v2",
"pr": 302
}
],
"timestamp": 1628225642
},
{
"version": "16.23.1",
"changes": [
{
"note": "Fix fill amount rounding error when covnerting fills to orders.",
"pr": 296
}
],
"timestamp": 1627572227
},
{
"version": "16.23.0",
"changes": [
{
"note": "ACryptoS",
"pr": 284
}
],
"timestamp": 1626473497
},
{
"version": "16.22.0",
"changes": [
{
"note": "IronSwap",
"pr": 281
}
],
"timestamp": 1626214787
},
{
"version": "16.21.0",
"changes": [
{
"note": "JetSwap",
"pr": 280
}
],
"timestamp": 1625904026
},
{
"version": "16.20.0",
"changes": [
{
"note": "ShibaSwap",
"pr": 276
}
],
"timestamp": 1625607277
},
{
"version": "16.19.1",
"changes": [
{
"note": "Fix LiquidityProvider fallback",
"pr": 272
}
],
"timestamp": 1625544188
},
{
"version": "16.19.0",
"changes": [
{
"note": "Add LiquidityProvider to Polygon sources",
"pr": 270
}
],
"timestamp": 1625190486
},
{
"version": "6.18.3",
"changes": [
{
"note": "Polygon Balance V2"
}
],
"timestamp": 1624987208
},
{
"timestamp": 1624562704,
"version": "6.18.2",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"version": "6.18.1",
"changes": [
{
"note": "FirebirdOneSwap, ApeSwap. New hop tokens: DFYN, BANANA, WEXPOLY",
"pr": 265
}
],
"timestamp": 1624405040
},
{
"version": "6.18.0",
"changes": [
{
"note": "Add Lido stETH deposit integration",
"pr": 260
}
],
"timestamp": 1624356181
},
{
"version": "6.17.3",
"changes": [
{
"note": "QUICK, TITAN, IRON as intermediate tokens, integrating WaultSwap and Polydex for Polygon, Curve renBTC pool"
}
],
"timestamp": 1623807529
},
{
"timestamp": 1623382456,
"version": "6.17.2",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1622609597,
"version": "6.17.1",

View File

@@ -5,6 +5,63 @@ Edit the package's CHANGELOG.json file only.
CHANGELOG
## v16.24.0 - _August 6, 2021_
* Add `Clipper` as a custom liquidity source (#299)
* Added `Curve` `Tricrypto2` and `ESD` v2 (#302)
## v16.23.1 - _July 29, 2021_
* Fix fill amount rounding error when covnerting fills to orders. (#296)
## v16.23.0 - _July 16, 2021_
* ACryptoS (#284)
## v16.22.0 - _July 13, 2021_
* IronSwap (#281)
## v16.21.0 - _July 10, 2021_
* JetSwap (#280)
## v16.20.0 - _July 6, 2021_
* ShibaSwap (#276)
## v16.19.1 - _July 6, 2021_
* Fix LiquidityProvider fallback (#272)
## v16.19.0 - _July 2, 2021_
* Add LiquidityProvider to Polygon sources (#270)
## v6.18.3 - _June 29, 2021_
* Polygon Balance V2
## v6.18.2 - _June 24, 2021_
* Dependencies updated
## v6.18.1 - _June 22, 2021_
* FirebirdOneSwap, ApeSwap. New hop tokens: DFYN, BANANA, WEXPOLY (#265)
## v6.18.0 - _June 22, 2021_
* Add Lido stETH deposit integration (#260)
## v6.17.3 - _June 16, 2021_
* QUICK, TITAN, IRON as intermediate tokens, integrating WaultSwap and Polydex for Polygon, Curve renBTC pool
## v6.17.2 - _June 11, 2021_
* Dependencies updated
## v6.17.1 - _June 2, 2021_
* Dependencies updated

View File

@@ -29,6 +29,7 @@ import "./DODOV2Sampler.sol";
import "./Eth2DaiSampler.sol";
import "./KyberSampler.sol";
import "./KyberDmmSampler.sol";
import "./LidoSampler.sol";
import "./LiquidityProviderSampler.sol";
import "./MakerPSMSampler.sol";
import "./MultiBridgeSampler.sol";
@@ -54,6 +55,7 @@ contract ERC20BridgeSampler is
Eth2DaiSampler,
KyberSampler,
KyberDmmSampler,
LidoSampler,
LiquidityProviderSampler,
MakerPSMSampler,
MStableSampler,

View File

@@ -20,12 +20,20 @@
pragma solidity ^0.6;
pragma experimental ABIEncoderV2;
interface IKyberDmmFactory {
interface IKyberDmmPool {
function getPoolAtIndex(address token0, address token1, uint256 index)
function totalSupply()
external
view
returns (address);
returns (uint256);
}
interface IKyberDmmFactory {
function getPools(address token0, address token1)
external
view
returns (address[] memory _tokenPools);
}
interface IKyberDmmRouter {
@@ -140,17 +148,26 @@ contract KyberDmmSampler
view
returns (address[] memory pools)
{
pools = new address[](path.length - 1);
IKyberDmmFactory factory = IKyberDmmFactory(IKyberDmmRouter(router).factory());
pools = new address[](path.length - 1);
for (uint256 i = 0; i < pools.length; i++) {
// Currently only supporting the first pool found at the index
// find the best pool
address[] memory allPools;
try
factory.getPoolAtIndex
factory.getPools
{gas: KYBER_DMM_CALL_GAS}
(path[i], path[i + 1], 0)
returns (address pool)
(path[i], path[i + 1])
returns (address[] memory allPools)
{
pools[i] = pool;
uint256 maxSupply = 0;
require(allPools.length >= 1, "KyberDMMSampler/NO_POOLS_FOUND");
for (uint256 j = 0; j < allPools.length; j++) {
uint256 totalSupply = IKyberDmmPool(allPools[j]).totalSupply();
if (totalSupply > maxSupply) {
maxSupply = totalSupply;
pools[i] = allPools[j];
}
}
} catch (bytes memory) {
return new address[](0);
}

View File

@@ -0,0 +1,91 @@
// SPDX-License-Identifier: Apache-2.0
/*
Copyright 2021 ZeroEx Intl.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
pragma solidity ^0.6;
pragma experimental ABIEncoderV2;
import "./SamplerUtils.sol";
contract LidoSampler is SamplerUtils {
struct LidoInfo {
address stEthToken;
address wethToken;
}
/// @dev Sample sell quotes from Lido
/// @param lidoInfo Info regarding a specific Lido deployment
/// @param takerToken Address of the taker token (what to sell).
/// @param makerToken Address of the maker token (what to buy).
/// @param takerTokenAmounts Taker token sell amount for each sample.
/// @return makerTokenAmounts Maker amounts bought at each taker token
/// amount.
function sampleSellsFromLido(
LidoInfo memory lidoInfo,
address takerToken,
address makerToken,
uint256[] memory takerTokenAmounts
)
public
pure
returns (uint256[] memory)
{
_assertValidPair(makerToken, takerToken);
if (takerToken != lidoInfo.wethToken || makerToken != address(lidoInfo.stEthToken)) {
// Return 0 values if not selling WETH for stETH
uint256 numSamples = takerTokenAmounts.length;
uint256[] memory makerTokenAmounts = new uint256[](numSamples);
return makerTokenAmounts;
}
// Minting stETH is always 1:1 therefore we can just return the same amounts back
return takerTokenAmounts;
}
/// @dev Sample buy quotes from Lido.
/// @param lidoInfo Info regarding a specific Lido deployment
/// @param takerToken Address of the taker token (what to sell).
/// @param makerToken Address of the maker token (what to buy).
/// @param makerTokenAmounts Maker token buy amount for each sample.
/// @return takerTokenAmounts Taker amounts sold at each maker token
/// amount.
function sampleBuysFromLido(
LidoInfo memory lidoInfo,
address takerToken,
address makerToken,
uint256[] memory makerTokenAmounts
)
public
pure
returns (uint256[] memory)
{
_assertValidPair(makerToken, takerToken);
if (takerToken != lidoInfo.wethToken || makerToken != address(lidoInfo.stEthToken)) {
// Return 0 values if not buying stETH for WETH
uint256 numSamples = makerTokenAmounts.length;
uint256[] memory takerTokenAmounts = new uint256[](numSamples);
return takerTokenAmounts;
}
// Minting stETH is always 1:1 therefore we can just return the same amounts back
return makerTokenAmounts;
}
}

View File

@@ -1,6 +1,6 @@
{
"name": "@0x/asset-swapper",
"version": "6.17.1",
"version": "16.24.0",
"engines": {
"node": ">=6.12"
},
@@ -39,7 +39,7 @@
"config": {
"publicInterfaceContracts": "ERC20BridgeSampler,BalanceChecker,FakeTaker",
"abis:comment": "This list is auto-generated by contracts-gen. Don't edit manually.",
"abis": "./test/generated-artifacts/@(ApproximateBuys|BalanceChecker|BalancerSampler|BalancerV2Sampler|BancorSampler|CurveSampler|DODOSampler|DODOV2Sampler|DummyLiquidityProvider|ERC20BridgeSampler|Eth2DaiSampler|FakeTaker|IBalancer|IBancor|ICurve|IEth2Dai|IKyberNetwork|IMStable|IMooniswap|IMultiBridge|IShell|ISmoothy|IUniswapExchangeQuotes|IUniswapV2Router01|KyberDmmSampler|KyberSampler|LiquidityProviderSampler|MStableSampler|MakerPSMSampler|MooniswapSampler|MultiBridgeSampler|NativeOrderSampler|SamplerUtils|ShellSampler|SmoothySampler|TestERC20BridgeSampler|TestNativeOrderSampler|TwoHopSampler|UniswapSampler|UniswapV2Sampler|UniswapV3Sampler|UtilitySampler).json",
"abis": "./test/generated-artifacts/@(ApproximateBuys|BalanceChecker|BalancerSampler|BalancerV2Sampler|BancorSampler|CurveSampler|DODOSampler|DODOV2Sampler|DummyLiquidityProvider|ERC20BridgeSampler|Eth2DaiSampler|FakeTaker|IBalancer|IBancor|ICurve|IEth2Dai|IKyberNetwork|IMStable|IMooniswap|IMultiBridge|IShell|ISmoothy|IUniswapExchangeQuotes|IUniswapV2Router01|KyberDmmSampler|KyberSampler|LidoSampler|LiquidityProviderSampler|MStableSampler|MakerPSMSampler|MooniswapSampler|MultiBridgeSampler|NativeOrderSampler|SamplerUtils|ShellSampler|SmoothySampler|TestERC20BridgeSampler|TestNativeOrderSampler|TwoHopSampler|UniswapSampler|UniswapV2Sampler|UniswapV3Sampler|UtilitySampler).json",
"postpublish": {
"assets": []
}
@@ -60,13 +60,13 @@
"dependencies": {
"@0x/assert": "^3.0.27",
"@0x/base-contract": "^6.4.0",
"@0x/contract-addresses": "^6.3.0",
"@0x/contract-wrappers": "^13.17.0",
"@0x/contracts-erc20": "^3.3.11",
"@0x/contracts-zero-ex": "^0.25.0",
"@0x/contract-addresses": "^6.5.0",
"@0x/contract-wrappers": "^13.17.3",
"@0x/contracts-erc20": "^3.3.14",
"@0x/contracts-zero-ex": "^0.27.0",
"@0x/dev-utils": "^4.2.7",
"@0x/json-schemas": "^6.1.3",
"@0x/protocol-utils": "^1.7.0",
"@0x/protocol-utils": "^1.8.0",
"@0x/quote-server": "^6.0.2",
"@0x/types": "^3.3.3",
"@0x/typescript-typings": "^5.2.0",
@@ -93,14 +93,14 @@
},
"devDependencies": {
"@0x/abi-gen": "^5.6.0",
"@0x/contracts-asset-proxy": "^3.7.14",
"@0x/contracts-exchange": "^3.2.33",
"@0x/contracts-exchange-libs": "^4.3.32",
"@0x/contracts-asset-proxy": "^3.7.17",
"@0x/contracts-exchange": "^3.2.36",
"@0x/contracts-exchange-libs": "^4.3.35",
"@0x/contracts-gen": "^2.0.38",
"@0x/contracts-test-utils": "^5.4.3",
"@0x/contracts-utils": "^4.7.11",
"@0x/contracts-test-utils": "^5.4.6",
"@0x/contracts-utils": "^4.7.14",
"@0x/mesh-rpc-client": "^9.4.2",
"@0x/migrations": "^8.0.9",
"@0x/migrations": "^8.0.12",
"@0x/sol-compiler": "^4.7.3",
"@0x/subproviders": "^6.5.3",
"@0x/ts-doc-gen": "^0.0.28",

View File

@@ -2,6 +2,7 @@ import { ChainId } from '@0x/contract-addresses';
import { BigNumber, NULL_BYTES } from '@0x/utils';
import {
ACRYPTOS_BSC_INFOS,
APESWAP_ROUTER_BY_CHAIN_ID,
BAKERYSWAP_ROUTER_BY_CHAIN_ID,
BELT_BSC_INFOS,
@@ -12,8 +13,14 @@ import {
CRYPTO_COM_ROUTER_BY_CHAIN_ID,
CURVE_MAINNET_INFOS,
CURVE_POLYGON_INFOS,
CURVE_V2_MAINNET_INFOS,
CURVE_V2_POLYGON_INFOS,
DFYN_ROUTER_BY_CHAIN_ID,
ELLIPSIS_BSC_INFOS,
FIREBIRDONESWAP_BSC_INFOS,
FIREBIRDONESWAP_POLYGON_INFOS,
IRONSWAP_POLYGON_INFOS,
JETSWAP_ROUTER_BY_CHAIN_ID,
JULSWAP_ROUTER_BY_CHAIN_ID,
KYBER_BANNED_RESERVES,
KYBER_BRIDGED_LIQUIDITY_PREFIX,
@@ -24,15 +31,18 @@ import {
NULL_ADDRESS,
PANCAKESWAP_ROUTER_BY_CHAIN_ID,
PANCAKESWAPV2_ROUTER_BY_CHAIN_ID,
POLYDEX_ROUTER_BY_CHAIN_ID,
QUICKSWAP_ROUTER_BY_CHAIN_ID,
SADDLE_MAINNET_INFOS,
SHELL_POOLS_BY_CHAIN_ID,
SHIBASWAP_ROUTER_BY_CHAIN_ID,
SMOOTHY_BSC_INFOS,
SMOOTHY_MAINNET_INFOS,
SNOWSWAP_MAINNET_INFOS,
SUSHISWAP_ROUTER_BY_CHAIN_ID,
SWERVE_MAINNET_INFOS,
UNISWAPV2_ROUTER_BY_CHAIN_ID,
WAULTSWAP_ROUTER_BY_CHAIN_ID,
XSIGMA_MAINNET_INFOS,
} from './constants';
import { CurveInfo, ERC20BridgeSource } from './types';
@@ -107,20 +117,44 @@ export function getCurveInfosForPair(chainId: ChainId, takerToken: string, maker
return Object.values(CURVE_MAINNET_INFOS).filter(c =>
[makerToken, takerToken].every(
t =>
(c.tokens.includes(t) && c.metaToken === undefined) ||
(c.tokens.includes(t) && c.metaTokens === undefined) ||
(c.tokens.includes(t) &&
c.metaToken !== undefined &&
[makerToken, takerToken].includes(c.metaToken)),
[makerToken, takerToken].filter(v => c.metaTokens?.includes(v)).length > 0),
),
);
case ChainId.Polygon:
return Object.values(CURVE_POLYGON_INFOS).filter(c =>
[makerToken, takerToken].every(
t =>
(c.tokens.includes(t) && c.metaToken === undefined) ||
(c.tokens.includes(t) && c.metaTokens === undefined) ||
(c.tokens.includes(t) &&
c.metaToken !== undefined &&
[makerToken, takerToken].includes(c.metaToken)),
[makerToken, takerToken].filter(v => c.metaTokens?.includes(v)).length > 0),
),
);
default:
return [];
}
}
// tslint:disable completed-docs
export function getCurveV2InfosForPair(chainId: ChainId, takerToken: string, makerToken: string): CurveInfo[] {
switch (chainId) {
case ChainId.Mainnet:
return Object.values(CURVE_V2_MAINNET_INFOS).filter(c =>
[makerToken, takerToken].every(
t =>
(c.tokens.includes(t) && c.metaTokens === undefined) ||
(c.tokens.includes(t) &&
[makerToken, takerToken].filter(v => c.metaTokens?.includes(v)).length > 0),
),
);
case ChainId.Polygon:
return Object.values(CURVE_V2_POLYGON_INFOS).filter(c =>
[makerToken, takerToken].every(
t =>
(c.tokens.includes(t) && c.metaTokens === undefined) ||
(c.tokens.includes(t) &&
[makerToken, takerToken].filter(v => c.metaTokens?.includes(v)).length > 0),
),
);
default:
@@ -135,8 +169,8 @@ export function getSwerveInfosForPair(chainId: ChainId, takerToken: string, make
return Object.values(SWERVE_MAINNET_INFOS).filter(c =>
[makerToken, takerToken].every(
t =>
(c.tokens.includes(t) && c.metaToken === undefined) ||
(c.tokens.includes(t) && c.metaToken !== undefined && [makerToken, takerToken].includes(c.metaToken)),
(c.tokens.includes(t) && c.metaTokens === undefined) ||
(c.tokens.includes(t) && [makerToken, takerToken].filter(v => c.metaTokens?.includes(v)).length > 0),
),
);
}
@@ -148,8 +182,8 @@ export function getSnowSwapInfosForPair(chainId: ChainId, takerToken: string, ma
return Object.values(SNOWSWAP_MAINNET_INFOS).filter(c =>
[makerToken, takerToken].every(
t =>
(c.tokens.includes(t) && c.metaToken === undefined) ||
(c.tokens.includes(t) && c.metaToken !== undefined && [makerToken, takerToken].includes(c.metaToken)),
(c.tokens.includes(t) && c.metaTokens === undefined) ||
(c.tokens.includes(t) && [makerToken, takerToken].filter(v => c.metaTokens?.includes(v)).length > 0),
),
);
}
@@ -161,12 +195,36 @@ export function getNerveInfosForPair(chainId: ChainId, takerToken: string, maker
return Object.values(NERVE_BSC_INFOS).filter(c =>
[makerToken, takerToken].every(
t =>
(c.tokens.includes(t) && c.metaToken === undefined) ||
(c.tokens.includes(t) && c.metaToken !== undefined && [makerToken, takerToken].includes(c.metaToken)),
(c.tokens.includes(t) && c.metaTokens === undefined) ||
(c.tokens.includes(t) && [makerToken, takerToken].filter(v => c.metaTokens?.includes(v)).length > 0),
),
);
}
export function getFirebirdOneSwapInfosForPair(chainId: ChainId, takerToken: string, makerToken: string): CurveInfo[] {
if (chainId === ChainId.BSC) {
return Object.values(FIREBIRDONESWAP_BSC_INFOS).filter(c =>
[makerToken, takerToken].every(
t =>
(c.tokens.includes(t) && c.metaTokens === undefined) ||
(c.tokens.includes(t) &&
[makerToken, takerToken].filter(v => c.metaTokens?.includes(v)).length > 0),
),
);
} else if (chainId === ChainId.Polygon) {
return Object.values(FIREBIRDONESWAP_POLYGON_INFOS).filter(c =>
[makerToken, takerToken].every(
t =>
(c.tokens.includes(t) && c.metaTokens === undefined) ||
(c.tokens.includes(t) &&
[makerToken, takerToken].filter(v => c.metaTokens?.includes(v)).length > 0),
),
);
} else {
return [];
}
}
export function getBeltInfosForPair(chainId: ChainId, takerToken: string, makerToken: string): CurveInfo[] {
if (chainId !== ChainId.BSC) {
return [];
@@ -174,8 +232,8 @@ export function getBeltInfosForPair(chainId: ChainId, takerToken: string, makerT
return Object.values(BELT_BSC_INFOS).filter(c =>
[makerToken, takerToken].every(
t =>
(c.tokens.includes(t) && c.metaToken === undefined) ||
(c.tokens.includes(t) && c.metaToken !== undefined && [makerToken, takerToken].includes(c.metaToken)),
(c.tokens.includes(t) && c.metaTokens === undefined) ||
(c.tokens.includes(t) && [makerToken, takerToken].filter(v => c.metaTokens?.includes(v)).length > 0),
),
);
}
@@ -187,8 +245,8 @@ export function getEllipsisInfosForPair(chainId: ChainId, takerToken: string, ma
return Object.values(ELLIPSIS_BSC_INFOS).filter(c =>
[makerToken, takerToken].every(
t =>
(c.tokens.includes(t) && c.metaToken === undefined) ||
(c.tokens.includes(t) && c.metaToken !== undefined && [makerToken, takerToken].includes(c.metaToken)),
(c.tokens.includes(t) && c.metaTokens === undefined) ||
(c.tokens.includes(t) && [makerToken, takerToken].filter(v => c.metaTokens?.includes(v)).length > 0),
),
);
}
@@ -198,20 +256,18 @@ export function getSmoothyInfosForPair(chainId: ChainId, takerToken: string, mak
return Object.values(SMOOTHY_BSC_INFOS).filter(c =>
[makerToken, takerToken].every(
t =>
(c.tokens.includes(t) && c.metaToken === undefined) ||
(c.tokens.includes(t) && c.metaTokens === undefined) ||
(c.tokens.includes(t) &&
c.metaToken !== undefined &&
[makerToken, takerToken].includes(c.metaToken)),
[makerToken, takerToken].filter(v => c.metaTokens?.includes(v)).length > 0),
),
);
} else if (chainId === ChainId.Mainnet) {
return Object.values(SMOOTHY_MAINNET_INFOS).filter(c =>
[makerToken, takerToken].every(
t =>
(c.tokens.includes(t) && c.metaToken === undefined) ||
(c.tokens.includes(t) && c.metaTokens === undefined) ||
(c.tokens.includes(t) &&
c.metaToken !== undefined &&
[makerToken, takerToken].includes(c.metaToken)),
[makerToken, takerToken].filter(v => c.metaTokens?.includes(v)).length > 0),
),
);
} else {
@@ -226,8 +282,21 @@ export function getSaddleInfosForPair(chainId: ChainId, takerToken: string, make
return Object.values(SADDLE_MAINNET_INFOS).filter(c =>
[makerToken, takerToken].every(
t =>
(c.tokens.includes(t) && c.metaToken === undefined) ||
(c.tokens.includes(t) && c.metaToken !== undefined && [makerToken, takerToken].includes(c.metaToken)),
(c.tokens.includes(t) && c.metaTokens === undefined) ||
(c.tokens.includes(t) && [makerToken, takerToken].filter(v => c.metaTokens?.includes(v)).length > 0),
),
);
}
export function getIronSwapInfosForPair(chainId: ChainId, takerToken: string, makerToken: string): CurveInfo[] {
if (chainId !== ChainId.Polygon) {
return [];
}
return Object.values(IRONSWAP_POLYGON_INFOS).filter(c =>
[makerToken, takerToken].every(
t =>
(c.tokens.includes(t) && c.metaTokens === undefined) ||
(c.tokens.includes(t) && [makerToken, takerToken].filter(v => c.metaTokens?.includes(v)).length > 0),
),
);
}
@@ -239,8 +308,21 @@ export function getXSigmaInfosForPair(chainId: ChainId, takerToken: string, make
return Object.values(XSIGMA_MAINNET_INFOS).filter(c =>
[makerToken, takerToken].every(
t =>
(c.tokens.includes(t) && c.metaToken === undefined) ||
(c.tokens.includes(t) && c.metaToken !== undefined && [makerToken, takerToken].includes(c.metaToken)),
(c.tokens.includes(t) && c.metaTokens === undefined) ||
(c.tokens.includes(t) && [makerToken, takerToken].filter(v => c.metaTokens?.includes(v)).length > 0),
),
);
}
export function getAcryptosInfosForPair(chainId: ChainId, takerToken: string, makerToken: string): CurveInfo[] {
if (chainId !== ChainId.BSC) {
return [];
}
return Object.values(ACRYPTOS_BSC_INFOS).filter(c =>
[makerToken, takerToken].every(
t =>
(c.tokens.includes(t) && c.metaTokens === undefined) ||
(c.tokens.includes(t) && [makerToken, takerToken].filter(v => c.metaTokens?.includes(v)).length > 0),
),
);
}
@@ -274,6 +356,7 @@ export function getCurveLikeInfosForPair(
makerToken: string,
source:
| ERC20BridgeSource.Curve
| ERC20BridgeSource.CurveV2
| ERC20BridgeSource.Swerve
| ERC20BridgeSource.SnowSwap
| ERC20BridgeSource.Nerve
@@ -281,13 +364,19 @@ export function getCurveLikeInfosForPair(
| ERC20BridgeSource.Ellipsis
| ERC20BridgeSource.Smoothy
| ERC20BridgeSource.Saddle
| ERC20BridgeSource.XSigma,
| ERC20BridgeSource.IronSwap
| ERC20BridgeSource.XSigma
| ERC20BridgeSource.FirebirdOneSwap
| ERC20BridgeSource.ACryptos,
): CurveDetailedInfo[] {
let pools: CurveInfo[] = [];
switch (source) {
case ERC20BridgeSource.Curve:
pools = getCurveInfosForPair(chainId, takerToken, makerToken);
break;
case ERC20BridgeSource.CurveV2:
pools = getCurveV2InfosForPair(chainId, takerToken, makerToken);
break;
case ERC20BridgeSource.Swerve:
pools = getSwerveInfosForPair(chainId, takerToken, makerToken);
break;
@@ -312,6 +401,15 @@ export function getCurveLikeInfosForPair(
case ERC20BridgeSource.XSigma:
pools = getXSigmaInfosForPair(chainId, takerToken, makerToken);
break;
case ERC20BridgeSource.FirebirdOneSwap:
pools = getFirebirdOneSwapInfosForPair(chainId, takerToken, makerToken);
break;
case ERC20BridgeSource.IronSwap:
pools = getIronSwapInfosForPair(chainId, takerToken, makerToken);
break;
case ERC20BridgeSource.ACryptos:
pools = getAcryptosInfosForPair(chainId, takerToken, makerToken);
break;
default:
throw new Error(`Unknown Curve like source ${source}`);
}
@@ -337,7 +435,11 @@ export function uniswapV2LikeRouterAddress(
| ERC20BridgeSource.JulSwap
| ERC20BridgeSource.QuickSwap
| ERC20BridgeSource.ComethSwap
| ERC20BridgeSource.Dfyn,
| ERC20BridgeSource.Dfyn
| ERC20BridgeSource.WaultSwap
| ERC20BridgeSource.Polydex
| ERC20BridgeSource.ShibaSwap
| ERC20BridgeSource.JetSwap,
): string {
switch (source) {
case ERC20BridgeSource.UniswapV2:
@@ -366,6 +468,14 @@ export function uniswapV2LikeRouterAddress(
return COMETHSWAP_ROUTER_BY_CHAIN_ID[chainId];
case ERC20BridgeSource.Dfyn:
return DFYN_ROUTER_BY_CHAIN_ID[chainId];
case ERC20BridgeSource.WaultSwap:
return WAULTSWAP_ROUTER_BY_CHAIN_ID[chainId];
case ERC20BridgeSource.Polydex:
return POLYDEX_ROUTER_BY_CHAIN_ID[chainId];
case ERC20BridgeSource.ShibaSwap:
return SHIBASWAP_ROUTER_BY_CHAIN_ID[chainId];
case ERC20BridgeSource.JetSwap:
return JETSWAP_ROUTER_BY_CHAIN_ID[chainId];
default:
throw new Error(`Unknown UniswapV2 like source ${source}`);
}

View File

@@ -17,6 +17,7 @@ import {
FillData,
GetMarketOrdersOpts,
KyberSamplerOpts,
LidoInfo,
LiquidityProviderFillData,
LiquidityProviderRegistry,
MakerPsmFillData,
@@ -87,6 +88,7 @@ export const SELL_SOURCE_FILTER_BY_CHAIN_ID = valueByChainId<SourceFilters>(
ERC20BridgeSource.LiquidityProvider,
ERC20BridgeSource.CryptoCom,
ERC20BridgeSource.Linkswap,
ERC20BridgeSource.Lido,
ERC20BridgeSource.MakerPsm,
ERC20BridgeSource.KyberDmm,
ERC20BridgeSource.Smoothy,
@@ -94,6 +96,9 @@ export const SELL_SOURCE_FILTER_BY_CHAIN_ID = valueByChainId<SourceFilters>(
ERC20BridgeSource.Saddle,
ERC20BridgeSource.XSigma,
ERC20BridgeSource.UniswapV3,
ERC20BridgeSource.CurveV2,
ERC20BridgeSource.ShibaSwap,
ERC20BridgeSource.Clipper,
]),
[ChainId.Ropsten]: new SourceFilters([
ERC20BridgeSource.Kyber,
@@ -126,6 +131,10 @@ export const SELL_SOURCE_FILTER_BY_CHAIN_ID = valueByChainId<SourceFilters>(
ERC20BridgeSource.CheeseSwap,
ERC20BridgeSource.JulSwap,
ERC20BridgeSource.LiquidityProvider,
ERC20BridgeSource.WaultSwap,
ERC20BridgeSource.FirebirdOneSwap,
ERC20BridgeSource.JetSwap,
ERC20BridgeSource.ACryptos,
]),
[ChainId.Polygon]: new SourceFilters([
ERC20BridgeSource.SushiSwap,
@@ -136,6 +145,17 @@ export const SELL_SOURCE_FILTER_BY_CHAIN_ID = valueByChainId<SourceFilters>(
ERC20BridgeSource.Curve,
ERC20BridgeSource.DodoV2,
ERC20BridgeSource.Dodo,
ERC20BridgeSource.CurveV2,
ERC20BridgeSource.WaultSwap,
ERC20BridgeSource.Polydex,
ERC20BridgeSource.ApeSwap,
ERC20BridgeSource.FirebirdOneSwap,
ERC20BridgeSource.BalancerV2,
ERC20BridgeSource.KyberDmm,
ERC20BridgeSource.LiquidityProvider,
ERC20BridgeSource.MultiHop,
ERC20BridgeSource.JetSwap,
ERC20BridgeSource.IronSwap,
]),
},
new SourceFilters([]),
@@ -166,6 +186,7 @@ export const BUY_SOURCE_FILTER_BY_CHAIN_ID = valueByChainId<SourceFilters>(
ERC20BridgeSource.Dodo,
ERC20BridgeSource.DodoV2,
ERC20BridgeSource.Cream,
ERC20BridgeSource.Lido,
ERC20BridgeSource.LiquidityProvider,
ERC20BridgeSource.CryptoCom,
ERC20BridgeSource.Linkswap,
@@ -176,6 +197,9 @@ export const BUY_SOURCE_FILTER_BY_CHAIN_ID = valueByChainId<SourceFilters>(
ERC20BridgeSource.Saddle,
ERC20BridgeSource.XSigma,
ERC20BridgeSource.UniswapV3,
ERC20BridgeSource.CurveV2,
ERC20BridgeSource.ShibaSwap,
ERC20BridgeSource.Clipper,
]),
[ChainId.Ropsten]: new SourceFilters([
ERC20BridgeSource.Kyber,
@@ -208,6 +232,10 @@ export const BUY_SOURCE_FILTER_BY_CHAIN_ID = valueByChainId<SourceFilters>(
ERC20BridgeSource.CheeseSwap,
ERC20BridgeSource.JulSwap,
ERC20BridgeSource.LiquidityProvider,
ERC20BridgeSource.WaultSwap,
ERC20BridgeSource.FirebirdOneSwap,
ERC20BridgeSource.JetSwap,
ERC20BridgeSource.ACryptos,
]),
[ChainId.Polygon]: new SourceFilters([
ERC20BridgeSource.SushiSwap,
@@ -218,6 +246,17 @@ export const BUY_SOURCE_FILTER_BY_CHAIN_ID = valueByChainId<SourceFilters>(
ERC20BridgeSource.Curve,
ERC20BridgeSource.DodoV2,
ERC20BridgeSource.Dodo,
ERC20BridgeSource.CurveV2,
ERC20BridgeSource.WaultSwap,
ERC20BridgeSource.Polydex,
ERC20BridgeSource.ApeSwap,
ERC20BridgeSource.FirebirdOneSwap,
ERC20BridgeSource.BalancerV2,
ERC20BridgeSource.KyberDmm,
ERC20BridgeSource.LiquidityProvider,
ERC20BridgeSource.MultiHop,
ERC20BridgeSource.JetSwap,
ERC20BridgeSource.IronSwap,
]),
},
new SourceFilters([]),
@@ -233,7 +272,7 @@ export const PROTOCOL_FEE_MULTIPLIER = new BigNumber(70000);
*/
export const FEE_QUOTE_SOURCES_BY_CHAIN_ID = valueByChainId<ERC20BridgeSource[]>(
{
[ChainId.Mainnet]: [ERC20BridgeSource.UniswapV2, ERC20BridgeSource.SushiSwap],
[ChainId.Mainnet]: [ERC20BridgeSource.UniswapV2, ERC20BridgeSource.SushiSwap, ERC20BridgeSource.UniswapV3],
[ChainId.BSC]: [ERC20BridgeSource.PancakeSwap, ERC20BridgeSource.Mooniswap, ERC20BridgeSource.SushiSwap],
[ChainId.Ropsten]: [ERC20BridgeSource.UniswapV2, ERC20BridgeSource.SushiSwap],
[ChainId.Polygon]: [ERC20BridgeSource.QuickSwap, ERC20BridgeSource.SushiSwap],
@@ -243,13 +282,13 @@ export const FEE_QUOTE_SOURCES_BY_CHAIN_ID = valueByChainId<ERC20BridgeSource[]>
// HACK(mzhu25): Limit and RFQ orders need to be treated as different sources
// when computing the exchange proxy gas overhead.
export const SOURCE_FLAGS: { [key in ERC20BridgeSource]: number } & {
RfqOrder: number;
LimitOrder: number;
export const SOURCE_FLAGS: { [key in ERC20BridgeSource]: bigint } & {
RfqOrder: bigint;
LimitOrder: bigint;
} = Object.assign(
{},
...['RfqOrder', 'LimitOrder', ...Object.values(ERC20BridgeSource)].map((source, index) => ({
[source]: source === ERC20BridgeSource.Native ? 0 : 1 << index,
[source]: source === ERC20BridgeSource.Native ? BigInt(0) : BigInt(1) << BigInt(index),
})),
);
@@ -324,6 +363,7 @@ export const MAINNET_TOKENS = {
crETH: '0xcbc1065255cbc3ab41a6868c22d1f1c573ab89fd',
ankrETH: '0xe95a203b1a91a908f9b9ce46459d101078c2c3cb',
vETH: '0x898bad2774eb97cf6b94605677f43b41871410b1',
alETH: '0x0100546f2cd4c9d97f798ffc9755e47865ff7ee6',
HT: '0x6f259637dcD74C767781E37Bc6133cd6A68aa161',
// Mirror Protocol
UST: '0xa47c8bf37f92abed4a126bda807a7b7498661acd',
@@ -334,15 +374,25 @@ export const MAINNET_TOKENS = {
alUSD: '0xbc6da0fe9ad5f3b0d58160288917aa56653660e9',
FRAX: '0x853d955acef822db058eb8505911ed77f175b99e',
LUSD: '0x5f98805a4e8be255a32880fdec7f6728c6568ba0',
FEI: '0x956f47f50a910163d8bf957cf5846d573e7f87ca',
DSU: '0x605d26fbd5be761089281d5cec2ce86eea667109',
ESS: '0x24ae124c4cc33d6791f8e8b63520ed7107ac8b3e',
};
export const BSC_TOKENS = {
WBNB: '0xbb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c',
BUSD: '0xe9e7cea3dedca5984780bafc599bd69add087d56',
USDT: '0x55d398326f99059ff775485246999027b3197955',
USDC: '0x8ac76a51cc950d9822d68b83fe1ad97b32cd580d',
DAI: '0x1af3f329e8be154074d8769d1ffa4ee058b1dbc3',
PAX: '0xb7f8cd00c5a06c0537e2abff0b58033d02e5e094',
UST: '0x23396cf899ca06c4472205fc903bdb4de249d6fc',
VAI: '0x4bd17003473389a42daf6a0a729f6fdb328bbbd7',
WEX: '0xa9c41a46a6b3531d28d5c32f6633dd2ff05dfb90',
WETH: '0x2170ed0880ac9a755fd29b2688956bd959f933f8',
BTCB: '0x7130d2a12b9bcbfae4f2634d864a1ee1ce3ead9c',
renBTC: '0xfce146bf3146100cfe5db4129cf6c82b0ef4ad8c',
pBTC: '0xed28a457a5a76596ac48d87c0f577020f6ea1c4c',
};
export const POLYGON_TOKENS = {
@@ -355,6 +405,11 @@ export const POLYGON_TOKENS = {
WBTC: '0x1bfd67037b42cf73acf2047067bd4f2c47d9bfd6',
WMATIC: '0x0d500b1d8e8ef31e21c99d1db9a6444d3adf1270',
WETH: '0x7ceb23fd6bc0add59e62ac25578270cff1b9f619',
renBTC: '0xdbf31df14b66535af65aac99c32e9ea844e14501',
QUICK: '0x831753dd7087cac61ab5644b308642cc1c33dc13',
DFYN: '0xc168e40227e4ebd8c1cae80f7a55a4f0e6d66c97',
BANANA: '0x5d47baba0d66083c52009271faf3f50dcc01023c',
WEXPOLY: '0x4c4bf319237d98a30a929a96112effa8da3510eb',
};
export const CURVE_POOLS = {
@@ -397,10 +452,21 @@ export const CURVE_POOLS = {
FRAX: '0xd632f22692fac7611d2aa1c0d552930d43caed3b',
LUSD: '0xed279fdd11ca84beef15af5d39bb4d4bee23f0ca',
BUSD: '0x4807862aa8b2bf68830e4c8dc86d0e9a998e085a',
DSU3CRV: '0x6ec80df362d7042c50d4469bcfbc174c9dd9109a',
};
export const CURVE_V2_POOLS = {
tricrypto: '0x80466c64868e1ab14a1ddf27a676c3fcbe638fe5',
tricrypto2: '0xd51a44d3fae010294c616388b506acda1bfaae46',
};
export const CURVE_POLYGON_POOLS = {
aave: '0x445fe580ef8d70ff569ab36e80c647af338db351',
ren: '0xc2d95eef97ec6c17551d45e77b590dc1f9117c67',
};
export const CURVE_V2_POLYGON_POOLS = {
atricrypto: '0x3fcd5de6a9fc8a99995c406c77dda3ed7e406f81',
};
export const SWERVE_POOLS = {
@@ -425,6 +491,12 @@ export const SMOOTHY_POOLS = {
export const SADDLE_POOLS = {
stables: '0x3911f80530595fbd01ab1516ab61255d75aeb066',
bitcoins: '0x4f6a43ad7cba042606decaca730d4ce0a57ac62e',
alETH: '0xa6018520eaacc06c30ff2e1b3ee2c7c22e64196a',
d4: '0xc69ddcd4dfef25d8a793241834d4cc4b3668ead6',
};
export const IRONSWAP_POOLS = {
is3usd: '0x837503e8a8753ae17fb8c8151b8e6f586defcb57',
};
export const NERVE_POOLS = {
@@ -443,6 +515,21 @@ export const XSIGMA_POOLS = {
stable: '0x3333333ACdEdBbC9Ad7bda0876e60714195681c5',
};
export const FIREBIRDONESWAP_BSC_POOLS = {
oneswap: '0x01c9475dbd36e46d1961572c8de24b74616bae9e',
};
export const FIREBIRDONESWAP_POLYGON_POOLS = {
oneswap: '0x01c9475dbd36e46d1961572c8de24b74616bae9e',
};
export const ACRYPTOS_POOLS = {
acs4usd: '0xb3f0c9ea1f05e312093fdb031e789a756659b0ac',
acs4vai: '0x191409d5a4effe25b0f4240557ba2192d18a191e',
acs4ust: '0x99c92765efc472a9709ced86310d64c4573c4b77',
acs3btc: '0xbe7caa236544d1b9a0e7f91e94b9f5bfd3b5ca81',
};
export const DEFAULT_INTERMEDIATE_TOKENS_BY_CHAIN_ID = valueByChainId<string[]>(
{
[ChainId.Mainnet]: [
@@ -453,12 +540,13 @@ export const DEFAULT_INTERMEDIATE_TOKENS_BY_CHAIN_ID = valueByChainId<string[]>(
MAINNET_TOKENS.WBTC,
],
[ChainId.BSC]: [
'0xbb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c', // WBNB
'0xe9e7cea3dedca5984780bafc599bd69add087d56', // BUSD
'0x1af3f329e8be154074d8769d1ffa4ee058b1dbc3', // DAI
'0x8ac76a51cc950d9822d68b83fe1ad97b32cd580d', // USDC
'0x2170ed0880ac9a755fd29b2688956bd959f933f8', // ETH
'0x55d398326f99059ff775485246999027b3197955', // BUSD-T
BSC_TOKENS.WBNB,
BSC_TOKENS.BUSD,
BSC_TOKENS.DAI,
BSC_TOKENS.USDC,
BSC_TOKENS.WETH,
BSC_TOKENS.USDT,
BSC_TOKENS.WEX,
],
[ChainId.Ropsten]: [
getContractAddressesForChainOrThrow(ChainId.Ropsten).etherToken,
@@ -523,13 +611,15 @@ export const NATIVE_FEE_TOKEN_AMOUNT_BY_CHAIN_ID = valueByChainId(
// Order dependent
const CURVE_TRI_POOL_MAINNET_TOKENS = [MAINNET_TOKENS.DAI, MAINNET_TOKENS.USDC, MAINNET_TOKENS.USDT];
const CURVE_TRI_BTC_POOL_TOKEN = [MAINNET_TOKENS.RenBTC, MAINNET_TOKENS.WBTC, MAINNET_TOKENS.sBTC];
const CURVE_POLYGON_ATRICRYPTO_UNDERLYING_TOKENS = [POLYGON_TOKENS.DAI, POLYGON_TOKENS.USDC, POLYGON_TOKENS.USDT];
const CURVE_POLYGON_ATRICRYPTO_TOKENS = [POLYGON_TOKENS.amDAI, POLYGON_TOKENS.amUSDC, POLYGON_TOKENS.amUSDT];
const createCurveExchangePool = (info: { tokens: string[]; pool: string; gasSchedule: number }) => ({
exchangeFunctionSelector: CurveFunctionSelectors.exchange,
sellQuoteFunctionSelector: CurveFunctionSelectors.get_dy,
buyQuoteFunctionSelector: CurveFunctionSelectors.None,
tokens: info.tokens,
metaToken: undefined,
metaTokens: undefined,
poolAddress: info.pool,
gasSchedule: info.gasSchedule,
});
@@ -539,27 +629,47 @@ const createCurveExchangeUnderlyingPool = (info: { tokens: string[]; pool: strin
sellQuoteFunctionSelector: CurveFunctionSelectors.get_dy_underlying,
buyQuoteFunctionSelector: CurveFunctionSelectors.None,
tokens: info.tokens,
metaToken: undefined,
metaTokens: undefined,
poolAddress: info.pool,
gasSchedule: info.gasSchedule,
});
const createCurveMetaTriPool = (info: { token: string; pool: string; gasSchedule: number }) => ({
const createCurveMetaTriPool = (info: { tokens: string[]; pool: string; gasSchedule: number }) => ({
exchangeFunctionSelector: CurveFunctionSelectors.exchange_underlying,
sellQuoteFunctionSelector: CurveFunctionSelectors.get_dy_underlying,
buyQuoteFunctionSelector: CurveFunctionSelectors.None,
tokens: [info.token, ...CURVE_TRI_POOL_MAINNET_TOKENS],
metaToken: info.token,
tokens: [...info.tokens, ...CURVE_TRI_POOL_MAINNET_TOKENS],
metaTokens: info.tokens,
poolAddress: info.pool,
gasSchedule: info.gasSchedule,
});
const createCurveMetaTriBtcPool = (info: { token: string; pool: string; gasSchedule: number }) => ({
const createCurveMetaTriBtcPool = (info: { tokens: string[]; pool: string; gasSchedule: number }) => ({
exchangeFunctionSelector: CurveFunctionSelectors.exchange_underlying,
sellQuoteFunctionSelector: CurveFunctionSelectors.get_dy_underlying,
buyQuoteFunctionSelector: CurveFunctionSelectors.None,
tokens: [info.token, ...CURVE_TRI_BTC_POOL_TOKEN],
metaToken: info.token,
tokens: [...info.tokens, ...CURVE_TRI_BTC_POOL_TOKEN],
metaTokens: info.tokens,
poolAddress: info.pool,
gasSchedule: info.gasSchedule,
});
const createCurveExchangeV2Pool = (info: { tokens: string[]; pool: string; gasSchedule: number }) => ({
exchangeFunctionSelector: CurveFunctionSelectors.exchange_v2,
sellQuoteFunctionSelector: CurveFunctionSelectors.get_dy_v2,
buyQuoteFunctionSelector: CurveFunctionSelectors.None,
tokens: info.tokens,
metaTokens: undefined,
poolAddress: info.pool,
gasSchedule: info.gasSchedule,
});
const createCurveV2MetaTriPool = (info: { tokens: string[]; pool: string; gasSchedule: number }) => ({
exchangeFunctionSelector: CurveFunctionSelectors.exchange_underlying_v2,
sellQuoteFunctionSelector: CurveFunctionSelectors.get_dy_underlying_v2,
buyQuoteFunctionSelector: CurveFunctionSelectors.None,
tokens: [...CURVE_POLYGON_ATRICRYPTO_UNDERLYING_TOKENS, ...info.tokens],
metaTokens: info.tokens,
poolAddress: info.pool,
gasSchedule: info.gasSchedule,
});
@@ -606,52 +716,52 @@ export const CURVE_MAINNET_INFOS: { [name: string]: CurveInfo } = {
gasSchedule: 176e3,
}),
[CURVE_POOLS.GUSD]: createCurveMetaTriPool({
token: MAINNET_TOKENS.GUSD,
tokens: [MAINNET_TOKENS.GUSD],
pool: CURVE_POOLS.GUSD,
gasSchedule: 411e3,
}),
[CURVE_POOLS.HUSD]: createCurveMetaTriPool({
token: MAINNET_TOKENS.HUSD,
tokens: [MAINNET_TOKENS.HUSD],
pool: CURVE_POOLS.HUSD,
gasSchedule: 396e3,
}),
[CURVE_POOLS.USDN]: createCurveMetaTriPool({
token: MAINNET_TOKENS.USDN,
tokens: [MAINNET_TOKENS.USDN],
pool: CURVE_POOLS.USDN,
gasSchedule: 398e3,
}),
[CURVE_POOLS.mUSD]: createCurveMetaTriPool({
token: MAINNET_TOKENS.mUSD,
tokens: [MAINNET_TOKENS.mUSD],
pool: CURVE_POOLS.mUSD,
gasSchedule: 385e3,
}),
[CURVE_POOLS.dUSD]: createCurveMetaTriPool({
token: MAINNET_TOKENS.dUSD,
tokens: [MAINNET_TOKENS.dUSD],
pool: CURVE_POOLS.dUSD,
gasSchedule: 371e3,
}),
[CURVE_POOLS.tBTC]: createCurveMetaTriBtcPool({
token: MAINNET_TOKENS.tBTC,
tokens: [MAINNET_TOKENS.tBTC],
pool: CURVE_POOLS.tBTC,
gasSchedule: 482e3,
}),
[CURVE_POOLS.pBTC]: createCurveMetaTriBtcPool({
token: MAINNET_TOKENS.pBTC,
tokens: [MAINNET_TOKENS.pBTC],
pool: CURVE_POOLS.pBTC,
gasSchedule: 503e3,
}),
[CURVE_POOLS.bBTC]: createCurveMetaTriBtcPool({
token: MAINNET_TOKENS.bBTC,
tokens: [MAINNET_TOKENS.bBTC],
pool: CURVE_POOLS.bBTC,
gasSchedule: 497e3,
}),
[CURVE_POOLS.oBTC]: createCurveMetaTriBtcPool({
token: MAINNET_TOKENS.oBTC,
tokens: [MAINNET_TOKENS.oBTC],
pool: CURVE_POOLS.oBTC,
gasSchedule: 488e3,
}),
[CURVE_POOLS.UST]: createCurveMetaTriPool({
token: MAINNET_TOKENS.UST,
tokens: [MAINNET_TOKENS.UST],
pool: CURVE_POOLS.UST,
gasSchedule: 340e3,
}),
@@ -681,7 +791,7 @@ export const CURVE_MAINNET_INFOS: { [name: string]: CurveInfo } = {
gasSchedule: 580e3,
}),
[CURVE_POOLS.USDP]: createCurveMetaTriPool({
token: MAINNET_TOKENS.USDP,
tokens: [MAINNET_TOKENS.USDP],
pool: CURVE_POOLS.USDP,
gasSchedule: 374e3,
}),
@@ -696,32 +806,32 @@ export const CURVE_MAINNET_INFOS: { [name: string]: CurveInfo } = {
gasSchedule: 319e3,
}),
[CURVE_POOLS.TUSD]: createCurveMetaTriPool({
token: MAINNET_TOKENS.TUSD,
tokens: [MAINNET_TOKENS.TUSD],
pool: CURVE_POOLS.TUSD,
gasSchedule: 404e3,
}),
[CURVE_POOLS.STABLEx]: createCurveMetaTriPool({
token: MAINNET_TOKENS.STABLEx,
tokens: [MAINNET_TOKENS.STABLEx],
pool: CURVE_POOLS.STABLEx,
gasSchedule: 397e3,
}),
[CURVE_POOLS.alUSD]: createCurveMetaTriPool({
token: MAINNET_TOKENS.alUSD,
tokens: [MAINNET_TOKENS.alUSD],
pool: CURVE_POOLS.alUSD,
gasSchedule: 387e3,
}),
[CURVE_POOLS.FRAX]: createCurveMetaTriPool({
token: MAINNET_TOKENS.FRAX,
tokens: [MAINNET_TOKENS.FRAX],
pool: CURVE_POOLS.FRAX,
gasSchedule: 387e3,
}),
[CURVE_POOLS.LUSD]: createCurveMetaTriPool({
token: MAINNET_TOKENS.LUSD,
tokens: [MAINNET_TOKENS.LUSD],
pool: CURVE_POOLS.LUSD,
gasSchedule: 387e3,
}),
[CURVE_POOLS.BUSD]: createCurveMetaTriPool({
token: MAINNET_TOKENS.BUSD,
tokens: [MAINNET_TOKENS.BUSD],
pool: CURVE_POOLS.BUSD,
gasSchedule: 387e3,
}),
@@ -743,19 +853,50 @@ export const CURVE_MAINNET_INFOS: { [name: string]: CurveInfo } = {
pool: CURVE_POOLS.ankreth,
gasSchedule: 125e3,
}),
[CURVE_POOLS.DSU3CRV]: createCurveMetaTriPool({
tokens: [MAINNET_TOKENS.DSU],
pool: CURVE_POOLS.DSU3CRV,
gasSchedule: 387e3,
}),
};
export const CURVE_V2_MAINNET_INFOS: { [name: string]: CurveInfo } = {
[CURVE_V2_POOLS.tricrypto]: createCurveExchangeV2Pool({
tokens: [MAINNET_TOKENS.USDT, MAINNET_TOKENS.WBTC, MAINNET_TOKENS.WETH],
pool: CURVE_V2_POOLS.tricrypto,
gasSchedule: 300e3,
}),
[CURVE_V2_POOLS.tricrypto2]: createCurveExchangeV2Pool({
tokens: [MAINNET_TOKENS.USDT, MAINNET_TOKENS.WBTC, MAINNET_TOKENS.WETH],
pool: CURVE_V2_POOLS.tricrypto2,
gasSchedule: 300e3,
}),
};
export const CURVE_POLYGON_INFOS: { [name: string]: CurveInfo } = {
['aave_exchangeunderlying']: createCurveExchangeUnderlyingPool({
tokens: [POLYGON_TOKENS.DAI, POLYGON_TOKENS.USDC, POLYGON_TOKENS.USDT],
tokens: CURVE_POLYGON_ATRICRYPTO_UNDERLYING_TOKENS,
pool: CURVE_POLYGON_POOLS.aave,
gasSchedule: 300e3,
}),
['aave_exchange']: createCurveExchangePool({
tokens: [POLYGON_TOKENS.amDAI, POLYGON_TOKENS.amUSDC, POLYGON_TOKENS.amUSDT],
tokens: CURVE_POLYGON_ATRICRYPTO_TOKENS,
pool: CURVE_POLYGON_POOLS.aave,
gasSchedule: 150e3,
}),
[CURVE_POLYGON_POOLS.ren]: createCurveExchangeUnderlyingPool({
tokens: [POLYGON_TOKENS.WBTC, POLYGON_TOKENS.renBTC],
pool: CURVE_POLYGON_POOLS.ren,
gasSchedule: 350e3,
}),
};
export const CURVE_V2_POLYGON_INFOS: { [name: string]: CurveInfo } = {
[CURVE_V2_POLYGON_POOLS.atricrypto]: createCurveV2MetaTriPool({
tokens: [POLYGON_TOKENS.WBTC, POLYGON_TOKENS.WETH],
pool: CURVE_V2_POLYGON_POOLS.atricrypto,
gasSchedule: 300e3,
}),
};
export const SWERVE_MAINNET_INFOS: { [name: string]: CurveInfo } = {
@@ -814,7 +955,7 @@ export const XSIGMA_MAINNET_INFOS: { [name: string]: CurveInfo } = {
}),
};
// Curve pools like using custom selectors
// Curve-like sources using custom selectors
export const SADDLE_MAINNET_INFOS: { [name: string]: CurveInfo } = {
[SADDLE_POOLS.stables]: {
exchangeFunctionSelector: CurveFunctionSelectors.swap,
@@ -822,7 +963,7 @@ export const SADDLE_MAINNET_INFOS: { [name: string]: CurveInfo } = {
buyQuoteFunctionSelector: CurveFunctionSelectors.None,
poolAddress: SADDLE_POOLS.stables,
tokens: [MAINNET_TOKENS.DAI, MAINNET_TOKENS.USDC, MAINNET_TOKENS.USDT],
metaToken: undefined,
metaTokens: undefined,
gasSchedule: 150e3,
},
[SADDLE_POOLS.bitcoins]: {
@@ -831,7 +972,37 @@ export const SADDLE_MAINNET_INFOS: { [name: string]: CurveInfo } = {
buyQuoteFunctionSelector: CurveFunctionSelectors.None,
poolAddress: SADDLE_POOLS.bitcoins,
tokens: [MAINNET_TOKENS.tBTC, MAINNET_TOKENS.WBTC, MAINNET_TOKENS.RenBTC, MAINNET_TOKENS.sBTC],
metaToken: undefined,
metaTokens: undefined,
gasSchedule: 150e3,
},
[SADDLE_POOLS.alETH]: {
exchangeFunctionSelector: CurveFunctionSelectors.swap,
sellQuoteFunctionSelector: CurveFunctionSelectors.calculateSwap,
buyQuoteFunctionSelector: CurveFunctionSelectors.None,
poolAddress: SADDLE_POOLS.alETH,
tokens: [MAINNET_TOKENS.WETH, MAINNET_TOKENS.alETH, MAINNET_TOKENS.sETH],
metaTokens: undefined,
gasSchedule: 200e3,
},
[SADDLE_POOLS.d4]: {
exchangeFunctionSelector: CurveFunctionSelectors.swap,
sellQuoteFunctionSelector: CurveFunctionSelectors.calculateSwap,
buyQuoteFunctionSelector: CurveFunctionSelectors.None,
poolAddress: SADDLE_POOLS.d4,
tokens: [MAINNET_TOKENS.alUSD, MAINNET_TOKENS.FEI, MAINNET_TOKENS.FRAX, MAINNET_TOKENS.LUSD],
metaTokens: undefined,
gasSchedule: 150e3,
},
};
export const IRONSWAP_POLYGON_INFOS: { [name: string]: CurveInfo } = {
[IRONSWAP_POOLS.is3usd]: {
exchangeFunctionSelector: CurveFunctionSelectors.swap,
sellQuoteFunctionSelector: CurveFunctionSelectors.calculateSwap,
buyQuoteFunctionSelector: CurveFunctionSelectors.None,
poolAddress: IRONSWAP_POOLS.is3usd,
tokens: [POLYGON_TOKENS.USDC, POLYGON_TOKENS.USDT, POLYGON_TOKENS.DAI],
metaTokens: undefined,
gasSchedule: 150e3,
},
};
@@ -852,7 +1023,7 @@ export const SMOOTHY_MAINNET_INFOS: { [name: string]: CurveInfo } = {
MAINNET_TOKENS.PAX,
MAINNET_TOKENS.GUSD,
],
metaToken: undefined,
metaTokens: undefined,
gasSchedule: 190e3,
},
};
@@ -864,7 +1035,7 @@ export const SMOOTHY_BSC_INFOS: { [name: string]: CurveInfo } = {
buyQuoteFunctionSelector: CurveFunctionSelectors.None,
poolAddress: SMOOTHY_POOLS.syUSD,
tokens: [BSC_TOKENS.BUSD, BSC_TOKENS.USDT, BSC_TOKENS.USDC, BSC_TOKENS.DAI, BSC_TOKENS.PAX, BSC_TOKENS.UST],
metaToken: undefined,
metaTokens: undefined,
gasSchedule: 90e3,
},
};
@@ -876,11 +1047,73 @@ export const NERVE_BSC_INFOS: { [name: string]: CurveInfo } = {
buyQuoteFunctionSelector: CurveFunctionSelectors.None,
poolAddress: NERVE_POOLS.threePool,
tokens: [BSC_TOKENS.BUSD, BSC_TOKENS.USDT, BSC_TOKENS.USDC],
metaToken: undefined,
metaTokens: undefined,
gasSchedule: 140e3,
},
};
export const FIREBIRDONESWAP_BSC_INFOS: { [name: string]: CurveInfo } = {
[FIREBIRDONESWAP_BSC_POOLS.oneswap]: {
exchangeFunctionSelector: CurveFunctionSelectors.swap,
sellQuoteFunctionSelector: CurveFunctionSelectors.calculateSwap,
buyQuoteFunctionSelector: CurveFunctionSelectors.None,
poolAddress: FIREBIRDONESWAP_BSC_POOLS.oneswap,
tokens: [BSC_TOKENS.BUSD, BSC_TOKENS.USDT, BSC_TOKENS.DAI, BSC_TOKENS.USDC],
metaTokens: undefined,
gasSchedule: 100e3,
},
};
export const FIREBIRDONESWAP_POLYGON_INFOS: { [name: string]: CurveInfo } = {
[FIREBIRDONESWAP_POLYGON_POOLS.oneswap]: {
exchangeFunctionSelector: CurveFunctionSelectors.swap,
sellQuoteFunctionSelector: CurveFunctionSelectors.calculateSwap,
buyQuoteFunctionSelector: CurveFunctionSelectors.None,
poolAddress: FIREBIRDONESWAP_POLYGON_POOLS.oneswap,
tokens: [POLYGON_TOKENS.DAI, POLYGON_TOKENS.USDC, POLYGON_TOKENS.USDT],
metaTokens: undefined,
gasSchedule: 100e3,
},
};
const ACRYPTOS_ACS4USD_POOL_BSC_TOKENS = [BSC_TOKENS.BUSD, BSC_TOKENS.USDT, BSC_TOKENS.DAI, BSC_TOKENS.USDC];
const createAcryptosMetaUsdPool = (info: { tokens: string[]; pool: string; gasSchedule: number }) => ({
exchangeFunctionSelector: CurveFunctionSelectors.exchange_underlying,
sellQuoteFunctionSelector: CurveFunctionSelectors.get_dy_underlying,
buyQuoteFunctionSelector: CurveFunctionSelectors.None,
tokens: [...info.tokens, ...ACRYPTOS_ACS4USD_POOL_BSC_TOKENS],
metaTokens: info.tokens,
poolAddress: info.pool,
gasSchedule: info.gasSchedule,
});
export const ACRYPTOS_BSC_INFOS: { [name: string]: CurveInfo } = {
[ACRYPTOS_POOLS.acs4usd]: createCurveExchangePool({
tokens: ACRYPTOS_ACS4USD_POOL_BSC_TOKENS,
pool: ACRYPTOS_POOLS.acs4usd,
gasSchedule: 145e3,
}),
[ACRYPTOS_POOLS.acs4vai]: createAcryptosMetaUsdPool({
tokens: [BSC_TOKENS.VAI],
pool: ACRYPTOS_POOLS.acs4vai,
gasSchedule: 300e3,
}),
[ACRYPTOS_POOLS.acs4ust]: createAcryptosMetaUsdPool({
tokens: [BSC_TOKENS.UST],
pool: ACRYPTOS_POOLS.acs4ust,
gasSchedule: 300e3,
}),
[ACRYPTOS_POOLS.acs3btc]: createCurveExchangePool({
tokens: [BSC_TOKENS.BTCB, BSC_TOKENS.renBTC, BSC_TOKENS.pBTC],
pool: ACRYPTOS_POOLS.acs3btc,
gasSchedule: 145e3,
}),
};
/**
* Kyber reserve prefixes
* 0xff Fed price reserve
@@ -974,6 +1207,13 @@ export const LINKSWAP_ROUTER_BY_CHAIN_ID = valueByChainId<string>(
NULL_ADDRESS,
);
export const SHIBASWAP_ROUTER_BY_CHAIN_ID = valueByChainId<string>(
{
[ChainId.Mainnet]: '0x03f7724180aa6b939894b5ca4314783b0b36b329',
},
NULL_ADDRESS,
);
export const MSTABLE_POOLS_BY_CHAIN_ID = valueByChainId(
{
[ChainId.Mainnet]: {
@@ -1019,6 +1259,7 @@ export const OASIS_ROUTER_BY_CHAIN_ID = valueByChainId<string>(
export const KYBER_DMM_ROUTER_BY_CHAIN_ID = valueByChainId<string>(
{
[ChainId.Mainnet]: '0x1c87257f5e8609940bc751a07bb085bb7f8cdbe6',
[ChainId.Polygon]: '0x546c79662e028b661dfb4767664d0273184e4dd1',
},
NULL_ADDRESS,
);
@@ -1167,14 +1408,50 @@ export const COMPONENT_POOLS_BY_CHAIN_ID = valueByChainId(
export const BALANCER_V2_VAULT_ADDRESS_BY_CHAIN = valueByChainId<string>(
{
[ChainId.Mainnet]: '0xba12222222228d8ba445958a75a0704d566bf2c8',
[ChainId.Polygon]: '0xba12222222228d8ba445958a75a0704d566bf2c8',
},
NULL_ADDRESS,
);
export const LIDO_INFO_BY_CHAIN = valueByChainId<LidoInfo>(
{
[ChainId.Mainnet]: {
stEthToken: '0xae7ab96520de3a18e5e111b5eaab095312d7fe84',
wethToken: MAINNET_TOKENS.WETH,
},
},
{
stEthToken: NULL_ADDRESS,
wethToken: NULL_ADDRESS,
},
);
export const CLIPPER_INFO_BY_CHAIN = valueByChainId(
{
[ChainId.Mainnet]: {
poolAddress: '0xe82906b6b1b04f631d126c974af57a3a7b6a99d9',
tokens: [
MAINNET_TOKENS.WETH, // technically ETH but our sampler and mixin handle this
MAINNET_TOKENS.WBTC,
MAINNET_TOKENS.USDC,
MAINNET_TOKENS.USDT,
MAINNET_TOKENS.DAI,
],
},
},
{ poolAddress: NULL_ADDRESS, tokens: [] },
);
export const BALANCER_SUBGRAPH_URL = 'https://api.thegraph.com/subgraphs/name/balancer-labs/balancer';
export const BALANCER_TOP_POOLS_FETCHED = 250;
export const BALANCER_MAX_POOLS_FETCHED = 3;
export const BALANCER_V2_SUBGRAPH_URL = 'https://api.thegraph.com/subgraphs/name/balancer-labs/balancer-v2';
export const BALANCER_V2_SUBGRAPH_URL_BY_CHAIN = valueByChainId<string>(
{
[ChainId.Polygon]: 'https://api.thegraph.com/subgraphs/name/balancer-labs/balancer-polygon-v2',
},
'https://api.thegraph.com/subgraphs/name/balancer-labs/balancer-v2',
);
export const UNISWAPV3_CONFIG_BY_CHAIN_ID = valueByChainId(
{
@@ -1217,6 +1494,7 @@ export const BAKERYSWAP_ROUTER_BY_CHAIN_ID = valueByChainId<string>(
export const APESWAP_ROUTER_BY_CHAIN_ID = valueByChainId<string>(
{
[ChainId.BSC]: '0xc0788a3ad43d79aa53b09c2eacc313a787d1d607',
[ChainId.Polygon]: '0xc0788a3ad43d79aa53b09c2eacc313a787d1d607',
},
NULL_ADDRESS,
);
@@ -1266,6 +1544,29 @@ export const DFYN_ROUTER_BY_CHAIN_ID = valueByChainId<string>(
NULL_ADDRESS,
);
export const WAULTSWAP_ROUTER_BY_CHAIN_ID = valueByChainId<string>(
{
[ChainId.BSC]: '0xd48745e39bbed146eec15b79cbf964884f9877c2',
[ChainId.Polygon]: '0x3a1d87f206d12415f5b0a33e786967680aab4f6d',
},
NULL_ADDRESS,
);
export const POLYDEX_ROUTER_BY_CHAIN_ID = valueByChainId<string>(
{
[ChainId.Polygon]: '0xe5c67ba380fb2f70a47b489e94bced486bb8fb74',
},
NULL_ADDRESS,
);
export const JETSWAP_ROUTER_BY_CHAIN_ID = valueByChainId<string>(
{
[ChainId.BSC]: '0xbe65b8f75b9f20f4c522e0067a3887fada714800',
[ChainId.Polygon]: '0x5c6ec38fb0e2609672bdf628b1fd605a523e5923',
},
NULL_ADDRESS,
);
const uniswapV2CloneGasSchedule = (fillData?: FillData) => {
// TODO: Different base cost if to/from ETH.
let gas = 90e3;
@@ -1300,6 +1601,7 @@ export const DEFAULT_GAS_SCHEDULE: Required<FeeSchedule> = {
[ERC20BridgeSource.Eth2Dai]: () => 400e3,
[ERC20BridgeSource.Kyber]: () => 450e3,
[ERC20BridgeSource.Curve]: fillData => (fillData as CurveFillData).pool.gasSchedule,
[ERC20BridgeSource.CurveV2]: fillData => (fillData as CurveFillData).pool.gasSchedule,
[ERC20BridgeSource.Swerve]: fillData => (fillData as CurveFillData).pool.gasSchedule,
[ERC20BridgeSource.SnowSwap]: fillData => (fillData as CurveFillData).pool.gasSchedule,
[ERC20BridgeSource.Nerve]: fillData => (fillData as CurveFillData).pool.gasSchedule,
@@ -1307,12 +1609,15 @@ export const DEFAULT_GAS_SCHEDULE: Required<FeeSchedule> = {
[ERC20BridgeSource.Ellipsis]: fillData => (fillData as CurveFillData).pool.gasSchedule,
[ERC20BridgeSource.Smoothy]: fillData => (fillData as CurveFillData).pool.gasSchedule,
[ERC20BridgeSource.Saddle]: fillData => (fillData as CurveFillData).pool.gasSchedule,
[ERC20BridgeSource.IronSwap]: fillData => (fillData as CurveFillData).pool.gasSchedule,
[ERC20BridgeSource.XSigma]: fillData => (fillData as CurveFillData).pool.gasSchedule,
[ERC20BridgeSource.FirebirdOneSwap]: fillData => (fillData as CurveFillData).pool.gasSchedule,
[ERC20BridgeSource.MultiBridge]: () => 350e3,
[ERC20BridgeSource.UniswapV2]: uniswapV2CloneGasSchedule,
[ERC20BridgeSource.SushiSwap]: uniswapV2CloneGasSchedule,
[ERC20BridgeSource.CryptoCom]: uniswapV2CloneGasSchedule,
[ERC20BridgeSource.Linkswap]: uniswapV2CloneGasSchedule,
[ERC20BridgeSource.ShibaSwap]: uniswapV2CloneGasSchedule,
[ERC20BridgeSource.Balancer]: () => 120e3,
[ERC20BridgeSource.BalancerV2]: () => 100e3,
[ERC20BridgeSource.Cream]: () => 120e3,
@@ -1366,6 +1671,8 @@ export const DEFAULT_GAS_SCHEDULE: Required<FeeSchedule> = {
}
return gas;
},
[ERC20BridgeSource.Lido]: () => 226e3,
[ERC20BridgeSource.Clipper]: () => 170e3,
//
// BSC
@@ -1377,6 +1684,8 @@ export const DEFAULT_GAS_SCHEDULE: Required<FeeSchedule> = {
[ERC20BridgeSource.CafeSwap]: uniswapV2CloneGasSchedule,
[ERC20BridgeSource.CheeseSwap]: uniswapV2CloneGasSchedule,
[ERC20BridgeSource.JulSwap]: uniswapV2CloneGasSchedule,
[ERC20BridgeSource.WaultSwap]: uniswapV2CloneGasSchedule,
[ERC20BridgeSource.ACryptos]: fillData => (fillData as CurveFillData).pool.gasSchedule,
//
// Polygon
@@ -1384,6 +1693,8 @@ export const DEFAULT_GAS_SCHEDULE: Required<FeeSchedule> = {
[ERC20BridgeSource.QuickSwap]: uniswapV2CloneGasSchedule,
[ERC20BridgeSource.ComethSwap]: uniswapV2CloneGasSchedule,
[ERC20BridgeSource.Dfyn]: uniswapV2CloneGasSchedule,
[ERC20BridgeSource.Polydex]: uniswapV2CloneGasSchedule,
[ERC20BridgeSource.JetSwap]: uniswapV2CloneGasSchedule,
};
export const DEFAULT_FEE_SCHEDULE: Required<FeeSchedule> = { ...DEFAULT_GAS_SCHEDULE };

View File

@@ -523,7 +523,7 @@ export class MarketOperationUtils {
const sturdyFills = fills.filter(p => p.length > 0 && !fragileSources.includes(p[0].source));
const sturdyOptimalPath = await findOptimalPathAsync(side, sturdyFills, inputAmount, opts.runLimit, {
...penaltyOpts,
exchangeProxyOverhead: (sourceFlags: number) =>
exchangeProxyOverhead: (sourceFlags: bigint) =>
// tslint:disable-next-line: no-bitwise
penaltyOpts.exchangeProxyOverhead(sourceFlags | optimalPath.sourceFlags),
});

View File

@@ -3,7 +3,7 @@ import { AbiEncoder, BigNumber } from '@0x/utils';
import { AssetSwapperContractAddresses, MarketOperation } from '../../types';
import { MAX_UINT256, ZERO_AMOUNT } from './constants';
import { MAX_UINT256, NULL_BYTES, ZERO_AMOUNT } from './constants';
import {
AggregationError,
BalancerFillData,
@@ -19,6 +19,7 @@ import {
GenericRouterFillData,
KyberDmmFillData,
KyberFillData,
LidoFillData,
LiquidityProviderFillData,
MakerPsmFillData,
MooniswapFillData,
@@ -161,6 +162,26 @@ export function getErc20BridgeSourceToBridgeSource(source: ERC20BridgeSource): s
return encodeBridgeSourceId(BridgeProtocol.UniswapV2, 'ComethSwap');
case ERC20BridgeSource.Dfyn:
return encodeBridgeSourceId(BridgeProtocol.UniswapV2, 'Dfyn');
case ERC20BridgeSource.CurveV2:
return encodeBridgeSourceId(BridgeProtocol.CurveV2, 'CurveV2');
case ERC20BridgeSource.WaultSwap:
return encodeBridgeSourceId(BridgeProtocol.UniswapV2, 'WaultSwap');
case ERC20BridgeSource.Polydex:
return encodeBridgeSourceId(BridgeProtocol.UniswapV2, 'Polydex');
case ERC20BridgeSource.FirebirdOneSwap:
return encodeBridgeSourceId(BridgeProtocol.Nerve, 'FirebirdOneSwap');
case ERC20BridgeSource.Lido:
return encodeBridgeSourceId(BridgeProtocol.Lido, 'Lido');
case ERC20BridgeSource.ShibaSwap:
return encodeBridgeSourceId(BridgeProtocol.UniswapV2, 'ShibaSwap');
case ERC20BridgeSource.JetSwap:
return encodeBridgeSourceId(BridgeProtocol.UniswapV2, 'JetSwap');
case ERC20BridgeSource.IronSwap:
return encodeBridgeSourceId(BridgeProtocol.Nerve, 'IronSwap');
case ERC20BridgeSource.ACryptos:
return encodeBridgeSourceId(BridgeProtocol.Curve, 'ACryptoS');
case ERC20BridgeSource.Clipper:
return encodeBridgeSourceId(BridgeProtocol.Clipper, 'Clipper');
default:
throw new Error(AggregationError.NoBridgeForSource);
}
@@ -183,6 +204,7 @@ export function createBridgeDataForBridgeOrder(order: OptimizedMarketBridgeOrder
switch (order.source) {
case ERC20BridgeSource.Curve:
case ERC20BridgeSource.CurveV2:
case ERC20BridgeSource.Swerve:
case ERC20BridgeSource.SnowSwap:
case ERC20BridgeSource.Nerve:
@@ -191,6 +213,9 @@ export function createBridgeDataForBridgeOrder(order: OptimizedMarketBridgeOrder
case ERC20BridgeSource.Smoothy:
case ERC20BridgeSource.Saddle:
case ERC20BridgeSource.XSigma:
case ERC20BridgeSource.FirebirdOneSwap:
case ERC20BridgeSource.IronSwap:
case ERC20BridgeSource.ACryptos:
const curveFillData = (order as OptimizedMarketBridgeOrder<CurveFillData>).fillData;
bridgeData = encoder.encode([
curveFillData.pool.poolAddress,
@@ -227,6 +252,10 @@ export function createBridgeDataForBridgeOrder(order: OptimizedMarketBridgeOrder
case ERC20BridgeSource.QuickSwap:
case ERC20BridgeSource.ComethSwap:
case ERC20BridgeSource.Dfyn:
case ERC20BridgeSource.WaultSwap:
case ERC20BridgeSource.Polydex:
case ERC20BridgeSource.ShibaSwap:
case ERC20BridgeSource.JetSwap:
const uniswapV2FillData = (order as OptimizedMarketBridgeOrder<UniswapV2FillData>).fillData;
bridgeData = encoder.encode([uniswapV2FillData.router, uniswapV2FillData.tokenAddressPath]);
break;
@@ -287,6 +316,14 @@ export function createBridgeDataForBridgeOrder(order: OptimizedMarketBridgeOrder
kyberDmmFillData.tokenAddressPath,
]);
break;
case ERC20BridgeSource.Lido:
const lidoFillData = (order as OptimizedMarketBridgeOrder<LidoFillData>).fillData;
bridgeData = encoder.encode([lidoFillData.stEthTokenAddress]);
break;
case ERC20BridgeSource.Clipper:
const clipperFillData = (order as OptimizedMarketBridgeOrder<LiquidityProviderFillData>).fillData;
bridgeData = encoder.encode([clipperFillData.poolAddress, NULL_BYTES]);
break;
default:
throw new Error(AggregationError.NoBridgeForSource);
}
@@ -392,6 +429,7 @@ export const BRIDGE_ENCODERS: {
]),
// Curve like
[ERC20BridgeSource.Curve]: curveEncoder,
[ERC20BridgeSource.CurveV2]: curveEncoder,
[ERC20BridgeSource.Swerve]: curveEncoder,
[ERC20BridgeSource.SnowSwap]: curveEncoder,
[ERC20BridgeSource.Nerve]: curveEncoder,
@@ -400,12 +438,16 @@ export const BRIDGE_ENCODERS: {
[ERC20BridgeSource.Smoothy]: curveEncoder,
[ERC20BridgeSource.Saddle]: curveEncoder,
[ERC20BridgeSource.XSigma]: curveEncoder,
[ERC20BridgeSource.FirebirdOneSwap]: curveEncoder,
[ERC20BridgeSource.IronSwap]: curveEncoder,
[ERC20BridgeSource.ACryptos]: curveEncoder,
// UniswapV2 like, (router, address[])
[ERC20BridgeSource.Bancor]: routerAddressPathEncoder,
[ERC20BridgeSource.UniswapV2]: routerAddressPathEncoder,
[ERC20BridgeSource.SushiSwap]: routerAddressPathEncoder,
[ERC20BridgeSource.CryptoCom]: routerAddressPathEncoder,
[ERC20BridgeSource.Linkswap]: routerAddressPathEncoder,
[ERC20BridgeSource.ShibaSwap]: routerAddressPathEncoder,
// BSC
[ERC20BridgeSource.PancakeSwap]: routerAddressPathEncoder,
[ERC20BridgeSource.PancakeSwapV2]: routerAddressPathEncoder,
@@ -414,10 +456,13 @@ export const BRIDGE_ENCODERS: {
[ERC20BridgeSource.CafeSwap]: routerAddressPathEncoder,
[ERC20BridgeSource.CheeseSwap]: routerAddressPathEncoder,
[ERC20BridgeSource.JulSwap]: routerAddressPathEncoder,
[ERC20BridgeSource.WaultSwap]: routerAddressPathEncoder,
// Polygon
[ERC20BridgeSource.QuickSwap]: routerAddressPathEncoder,
[ERC20BridgeSource.ComethSwap]: routerAddressPathEncoder,
[ERC20BridgeSource.Dfyn]: routerAddressPathEncoder,
[ERC20BridgeSource.Polydex]: routerAddressPathEncoder,
[ERC20BridgeSource.JetSwap]: routerAddressPathEncoder,
// Generic pools
[ERC20BridgeSource.Shell]: poolEncoder,
[ERC20BridgeSource.Component]: poolEncoder,
@@ -435,14 +480,19 @@ export const BRIDGE_ENCODERS: {
{ name: 'path', type: 'bytes' },
]),
[ERC20BridgeSource.KyberDmm]: AbiEncoder.create('(address,address[],address[])'),
[ERC20BridgeSource.Lido]: AbiEncoder.create('(address)'),
[ERC20BridgeSource.Clipper]: AbiEncoder.create([
{ name: 'provider', type: 'address' },
{ name: 'data', type: 'bytes' },
]),
};
function getFillTokenAmounts(fill: CollapsedFill, side: MarketOperation): [BigNumber, BigNumber] {
return [
// Maker asset amount.
side === MarketOperation.Sell ? fill.output : fill.input,
side === MarketOperation.Sell ? fill.output.integerValue(BigNumber.ROUND_DOWN) : fill.input,
// Taker asset amount.
side === MarketOperation.Sell ? fill.input : fill.output,
side === MarketOperation.Sell ? fill.input : fill.output.integerValue(BigNumber.ROUND_UP),
];
}

View File

@@ -36,7 +36,7 @@ export const DEFAULT_PATH_PENALTY_OPTS: PathPenaltyOpts = {
export class Path {
public collapsedFills?: ReadonlyArray<CollapsedFill>;
public orders?: OptimizedMarketOrder[];
public sourceFlags: number = 0;
public sourceFlags: bigint = BigInt(0);
protected _size: PathSize = { input: ZERO_AMOUNT, output: ZERO_AMOUNT };
protected _adjustedSize: PathSize = { input: ZERO_AMOUNT, output: ZERO_AMOUNT };
@@ -78,6 +78,11 @@ export class Path {
return this;
}
/**
* Add a fallback path to the current path
* Fallback must contain exclusive fills that are
* not present in this path
*/
public addFallback(fallback: Path): this {
// If the last fill is Native and penultimate is not, then the intention was to partial fill
// In this case we drop it entirely as we can't handle a failure at the end and we don't
@@ -93,9 +98,18 @@ export class Path {
// an additional protocol fee. I.e [Uniswap,Native,Kyber] becomes [Native,Uniswap,Kyber]
// In the previous step we dropped any hanging Native partial fills, as to not fully fill
const nativeFills = this.fills.filter(f => f.source === ERC20BridgeSource.Native);
this.fills = [...nativeFills.filter(f => f !== lastNativeFillIfExists), ...fallback.fills];
const otherFills = this.fills.filter(f => f.source !== ERC20BridgeSource.Native);
const otherSourcePathIds = otherFills.map(f => f.sourcePathId);
this.fills = [
// Append all of the native fills first
...nativeFills.filter(f => f !== lastNativeFillIfExists),
// Add the other fills that are not native in the optimal path
...otherFills,
// Add the fallbacks to the end that aren't already included
...fallback.fills.filter(f => !otherSourcePathIds.includes(f.sourcePathId)),
];
// Recompute the source flags
this.sourceFlags = this.fills.reduce((flags, fill) => flags | fill.flags, 0);
this.sourceFlags = this.fills.reduce((flags, fill) => flags | fill.flags, BigInt(0));
return this;
}

View File

@@ -1,3 +1,4 @@
import { ChainId } from '@0x/contract-addresses';
import { BigNumber } from '@0x/utils';
// import { parsePoolData } from '@balancer-labs'; // TODO - upgrade to v2
import { Pool } from '@balancer-labs/sor/dist/types';
@@ -5,7 +6,11 @@ import { gql, request } from 'graphql-request';
import { DEFAULT_WARNING_LOGGER } from '../../../constants';
import { LogFunction } from '../../../types';
import { BALANCER_MAX_POOLS_FETCHED, BALANCER_TOP_POOLS_FETCHED, BALANCER_V2_SUBGRAPH_URL } from '../constants';
import {
BALANCER_MAX_POOLS_FETCHED,
BALANCER_TOP_POOLS_FETCHED,
BALANCER_V2_SUBGRAPH_URL_BY_CHAIN,
} from '../constants';
import { parsePoolData } from './balancer_sor_v2';
import { CacheValue, PoolsCache } from './pools_cache';
@@ -45,7 +50,8 @@ export class BalancerV2PoolsCache extends PoolsCache {
}
constructor(
private readonly subgraphUrl: string = BALANCER_V2_SUBGRAPH_URL,
chainId: ChainId,
private readonly subgraphUrl: string = BALANCER_V2_SUBGRAPH_URL_BY_CHAIN[chainId],
private readonly maxPoolsFetched: number = BALANCER_MAX_POOLS_FETCHED,
private readonly _topPoolsFetched: number = BALANCER_TOP_POOLS_FETCHED,
private readonly _warningLogger: LogFunction = DEFAULT_WARNING_LOGGER,

View File

@@ -20,10 +20,12 @@ import {
import {
BALANCER_V2_VAULT_ADDRESS_BY_CHAIN,
BANCOR_REGISTRY_BY_CHAIN_ID,
CLIPPER_INFO_BY_CHAIN,
DODOV1_CONFIG_BY_CHAIN_ID,
DODOV2_FACTORIES_BY_CHAIN_ID,
KYBER_CONFIG_BY_CHAIN_ID,
KYBER_DMM_ROUTER_BY_CHAIN_ID,
LIDO_INFO_BY_CHAIN,
LINKSWAP_ROUTER_BY_CHAIN_ID,
LIQUIDITY_PROVIDER_REGISTRY_BY_CHAIN_ID,
MAINNET_TOKENS,
@@ -60,6 +62,8 @@ import {
KyberDmmFillData,
KyberFillData,
KyberSamplerOpts,
LidoFillData,
LidoInfo,
LiquidityProviderFillData,
LiquidityProviderRegistry,
MakerPsmFillData,
@@ -119,7 +123,7 @@ export class SamplerOperations {
this.poolsCaches = poolsCaches
? poolsCaches
: {
[ERC20BridgeSource.BalancerV2]: new BalancerV2PoolsCache(),
[ERC20BridgeSource.BalancerV2]: new BalancerV2PoolsCache(chainId),
[ERC20BridgeSource.Balancer]: new BalancerPoolsCache(),
[ERC20BridgeSource.Cream]: new CreamPoolsCache(),
};
@@ -356,9 +360,10 @@ export class SamplerOperations {
takerToken: string,
takerFillAmounts: BigNumber[],
gasCost: number,
source: ERC20BridgeSource = ERC20BridgeSource.LiquidityProvider,
): SourceQuoteOperation<LiquidityProviderFillData> {
return new SamplerContractOperation({
source: ERC20BridgeSource.LiquidityProvider,
source,
fillData: {
poolAddress: providerAddress,
gasCost,
@@ -375,9 +380,10 @@ export class SamplerOperations {
takerToken: string,
makerFillAmounts: BigNumber[],
gasCost: number,
source: ERC20BridgeSource = ERC20BridgeSource.LiquidityProvider,
): SourceQuoteOperation<LiquidityProviderFillData> {
return new SamplerContractOperation({
source: ERC20BridgeSource.LiquidityProvider,
source,
fillData: {
poolAddress: providerAddress,
gasCost,
@@ -1059,6 +1065,42 @@ export class SamplerOperations {
});
}
public getLidoSellQuotes(
lidoInfo: LidoInfo,
makerToken: string,
takerToken: string,
takerFillAmounts: BigNumber[],
): SourceQuoteOperation<LidoFillData> {
return new SamplerContractOperation({
source: ERC20BridgeSource.Lido,
fillData: {
takerToken,
stEthTokenAddress: lidoInfo.stEthToken,
},
contract: this._samplerContract,
function: this._samplerContract.sampleSellsFromLido,
params: [lidoInfo, takerToken, makerToken, takerFillAmounts],
});
}
public getLidoBuyQuotes(
lidoInfo: LidoInfo,
makerToken: string,
takerToken: string,
makerFillAmounts: BigNumber[],
): SourceQuoteOperation<LidoFillData> {
return new SamplerContractOperation({
source: ERC20BridgeSource.Lido,
fillData: {
takerToken,
stEthTokenAddress: lidoInfo.stEthToken,
},
contract: this._samplerContract,
function: this._samplerContract.sampleBuysFromLido,
params: [lidoInfo, takerToken, makerToken, makerFillAmounts],
});
}
public getMedianSellRate(
sources: ERC20BridgeSource[],
makerToken: string,
@@ -1188,6 +1230,10 @@ export class SamplerOperations {
case ERC20BridgeSource.QuickSwap:
case ERC20BridgeSource.ComethSwap:
case ERC20BridgeSource.Dfyn:
case ERC20BridgeSource.WaultSwap:
case ERC20BridgeSource.Polydex:
case ERC20BridgeSource.ShibaSwap:
case ERC20BridgeSource.JetSwap:
const uniLikeRouter = uniswapV2LikeRouterAddress(this.chainId, source);
if (!isValidAddress(uniLikeRouter)) {
return [];
@@ -1213,6 +1259,7 @@ export class SamplerOperations {
),
);
case ERC20BridgeSource.Curve:
case ERC20BridgeSource.CurveV2:
case ERC20BridgeSource.Swerve:
case ERC20BridgeSource.SnowSwap:
case ERC20BridgeSource.Nerve:
@@ -1220,6 +1267,9 @@ export class SamplerOperations {
case ERC20BridgeSource.Ellipsis:
case ERC20BridgeSource.Saddle:
case ERC20BridgeSource.XSigma:
case ERC20BridgeSource.FirebirdOneSwap:
case ERC20BridgeSource.IronSwap:
case ERC20BridgeSource.ACryptos:
return getCurveLikeInfosForPair(this.chainId, takerToken, makerToken, source).map(pool =>
this.getCurveSellQuotes(
pool,
@@ -1275,9 +1325,9 @@ export class SamplerOperations {
takerToken,
makerToken,
) || []
).map(poolAddress =>
).map(balancerPool =>
this.getBalancerSellQuotes(
poolAddress,
balancerPool,
makerToken,
takerToken,
takerFillAmounts,
@@ -1311,9 +1361,9 @@ export class SamplerOperations {
takerToken,
makerToken,
) || []
).map(poolAddress =>
).map(creamPool =>
this.getBalancerSellQuotes(
poolAddress,
creamPool,
makerToken,
takerToken,
takerFillAmounts,
@@ -1389,6 +1439,45 @@ export class SamplerOperations {
...intermediateTokens.map(t => [takerToken, t, makerToken]),
].map(path => this.getUniswapV3SellQuotes(router, quoter, path, takerFillAmounts));
}
case ERC20BridgeSource.Lido: {
const lidoInfo = LIDO_INFO_BY_CHAIN[this.chainId];
if (
lidoInfo.stEthToken === NULL_ADDRESS ||
lidoInfo.wethToken === NULL_ADDRESS ||
takerToken.toLowerCase() !== lidoInfo.wethToken.toLowerCase() ||
makerToken.toLowerCase() !== lidoInfo.stEthToken.toLowerCase()
) {
return [];
}
return this.getLidoSellQuotes(lidoInfo, makerToken, takerToken, takerFillAmounts);
}
case ERC20BridgeSource.Clipper:
const { poolAddress: clipperPoolAddress, tokens: clipperTokens } = CLIPPER_INFO_BY_CHAIN[
this.chainId
];
if (
clipperPoolAddress === NULL_ADDRESS ||
!clipperTokens.includes(makerToken) ||
!clipperTokens.includes(takerToken)
) {
return [];
}
// Clipper requires WETH to be represented as address(0)
const adjustedMakerToken =
makerToken === NATIVE_FEE_TOKEN_BY_CHAIN_ID[this.chainId] ? NULL_ADDRESS : makerToken;
const adjustedTakerToken =
takerToken === NATIVE_FEE_TOKEN_BY_CHAIN_ID[this.chainId] ? NULL_ADDRESS : takerToken;
// Supports the PLP interface
return this.getLiquidityProviderSellQuotes(
clipperPoolAddress,
adjustedMakerToken,
adjustedTakerToken,
takerFillAmounts,
// tslint:disable-next-line: custom-no-magic-numbers
0, // Not used for Clipper
ERC20BridgeSource.Clipper,
);
default:
throw new Error(`Unsupported sell sample source: ${source}`);
}
@@ -1441,6 +1530,10 @@ export class SamplerOperations {
case ERC20BridgeSource.QuickSwap:
case ERC20BridgeSource.ComethSwap:
case ERC20BridgeSource.Dfyn:
case ERC20BridgeSource.WaultSwap:
case ERC20BridgeSource.Polydex:
case ERC20BridgeSource.ShibaSwap:
case ERC20BridgeSource.JetSwap:
const uniLikeRouter = uniswapV2LikeRouterAddress(this.chainId, source);
if (!isValidAddress(uniLikeRouter)) {
return [];
@@ -1466,6 +1559,7 @@ export class SamplerOperations {
),
);
case ERC20BridgeSource.Curve:
case ERC20BridgeSource.CurveV2:
case ERC20BridgeSource.Swerve:
case ERC20BridgeSource.SnowSwap:
case ERC20BridgeSource.Nerve:
@@ -1473,6 +1567,9 @@ export class SamplerOperations {
case ERC20BridgeSource.Ellipsis:
case ERC20BridgeSource.Saddle:
case ERC20BridgeSource.XSigma:
case ERC20BridgeSource.FirebirdOneSwap:
case ERC20BridgeSource.IronSwap:
case ERC20BridgeSource.ACryptos:
return getCurveLikeInfosForPair(this.chainId, takerToken, makerToken, source).map(pool =>
this.getCurveBuyQuotes(
pool,
@@ -1636,6 +1733,46 @@ export class SamplerOperations {
...intermediateTokens.map(t => [takerToken, t, makerToken]),
].map(path => this.getUniswapV3BuyQuotes(router, quoter, path, makerFillAmounts));
}
case ERC20BridgeSource.Lido: {
const lidoInfo = LIDO_INFO_BY_CHAIN[this.chainId];
if (
lidoInfo.stEthToken === NULL_ADDRESS ||
lidoInfo.wethToken === NULL_ADDRESS ||
takerToken.toLowerCase() !== lidoInfo.wethToken.toLowerCase() ||
makerToken.toLowerCase() !== lidoInfo.stEthToken.toLowerCase()
) {
return [];
}
return this.getLidoBuyQuotes(lidoInfo, makerToken, takerToken, makerFillAmounts);
}
case ERC20BridgeSource.Clipper:
const { poolAddress: clipperPoolAddress, tokens: clipperTokens } = CLIPPER_INFO_BY_CHAIN[
this.chainId
];
if (
clipperPoolAddress === NULL_ADDRESS ||
!clipperTokens.includes(makerToken) ||
!clipperTokens.includes(takerToken)
) {
return [];
}
// Clipper requires WETH to be represented as address(0)
const adjustedMakerToken =
makerToken === NATIVE_FEE_TOKEN_BY_CHAIN_ID[this.chainId] ? NULL_ADDRESS : makerToken;
const adjustedTakerToken =
takerToken === NATIVE_FEE_TOKEN_BY_CHAIN_ID[this.chainId] ? NULL_ADDRESS : takerToken;
// Supports the PLP interface
return this.getLiquidityProviderBuyQuotes(
clipperPoolAddress,
adjustedMakerToken,
adjustedTakerToken,
makerFillAmounts,
// tslint:disable-next-line: custom-no-magic-numbers
0, // Not used for Clipper
ERC20BridgeSource.Clipper,
);
default:
throw new Error(`Unsupported buy sample source: ${source}`);
}

View File

@@ -66,6 +66,10 @@ export enum ERC20BridgeSource {
Saddle = 'Saddle',
XSigma = 'xSigma',
UniswapV3 = 'Uniswap_V3',
CurveV2 = 'Curve_V2',
Lido = 'Lido',
ShibaSwap = 'ShibaSwap',
Clipper = 'Clipper',
// BSC only
PancakeSwap = 'PancakeSwap',
PancakeSwapV2 = 'PancakeSwap_V2',
@@ -77,10 +81,16 @@ export enum ERC20BridgeSource {
CafeSwap = 'CafeSwap',
CheeseSwap = 'CheeseSwap',
JulSwap = 'JulSwap',
ACryptos = 'ACryptoS',
// Polygon only
QuickSwap = 'QuickSwap',
ComethSwap = 'ComethSwap',
Dfyn = 'Dfyn',
WaultSwap = 'WaultSwap',
Polydex = 'Polydex',
FirebirdOneSwap = 'FirebirdOneSwap',
JetSwap = 'JetSwap',
IronSwap = 'IronSwap',
}
export type SourcesWithPoolsCache = ERC20BridgeSource.Balancer | ERC20BridgeSource.BalancerV2 | ERC20BridgeSource.Cream;
@@ -96,6 +106,11 @@ export enum CurveFunctionSelectors {
get_dx_underlying = '0x0e71d1b9',
get_dy = '0x5e0d443f',
get_dx = '0x67df02ca',
// Curve V2
exchange_v2 = '0x5b41b908',
exchange_underlying_v2 = '0x65b2489b',
get_dy_v2 = '0x556d6e9f',
get_dy_underlying_v2 = '0x85f11d1e',
// Smoothy
swap_uint256 = '0x5673b02d', // swap(uint256,uint256,uint256,uint256)
get_swap_amount = '0x45cf2ef6', // getSwapAmount(uint256,uint256,uint256)
@@ -114,7 +129,7 @@ export interface CurveInfo {
buyQuoteFunctionSelector: CurveFunctionSelectors;
poolAddress: string;
tokens: string[];
metaToken: string | undefined;
metaTokens: string[] | undefined;
gasSchedule: number;
}
@@ -127,6 +142,14 @@ export interface PsmInfo {
gemTokenAddress: string;
}
/**
* Configuration for a Lido deployment
*/
export interface LidoInfo {
stEthToken: string;
wethToken: string;
}
/**
* Configuration info for a Balancer V2 pool.
*/
@@ -237,6 +260,11 @@ export interface FinalUniswapV3FillData extends Omit<UniswapV3FillData, 'uniswap
uniswapPath: string;
}
export interface LidoFillData extends FillData {
stEthTokenAddress: string;
takerToken: string;
}
/**
* Represents a node on a fill path.
*/
@@ -251,7 +279,7 @@ export interface Fill<TFillData extends FillData = FillData> {
// paths that have the same `source` IDs but are distinct (e.g., Curves).
sourcePathId: string;
// See `SOURCE_FLAGS`.
flags: number;
flags: bigint;
// Input fill amount (taker asset amount in a sell, maker asset amount in a buy).
input: BigNumber;
// Output fill amount (maker asset amount in a sell, taker asset amount in a buy).
@@ -340,7 +368,7 @@ export interface GetMarketOrdersRfqOpts extends RfqRequestOpts {
export type FeeEstimate = (fillData: FillData) => number | BigNumber;
export type FeeSchedule = Partial<{ [key in ERC20BridgeSource]: FeeEstimate }>;
export type ExchangeProxyOverhead = (sourceFlags: number) => BigNumber;
export type ExchangeProxyOverhead = (sourceFlags: bigint) => BigNumber;
/**
* Options for `getMarketSellOrdersAsync()` and `getMarketBuyOrdersAsync()`.
@@ -442,7 +470,7 @@ export interface SourceQuoteOperation<TFillData extends FillData = FillData> ext
export interface OptimizerResult {
optimizedOrders: OptimizedMarketOrder[];
sourceFlags: number;
sourceFlags: bigint;
liquidityDelivered: CollapsedFill[] | DexSample<MultiHopFillData>;
marketSideLiquidity: MarketSideLiquidity;
adjustedRate: BigNumber;

View File

@@ -29,6 +29,7 @@ import { RfqMakerBlacklist } from './rfq_maker_blacklist';
const MAKER_TIMEOUT_STREAK_LENGTH = 10;
const MAKER_TIMEOUT_BLACKLIST_DURATION_MINUTES = 10;
const FILL_RATIO_WARNING_LEVEL = 0.99;
const rfqMakerBlacklist = new RfqMakerBlacklist(MAKER_TIMEOUT_STREAK_LENGTH, MAKER_TIMEOUT_BLACKLIST_DURATION_MINUTES);
interface RfqQuote<T> {
@@ -563,6 +564,22 @@ export class QuoteRequestor {
this._warningLogger(order, 'Expiry too soon in RFQ-T firm quote, filtering out');
return false;
} else {
const takerAmount = new BigNumber(order.takerAmount);
const fillRatio = takerAmount.div(assetFillAmount);
if (fillRatio.lt(1) && fillRatio.gte(FILL_RATIO_WARNING_LEVEL)) {
this._warningLogger(
{
makerUri: result.makerUri,
fillRatio,
assetFillAmount,
takerToken,
makerToken,
takerAmount: order.takerAmount,
makerAmount: order.makerAmount,
},
'Fill ratio in warning range',
);
}
return true;
}
});

View File

@@ -31,6 +31,7 @@ import * as IUniswapExchangeQuotes from '../test/generated-artifacts/IUniswapExc
import * as IUniswapV2Router01 from '../test/generated-artifacts/IUniswapV2Router01.json';
import * as KyberDmmSampler from '../test/generated-artifacts/KyberDmmSampler.json';
import * as KyberSampler from '../test/generated-artifacts/KyberSampler.json';
import * as LidoSampler from '../test/generated-artifacts/LidoSampler.json';
import * as LiquidityProviderSampler from '../test/generated-artifacts/LiquidityProviderSampler.json';
import * as MakerPSMSampler from '../test/generated-artifacts/MakerPSMSampler.json';
import * as MooniswapSampler from '../test/generated-artifacts/MooniswapSampler.json';
@@ -61,6 +62,7 @@ export const artifacts = {
FakeTaker: FakeTaker as ContractArtifact,
KyberDmmSampler: KyberDmmSampler as ContractArtifact,
KyberSampler: KyberSampler as ContractArtifact,
LidoSampler: LidoSampler as ContractArtifact,
LiquidityProviderSampler: LiquidityProviderSampler as ContractArtifact,
MStableSampler: MStableSampler as ContractArtifact,
MakerPSMSampler: MakerPSMSampler as ContractArtifact,

View File

@@ -39,7 +39,7 @@ const feeSchedule = {
[ERC20BridgeSource.Native]: _.constant(GAS_PRICE.times(NATIVE_ORDER_FEE)),
};
const exchangeProxyOverhead = (sourceFlags: number) => {
const exchangeProxyOverhead = (sourceFlags: bigint) => {
if ([SOURCE_FLAGS.RfqOrder].includes(sourceFlags)) {
return new BigNumber(20e3).times(GAS_PRICE);
} else {

View File

@@ -1280,7 +1280,7 @@ describe('MarketOperationUtils tests', () => {
});
const optimizer = new MarketOperationUtils(MOCK_SAMPLER, contractAddresses, ORDER_DOMAIN);
const gasPrice = 100e9; // 100 gwei
const exchangeProxyOverhead = (sourceFlags: number) =>
const exchangeProxyOverhead = (sourceFlags: bigint) =>
sourceFlags === SOURCE_FLAGS.LiquidityProvider
? constants.ZERO_AMOUNT
: new BigNumber(1.3e5).times(gasPrice);
@@ -1663,7 +1663,7 @@ describe('MarketOperationUtils tests', () => {
});
const optimizer = new MarketOperationUtils(MOCK_SAMPLER, contractAddresses, ORDER_DOMAIN);
const gasPrice = 100e9; // 100 gwei
const exchangeProxyOverhead = (sourceFlags: number) =>
const exchangeProxyOverhead = (sourceFlags: bigint) =>
sourceFlags === SOURCE_FLAGS.LiquidityProvider
? constants.ZERO_AMOUNT
: new BigNumber(1.3e5).times(gasPrice);

View File

@@ -0,0 +1,86 @@
import { expect } from '@0x/contracts-test-utils';
import { BigNumber } from '@0x/utils';
import { MarketOperation } from '../src/types';
import { Path } from '../src/utils/market_operation_utils/path';
import { ERC20BridgeSource, Fill } from '../src/utils/market_operation_utils/types';
const createFill = (
source: ERC20BridgeSource,
input: BigNumber = new BigNumber(100),
output: BigNumber = new BigNumber(100),
): Fill =>
// tslint:disable-next-line: no-object-literal-type-assertion
({
source,
input,
output,
adjustedOutput: output,
flags: BigInt(0),
sourcePathId: source,
} as Fill);
describe('Path', () => {
it('Adds a fallback', () => {
const targetInput = new BigNumber(100);
const path = Path.create(
MarketOperation.Sell,
[createFill(ERC20BridgeSource.Native), createFill(ERC20BridgeSource.Native)],
targetInput,
);
const fallback = Path.create(MarketOperation.Sell, [createFill(ERC20BridgeSource.Uniswap)], targetInput);
path.addFallback(fallback);
const sources = path.fills.map(f => f.source);
expect(sources).to.deep.eq([ERC20BridgeSource.Native, ERC20BridgeSource.Native, ERC20BridgeSource.Uniswap]);
});
it('Adds a fallback with LiquidityProvider', () => {
const targetInput = new BigNumber(100);
const path = Path.create(
MarketOperation.Sell,
[createFill(ERC20BridgeSource.Native), createFill(ERC20BridgeSource.LiquidityProvider)],
targetInput,
);
const fallback = Path.create(MarketOperation.Sell, [createFill(ERC20BridgeSource.Uniswap)], targetInput);
path.addFallback(fallback);
const sources = path.fills.map(f => f.source);
expect(sources).to.deep.eq([
ERC20BridgeSource.Native,
ERC20BridgeSource.LiquidityProvider,
ERC20BridgeSource.Uniswap,
]);
});
it('Removes partial Native orders', () => {
const targetInput = new BigNumber(100);
const path = Path.create(
MarketOperation.Sell,
[
createFill(ERC20BridgeSource.Uniswap),
createFill(ERC20BridgeSource.LiquidityProvider),
createFill(ERC20BridgeSource.Native),
],
targetInput,
);
const fallback = Path.create(MarketOperation.Sell, [createFill(ERC20BridgeSource.Kyber)], targetInput);
path.addFallback(fallback);
const sources = path.fills.map(f => f.source);
expect(sources).to.deep.eq([
ERC20BridgeSource.Uniswap,
ERC20BridgeSource.LiquidityProvider,
ERC20BridgeSource.Kyber,
]);
});
it('Handles duplicates', () => {
const targetInput = new BigNumber(100);
const path = Path.create(
MarketOperation.Sell,
[createFill(ERC20BridgeSource.Uniswap), createFill(ERC20BridgeSource.LiquidityProvider)],
targetInput,
);
const fallback = Path.create(MarketOperation.Sell, [createFill(ERC20BridgeSource.Uniswap)], targetInput);
path.addFallback(fallback);
const sources = path.fills.map(f => f.source);
expect(sources).to.deep.eq([ERC20BridgeSource.Uniswap, ERC20BridgeSource.LiquidityProvider]);
});
});

View File

@@ -1,3 +1,4 @@
import { ChainId } from '@0x/contract-addresses';
import * as chai from 'chai';
import 'mocha';
@@ -49,7 +50,7 @@ describe('Pools Caches for Balancer-based sampling', () => {
});
describe('BalancerV2PoolsCache', () => {
const cache = new BalancerV2PoolsCache();
const cache = new BalancerV2PoolsCache(ChainId.Mainnet);
it('fetches pools', async () => {
const pairs = [
[wethAddress, wbtcAddress],

View File

@@ -29,6 +29,7 @@ export * from '../test/generated-wrappers/i_uniswap_exchange_quotes';
export * from '../test/generated-wrappers/i_uniswap_v2_router01';
export * from '../test/generated-wrappers/kyber_dmm_sampler';
export * from '../test/generated-wrappers/kyber_sampler';
export * from '../test/generated-wrappers/lido_sampler';
export * from '../test/generated-wrappers/liquidity_provider_sampler';
export * from '../test/generated-wrappers/m_stable_sampler';
export * from '../test/generated-wrappers/maker_p_s_m_sampler';

View File

@@ -32,6 +32,7 @@
"test/generated-artifacts/IUniswapV2Router01.json",
"test/generated-artifacts/KyberDmmSampler.json",
"test/generated-artifacts/KyberSampler.json",
"test/generated-artifacts/LidoSampler.json",
"test/generated-artifacts/LiquidityProviderSampler.json",
"test/generated-artifacts/MStableSampler.json",
"test/generated-artifacts/MakerPSMSampler.json",

View File

@@ -1,4 +1,32 @@
[
{
"version": "6.5.0",
"changes": [
{
"note": "Deployed `Clipper`",
"pr": 299
}
],
"timestamp": 1628225642
},
{
"version": "6.4.0",
"changes": [
{
"note": "Deployed Lido FQT"
}
],
"timestamp": 1624356181
},
{
"timestamp": 1623382456,
"version": "6.3.1",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"version": "6.3.0",
"changes": [

View File

@@ -5,6 +5,18 @@ Edit the package's CHANGELOG.json file only.
CHANGELOG
## v6.5.0 - _August 6, 2021_
* Deployed `Clipper` (#299)
## v6.4.0 - _June 22, 2021_
* Deployed Lido FQT
## v6.3.1 - _June 11, 2021_
* Dependencies updated
## v6.3.0 - _May 25, 2021_
* Deployed contracts on `Polygon` (#240)

View File

@@ -36,7 +36,7 @@
"wethTransformer": "0xb2bc06a4efb20fc6553a69dbfa49b7be938034a7",
"payTakerTransformer": "0x4638a7ebe75b911b995d0ec73a81e4f85f41f24e",
"affiliateFeeTransformer": "0xda6d9fc5998f550a094585cf9171f0e8ee3ac59f",
"fillQuoteTransformer": "0xd12a34076a4d9eac4cb82d87411d958641d0db9b",
"fillQuoteTransformer": "0xb4fa284689c9784a60d840eb136bb16c5246191f",
"positiveSlippageFeeTransformer": "0xa9416ce1dbde8d331210c07b5c253d94ee4cc3fd"
}
},
@@ -77,7 +77,7 @@
"wethTransformer": "0x05ad19aa3826e0609a19568ffbd1dfe86c6c7184",
"payTakerTransformer": "0x6d0ebf2bcd9cc93ec553b60ad201943dcca4e291",
"affiliateFeeTransformer": "0x6588256778ca4432fa43983ac685c45efb2379e2",
"fillQuoteTransformer": "0xfdabf2a405034fd9034ddc51ba1189cbed6bd651",
"fillQuoteTransformer": "0xeca4b22f9005cd610c6a09e91fc3dd298a64837d",
"positiveSlippageFeeTransformer": "0x8b332f700fd37e71c5c5b26c4d78b5ca63dd33b2"
}
},
@@ -282,7 +282,7 @@
"wethTransformer": "0xe309d011cc6f189a3e8dcba85922715a019fed38",
"payTakerTransformer": "0x5ba7b9be86cda01cfbf56e0fb97184783be9dda1",
"affiliateFeeTransformer": "0xbed27284b42e5684e987169cf1da09c5d6c49fa8",
"fillQuoteTransformer": "0x2a0b60642d58ca819a6f3a3b4a6066be0df0486c",
"fillQuoteTransformer": "0xf708d512b8a82e2862543a630403327174410baf",
"positiveSlippageFeeTransformer": "0x4cd8f1c0df4d40fcc1e073845d5f6f4ed5cc8dab"
}
},

View File

@@ -1,6 +1,6 @@
{
"name": "@0x/contract-addresses",
"version": "6.3.0",
"version": "6.5.0",
"engines": {
"node": ">=6.12"
},

View File

@@ -1,6 +1,6 @@
{
"name": "@0x/contract-wrappers-test",
"version": "12.2.48",
"version": "12.2.51",
"engines": {
"node": ">=6.12"
},
@@ -31,11 +31,11 @@
},
"homepage": "https://github.com/0xProject/protocol/tree/main/packages/contract-wrappers-test",
"devDependencies": {
"@0x/contract-wrappers": "^13.17.0",
"@0x/contracts-test-utils": "^5.4.3",
"@0x/contract-wrappers": "^13.17.3",
"@0x/contracts-test-utils": "^5.4.6",
"@0x/dev-utils": "^4.2.7",
"@0x/migrations": "^8.0.9",
"@0x/order-utils": "^10.4.24",
"@0x/migrations": "^8.0.12",
"@0x/order-utils": "^10.4.27",
"@0x/subproviders": "^6.5.3",
"@0x/ts-doc-gen": "^0.0.28",
"@0x/tslint-config": "^4.1.4",

View File

@@ -1,4 +1,31 @@
[
{
"timestamp": 1628225642,
"version": "13.17.3",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1624356181,
"version": "13.17.2",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1623382456,
"version": "13.17.1",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"version": "13.17.0",
"changes": [

View File

@@ -5,6 +5,18 @@ Edit the package's CHANGELOG.json file only.
CHANGELOG
## v13.17.3 - _August 6, 2021_
* Dependencies updated
## v13.17.2 - _June 22, 2021_
* Dependencies updated
## v13.17.1 - _June 11, 2021_
* Dependencies updated
## v13.17.0 - _June 2, 2021_
* Update wrappers (#237)

View File

@@ -1,6 +1,6 @@
{
"name": "@0x/contract-wrappers",
"version": "13.17.0",
"version": "13.17.3",
"engines": {
"node": ">=6.12"
},
@@ -57,7 +57,7 @@
"dependencies": {
"@0x/assert": "^3.0.27",
"@0x/base-contract": "^6.4.0",
"@0x/contract-addresses": "^6.3.0",
"@0x/contract-addresses": "^6.5.0",
"@0x/json-schemas": "^6.1.3",
"@0x/types": "^3.3.3",
"@0x/utils": "^6.4.3",

View File

@@ -1,4 +1,31 @@
[
{
"timestamp": 1628225642,
"version": "8.0.12",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1624356181,
"version": "8.0.11",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1623382456,
"version": "8.0.10",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1622609597,
"version": "8.0.9",

View File

@@ -5,6 +5,18 @@ Edit the package's CHANGELOG.json file only.
CHANGELOG
## v8.0.12 - _August 6, 2021_
* Dependencies updated
## v8.0.11 - _June 22, 2021_
* Dependencies updated
## v8.0.10 - _June 11, 2021_
* Dependencies updated
## v8.0.9 - _June 2, 2021_
* Dependencies updated

View File

@@ -1,6 +1,6 @@
{
"name": "@0x/migrations",
"version": "8.0.9",
"version": "8.0.12",
"engines": {
"node": ">=6.12"
},
@@ -68,20 +68,20 @@
},
"dependencies": {
"@0x/base-contract": "^6.4.0",
"@0x/contract-addresses": "^6.3.0",
"@0x/contracts-asset-proxy": "^3.7.14",
"@0x/contracts-coordinator": "^3.1.33",
"@0x/contracts-dev-utils": "^1.3.31",
"@0x/contracts-erc1155": "^2.1.32",
"@0x/contracts-erc20": "^3.3.11",
"@0x/contracts-erc721": "^3.1.32",
"@0x/contracts-exchange": "^3.2.33",
"@0x/contracts-exchange-forwarder": "^4.2.33",
"@0x/contracts-extensions": "^6.2.27",
"@0x/contracts-multisig": "^4.1.33",
"@0x/contracts-staking": "^2.0.40",
"@0x/contracts-utils": "^4.7.11",
"@0x/contracts-zero-ex": "^0.25.0",
"@0x/contract-addresses": "^6.5.0",
"@0x/contracts-asset-proxy": "^3.7.17",
"@0x/contracts-coordinator": "^3.1.36",
"@0x/contracts-dev-utils": "^1.3.34",
"@0x/contracts-erc1155": "^2.1.35",
"@0x/contracts-erc20": "^3.3.14",
"@0x/contracts-erc721": "^3.1.35",
"@0x/contracts-exchange": "^3.2.36",
"@0x/contracts-exchange-forwarder": "^4.2.36",
"@0x/contracts-extensions": "^6.2.30",
"@0x/contracts-multisig": "^4.1.36",
"@0x/contracts-staking": "^2.0.43",
"@0x/contracts-utils": "^4.7.14",
"@0x/contracts-zero-ex": "^0.27.0",
"@0x/sol-compiler": "^4.7.3",
"@0x/subproviders": "^6.5.3",
"@0x/typescript-typings": "^5.2.0",

View File

@@ -1,4 +1,31 @@
[
{
"timestamp": 1628225642,
"version": "10.4.27",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1624356181,
"version": "10.4.26",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1623382456,
"version": "10.4.25",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1622609597,
"version": "10.4.24",

View File

@@ -5,6 +5,18 @@ Edit the package's CHANGELOG.json file only.
CHANGELOG
## v10.4.27 - _August 6, 2021_
* Dependencies updated
## v10.4.26 - _June 22, 2021_
* Dependencies updated
## v10.4.25 - _June 11, 2021_
* Dependencies updated
## v10.4.24 - _June 2, 2021_
* Dependencies updated

View File

@@ -1,6 +1,6 @@
{
"name": "@0x/order-utils",
"version": "10.4.24",
"version": "10.4.27",
"engines": {
"node": ">=6.12"
},
@@ -69,8 +69,8 @@
},
"dependencies": {
"@0x/assert": "^3.0.27",
"@0x/contract-addresses": "^6.3.0",
"@0x/contract-wrappers": "^13.17.0",
"@0x/contract-addresses": "^6.5.0",
"@0x/contract-wrappers": "^13.17.3",
"@0x/json-schemas": "^6.1.3",
"@0x/utils": "^6.4.3",
"@0x/web3-wrapper": "^7.5.3",

View File

@@ -1,4 +1,31 @@
[
{
"version": "1.8.0",
"changes": [
{
"note": "Add `Clipper`"
}
],
"timestamp": 1628225642
},
{
"timestamp": 1624356181,
"version": "1.7.2",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1623382456,
"version": "1.7.1",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"version": "1.7.0",
"changes": [

View File

@@ -5,6 +5,18 @@ Edit the package's CHANGELOG.json file only.
CHANGELOG
## v1.8.0 - _August 6, 2021_
* Add `Clipper`
## v1.7.2 - _June 22, 2021_
* Dependencies updated
## v1.7.1 - _June 11, 2021_
* Dependencies updated
## v1.7.0 - _June 2, 2021_
* Add utils for OtcOrders (#244)

Some files were not shown because too many files have changed in this diff Show More