Compare commits
32 Commits
@0x/contra
...
protocol@4
Author | SHA1 | Date | |
---|---|---|---|
|
4057bdab91 | ||
|
1cd10f0ac9 | ||
|
68f87b2432 | ||
|
69bafc3bcd | ||
|
2c44b06b7b | ||
|
0233f00b4e | ||
|
fedb53187d | ||
|
6774d2f588 | ||
|
cf740b74f5 | ||
|
177c00463a | ||
|
49b0e32129 | ||
|
938fc94756 | ||
|
1561d91c2b | ||
|
9a28e51f51 | ||
|
f55eaa867b | ||
|
6b2856424a | ||
|
da757c4700 | ||
|
75e6654884 | ||
|
87308e7693 | ||
|
d5eef93a76 | ||
|
a7f23a982e | ||
|
9eadc5fc28 | ||
|
92ad1a612e | ||
|
09413c0e12 | ||
|
23788b41d5 | ||
|
ccf999a495 | ||
|
aa1016ee5f | ||
|
423ef57344 | ||
|
c18149e82f | ||
|
d14aebf724 | ||
|
ba719a9631 | ||
|
d36034d958 |
@@ -1,4 +1,13 @@
|
|||||||
[
|
[
|
||||||
|
{
|
||||||
|
"timestamp": 1652919697,
|
||||||
|
"version": "3.3.30",
|
||||||
|
"changes": [
|
||||||
|
{
|
||||||
|
"note": "Dependencies updated"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"timestamp": 1650611093,
|
"timestamp": 1650611093,
|
||||||
"version": "3.3.29",
|
"version": "3.3.29",
|
||||||
|
@@ -5,6 +5,10 @@ Edit the package's CHANGELOG.json file only.
|
|||||||
|
|
||||||
CHANGELOG
|
CHANGELOG
|
||||||
|
|
||||||
|
## v3.3.30 - _May 19, 2022_
|
||||||
|
|
||||||
|
* Dependencies updated
|
||||||
|
|
||||||
## v3.3.29 - _April 22, 2022_
|
## v3.3.29 - _April 22, 2022_
|
||||||
|
|
||||||
* Dependencies updated
|
* Dependencies updated
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@0x/contracts-erc20",
|
"name": "@0x/contracts-erc20",
|
||||||
"version": "3.3.29",
|
"version": "3.3.30",
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=6.12"
|
"node": ">=6.12"
|
||||||
},
|
},
|
||||||
@@ -53,8 +53,8 @@
|
|||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@0x/abi-gen": "^5.8.0",
|
"@0x/abi-gen": "^5.8.0",
|
||||||
"@0x/contracts-gen": "^2.0.46",
|
"@0x/contracts-gen": "^2.0.46",
|
||||||
"@0x/contracts-test-utils": "^5.4.20",
|
"@0x/contracts-test-utils": "^5.4.21",
|
||||||
"@0x/contracts-utils": "^4.8.10",
|
"@0x/contracts-utils": "^4.8.11",
|
||||||
"@0x/dev-utils": "^4.2.14",
|
"@0x/dev-utils": "^4.2.14",
|
||||||
"@0x/sol-compiler": "^4.8.1",
|
"@0x/sol-compiler": "^4.8.1",
|
||||||
"@0x/ts-doc-gen": "^0.0.28",
|
"@0x/ts-doc-gen": "^0.0.28",
|
||||||
|
@@ -1,4 +1,13 @@
|
|||||||
[
|
[
|
||||||
|
{
|
||||||
|
"timestamp": 1652919697,
|
||||||
|
"version": "5.4.21",
|
||||||
|
"changes": [
|
||||||
|
{
|
||||||
|
"note": "Dependencies updated"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"timestamp": 1650611093,
|
"timestamp": 1650611093,
|
||||||
"version": "5.4.20",
|
"version": "5.4.20",
|
||||||
|
@@ -5,6 +5,10 @@ Edit the package's CHANGELOG.json file only.
|
|||||||
|
|
||||||
CHANGELOG
|
CHANGELOG
|
||||||
|
|
||||||
|
## v5.4.21 - _May 19, 2022_
|
||||||
|
|
||||||
|
* Dependencies updated
|
||||||
|
|
||||||
## v5.4.20 - _April 22, 2022_
|
## v5.4.20 - _April 22, 2022_
|
||||||
|
|
||||||
* Dependencies updated
|
* Dependencies updated
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@0x/contracts-test-utils",
|
"name": "@0x/contracts-test-utils",
|
||||||
"version": "5.4.20",
|
"version": "5.4.21",
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=6.12"
|
"node": ">=6.12"
|
||||||
},
|
},
|
||||||
@@ -44,7 +44,7 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@0x/assert": "^3.0.34",
|
"@0x/assert": "^3.0.34",
|
||||||
"@0x/base-contract": "^6.5.0",
|
"@0x/base-contract": "^6.5.0",
|
||||||
"@0x/contract-addresses": "^6.13.0",
|
"@0x/contract-addresses": "^6.14.0",
|
||||||
"@0x/dev-utils": "^4.2.14",
|
"@0x/dev-utils": "^4.2.14",
|
||||||
"@0x/json-schemas": "^6.4.4",
|
"@0x/json-schemas": "^6.4.4",
|
||||||
"@0x/order-utils": "^10.4.28",
|
"@0x/order-utils": "^10.4.28",
|
||||||
|
@@ -1,4 +1,13 @@
|
|||||||
[
|
[
|
||||||
|
{
|
||||||
|
"timestamp": 1652919697,
|
||||||
|
"version": "1.4.13",
|
||||||
|
"changes": [
|
||||||
|
{
|
||||||
|
"note": "Dependencies updated"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"timestamp": 1650611093,
|
"timestamp": 1650611093,
|
||||||
"version": "1.4.12",
|
"version": "1.4.12",
|
||||||
|
@@ -5,6 +5,10 @@ Edit the package's CHANGELOG.json file only.
|
|||||||
|
|
||||||
CHANGELOG
|
CHANGELOG
|
||||||
|
|
||||||
|
## v1.4.13 - _May 19, 2022_
|
||||||
|
|
||||||
|
* Dependencies updated
|
||||||
|
|
||||||
## v1.4.12 - _April 22, 2022_
|
## v1.4.12 - _April 22, 2022_
|
||||||
|
|
||||||
* Dependencies updated
|
* Dependencies updated
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@0x/contracts-treasury",
|
"name": "@0x/contracts-treasury",
|
||||||
"version": "1.4.12",
|
"version": "1.4.13",
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=6.12"
|
"node": ">=6.12"
|
||||||
},
|
},
|
||||||
@@ -47,12 +47,12 @@
|
|||||||
"homepage": "https://github.com/0xProject/protocol/tree/main/contracts/treasury",
|
"homepage": "https://github.com/0xProject/protocol/tree/main/contracts/treasury",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@0x/abi-gen": "^5.8.0",
|
"@0x/abi-gen": "^5.8.0",
|
||||||
"@0x/contract-addresses": "^6.13.0",
|
"@0x/contract-addresses": "^6.14.0",
|
||||||
"@0x/contracts-asset-proxy": "^3.7.19",
|
"@0x/contracts-asset-proxy": "^3.7.19",
|
||||||
"@0x/contracts-erc20": "^3.3.29",
|
"@0x/contracts-erc20": "^3.3.30",
|
||||||
"@0x/contracts-gen": "^2.0.46",
|
"@0x/contracts-gen": "^2.0.46",
|
||||||
"@0x/contracts-staking": "^2.0.45",
|
"@0x/contracts-staking": "^2.0.45",
|
||||||
"@0x/contracts-test-utils": "^5.4.20",
|
"@0x/contracts-test-utils": "^5.4.21",
|
||||||
"@0x/sol-compiler": "^4.8.1",
|
"@0x/sol-compiler": "^4.8.1",
|
||||||
"@0x/ts-doc-gen": "^0.0.28",
|
"@0x/ts-doc-gen": "^0.0.28",
|
||||||
"@0x/tslint-config": "^4.1.4",
|
"@0x/tslint-config": "^4.1.4",
|
||||||
@@ -73,7 +73,7 @@
|
|||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@0x/base-contract": "^6.5.0",
|
"@0x/base-contract": "^6.5.0",
|
||||||
"@0x/protocol-utils": "^11.12.0",
|
"@0x/protocol-utils": "^11.13.0",
|
||||||
"@0x/subproviders": "^6.6.5",
|
"@0x/subproviders": "^6.6.5",
|
||||||
"@0x/types": "^3.3.6",
|
"@0x/types": "^3.3.6",
|
||||||
"@0x/typescript-typings": "^5.3.1",
|
"@0x/typescript-typings": "^5.3.1",
|
||||||
|
@@ -1,4 +1,13 @@
|
|||||||
[
|
[
|
||||||
|
{
|
||||||
|
"timestamp": 1652919697,
|
||||||
|
"version": "4.8.11",
|
||||||
|
"changes": [
|
||||||
|
{
|
||||||
|
"note": "Dependencies updated"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"timestamp": 1650611093,
|
"timestamp": 1650611093,
|
||||||
"version": "4.8.10",
|
"version": "4.8.10",
|
||||||
|
@@ -5,6 +5,10 @@ Edit the package's CHANGELOG.json file only.
|
|||||||
|
|
||||||
CHANGELOG
|
CHANGELOG
|
||||||
|
|
||||||
|
## v4.8.11 - _May 19, 2022_
|
||||||
|
|
||||||
|
* Dependencies updated
|
||||||
|
|
||||||
## v4.8.10 - _April 22, 2022_
|
## v4.8.10 - _April 22, 2022_
|
||||||
|
|
||||||
* Dependencies updated
|
* Dependencies updated
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@0x/contracts-utils",
|
"name": "@0x/contracts-utils",
|
||||||
"version": "4.8.10",
|
"version": "4.8.11",
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=6.12"
|
"node": ">=6.12"
|
||||||
},
|
},
|
||||||
@@ -52,7 +52,7 @@
|
|||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@0x/abi-gen": "^5.8.0",
|
"@0x/abi-gen": "^5.8.0",
|
||||||
"@0x/contracts-gen": "^2.0.46",
|
"@0x/contracts-gen": "^2.0.46",
|
||||||
"@0x/contracts-test-utils": "^5.4.20",
|
"@0x/contracts-test-utils": "^5.4.21",
|
||||||
"@0x/dev-utils": "^4.2.14",
|
"@0x/dev-utils": "^4.2.14",
|
||||||
"@0x/order-utils": "^10.4.28",
|
"@0x/order-utils": "^10.4.28",
|
||||||
"@0x/sol-compiler": "^4.8.1",
|
"@0x/sol-compiler": "^4.8.1",
|
||||||
|
@@ -1,4 +1,14 @@
|
|||||||
[
|
[
|
||||||
|
{
|
||||||
|
"version": "0.33.0",
|
||||||
|
"changes": [
|
||||||
|
{
|
||||||
|
"note": "Add support for GMX and Platypus to bridge adapter",
|
||||||
|
"pr": 478
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"timestamp": 1652919697
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"version": "0.32.0",
|
"version": "0.32.0",
|
||||||
"changes": [
|
"changes": [
|
||||||
|
@@ -5,6 +5,10 @@ Edit the package's CHANGELOG.json file only.
|
|||||||
|
|
||||||
CHANGELOG
|
CHANGELOG
|
||||||
|
|
||||||
|
## v0.33.0 - _May 19, 2022_
|
||||||
|
|
||||||
|
* Add support for GMX and Platypus to bridge adapter (#478)
|
||||||
|
|
||||||
## v0.32.0 - _April 22, 2022_
|
## v0.32.0 - _April 22, 2022_
|
||||||
|
|
||||||
* Add support for `BalancerV2Batch` fills in FQT (#462)
|
* Add support for `BalancerV2Batch` fills in FQT (#462)
|
||||||
|
@@ -27,14 +27,13 @@ import "./mixins/MixinBalancer.sol";
|
|||||||
import "./mixins/MixinBalancerV2.sol";
|
import "./mixins/MixinBalancerV2.sol";
|
||||||
import "./mixins/MixinBalancerV2Batch.sol";
|
import "./mixins/MixinBalancerV2Batch.sol";
|
||||||
import "./mixins/MixinBancor.sol";
|
import "./mixins/MixinBancor.sol";
|
||||||
import "./mixins/MixinCoFiX.sol";
|
|
||||||
import "./mixins/MixinCompound.sol";
|
import "./mixins/MixinCompound.sol";
|
||||||
import "./mixins/MixinCurve.sol";
|
import "./mixins/MixinCurve.sol";
|
||||||
import "./mixins/MixinCurveV2.sol";
|
import "./mixins/MixinCurveV2.sol";
|
||||||
import "./mixins/MixinCryptoCom.sol";
|
import "./mixins/MixinCryptoCom.sol";
|
||||||
import "./mixins/MixinDodo.sol";
|
import "./mixins/MixinDodo.sol";
|
||||||
import "./mixins/MixinDodoV2.sol";
|
import "./mixins/MixinDodoV2.sol";
|
||||||
import "./mixins/MixinKyber.sol";
|
import "./mixins/MixinGMX.sol";
|
||||||
import "./mixins/MixinKyberDmm.sol";
|
import "./mixins/MixinKyberDmm.sol";
|
||||||
import "./mixins/MixinLido.sol";
|
import "./mixins/MixinLido.sol";
|
||||||
import "./mixins/MixinMakerPSM.sol";
|
import "./mixins/MixinMakerPSM.sol";
|
||||||
@@ -42,6 +41,7 @@ import "./mixins/MixinMooniswap.sol";
|
|||||||
import "./mixins/MixinMStable.sol";
|
import "./mixins/MixinMStable.sol";
|
||||||
import "./mixins/MixinNerve.sol";
|
import "./mixins/MixinNerve.sol";
|
||||||
import "./mixins/MixinOasis.sol";
|
import "./mixins/MixinOasis.sol";
|
||||||
|
import "./mixins/MixinPlatypus.sol";
|
||||||
import "./mixins/MixinShell.sol";
|
import "./mixins/MixinShell.sol";
|
||||||
import "./mixins/MixinUniswap.sol";
|
import "./mixins/MixinUniswap.sol";
|
||||||
import "./mixins/MixinUniswapV2.sol";
|
import "./mixins/MixinUniswapV2.sol";
|
||||||
@@ -55,14 +55,13 @@ contract BridgeAdapter is
|
|||||||
MixinBalancerV2,
|
MixinBalancerV2,
|
||||||
MixinBalancerV2Batch,
|
MixinBalancerV2Batch,
|
||||||
MixinBancor,
|
MixinBancor,
|
||||||
MixinCoFiX,
|
|
||||||
MixinCompound,
|
MixinCompound,
|
||||||
MixinCurve,
|
MixinCurve,
|
||||||
MixinCurveV2,
|
MixinCurveV2,
|
||||||
MixinCryptoCom,
|
MixinCryptoCom,
|
||||||
MixinDodo,
|
MixinDodo,
|
||||||
MixinDodoV2,
|
MixinDodoV2,
|
||||||
MixinKyber,
|
MixinGMX,
|
||||||
MixinKyberDmm,
|
MixinKyberDmm,
|
||||||
MixinLido,
|
MixinLido,
|
||||||
MixinMakerPSM,
|
MixinMakerPSM,
|
||||||
@@ -70,6 +69,7 @@ contract BridgeAdapter is
|
|||||||
MixinMStable,
|
MixinMStable,
|
||||||
MixinNerve,
|
MixinNerve,
|
||||||
MixinOasis,
|
MixinOasis,
|
||||||
|
MixinPlatypus,
|
||||||
MixinShell,
|
MixinShell,
|
||||||
MixinUniswap,
|
MixinUniswap,
|
||||||
MixinUniswapV2,
|
MixinUniswapV2,
|
||||||
@@ -82,20 +82,20 @@ contract BridgeAdapter is
|
|||||||
MixinBalancer()
|
MixinBalancer()
|
||||||
MixinBalancerV2()
|
MixinBalancerV2()
|
||||||
MixinBancor(weth)
|
MixinBancor(weth)
|
||||||
MixinCoFiX()
|
|
||||||
MixinCompound(weth)
|
MixinCompound(weth)
|
||||||
MixinCurve(weth)
|
MixinCurve(weth)
|
||||||
MixinCurveV2()
|
MixinCurveV2()
|
||||||
MixinCryptoCom()
|
MixinCryptoCom()
|
||||||
MixinDodo()
|
MixinDodo()
|
||||||
MixinDodoV2()
|
MixinDodoV2()
|
||||||
MixinKyber(weth)
|
MixinGMX()
|
||||||
MixinLido(weth)
|
MixinLido(weth)
|
||||||
MixinMakerPSM()
|
MixinMakerPSM()
|
||||||
MixinMooniswap(weth)
|
MixinMooniswap(weth)
|
||||||
MixinMStable()
|
MixinMStable()
|
||||||
MixinNerve()
|
MixinNerve()
|
||||||
MixinOasis()
|
MixinOasis()
|
||||||
|
MixinPlatypus()
|
||||||
MixinShell()
|
MixinShell()
|
||||||
MixinUniswap(weth)
|
MixinUniswap(weth)
|
||||||
MixinUniswapV2()
|
MixinUniswapV2()
|
||||||
@@ -166,14 +166,7 @@ contract BridgeAdapter is
|
|||||||
sellAmount,
|
sellAmount,
|
||||||
order.bridgeData
|
order.bridgeData
|
||||||
);
|
);
|
||||||
} else if (protocolId == BridgeProtocols.KYBER) {
|
}else if (protocolId == BridgeProtocols.MAKERPSM) {
|
||||||
boughtAmount = _tradeKyber(
|
|
||||||
sellToken,
|
|
||||||
buyToken,
|
|
||||||
sellAmount,
|
|
||||||
order.bridgeData
|
|
||||||
);
|
|
||||||
} else if (protocolId == BridgeProtocols.MAKERPSM) {
|
|
||||||
boughtAmount = _tradeMakerPsm(
|
boughtAmount = _tradeMakerPsm(
|
||||||
sellToken,
|
sellToken,
|
||||||
buyToken,
|
buyToken,
|
||||||
@@ -232,13 +225,6 @@ contract BridgeAdapter is
|
|||||||
sellAmount,
|
sellAmount,
|
||||||
order.bridgeData
|
order.bridgeData
|
||||||
);
|
);
|
||||||
} else if (protocolId == BridgeProtocols.COFIX) {
|
|
||||||
boughtAmount = _tradeCoFiX(
|
|
||||||
sellToken,
|
|
||||||
buyToken,
|
|
||||||
sellAmount,
|
|
||||||
order.bridgeData
|
|
||||||
);
|
|
||||||
} else if (protocolId == BridgeProtocols.NERVE) {
|
} else if (protocolId == BridgeProtocols.NERVE) {
|
||||||
boughtAmount = _tradeNerve(
|
boughtAmount = _tradeNerve(
|
||||||
sellToken,
|
sellToken,
|
||||||
@@ -272,6 +258,18 @@ contract BridgeAdapter is
|
|||||||
sellAmount,
|
sellAmount,
|
||||||
order.bridgeData
|
order.bridgeData
|
||||||
);
|
);
|
||||||
|
} else if (protocolId == BridgeProtocols.GMX) {
|
||||||
|
boughtAmount = _tradeGMX(
|
||||||
|
buyToken,
|
||||||
|
sellAmount,
|
||||||
|
order.bridgeData
|
||||||
|
);
|
||||||
|
} else if (protocolId == BridgeProtocols.PLATYPUS) {
|
||||||
|
boughtAmount = _tradePlatypus(
|
||||||
|
buyToken,
|
||||||
|
sellAmount,
|
||||||
|
order.bridgeData
|
||||||
|
);
|
||||||
} else {
|
} else {
|
||||||
boughtAmount = _tradeZeroExBridge(
|
boughtAmount = _tradeZeroExBridge(
|
||||||
sellToken,
|
sellToken,
|
||||||
|
@@ -53,4 +53,6 @@ library BridgeProtocols {
|
|||||||
uint128 internal constant AAVEV2 = 23;
|
uint128 internal constant AAVEV2 = 23;
|
||||||
uint128 internal constant COMPOUND = 24;
|
uint128 internal constant COMPOUND = 24;
|
||||||
uint128 internal constant BALANCERV2BATCH = 25;
|
uint128 internal constant BALANCERV2BATCH = 25;
|
||||||
|
uint128 internal constant GMX = 26;
|
||||||
|
uint128 internal constant PLATYPUS = 27;
|
||||||
}
|
}
|
||||||
|
@@ -0,0 +1,98 @@
|
|||||||
|
// 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-erc20/contracts/src/v06/LibERC20TokenV06.sol";
|
||||||
|
import "@0x/contracts-erc20/contracts/src/v06/IERC20TokenV06.sol";
|
||||||
|
import "@0x/contracts-utils/contracts/src/v06/LibSafeMathV06.sol";
|
||||||
|
import "../IBridgeAdapter.sol";
|
||||||
|
|
||||||
|
/*
|
||||||
|
UniswapV2
|
||||||
|
*/
|
||||||
|
interface IGmxRouter {
|
||||||
|
|
||||||
|
// /// @dev Swaps an exact amount of input tokens for as many output tokens as possible, along the route determined by the path.
|
||||||
|
// /// The first element of path is the input token, the last is the output token, and any intermediate elements represent
|
||||||
|
// /// intermediate pairs to trade through (if, for example, a direct pair does not exist).
|
||||||
|
// /// @param _path An array of token addresses. path.length must be >= 2. Pools for each consecutive pair of addresses must exist and have liquidity.
|
||||||
|
// /// @param _amountIn The amount of input tokens to send.
|
||||||
|
// /// @param _minOut The minimum amount of output tokens that must be received for the transaction not to revert.
|
||||||
|
// /// @param _reciever Recipient of the output tokens.
|
||||||
|
function swap(
|
||||||
|
address[] calldata _path, uint256 _amountIn, uint256 _minOut, address _receiver
|
||||||
|
) external;
|
||||||
|
}
|
||||||
|
|
||||||
|
contract MixinGMX {
|
||||||
|
|
||||||
|
using LibERC20TokenV06 for IERC20TokenV06;
|
||||||
|
using LibSafeMathV06 for uint256;
|
||||||
|
|
||||||
|
function _tradeGMX(
|
||||||
|
IERC20TokenV06 buyToken,
|
||||||
|
uint256 sellAmount,
|
||||||
|
bytes memory bridgeData
|
||||||
|
)
|
||||||
|
public
|
||||||
|
returns (uint256 boughtAmount)
|
||||||
|
{
|
||||||
|
address _router;
|
||||||
|
address reader;
|
||||||
|
address vault;
|
||||||
|
address[] memory _path;
|
||||||
|
IGmxRouter router;
|
||||||
|
IERC20TokenV06[] memory path;
|
||||||
|
|
||||||
|
{
|
||||||
|
//decode the bridge data
|
||||||
|
(_router, reader, vault, _path) = abi.decode(bridgeData, (address, address, address, address[]));
|
||||||
|
// To get around `abi.decode()` not supporting interface array types.
|
||||||
|
assembly { path := _path }
|
||||||
|
}
|
||||||
|
|
||||||
|
require(path.length >= 2, "MixinGMX/PATH_LENGTH_MUST_BE_AT_LEAST_TWO");
|
||||||
|
require(
|
||||||
|
path[path.length - 1] == buyToken,
|
||||||
|
"MixinGMX/LAST_ELEMENT_OF_PATH_MUST_MATCH_OUTPUT_TOKEN"
|
||||||
|
);
|
||||||
|
|
||||||
|
//connect to the GMX router
|
||||||
|
router = IGmxRouter(_router);
|
||||||
|
|
||||||
|
// Grant the GMX router an allowance to sell the first token.
|
||||||
|
path[0].approveIfBelow(address(router), sellAmount);
|
||||||
|
|
||||||
|
//track the balance to know how much we bought
|
||||||
|
uint256 beforeBalance = buyToken.balanceOf(address(this));
|
||||||
|
router.swap(
|
||||||
|
// Convert to `buyToken` along this path.
|
||||||
|
_path,
|
||||||
|
// Sell all tokens we hold.
|
||||||
|
sellAmount,
|
||||||
|
// Minimum buy amount.
|
||||||
|
0,
|
||||||
|
// Recipient is `this`.
|
||||||
|
address(this)
|
||||||
|
);
|
||||||
|
|
||||||
|
//calculate the difference in balance from preswap->postswap to find how many tokens out
|
||||||
|
boughtAmount = buyToken.balanceOf(address(this)).safeSub(beforeBalance);
|
||||||
|
|
||||||
|
return boughtAmount;
|
||||||
|
}
|
||||||
|
}
|
@@ -0,0 +1,79 @@
|
|||||||
|
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-utils/contracts/src/v06/LibSafeMathV06.sol";
|
||||||
|
|
||||||
|
|
||||||
|
interface IPlatypusRouter {
|
||||||
|
|
||||||
|
function swapTokensForTokens(
|
||||||
|
address[] calldata tokenPath,
|
||||||
|
address[] calldata poolPath,
|
||||||
|
uint256 fromAmount,
|
||||||
|
uint256 minimumToAmount,
|
||||||
|
address to,
|
||||||
|
uint256 deadline
|
||||||
|
) external returns (uint256 amountOut, uint256 haircut);
|
||||||
|
}
|
||||||
|
|
||||||
|
contract MixinPlatypus {
|
||||||
|
|
||||||
|
using LibERC20TokenV06 for IERC20TokenV06;
|
||||||
|
using LibSafeMathV06 for uint256;
|
||||||
|
|
||||||
|
function _tradePlatypus(
|
||||||
|
IERC20TokenV06 buyToken,
|
||||||
|
uint256 sellAmount,
|
||||||
|
bytes memory bridgeData
|
||||||
|
)
|
||||||
|
public
|
||||||
|
returns (uint256 boughtAmount)
|
||||||
|
{
|
||||||
|
IPlatypusRouter router;
|
||||||
|
address _router;
|
||||||
|
address[] memory _pool;
|
||||||
|
IERC20TokenV06[] memory path;
|
||||||
|
address[] memory _path;
|
||||||
|
|
||||||
|
{
|
||||||
|
(_router, _pool, _path) = abi.decode(bridgeData, (address, address[], address[]));
|
||||||
|
|
||||||
|
// To get around `abi.decode()` not supporting interface array types.
|
||||||
|
assembly { path := _path }
|
||||||
|
}
|
||||||
|
|
||||||
|
//connect to the ptp router
|
||||||
|
router = IPlatypusRouter(_router);
|
||||||
|
|
||||||
|
require(path.length >= 2, "MixinPlatypus/PATH_LENGTH_MUST_BE_AT_LEAST_TWO");
|
||||||
|
require(
|
||||||
|
path[path.length - 1] == buyToken,
|
||||||
|
"MixinPlatypus/LAST_ELEMENT_OF_PATH_MUST_MATCH_OUTPUT_TOKEN"
|
||||||
|
);
|
||||||
|
// Grant the Platypus router an allowance to sell the first token.
|
||||||
|
path[0].approveIfBelow(address(router), sellAmount);
|
||||||
|
|
||||||
|
//keep track of the previous balance to confirm amount out
|
||||||
|
uint256 beforeBalance = buyToken.balanceOf(address(this));
|
||||||
|
|
||||||
|
(uint256 amountOut, uint256 haircut) = router.swapTokensForTokens(
|
||||||
|
// Convert to `buyToken` along this path.
|
||||||
|
_path,
|
||||||
|
// pool to swap on
|
||||||
|
_pool,
|
||||||
|
// Sell all tokens we hold.
|
||||||
|
sellAmount,
|
||||||
|
// Minimum buy amount.
|
||||||
|
0,
|
||||||
|
// Recipient is `this`.
|
||||||
|
address(this),
|
||||||
|
|
||||||
|
block.timestamp + 1
|
||||||
|
);
|
||||||
|
//calculate the buy amount from the tokens we recieved
|
||||||
|
boughtAmount = buyToken.balanceOf(address(this)).safeSub(beforeBalance);
|
||||||
|
return boughtAmount;
|
||||||
|
}
|
||||||
|
}
|
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@0x/contracts-zero-ex",
|
"name": "@0x/contracts-zero-ex",
|
||||||
"version": "0.32.0",
|
"version": "0.33.0",
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=6.12"
|
"node": ">=6.12"
|
||||||
},
|
},
|
||||||
@@ -43,7 +43,7 @@
|
|||||||
"config": {
|
"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",
|
"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:comment": "This list is auto-generated by contracts-gen. Don't edit manually.",
|
||||||
"abis": "./test/generated-artifacts/@(AffiliateFeeTransformer|BatchFillNativeOrdersFeature|BootstrapFeature|BridgeAdapter|BridgeProtocols|CurveLiquidityProvider|ERC1155OrdersFeature|ERC165Feature|ERC721OrdersFeature|FeeCollector|FeeCollectorController|FillQuoteTransformer|FixinCommon|FixinEIP712|FixinERC1155Spender|FixinERC721Spender|FixinProtocolFees|FixinReentrancyGuard|FixinTokenSpender|FlashWallet|FullMigration|FundRecoveryFeature|IBatchFillNativeOrdersFeature|IBootstrapFeature|IBridgeAdapter|IERC1155OrdersFeature|IERC1155Token|IERC165Feature|IERC20Bridge|IERC20Transformer|IERC721OrdersFeature|IERC721Token|IFeature|IFeeRecipient|IFlashWallet|IFundRecoveryFeature|ILiquidityProvider|ILiquidityProviderFeature|ILiquidityProviderSandbox|IMetaTransactionsFeature|IMooniswapPool|IMultiplexFeature|INativeOrdersEvents|INativeOrdersFeature|IOtcOrdersFeature|IOwnableFeature|IPancakeSwapFeature|IPropertyValidator|ISimpleFunctionRegistryFeature|IStaking|ITakerCallback|ITestSimpleFunctionRegistryFeature|ITokenSpenderFeature|ITransformERC20Feature|IUniswapFeature|IUniswapV2Pair|IUniswapV3Feature|IUniswapV3Pool|IZeroEx|InitialMigration|LibBootstrap|LibCommonRichErrors|LibERC1155OrdersStorage|LibERC20Transformer|LibERC721OrdersStorage|LibFeeCollector|LibLiquidityProviderRichErrors|LibMetaTransactionsRichErrors|LibMetaTransactionsStorage|LibMigrate|LibNFTOrder|LibNFTOrdersRichErrors|LibNativeOrder|LibNativeOrdersRichErrors|LibNativeOrdersStorage|LibOtcOrdersStorage|LibOwnableRichErrors|LibOwnableStorage|LibProxyRichErrors|LibProxyStorage|LibReentrancyGuardStorage|LibSignature|LibSignatureRichErrors|LibSimpleFunctionRegistryRichErrors|LibSimpleFunctionRegistryStorage|LibStorage|LibTransformERC20RichErrors|LibTransformERC20Storage|LibWalletRichErrors|LiquidityProviderFeature|LiquidityProviderSandbox|LogMetadataTransformer|MetaTransactionsFeature|MixinAaveV2|MixinBalancer|MixinBalancerV2|MixinBalancerV2Batch|MixinBancor|MixinCoFiX|MixinCompound|MixinCryptoCom|MixinCurve|MixinCurveV2|MixinDodo|MixinDodoV2|MixinKyber|MixinKyberDmm|MixinLido|MixinMStable|MixinMakerPSM|MixinMooniswap|MixinNerve|MixinOasis|MixinShell|MixinUniswap|MixinUniswapV2|MixinUniswapV3|MixinZeroExBridge|MooniswapLiquidityProvider|MultiplexFeature|MultiplexLiquidityProvider|MultiplexOtc|MultiplexRfq|MultiplexTransformERC20|MultiplexUniswapV2|MultiplexUniswapV3|NFTOrders|NativeOrdersCancellation|NativeOrdersFeature|NativeOrdersInfo|NativeOrdersProtocolFees|NativeOrdersSettlement|OtcOrdersFeature|OwnableFeature|PancakeSwapFeature|PayTakerTransformer|PermissionlessTransformerDeployer|PositiveSlippageFeeTransformer|SimpleFunctionRegistryFeature|TestBridge|TestCallTarget|TestCurve|TestDelegateCaller|TestFeeCollectorController|TestFeeRecipient|TestFillQuoteTransformerBridge|TestFillQuoteTransformerExchange|TestFillQuoteTransformerHost|TestFixinProtocolFees|TestFixinTokenSpender|TestFullMigration|TestInitialMigration|TestLibNativeOrder|TestLibSignature|TestLiquidityProvider|TestMetaTransactionsNativeOrdersFeature|TestMetaTransactionsTransformERC20Feature|TestMigrator|TestMintTokenERC20Transformer|TestMintableERC1155Token|TestMintableERC20Token|TestMintableERC721Token|TestMooniswap|TestNFTOrderPresigner|TestNativeOrdersFeature|TestNoEthRecipient|TestOrderSignerRegistryWithContractWallet|TestPermissionlessTransformerDeployerSuicidal|TestPermissionlessTransformerDeployerTransformer|TestPropertyValidator|TestRfqOriginRegistration|TestSimpleFunctionRegistryFeatureImpl1|TestSimpleFunctionRegistryFeatureImpl2|TestStaking|TestTokenSpenderERC20Token|TestTransformERC20|TestTransformerBase|TestTransformerDeployerTransformer|TestTransformerHost|TestUniswapV2Factory|TestUniswapV2Pool|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|ERC1155OrdersFeature|ERC165Feature|ERC721OrdersFeature|FeeCollector|FeeCollectorController|FillQuoteTransformer|FixinCommon|FixinEIP712|FixinERC1155Spender|FixinERC721Spender|FixinProtocolFees|FixinReentrancyGuard|FixinTokenSpender|FlashWallet|FullMigration|FundRecoveryFeature|IBatchFillNativeOrdersFeature|IBootstrapFeature|IBridgeAdapter|IERC1155OrdersFeature|IERC1155Token|IERC165Feature|IERC20Bridge|IERC20Transformer|IERC721OrdersFeature|IERC721Token|IFeature|IFeeRecipient|IFlashWallet|IFundRecoveryFeature|ILiquidityProvider|ILiquidityProviderFeature|ILiquidityProviderSandbox|IMetaTransactionsFeature|IMooniswapPool|IMultiplexFeature|INativeOrdersEvents|INativeOrdersFeature|IOtcOrdersFeature|IOwnableFeature|IPancakeSwapFeature|IPropertyValidator|ISimpleFunctionRegistryFeature|IStaking|ITakerCallback|ITestSimpleFunctionRegistryFeature|ITokenSpenderFeature|ITransformERC20Feature|IUniswapFeature|IUniswapV2Pair|IUniswapV3Feature|IUniswapV3Pool|IZeroEx|InitialMigration|LibBootstrap|LibCommonRichErrors|LibERC1155OrdersStorage|LibERC20Transformer|LibERC721OrdersStorage|LibFeeCollector|LibLiquidityProviderRichErrors|LibMetaTransactionsRichErrors|LibMetaTransactionsStorage|LibMigrate|LibNFTOrder|LibNFTOrdersRichErrors|LibNativeOrder|LibNativeOrdersRichErrors|LibNativeOrdersStorage|LibOtcOrdersStorage|LibOwnableRichErrors|LibOwnableStorage|LibProxyRichErrors|LibProxyStorage|LibReentrancyGuardStorage|LibSignature|LibSignatureRichErrors|LibSimpleFunctionRegistryRichErrors|LibSimpleFunctionRegistryStorage|LibStorage|LibTransformERC20RichErrors|LibTransformERC20Storage|LibWalletRichErrors|LiquidityProviderFeature|LiquidityProviderSandbox|LogMetadataTransformer|MetaTransactionsFeature|MixinAaveV2|MixinBalancer|MixinBalancerV2|MixinBalancerV2Batch|MixinBancor|MixinCoFiX|MixinCompound|MixinCryptoCom|MixinCurve|MixinCurveV2|MixinDodo|MixinDodoV2|MixinGMX|MixinKyber|MixinKyberDmm|MixinLido|MixinMStable|MixinMakerPSM|MixinMooniswap|MixinNerve|MixinOasis|MixinPlatypus|MixinShell|MixinUniswap|MixinUniswapV2|MixinUniswapV3|MixinZeroExBridge|MooniswapLiquidityProvider|MultiplexFeature|MultiplexLiquidityProvider|MultiplexOtc|MultiplexRfq|MultiplexTransformERC20|MultiplexUniswapV2|MultiplexUniswapV3|NFTOrders|NativeOrdersCancellation|NativeOrdersFeature|NativeOrdersInfo|NativeOrdersProtocolFees|NativeOrdersSettlement|OtcOrdersFeature|OwnableFeature|PancakeSwapFeature|PayTakerTransformer|PermissionlessTransformerDeployer|PositiveSlippageFeeTransformer|SimpleFunctionRegistryFeature|TestBridge|TestCallTarget|TestCurve|TestDelegateCaller|TestFeeCollectorController|TestFeeRecipient|TestFillQuoteTransformerBridge|TestFillQuoteTransformerExchange|TestFillQuoteTransformerHost|TestFixinProtocolFees|TestFixinTokenSpender|TestFullMigration|TestInitialMigration|TestLibNativeOrder|TestLibSignature|TestLiquidityProvider|TestMetaTransactionsNativeOrdersFeature|TestMetaTransactionsTransformERC20Feature|TestMigrator|TestMintTokenERC20Transformer|TestMintableERC1155Token|TestMintableERC20Token|TestMintableERC721Token|TestMooniswap|TestNFTOrderPresigner|TestNativeOrdersFeature|TestNoEthRecipient|TestOrderSignerRegistryWithContractWallet|TestPermissionlessTransformerDeployerSuicidal|TestPermissionlessTransformerDeployerTransformer|TestPropertyValidator|TestRfqOriginRegistration|TestSimpleFunctionRegistryFeatureImpl1|TestSimpleFunctionRegistryFeatureImpl2|TestStaking|TestTokenSpenderERC20Token|TestTransformERC20|TestTransformerBase|TestTransformerDeployerTransformer|TestTransformerHost|TestUniswapV2Factory|TestUniswapV2Pool|TestUniswapV3Factory|TestUniswapV3Feature|TestUniswapV3Pool|TestWeth|TestWethTransformerHost|TestZeroExFeature|TransformERC20Feature|Transformer|TransformerDeployer|UniswapFeature|UniswapV3Feature|WethTransformer|ZeroEx|ZeroExOptimized).json"
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
@@ -56,10 +56,10 @@
|
|||||||
"homepage": "https://github.com/0xProject/protocol/tree/main/contracts/zero-ex",
|
"homepage": "https://github.com/0xProject/protocol/tree/main/contracts/zero-ex",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@0x/abi-gen": "^5.8.0",
|
"@0x/abi-gen": "^5.8.0",
|
||||||
"@0x/contract-addresses": "^6.13.0",
|
"@0x/contract-addresses": "^6.14.0",
|
||||||
"@0x/contracts-erc20": "^3.3.29",
|
"@0x/contracts-erc20": "^3.3.30",
|
||||||
"@0x/contracts-gen": "^2.0.46",
|
"@0x/contracts-gen": "^2.0.46",
|
||||||
"@0x/contracts-test-utils": "^5.4.20",
|
"@0x/contracts-test-utils": "^5.4.21",
|
||||||
"@0x/dev-utils": "^4.2.14",
|
"@0x/dev-utils": "^4.2.14",
|
||||||
"@0x/order-utils": "^10.4.28",
|
"@0x/order-utils": "^10.4.28",
|
||||||
"@0x/sol-compiler": "^4.8.1",
|
"@0x/sol-compiler": "^4.8.1",
|
||||||
@@ -83,7 +83,7 @@
|
|||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@0x/base-contract": "^6.5.0",
|
"@0x/base-contract": "^6.5.0",
|
||||||
"@0x/protocol-utils": "^11.12.0",
|
"@0x/protocol-utils": "^11.13.0",
|
||||||
"@0x/subproviders": "^6.6.5",
|
"@0x/subproviders": "^6.6.5",
|
||||||
"@0x/types": "^3.3.6",
|
"@0x/types": "^3.3.6",
|
||||||
"@0x/typescript-typings": "^5.3.1",
|
"@0x/typescript-typings": "^5.3.1",
|
||||||
|
@@ -110,6 +110,7 @@ import * as MixinCurve from '../test/generated-artifacts/MixinCurve.json';
|
|||||||
import * as MixinCurveV2 from '../test/generated-artifacts/MixinCurveV2.json';
|
import * as MixinCurveV2 from '../test/generated-artifacts/MixinCurveV2.json';
|
||||||
import * as MixinDodo from '../test/generated-artifacts/MixinDodo.json';
|
import * as MixinDodo from '../test/generated-artifacts/MixinDodo.json';
|
||||||
import * as MixinDodoV2 from '../test/generated-artifacts/MixinDodoV2.json';
|
import * as MixinDodoV2 from '../test/generated-artifacts/MixinDodoV2.json';
|
||||||
|
import * as MixinGMX from '../test/generated-artifacts/MixinGMX.json';
|
||||||
import * as MixinKyber from '../test/generated-artifacts/MixinKyber.json';
|
import * as MixinKyber from '../test/generated-artifacts/MixinKyber.json';
|
||||||
import * as MixinKyberDmm from '../test/generated-artifacts/MixinKyberDmm.json';
|
import * as MixinKyberDmm from '../test/generated-artifacts/MixinKyberDmm.json';
|
||||||
import * as MixinLido from '../test/generated-artifacts/MixinLido.json';
|
import * as MixinLido from '../test/generated-artifacts/MixinLido.json';
|
||||||
@@ -118,6 +119,7 @@ import * as MixinMooniswap from '../test/generated-artifacts/MixinMooniswap.json
|
|||||||
import * as MixinMStable from '../test/generated-artifacts/MixinMStable.json';
|
import * as MixinMStable from '../test/generated-artifacts/MixinMStable.json';
|
||||||
import * as MixinNerve from '../test/generated-artifacts/MixinNerve.json';
|
import * as MixinNerve from '../test/generated-artifacts/MixinNerve.json';
|
||||||
import * as MixinOasis from '../test/generated-artifacts/MixinOasis.json';
|
import * as MixinOasis from '../test/generated-artifacts/MixinOasis.json';
|
||||||
|
import * as MixinPlatypus from '../test/generated-artifacts/MixinPlatypus.json';
|
||||||
import * as MixinShell from '../test/generated-artifacts/MixinShell.json';
|
import * as MixinShell from '../test/generated-artifacts/MixinShell.json';
|
||||||
import * as MixinUniswap from '../test/generated-artifacts/MixinUniswap.json';
|
import * as MixinUniswap from '../test/generated-artifacts/MixinUniswap.json';
|
||||||
import * as MixinUniswapV2 from '../test/generated-artifacts/MixinUniswapV2.json';
|
import * as MixinUniswapV2 from '../test/generated-artifacts/MixinUniswapV2.json';
|
||||||
@@ -323,6 +325,7 @@ export const artifacts = {
|
|||||||
MixinCurveV2: MixinCurveV2 as ContractArtifact,
|
MixinCurveV2: MixinCurveV2 as ContractArtifact,
|
||||||
MixinDodo: MixinDodo as ContractArtifact,
|
MixinDodo: MixinDodo as ContractArtifact,
|
||||||
MixinDodoV2: MixinDodoV2 as ContractArtifact,
|
MixinDodoV2: MixinDodoV2 as ContractArtifact,
|
||||||
|
MixinGMX: MixinGMX as ContractArtifact,
|
||||||
MixinKyber: MixinKyber as ContractArtifact,
|
MixinKyber: MixinKyber as ContractArtifact,
|
||||||
MixinKyberDmm: MixinKyberDmm as ContractArtifact,
|
MixinKyberDmm: MixinKyberDmm as ContractArtifact,
|
||||||
MixinLido: MixinLido as ContractArtifact,
|
MixinLido: MixinLido as ContractArtifact,
|
||||||
@@ -331,6 +334,7 @@ export const artifacts = {
|
|||||||
MixinMooniswap: MixinMooniswap as ContractArtifact,
|
MixinMooniswap: MixinMooniswap as ContractArtifact,
|
||||||
MixinNerve: MixinNerve as ContractArtifact,
|
MixinNerve: MixinNerve as ContractArtifact,
|
||||||
MixinOasis: MixinOasis as ContractArtifact,
|
MixinOasis: MixinOasis as ContractArtifact,
|
||||||
|
MixinPlatypus: MixinPlatypus as ContractArtifact,
|
||||||
MixinShell: MixinShell as ContractArtifact,
|
MixinShell: MixinShell as ContractArtifact,
|
||||||
MixinUniswap: MixinUniswap as ContractArtifact,
|
MixinUniswap: MixinUniswap as ContractArtifact,
|
||||||
MixinUniswapV2: MixinUniswapV2 as ContractArtifact,
|
MixinUniswapV2: MixinUniswapV2 as ContractArtifact,
|
||||||
|
@@ -108,6 +108,7 @@ export * from '../test/generated-wrappers/mixin_curve';
|
|||||||
export * from '../test/generated-wrappers/mixin_curve_v2';
|
export * from '../test/generated-wrappers/mixin_curve_v2';
|
||||||
export * from '../test/generated-wrappers/mixin_dodo';
|
export * from '../test/generated-wrappers/mixin_dodo';
|
||||||
export * from '../test/generated-wrappers/mixin_dodo_v2';
|
export * from '../test/generated-wrappers/mixin_dodo_v2';
|
||||||
|
export * from '../test/generated-wrappers/mixin_g_m_x';
|
||||||
export * from '../test/generated-wrappers/mixin_kyber';
|
export * from '../test/generated-wrappers/mixin_kyber';
|
||||||
export * from '../test/generated-wrappers/mixin_kyber_dmm';
|
export * from '../test/generated-wrappers/mixin_kyber_dmm';
|
||||||
export * from '../test/generated-wrappers/mixin_lido';
|
export * from '../test/generated-wrappers/mixin_lido';
|
||||||
@@ -116,6 +117,7 @@ export * from '../test/generated-wrappers/mixin_maker_p_s_m';
|
|||||||
export * from '../test/generated-wrappers/mixin_mooniswap';
|
export * from '../test/generated-wrappers/mixin_mooniswap';
|
||||||
export * from '../test/generated-wrappers/mixin_nerve';
|
export * from '../test/generated-wrappers/mixin_nerve';
|
||||||
export * from '../test/generated-wrappers/mixin_oasis';
|
export * from '../test/generated-wrappers/mixin_oasis';
|
||||||
|
export * from '../test/generated-wrappers/mixin_platypus';
|
||||||
export * from '../test/generated-wrappers/mixin_shell';
|
export * from '../test/generated-wrappers/mixin_shell';
|
||||||
export * from '../test/generated-wrappers/mixin_uniswap';
|
export * from '../test/generated-wrappers/mixin_uniswap';
|
||||||
export * from '../test/generated-wrappers/mixin_uniswap_v2';
|
export * from '../test/generated-wrappers/mixin_uniswap_v2';
|
||||||
|
@@ -141,6 +141,7 @@
|
|||||||
"test/generated-artifacts/MixinCurveV2.json",
|
"test/generated-artifacts/MixinCurveV2.json",
|
||||||
"test/generated-artifacts/MixinDodo.json",
|
"test/generated-artifacts/MixinDodo.json",
|
||||||
"test/generated-artifacts/MixinDodoV2.json",
|
"test/generated-artifacts/MixinDodoV2.json",
|
||||||
|
"test/generated-artifacts/MixinGMX.json",
|
||||||
"test/generated-artifacts/MixinKyber.json",
|
"test/generated-artifacts/MixinKyber.json",
|
||||||
"test/generated-artifacts/MixinKyberDmm.json",
|
"test/generated-artifacts/MixinKyberDmm.json",
|
||||||
"test/generated-artifacts/MixinLido.json",
|
"test/generated-artifacts/MixinLido.json",
|
||||||
@@ -149,6 +150,7 @@
|
|||||||
"test/generated-artifacts/MixinMooniswap.json",
|
"test/generated-artifacts/MixinMooniswap.json",
|
||||||
"test/generated-artifacts/MixinNerve.json",
|
"test/generated-artifacts/MixinNerve.json",
|
||||||
"test/generated-artifacts/MixinOasis.json",
|
"test/generated-artifacts/MixinOasis.json",
|
||||||
|
"test/generated-artifacts/MixinPlatypus.json",
|
||||||
"test/generated-artifacts/MixinShell.json",
|
"test/generated-artifacts/MixinShell.json",
|
||||||
"test/generated-artifacts/MixinUniswap.json",
|
"test/generated-artifacts/MixinUniswap.json",
|
||||||
"test/generated-artifacts/MixinUniswapV2.json",
|
"test/generated-artifacts/MixinUniswapV2.json",
|
||||||
|
@@ -1,4 +1,100 @@
|
|||||||
[
|
[
|
||||||
|
{
|
||||||
|
"version": "16.60.1",
|
||||||
|
"changes": [
|
||||||
|
{
|
||||||
|
"note": "Alias Balancer sor to the old version",
|
||||||
|
"pr": 481
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"timestamp": 1652931596
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"version": "16.60.0",
|
||||||
|
"changes": [
|
||||||
|
{
|
||||||
|
"note": "Add BiSwap on BSC",
|
||||||
|
"pr": 467
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"note": "Add GMX and Platypus on Avalanche and Enable KyberDMM on bsc",
|
||||||
|
"pr": 478
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"note": "Add Yoshi Exchange support in Fantom",
|
||||||
|
"pr": 473
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"note": "Fix KyberDMM gas underestimation",
|
||||||
|
"pr": 479
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"timestamp": 1652919697
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"version": "16.59.0",
|
||||||
|
"changes": [
|
||||||
|
{
|
||||||
|
"note": "Remove SnowSwap on mainnet",
|
||||||
|
"pr": 468
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"note": "Offboard Swerve Finance and LinkSwap",
|
||||||
|
"pr": 469
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"note": "Offboard Eth2Dai",
|
||||||
|
"pr": 470
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"note": "Add an optional IRfqClient for SwapQuoter#getSwapQuoteAsync",
|
||||||
|
"pr": 467
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"timestamp": 1652400434
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"version": "16.58.0",
|
||||||
|
"changes": [
|
||||||
|
{
|
||||||
|
"note": "Update Saddle pools on Mainnet",
|
||||||
|
"pr": 450
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"version": "16.57.3",
|
||||||
|
"changes": [
|
||||||
|
{
|
||||||
|
"note": "Fix a runtime error related to BalancerV2SwapInfoCache",
|
||||||
|
"pr": 472
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"timestamp": 1652146864
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"version": "16.57.2",
|
||||||
|
"changes": [
|
||||||
|
{
|
||||||
|
"note": "Fix missing AMM quotes on indicative Quote Reports",
|
||||||
|
"pr": 466
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"timestamp": 1651526551
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"version": "16.57.1",
|
||||||
|
"changes": [
|
||||||
|
{
|
||||||
|
"note": "Added QUICK/ANY pair on Polygon",
|
||||||
|
"pr": 464
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"note": "Added cvxFXS/FXS curve pool on mainnet",
|
||||||
|
"pr": 465
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"version": "16.57.0",
|
"version": "16.57.0",
|
||||||
"changes": [
|
"changes": [
|
||||||
|
@@ -5,6 +5,41 @@ Edit the package's CHANGELOG.json file only.
|
|||||||
|
|
||||||
CHANGELOG
|
CHANGELOG
|
||||||
|
|
||||||
|
## v16.60.1 - _May 19, 2022_
|
||||||
|
|
||||||
|
* Alias Balancer sor to the old version (#481)
|
||||||
|
|
||||||
|
## v16.60.0 - _May 19, 2022_
|
||||||
|
|
||||||
|
* Add BiSwap on BSC (#467)
|
||||||
|
* Add GMX and Platypus on Avalanche and Enable KyberDMM on bsc (#478)
|
||||||
|
* Add Yoshi Exchange support in Fantom (#473)
|
||||||
|
* Fix KyberDMM gas underestimation (#479)
|
||||||
|
|
||||||
|
## v16.59.0 - _May 13, 2022_
|
||||||
|
|
||||||
|
* Remove SnowSwap on mainnet (#468)
|
||||||
|
* Offboard Swerve Finance and LinkSwap (#469)
|
||||||
|
* Offboard Eth2Dai (#470)
|
||||||
|
* Add an optional IRfqClient for SwapQuoter#getSwapQuoteAsync (#467)
|
||||||
|
|
||||||
|
## v16.58.0 - _Invalid date_
|
||||||
|
|
||||||
|
* Update Saddle pools on Mainnet (#450)
|
||||||
|
|
||||||
|
## v16.57.3 - _May 10, 2022_
|
||||||
|
|
||||||
|
* Fix a runtime error related to BalancerV2SwapInfoCache (#472)
|
||||||
|
|
||||||
|
## v16.57.2 - _May 2, 2022_
|
||||||
|
|
||||||
|
* Fix missing AMM quotes on indicative Quote Reports (#466)
|
||||||
|
|
||||||
|
## v16.57.1 - _Invalid date_
|
||||||
|
|
||||||
|
* Added QUICK/ANY pair on Polygon (#464)
|
||||||
|
* Added cvxFXS/FXS curve pool on mainnet (#465)
|
||||||
|
|
||||||
## v16.57.0 - _April 22, 2022_
|
## v16.57.0 - _April 22, 2022_
|
||||||
|
|
||||||
* Add BalancerV2 batch swap support (#462)
|
* Add BalancerV2 batch swap support (#462)
|
||||||
|
@@ -28,6 +28,7 @@ import "./CompoundSampler.sol";
|
|||||||
import "./CurveSampler.sol";
|
import "./CurveSampler.sol";
|
||||||
import "./DODOSampler.sol";
|
import "./DODOSampler.sol";
|
||||||
import "./DODOV2Sampler.sol";
|
import "./DODOV2Sampler.sol";
|
||||||
|
import "./GMXSampler.sol";
|
||||||
import "./KyberSampler.sol";
|
import "./KyberSampler.sol";
|
||||||
import "./KyberDmmSampler.sol";
|
import "./KyberDmmSampler.sol";
|
||||||
import "./LidoSampler.sol";
|
import "./LidoSampler.sol";
|
||||||
@@ -36,6 +37,7 @@ import "./MakerPSMSampler.sol";
|
|||||||
import "./MStableSampler.sol";
|
import "./MStableSampler.sol";
|
||||||
import "./MooniswapSampler.sol";
|
import "./MooniswapSampler.sol";
|
||||||
import "./NativeOrderSampler.sol";
|
import "./NativeOrderSampler.sol";
|
||||||
|
import "./PlatypusSampler.sol";
|
||||||
import "./ShellSampler.sol";
|
import "./ShellSampler.sol";
|
||||||
import "./SmoothySampler.sol";
|
import "./SmoothySampler.sol";
|
||||||
import "./TwoHopSampler.sol";
|
import "./TwoHopSampler.sol";
|
||||||
@@ -54,6 +56,7 @@ contract ERC20BridgeSampler is
|
|||||||
CurveSampler,
|
CurveSampler,
|
||||||
DODOSampler,
|
DODOSampler,
|
||||||
DODOV2Sampler,
|
DODOV2Sampler,
|
||||||
|
GMXSampler,
|
||||||
KyberSampler,
|
KyberSampler,
|
||||||
KyberDmmSampler,
|
KyberDmmSampler,
|
||||||
LidoSampler,
|
LidoSampler,
|
||||||
@@ -62,6 +65,7 @@ contract ERC20BridgeSampler is
|
|||||||
MStableSampler,
|
MStableSampler,
|
||||||
MooniswapSampler,
|
MooniswapSampler,
|
||||||
NativeOrderSampler,
|
NativeOrderSampler,
|
||||||
|
PlatypusSampler,
|
||||||
ShellSampler,
|
ShellSampler,
|
||||||
SmoothySampler,
|
SmoothySampler,
|
||||||
TwoHopSampler,
|
TwoHopSampler,
|
||||||
|
96
packages/asset-swapper/contracts/src/GMXSampler.sol
Normal file
96
packages/asset-swapper/contracts/src/GMXSampler.sol
Normal file
@@ -0,0 +1,96 @@
|
|||||||
|
pragma solidity ^0.6;
|
||||||
|
pragma experimental ABIEncoderV2;
|
||||||
|
|
||||||
|
import "./interfaces/IGMX.sol";
|
||||||
|
import "./ApproximateBuys.sol";
|
||||||
|
import "./SamplerUtils.sol";
|
||||||
|
|
||||||
|
contract GMXSampler is
|
||||||
|
SamplerUtils,
|
||||||
|
ApproximateBuys
|
||||||
|
{
|
||||||
|
struct GMXInfo {
|
||||||
|
address reader;
|
||||||
|
address vault;
|
||||||
|
address[] path;
|
||||||
|
}
|
||||||
|
|
||||||
|
function sampleSellsFromGMX(
|
||||||
|
address reader,
|
||||||
|
address vault,
|
||||||
|
address[] memory path,
|
||||||
|
uint256[] memory takerTokenAmounts
|
||||||
|
)
|
||||||
|
public
|
||||||
|
view
|
||||||
|
returns (uint256[] memory makerTokenAmounts)
|
||||||
|
{
|
||||||
|
uint256 numSamples = takerTokenAmounts.length;
|
||||||
|
makerTokenAmounts = new uint256[](numSamples);
|
||||||
|
for (uint256 i = 0; i < numSamples; i++) {
|
||||||
|
try
|
||||||
|
IGMX(reader).getAmountOut(IVault(vault), path[0], path[1], takerTokenAmounts[i])
|
||||||
|
returns (uint256 amountAfterFees, uint256 feeAmount)
|
||||||
|
{
|
||||||
|
makerTokenAmounts[i] = amountAfterFees;
|
||||||
|
// Break early if there are 0 amounts
|
||||||
|
if (makerTokenAmounts[i] == 0) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
} catch (bytes memory) {
|
||||||
|
// Swallow failures, leaving all results as zero.
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function sampleBuysFromGMX(
|
||||||
|
address reader,
|
||||||
|
address vault,
|
||||||
|
address[] memory path,
|
||||||
|
uint256[] memory makerTokenAmounts
|
||||||
|
)
|
||||||
|
public
|
||||||
|
view
|
||||||
|
returns (uint256[] memory takerTokenAmounts)
|
||||||
|
{
|
||||||
|
address[] memory invertBuyPath = new address[](2);
|
||||||
|
invertBuyPath[0] = path[1];
|
||||||
|
invertBuyPath[1] = path[0];
|
||||||
|
return _sampleApproximateBuys(
|
||||||
|
ApproximateBuyQuoteOpts({
|
||||||
|
makerTokenData: abi.encode(reader, vault, invertBuyPath),
|
||||||
|
takerTokenData: abi.encode(reader, vault, path),
|
||||||
|
getSellQuoteCallback: _sampleSellForApproximateBuyFromGMX
|
||||||
|
}),
|
||||||
|
makerTokenAmounts
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function _sampleSellForApproximateBuyFromGMX(
|
||||||
|
bytes memory takerTokenData,
|
||||||
|
bytes memory makerTokenData,
|
||||||
|
uint256 sellAmount
|
||||||
|
)
|
||||||
|
private
|
||||||
|
view
|
||||||
|
returns (uint256 buyAmount)
|
||||||
|
{
|
||||||
|
(address _reader, address _vault, address[] memory _path ) = abi.decode(takerTokenData, (address, address, address[]));
|
||||||
|
|
||||||
|
(bool success, bytes memory resultData) = address(this).staticcall(abi.encodeWithSelector(
|
||||||
|
this.sampleSellsFromGMX.selector,
|
||||||
|
_reader,
|
||||||
|
_vault,
|
||||||
|
_path,
|
||||||
|
_toSingleValueArray(sellAmount)
|
||||||
|
));
|
||||||
|
if(!success) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
// solhint-disable-next-line indent
|
||||||
|
return abi.decode(resultData, (uint256[]))[0];
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
89
packages/asset-swapper/contracts/src/PlatypusSampler.sol
Normal file
89
packages/asset-swapper/contracts/src/PlatypusSampler.sol
Normal file
@@ -0,0 +1,89 @@
|
|||||||
|
pragma solidity ^0.6;
|
||||||
|
pragma experimental ABIEncoderV2;
|
||||||
|
|
||||||
|
import "./interfaces/IPlatypus.sol";
|
||||||
|
import "./ApproximateBuys.sol";
|
||||||
|
import "./SamplerUtils.sol";
|
||||||
|
|
||||||
|
|
||||||
|
contract PlatypusSampler is
|
||||||
|
SamplerUtils,
|
||||||
|
ApproximateBuys
|
||||||
|
{
|
||||||
|
|
||||||
|
function sampleSellsFromPlatypus(
|
||||||
|
address pool,
|
||||||
|
address[] memory path,
|
||||||
|
uint256[] memory takerTokenAmounts
|
||||||
|
)
|
||||||
|
public
|
||||||
|
view
|
||||||
|
returns (uint256[] memory makerTokenAmounts)
|
||||||
|
{
|
||||||
|
|
||||||
|
uint256 numSamples = takerTokenAmounts.length;
|
||||||
|
makerTokenAmounts = new uint256[](numSamples);
|
||||||
|
for (uint256 i = 0; i < numSamples; i++) {
|
||||||
|
try
|
||||||
|
IPlatypus(pool).quotePotentialSwap(path[0], path[1], takerTokenAmounts[i])
|
||||||
|
returns (uint256 amountAfterFees, uint256 feeAmount)
|
||||||
|
{
|
||||||
|
makerTokenAmounts[i] = amountAfterFees;
|
||||||
|
// Break early if there are 0 amounts
|
||||||
|
if (makerTokenAmounts[i] == 0) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
} catch (bytes memory result) {
|
||||||
|
// Swallow failures, leaving all results as zero.
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function sampleBuysFromPlatypus(
|
||||||
|
address pool,
|
||||||
|
address[] memory path,
|
||||||
|
uint256[] memory makerTokenAmounts
|
||||||
|
)
|
||||||
|
public
|
||||||
|
view
|
||||||
|
returns (uint256[] memory takerTokenAmounts)
|
||||||
|
{
|
||||||
|
address[] memory invertBuyPath = new address[](2);
|
||||||
|
invertBuyPath[0] = path[1];
|
||||||
|
invertBuyPath[1] = path[0];
|
||||||
|
return _sampleApproximateBuys(
|
||||||
|
ApproximateBuyQuoteOpts({
|
||||||
|
makerTokenData: abi.encode(pool, invertBuyPath),
|
||||||
|
takerTokenData: abi.encode(pool, path),
|
||||||
|
getSellQuoteCallback: _sampleSellForApproximateBuyFromPlatypus
|
||||||
|
}),
|
||||||
|
makerTokenAmounts
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function _sampleSellForApproximateBuyFromPlatypus(
|
||||||
|
bytes memory makerTokenData,
|
||||||
|
bytes memory takerTokenData,
|
||||||
|
uint256 sellAmount
|
||||||
|
)
|
||||||
|
private
|
||||||
|
view
|
||||||
|
returns (uint256 buyAmount)
|
||||||
|
{
|
||||||
|
(address _pool, address[] memory _path ) = abi.decode(makerTokenData, (address, address[]));
|
||||||
|
|
||||||
|
(bool success, bytes memory resultData) = address(this).staticcall(abi.encodeWithSelector(
|
||||||
|
this.sampleSellsFromPlatypus.selector,
|
||||||
|
_pool,
|
||||||
|
_path,
|
||||||
|
_toSingleValueArray(sellAmount)
|
||||||
|
));
|
||||||
|
if(!success) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
// solhint-disable-next-line indent
|
||||||
|
return abi.decode(resultData, (uint256[]))[0];
|
||||||
|
}
|
||||||
|
}
|
23
packages/asset-swapper/contracts/src/interfaces/IGMX.sol
Normal file
23
packages/asset-swapper/contracts/src/interfaces/IGMX.sol
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
pragma solidity ^0.6;
|
||||||
|
pragma experimental ABIEncoderV2;
|
||||||
|
|
||||||
|
interface IGMX {
|
||||||
|
function getMaxAmountIn(IVault _vault, address _tokenIn, address _tokenOut)
|
||||||
|
external
|
||||||
|
view
|
||||||
|
returns (uint256);
|
||||||
|
|
||||||
|
function getAmountOut(IVault _vault, address _tokenIn, address _tokenOut, uint256 _amountIn)
|
||||||
|
external
|
||||||
|
view
|
||||||
|
returns (uint256, uint256);
|
||||||
|
}
|
||||||
|
|
||||||
|
interface IVault {
|
||||||
|
function getFeeBasisPoints(address _token, uint256 _usdgDelta, uint256 _feeBasisPoints, uint256 _taxBasisPoints, bool _increment) external view returns (uint256);
|
||||||
|
function stableSwapFeeBasisPoints() external view returns (uint256);
|
||||||
|
function stableTokens(address _token) external view returns (bool);
|
||||||
|
function tokenDecimals(address _token) external view returns (uint256);
|
||||||
|
function getMaxPrice(address _token) external view returns (uint256);
|
||||||
|
function getMinPrice(address _token) external view returns (uint256);
|
||||||
|
}
|
@@ -0,0 +1,11 @@
|
|||||||
|
pragma solidity ^0.6;
|
||||||
|
|
||||||
|
interface IPlatypus {
|
||||||
|
function quotePotentialSwap(
|
||||||
|
address fromToken,
|
||||||
|
address toToken,
|
||||||
|
uint256 fromAmount
|
||||||
|
) external view returns (uint256 potentialOutcome, uint256 haircut);
|
||||||
|
|
||||||
|
function assetOf(address token) external view returns (address);
|
||||||
|
}
|
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@0x/asset-swapper",
|
"name": "@0x/asset-swapper",
|
||||||
"version": "16.57.0",
|
"version": "16.60.1",
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=6.12"
|
"node": ">=6.12"
|
||||||
},
|
},
|
||||||
@@ -39,7 +39,7 @@
|
|||||||
"config": {
|
"config": {
|
||||||
"publicInterfaceContracts": "ERC20BridgeSampler,BalanceChecker,FakeTaker",
|
"publicInterfaceContracts": "ERC20BridgeSampler,BalanceChecker,FakeTaker",
|
||||||
"abis:comment": "This list is auto-generated by contracts-gen. Don't edit manually.",
|
"abis:comment": "This list is auto-generated by contracts-gen. Don't edit manually.",
|
||||||
"abis": "./test/generated-artifacts/@(ApproximateBuys|BalanceChecker|BalancerSampler|BalancerV2BatchSampler|BalancerV2Common|BalancerV2Sampler|BancorSampler|CompoundSampler|CurveSampler|DODOSampler|DODOV2Sampler|ERC20BridgeSampler|FakeTaker|IBalancer|IBalancerV2Vault|IBancor|ICurve|IKyberNetwork|IMStable|IMooniswap|IMultiBridge|IShell|ISmoothy|IUniswapExchangeQuotes|IUniswapV2Router01|KyberDmmSampler|KyberSampler|LidoSampler|LiquidityProviderSampler|MStableSampler|MakerPSMSampler|MooniswapSampler|NativeOrderSampler|SamplerUtils|ShellSampler|SmoothySampler|TestNativeOrderSampler|TwoHopSampler|UniswapSampler|UniswapV2Sampler|UniswapV3Sampler|UtilitySampler).json",
|
"abis": "./test/generated-artifacts/@(ApproximateBuys|BalanceChecker|BalancerSampler|BalancerV2BatchSampler|BalancerV2Common|BalancerV2Sampler|BancorSampler|CompoundSampler|CurveSampler|DODOSampler|DODOV2Sampler|ERC20BridgeSampler|FakeTaker|GMXSampler|IBalancer|IBalancerV2Vault|IBancor|ICurve|IGMX|IKyberNetwork|IMStable|IMooniswap|IMultiBridge|IPlatypus|IShell|ISmoothy|IUniswapExchangeQuotes|IUniswapV2Router01|KyberDmmSampler|KyberSampler|LidoSampler|LiquidityProviderSampler|MStableSampler|MakerPSMSampler|MooniswapSampler|NativeOrderSampler|PlatypusSampler|SamplerUtils|ShellSampler|SmoothySampler|TestNativeOrderSampler|TwoHopSampler|UniswapSampler|UniswapV2Sampler|UniswapV3Sampler|UtilitySampler).json",
|
||||||
"postpublish": {
|
"postpublish": {
|
||||||
"assets": []
|
"assets": []
|
||||||
}
|
}
|
||||||
@@ -60,21 +60,20 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@0x/assert": "^3.0.34",
|
"@0x/assert": "^3.0.34",
|
||||||
"@0x/base-contract": "^6.5.0",
|
"@0x/base-contract": "^6.5.0",
|
||||||
"@0x/contract-addresses": "^6.13.0",
|
"@0x/contract-addresses": "^6.14.0",
|
||||||
"@0x/contract-wrappers": "^13.20.1",
|
"@0x/contract-wrappers": "^13.20.2",
|
||||||
"@0x/contracts-erc20": "^3.3.29",
|
"@0x/contracts-erc20": "^3.3.30",
|
||||||
"@0x/contracts-zero-ex": "^0.32.0",
|
"@0x/contracts-zero-ex": "^0.33.0",
|
||||||
"@0x/dev-utils": "^4.2.14",
|
"@0x/dev-utils": "^4.2.14",
|
||||||
"@0x/json-schemas": "^6.4.4",
|
"@0x/json-schemas": "^6.4.4",
|
||||||
"@0x/neon-router": "^0.3.5",
|
"@0x/neon-router": "^0.3.5",
|
||||||
"@0x/protocol-utils": "^11.12.0",
|
"@0x/protocol-utils": "^11.13.0",
|
||||||
"@0x/quote-server": "^6.0.6",
|
"@0x/quote-server": "^6.0.6",
|
||||||
"@0x/types": "^3.3.6",
|
"@0x/types": "^3.3.6",
|
||||||
"@0x/typescript-typings": "^5.3.1",
|
"@0x/typescript-typings": "^5.3.1",
|
||||||
"@0x/utils": "^6.5.3",
|
"@0x/utils": "^6.5.3",
|
||||||
"@0x/web3-wrapper": "^7.6.5",
|
"@0x/web3-wrapper": "^7.6.5",
|
||||||
"@balancer-labs/sdk": "^0.1.6",
|
"@balancer-labs/sdk": "0.1.6",
|
||||||
"@balancer-labs/sor": "0.3.2",
|
|
||||||
"@bancor/sdk": "0.2.9",
|
"@bancor/sdk": "0.2.9",
|
||||||
"@ethersproject/abi": "^5.0.1",
|
"@ethersproject/abi": "^5.0.1",
|
||||||
"@ethersproject/address": "^5.0.1",
|
"@ethersproject/address": "^5.0.1",
|
||||||
@@ -83,6 +82,7 @@
|
|||||||
"@ethersproject/strings": "^5.0.10",
|
"@ethersproject/strings": "^5.0.10",
|
||||||
"axios": "^0.21.1",
|
"axios": "^0.21.1",
|
||||||
"axios-mock-adapter": "^1.19.0",
|
"axios-mock-adapter": "^1.19.0",
|
||||||
|
"balancer-labs-sor-v1": "npm:@balancer-labs/sor@0.3.2",
|
||||||
"cream-sor": "^0.3.3",
|
"cream-sor": "^0.3.3",
|
||||||
"decimal.js": "^10.2.0",
|
"decimal.js": "^10.2.0",
|
||||||
"ethereum-types": "^3.7.0",
|
"ethereum-types": "^3.7.0",
|
||||||
@@ -91,8 +91,7 @@
|
|||||||
"graphql": "^15.4.0",
|
"graphql": "^15.4.0",
|
||||||
"graphql-request": "^3.4.0",
|
"graphql-request": "^3.4.0",
|
||||||
"heartbeats": "^5.0.1",
|
"heartbeats": "^5.0.1",
|
||||||
"lodash": "^4.17.11",
|
"lodash": "^4.17.11"
|
||||||
"sorV2": "npm:@balancer-labs/sor"
|
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@0x/abi-gen": "^5.8.0",
|
"@0x/abi-gen": "^5.8.0",
|
||||||
@@ -100,10 +99,10 @@
|
|||||||
"@0x/contracts-exchange": "^3.2.38",
|
"@0x/contracts-exchange": "^3.2.38",
|
||||||
"@0x/contracts-exchange-libs": "^4.3.37",
|
"@0x/contracts-exchange-libs": "^4.3.37",
|
||||||
"@0x/contracts-gen": "^2.0.46",
|
"@0x/contracts-gen": "^2.0.46",
|
||||||
"@0x/contracts-test-utils": "^5.4.20",
|
"@0x/contracts-test-utils": "^5.4.21",
|
||||||
"@0x/contracts-utils": "^4.8.10",
|
"@0x/contracts-utils": "^4.8.11",
|
||||||
"@0x/mesh-rpc-client": "^9.4.2",
|
"@0x/mesh-rpc-client": "^9.4.2",
|
||||||
"@0x/migrations": "^8.1.18",
|
"@0x/migrations": "^8.1.19",
|
||||||
"@0x/sol-compiler": "^4.8.1",
|
"@0x/sol-compiler": "^4.8.1",
|
||||||
"@0x/subproviders": "^6.6.5",
|
"@0x/subproviders": "^6.6.5",
|
||||||
"@0x/ts-doc-gen": "^0.0.28",
|
"@0x/ts-doc-gen": "^0.0.28",
|
||||||
|
@@ -116,6 +116,15 @@ export {
|
|||||||
SamplerMetrics,
|
SamplerMetrics,
|
||||||
} from './types';
|
} from './types';
|
||||||
export { affiliateFeeUtils } from './utils/affiliate_fee_utils';
|
export { affiliateFeeUtils } from './utils/affiliate_fee_utils';
|
||||||
|
export {
|
||||||
|
IRfqClient,
|
||||||
|
RfqClientV1Price,
|
||||||
|
RfqClientV1PriceRequest,
|
||||||
|
RfqClientV1PriceResponse,
|
||||||
|
RfqClientV1Quote,
|
||||||
|
RfqClientV1QuoteRequest,
|
||||||
|
RfqClientV1QuoteResponse,
|
||||||
|
} from './utils/irfq_client';
|
||||||
export {
|
export {
|
||||||
DEFAULT_TOKEN_ADJACENCY_GRAPH_BY_CHAIN_ID,
|
DEFAULT_TOKEN_ADJACENCY_GRAPH_BY_CHAIN_ID,
|
||||||
DEFAULT_GAS_SCHEDULE,
|
DEFAULT_GAS_SCHEDULE,
|
||||||
|
@@ -280,7 +280,7 @@ export class ExchangeProxySwapQuoteConsumer implements SwapQuoteConsumerBase {
|
|||||||
|
|
||||||
if (
|
if (
|
||||||
this.chainId === ChainId.Mainnet &&
|
this.chainId === ChainId.Mainnet &&
|
||||||
isDirectSwapCompatible(quote, optsWithDefaults, [ERC20BridgeSource.Curve, ERC20BridgeSource.Swerve]) &&
|
isDirectSwapCompatible(quote, optsWithDefaults, [ERC20BridgeSource.Curve]) &&
|
||||||
// Curve VIP cannot currently support WETH buy/sell as the functionality needs to WITHDRAW or DEPOSIT
|
// Curve VIP cannot currently support WETH buy/sell as the functionality needs to WITHDRAW or DEPOSIT
|
||||||
// into WETH prior/post the trade.
|
// into WETH prior/post the trade.
|
||||||
// ETH buy/sell is supported
|
// ETH buy/sell is supported
|
||||||
|
@@ -25,6 +25,7 @@ import {
|
|||||||
SwapQuoterRfqOpts,
|
SwapQuoterRfqOpts,
|
||||||
} from './types';
|
} from './types';
|
||||||
import { assert } from './utils/assert';
|
import { assert } from './utils/assert';
|
||||||
|
import { IRfqClient } from './utils/irfq_client';
|
||||||
import { MarketOperationUtils } from './utils/market_operation_utils';
|
import { MarketOperationUtils } from './utils/market_operation_utils';
|
||||||
import { BancorService } from './utils/market_operation_utils/bancor_service';
|
import { BancorService } from './utils/market_operation_utils/bancor_service';
|
||||||
import { SAMPLER_ADDRESS, SOURCE_FLAGS, ZERO_AMOUNT } from './utils/market_operation_utils/constants';
|
import { SAMPLER_ADDRESS, SOURCE_FLAGS, ZERO_AMOUNT } from './utils/market_operation_utils/constants';
|
||||||
@@ -327,6 +328,7 @@ export class SwapQuoter {
|
|||||||
assetFillAmount: BigNumber,
|
assetFillAmount: BigNumber,
|
||||||
marketOperation: MarketOperation,
|
marketOperation: MarketOperation,
|
||||||
options: Partial<SwapQuoteRequestOpts>,
|
options: Partial<SwapQuoteRequestOpts>,
|
||||||
|
rfqClient?: IRfqClient | undefined,
|
||||||
): Promise<SwapQuote> {
|
): Promise<SwapQuote> {
|
||||||
assert.isETHAddressHex('makerToken', makerToken);
|
assert.isETHAddressHex('makerToken', makerToken);
|
||||||
assert.isETHAddressHex('takerToken', takerToken);
|
assert.isETHAddressHex('takerToken', takerToken);
|
||||||
@@ -381,6 +383,7 @@ export class SwapQuoter {
|
|||||||
this.expiryBufferMs,
|
this.expiryBufferMs,
|
||||||
rfqtOptions?.metricsProxy,
|
rfqtOptions?.metricsProxy,
|
||||||
);
|
);
|
||||||
|
calcOpts.rfqt.rfqClient = rfqClient;
|
||||||
}
|
}
|
||||||
|
|
||||||
const result: OptimizerResultWithReport = await this._marketOperationUtils.getOptimizerResultAsync(
|
const result: OptimizerResultWithReport = await this._marketOperationUtils.getOptimizerResultAsync(
|
||||||
|
@@ -17,7 +17,10 @@ import {
|
|||||||
|
|
||||||
const SUCCESS_CODE = 201;
|
const SUCCESS_CODE = 201;
|
||||||
|
|
||||||
function getAltMarketInfo(
|
/**
|
||||||
|
* Returns the AltOffering if it exists for a given pair
|
||||||
|
*/
|
||||||
|
export function getAltMarketInfo(
|
||||||
offerings: AltOffering[],
|
offerings: AltOffering[],
|
||||||
buyTokenAddress: string,
|
buyTokenAddress: string,
|
||||||
sellTokenAddress: string,
|
sellTokenAddress: string,
|
||||||
|
59
packages/asset-swapper/src/utils/irfq_client.ts
Normal file
59
packages/asset-swapper/src/utils/irfq_client.ts
Normal file
@@ -0,0 +1,59 @@
|
|||||||
|
import { RfqOrder, Signature } from '@0x/protocol-utils';
|
||||||
|
import { BigNumber } from '@0x/utils';
|
||||||
|
|
||||||
|
import { AltRfqMakerAssetOfferings } from '../types';
|
||||||
|
|
||||||
|
export interface RfqClientV1PriceRequest {
|
||||||
|
altRfqAssetOfferings: AltRfqMakerAssetOfferings | undefined;
|
||||||
|
assetFillAmount: BigNumber;
|
||||||
|
chainId: number;
|
||||||
|
comparisonPrice: BigNumber | undefined;
|
||||||
|
integratorId: string;
|
||||||
|
intentOnFilling: boolean;
|
||||||
|
makerToken: string;
|
||||||
|
marketOperation: 'Sell' | 'Buy';
|
||||||
|
takerAddress: string;
|
||||||
|
takerToken: string;
|
||||||
|
txOrigin: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface RfqClientV1QuoteRequest extends RfqClientV1PriceRequest {}
|
||||||
|
|
||||||
|
export interface RfqClientV1Price {
|
||||||
|
expiry: BigNumber;
|
||||||
|
kind: 'rfq' | 'otc';
|
||||||
|
makerAmount: BigNumber;
|
||||||
|
makerToken: string;
|
||||||
|
makerUri: string;
|
||||||
|
takerAmount: BigNumber;
|
||||||
|
takerToken: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface RfqClientV1PriceResponse {
|
||||||
|
prices: RfqClientV1Price[];
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface RfqClientV1Quote {
|
||||||
|
makerUri: string;
|
||||||
|
order: RfqOrder;
|
||||||
|
signature: Signature;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface RfqClientV1QuoteResponse {
|
||||||
|
quotes: RfqClientV1Quote[];
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* IRfqClient is an interface that defines how to connect with an Rfq system.
|
||||||
|
*/
|
||||||
|
export interface IRfqClient {
|
||||||
|
/**
|
||||||
|
* Fetches a list of "indicative quotes" or prices from a remote Rfq server
|
||||||
|
*/
|
||||||
|
getV1PricesAsync(request: RfqClientV1PriceRequest): Promise<RfqClientV1PriceResponse>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Fetches a list of "firm quotes" or signed quotes from a remote Rfq server.
|
||||||
|
*/
|
||||||
|
getV1QuotesAsync(request: RfqClientV1QuoteRequest): Promise<RfqClientV1QuoteResponse>;
|
||||||
|
}
|
@@ -6,6 +6,7 @@ import {
|
|||||||
APESWAP_ROUTER_BY_CHAIN_ID,
|
APESWAP_ROUTER_BY_CHAIN_ID,
|
||||||
BAKERYSWAP_ROUTER_BY_CHAIN_ID,
|
BAKERYSWAP_ROUTER_BY_CHAIN_ID,
|
||||||
BELT_BSC_INFOS,
|
BELT_BSC_INFOS,
|
||||||
|
BISWAP_ROUTER_BY_CHAIN_ID,
|
||||||
CAFESWAP_ROUTER_BY_CHAIN_ID,
|
CAFESWAP_ROUTER_BY_CHAIN_ID,
|
||||||
CHEESESWAP_ROUTER_BY_CHAIN_ID,
|
CHEESESWAP_ROUTER_BY_CHAIN_ID,
|
||||||
COMETHSWAP_ROUTER_BY_CHAIN_ID,
|
COMETHSWAP_ROUTER_BY_CHAIN_ID,
|
||||||
@@ -39,6 +40,7 @@ import {
|
|||||||
PANCAKESWAP_ROUTER_BY_CHAIN_ID,
|
PANCAKESWAP_ROUTER_BY_CHAIN_ID,
|
||||||
PANCAKESWAPV2_ROUTER_BY_CHAIN_ID,
|
PANCAKESWAPV2_ROUTER_BY_CHAIN_ID,
|
||||||
PANGOLIN_ROUTER_BY_CHAIN_ID,
|
PANGOLIN_ROUTER_BY_CHAIN_ID,
|
||||||
|
PLATYPUS_AVALANCHE_INFOS,
|
||||||
POLYDEX_ROUTER_BY_CHAIN_ID,
|
POLYDEX_ROUTER_BY_CHAIN_ID,
|
||||||
QUICKSWAP_ROUTER_BY_CHAIN_ID,
|
QUICKSWAP_ROUTER_BY_CHAIN_ID,
|
||||||
SADDLE_MAINNET_INFOS,
|
SADDLE_MAINNET_INFOS,
|
||||||
@@ -46,11 +48,9 @@ import {
|
|||||||
SHIBASWAP_ROUTER_BY_CHAIN_ID,
|
SHIBASWAP_ROUTER_BY_CHAIN_ID,
|
||||||
SMOOTHY_BSC_INFOS,
|
SMOOTHY_BSC_INFOS,
|
||||||
SMOOTHY_MAINNET_INFOS,
|
SMOOTHY_MAINNET_INFOS,
|
||||||
SNOWSWAP_MAINNET_INFOS,
|
|
||||||
SPIRITSWAP_ROUTER_BY_CHAIN_ID,
|
SPIRITSWAP_ROUTER_BY_CHAIN_ID,
|
||||||
SPOOKYSWAP_ROUTER_BY_CHAIN_ID,
|
SPOOKYSWAP_ROUTER_BY_CHAIN_ID,
|
||||||
SUSHISWAP_ROUTER_BY_CHAIN_ID,
|
SUSHISWAP_ROUTER_BY_CHAIN_ID,
|
||||||
SWERVE_MAINNET_INFOS,
|
|
||||||
SYNAPSE_AVALANCHE_INFOS,
|
SYNAPSE_AVALANCHE_INFOS,
|
||||||
SYNAPSE_BSC_INFOS,
|
SYNAPSE_BSC_INFOS,
|
||||||
SYNAPSE_FANTOM_INFOS,
|
SYNAPSE_FANTOM_INFOS,
|
||||||
@@ -62,8 +62,9 @@ import {
|
|||||||
UNISWAPV2_ROUTER_BY_CHAIN_ID,
|
UNISWAPV2_ROUTER_BY_CHAIN_ID,
|
||||||
WAULTSWAP_ROUTER_BY_CHAIN_ID,
|
WAULTSWAP_ROUTER_BY_CHAIN_ID,
|
||||||
XSIGMA_MAINNET_INFOS,
|
XSIGMA_MAINNET_INFOS,
|
||||||
|
YOSHI_ROUTER_BY_CHAIN_ID,
|
||||||
} from './constants';
|
} from './constants';
|
||||||
import { CurveInfo, ERC20BridgeSource } from './types';
|
import { CurveInfo, ERC20BridgeSource, PlatypusInfo } from './types';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Filter Kyber reserves which should not be used (0xbb bridged reserves)
|
* Filter Kyber reserves which should not be used (0xbb bridged reserves)
|
||||||
@@ -225,32 +226,6 @@ export function getCurveV2InfosForPair(chainId: ChainId, takerToken: string, mak
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getSwerveInfosForPair(chainId: ChainId, takerToken: string, makerToken: string): CurveInfo[] {
|
|
||||||
if (chainId !== ChainId.Mainnet) {
|
|
||||||
return [];
|
|
||||||
}
|
|
||||||
return Object.values(SWERVE_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),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
export function getSnowSwapInfosForPair(chainId: ChainId, takerToken: string, makerToken: string): CurveInfo[] {
|
|
||||||
if (chainId !== ChainId.Mainnet) {
|
|
||||||
return [];
|
|
||||||
}
|
|
||||||
return Object.values(SNOWSWAP_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),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
export function getNerveInfosForPair(chainId: ChainId, takerToken: string, makerToken: string): CurveInfo[] {
|
export function getNerveInfosForPair(chainId: ChainId, takerToken: string, makerToken: string): CurveInfo[] {
|
||||||
if (chainId !== ChainId.BSC) {
|
if (chainId !== ChainId.BSC) {
|
||||||
return [];
|
return [];
|
||||||
@@ -463,6 +438,15 @@ export function getMobiusMoneyInfoForPair(chainId: ChainId, takerToken: string,
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function getPlatypusInfoForPair(chainId: ChainId, takerToken: string, makerToken: string): PlatypusInfo[] {
|
||||||
|
if (chainId !== ChainId.Avalanche) {
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
return Object.values(PLATYPUS_AVALANCHE_INFOS).filter(c =>
|
||||||
|
[makerToken, takerToken].every(t => c.tokens.includes(t)),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
export function getShellLikeInfosForPair(
|
export function getShellLikeInfosForPair(
|
||||||
chainId: ChainId,
|
chainId: ChainId,
|
||||||
takerToken: string,
|
takerToken: string,
|
||||||
@@ -493,8 +477,6 @@ export function getCurveLikeInfosForPair(
|
|||||||
source:
|
source:
|
||||||
| ERC20BridgeSource.Curve
|
| ERC20BridgeSource.Curve
|
||||||
| ERC20BridgeSource.CurveV2
|
| ERC20BridgeSource.CurveV2
|
||||||
| ERC20BridgeSource.Swerve
|
|
||||||
| ERC20BridgeSource.SnowSwap
|
|
||||||
| ERC20BridgeSource.Nerve
|
| ERC20BridgeSource.Nerve
|
||||||
| ERC20BridgeSource.Synapse
|
| ERC20BridgeSource.Synapse
|
||||||
| ERC20BridgeSource.Belt
|
| ERC20BridgeSource.Belt
|
||||||
@@ -515,12 +497,6 @@ export function getCurveLikeInfosForPair(
|
|||||||
case ERC20BridgeSource.CurveV2:
|
case ERC20BridgeSource.CurveV2:
|
||||||
pools = getCurveV2InfosForPair(chainId, takerToken, makerToken);
|
pools = getCurveV2InfosForPair(chainId, takerToken, makerToken);
|
||||||
break;
|
break;
|
||||||
case ERC20BridgeSource.Swerve:
|
|
||||||
pools = getSwerveInfosForPair(chainId, takerToken, makerToken);
|
|
||||||
break;
|
|
||||||
case ERC20BridgeSource.SnowSwap:
|
|
||||||
pools = getSnowSwapInfosForPair(chainId, takerToken, makerToken);
|
|
||||||
break;
|
|
||||||
case ERC20BridgeSource.Nerve:
|
case ERC20BridgeSource.Nerve:
|
||||||
pools = getNerveInfosForPair(chainId, takerToken, makerToken);
|
pools = getNerveInfosForPair(chainId, takerToken, makerToken);
|
||||||
break;
|
break;
|
||||||
@@ -589,7 +565,9 @@ export function uniswapV2LikeRouterAddress(
|
|||||||
| ERC20BridgeSource.UbeSwap
|
| ERC20BridgeSource.UbeSwap
|
||||||
| ERC20BridgeSource.MorpheusSwap
|
| ERC20BridgeSource.MorpheusSwap
|
||||||
| ERC20BridgeSource.SpookySwap
|
| ERC20BridgeSource.SpookySwap
|
||||||
| ERC20BridgeSource.SpiritSwap,
|
| ERC20BridgeSource.SpiritSwap
|
||||||
|
| ERC20BridgeSource.BiSwap
|
||||||
|
| ERC20BridgeSource.Yoshi,
|
||||||
): string {
|
): string {
|
||||||
switch (source) {
|
switch (source) {
|
||||||
case ERC20BridgeSource.UniswapV2:
|
case ERC20BridgeSource.UniswapV2:
|
||||||
@@ -638,6 +616,10 @@ export function uniswapV2LikeRouterAddress(
|
|||||||
return SPOOKYSWAP_ROUTER_BY_CHAIN_ID[chainId];
|
return SPOOKYSWAP_ROUTER_BY_CHAIN_ID[chainId];
|
||||||
case ERC20BridgeSource.SpiritSwap:
|
case ERC20BridgeSource.SpiritSwap:
|
||||||
return SPIRITSWAP_ROUTER_BY_CHAIN_ID[chainId];
|
return SPIRITSWAP_ROUTER_BY_CHAIN_ID[chainId];
|
||||||
|
case ERC20BridgeSource.BiSwap:
|
||||||
|
return BISWAP_ROUTER_BY_CHAIN_ID[chainId];
|
||||||
|
case ERC20BridgeSource.Yoshi:
|
||||||
|
return YOSHI_ROUTER_BY_CHAIN_ID[chainId];
|
||||||
default:
|
default:
|
||||||
throw new Error(`Unknown UniswapV2 like source ${source}`);
|
throw new Error(`Unknown UniswapV2 like source ${source}`);
|
||||||
}
|
}
|
||||||
|
@@ -28,6 +28,7 @@ import {
|
|||||||
LiquidityProviderRegistry,
|
LiquidityProviderRegistry,
|
||||||
MakerPsmFillData,
|
MakerPsmFillData,
|
||||||
MultiHopFillData,
|
MultiHopFillData,
|
||||||
|
PlatypusInfo,
|
||||||
PsmInfo,
|
PsmInfo,
|
||||||
TokenAdjacencyGraph,
|
TokenAdjacencyGraph,
|
||||||
UniswapV2FillData,
|
UniswapV2FillData,
|
||||||
@@ -79,7 +80,6 @@ export const SELL_SOURCE_FILTER_BY_CHAIN_ID = valueByChainId<SourceFilters>(
|
|||||||
ERC20BridgeSource.Native,
|
ERC20BridgeSource.Native,
|
||||||
ERC20BridgeSource.Uniswap,
|
ERC20BridgeSource.Uniswap,
|
||||||
ERC20BridgeSource.UniswapV2,
|
ERC20BridgeSource.UniswapV2,
|
||||||
ERC20BridgeSource.Eth2Dai,
|
|
||||||
ERC20BridgeSource.Kyber,
|
ERC20BridgeSource.Kyber,
|
||||||
ERC20BridgeSource.Curve,
|
ERC20BridgeSource.Curve,
|
||||||
ERC20BridgeSource.Balancer,
|
ERC20BridgeSource.Balancer,
|
||||||
@@ -87,8 +87,6 @@ export const SELL_SOURCE_FILTER_BY_CHAIN_ID = valueByChainId<SourceFilters>(
|
|||||||
ERC20BridgeSource.Bancor,
|
ERC20BridgeSource.Bancor,
|
||||||
ERC20BridgeSource.MStable,
|
ERC20BridgeSource.MStable,
|
||||||
ERC20BridgeSource.Mooniswap,
|
ERC20BridgeSource.Mooniswap,
|
||||||
ERC20BridgeSource.Swerve,
|
|
||||||
ERC20BridgeSource.SnowSwap,
|
|
||||||
ERC20BridgeSource.SushiSwap,
|
ERC20BridgeSource.SushiSwap,
|
||||||
ERC20BridgeSource.Shell,
|
ERC20BridgeSource.Shell,
|
||||||
ERC20BridgeSource.MultiHop,
|
ERC20BridgeSource.MultiHop,
|
||||||
@@ -97,7 +95,6 @@ export const SELL_SOURCE_FILTER_BY_CHAIN_ID = valueByChainId<SourceFilters>(
|
|||||||
ERC20BridgeSource.Cream,
|
ERC20BridgeSource.Cream,
|
||||||
ERC20BridgeSource.LiquidityProvider,
|
ERC20BridgeSource.LiquidityProvider,
|
||||||
ERC20BridgeSource.CryptoCom,
|
ERC20BridgeSource.CryptoCom,
|
||||||
ERC20BridgeSource.Linkswap,
|
|
||||||
ERC20BridgeSource.Lido,
|
ERC20BridgeSource.Lido,
|
||||||
ERC20BridgeSource.MakerPsm,
|
ERC20BridgeSource.MakerPsm,
|
||||||
ERC20BridgeSource.KyberDmm,
|
ERC20BridgeSource.KyberDmm,
|
||||||
@@ -150,6 +147,7 @@ export const SELL_SOURCE_FILTER_BY_CHAIN_ID = valueByChainId<SourceFilters>(
|
|||||||
ERC20BridgeSource.JetSwap,
|
ERC20BridgeSource.JetSwap,
|
||||||
ERC20BridgeSource.ACryptos,
|
ERC20BridgeSource.ACryptos,
|
||||||
ERC20BridgeSource.KyberDmm,
|
ERC20BridgeSource.KyberDmm,
|
||||||
|
ERC20BridgeSource.BiSwap,
|
||||||
]),
|
]),
|
||||||
[ChainId.Polygon]: new SourceFilters([
|
[ChainId.Polygon]: new SourceFilters([
|
||||||
ERC20BridgeSource.SushiSwap,
|
ERC20BridgeSource.SushiSwap,
|
||||||
@@ -185,6 +183,8 @@ export const SELL_SOURCE_FILTER_BY_CHAIN_ID = valueByChainId<SourceFilters>(
|
|||||||
ERC20BridgeSource.KyberDmm,
|
ERC20BridgeSource.KyberDmm,
|
||||||
ERC20BridgeSource.AaveV2,
|
ERC20BridgeSource.AaveV2,
|
||||||
ERC20BridgeSource.Synapse,
|
ERC20BridgeSource.Synapse,
|
||||||
|
ERC20BridgeSource.GMX,
|
||||||
|
ERC20BridgeSource.Platypus,
|
||||||
]),
|
]),
|
||||||
[ChainId.Fantom]: new SourceFilters([
|
[ChainId.Fantom]: new SourceFilters([
|
||||||
ERC20BridgeSource.MultiHop,
|
ERC20BridgeSource.MultiHop,
|
||||||
@@ -198,6 +198,7 @@ export const SELL_SOURCE_FILTER_BY_CHAIN_ID = valueByChainId<SourceFilters>(
|
|||||||
ERC20BridgeSource.SpookySwap,
|
ERC20BridgeSource.SpookySwap,
|
||||||
ERC20BridgeSource.SushiSwap,
|
ERC20BridgeSource.SushiSwap,
|
||||||
ERC20BridgeSource.Synapse,
|
ERC20BridgeSource.Synapse,
|
||||||
|
ERC20BridgeSource.Yoshi,
|
||||||
]),
|
]),
|
||||||
[ChainId.Celo]: new SourceFilters([
|
[ChainId.Celo]: new SourceFilters([
|
||||||
ERC20BridgeSource.UbeSwap,
|
ERC20BridgeSource.UbeSwap,
|
||||||
@@ -225,7 +226,6 @@ export const BUY_SOURCE_FILTER_BY_CHAIN_ID = valueByChainId<SourceFilters>(
|
|||||||
ERC20BridgeSource.Native,
|
ERC20BridgeSource.Native,
|
||||||
ERC20BridgeSource.Uniswap,
|
ERC20BridgeSource.Uniswap,
|
||||||
ERC20BridgeSource.UniswapV2,
|
ERC20BridgeSource.UniswapV2,
|
||||||
ERC20BridgeSource.Eth2Dai,
|
|
||||||
ERC20BridgeSource.Kyber,
|
ERC20BridgeSource.Kyber,
|
||||||
ERC20BridgeSource.Curve,
|
ERC20BridgeSource.Curve,
|
||||||
ERC20BridgeSource.Balancer,
|
ERC20BridgeSource.Balancer,
|
||||||
@@ -234,8 +234,6 @@ export const BUY_SOURCE_FILTER_BY_CHAIN_ID = valueByChainId<SourceFilters>(
|
|||||||
ERC20BridgeSource.MStable,
|
ERC20BridgeSource.MStable,
|
||||||
ERC20BridgeSource.Mooniswap,
|
ERC20BridgeSource.Mooniswap,
|
||||||
ERC20BridgeSource.Shell,
|
ERC20BridgeSource.Shell,
|
||||||
ERC20BridgeSource.Swerve,
|
|
||||||
ERC20BridgeSource.SnowSwap,
|
|
||||||
ERC20BridgeSource.SushiSwap,
|
ERC20BridgeSource.SushiSwap,
|
||||||
ERC20BridgeSource.MultiHop,
|
ERC20BridgeSource.MultiHop,
|
||||||
ERC20BridgeSource.Dodo,
|
ERC20BridgeSource.Dodo,
|
||||||
@@ -244,7 +242,6 @@ export const BUY_SOURCE_FILTER_BY_CHAIN_ID = valueByChainId<SourceFilters>(
|
|||||||
ERC20BridgeSource.Lido,
|
ERC20BridgeSource.Lido,
|
||||||
ERC20BridgeSource.LiquidityProvider,
|
ERC20BridgeSource.LiquidityProvider,
|
||||||
ERC20BridgeSource.CryptoCom,
|
ERC20BridgeSource.CryptoCom,
|
||||||
ERC20BridgeSource.Linkswap,
|
|
||||||
ERC20BridgeSource.MakerPsm,
|
ERC20BridgeSource.MakerPsm,
|
||||||
ERC20BridgeSource.KyberDmm,
|
ERC20BridgeSource.KyberDmm,
|
||||||
ERC20BridgeSource.Smoothy,
|
ERC20BridgeSource.Smoothy,
|
||||||
@@ -297,6 +294,7 @@ export const BUY_SOURCE_FILTER_BY_CHAIN_ID = valueByChainId<SourceFilters>(
|
|||||||
ERC20BridgeSource.ACryptos,
|
ERC20BridgeSource.ACryptos,
|
||||||
ERC20BridgeSource.KyberDmm,
|
ERC20BridgeSource.KyberDmm,
|
||||||
ERC20BridgeSource.Synapse,
|
ERC20BridgeSource.Synapse,
|
||||||
|
ERC20BridgeSource.BiSwap,
|
||||||
]),
|
]),
|
||||||
[ChainId.Polygon]: new SourceFilters([
|
[ChainId.Polygon]: new SourceFilters([
|
||||||
ERC20BridgeSource.SushiSwap,
|
ERC20BridgeSource.SushiSwap,
|
||||||
@@ -332,6 +330,8 @@ export const BUY_SOURCE_FILTER_BY_CHAIN_ID = valueByChainId<SourceFilters>(
|
|||||||
ERC20BridgeSource.KyberDmm,
|
ERC20BridgeSource.KyberDmm,
|
||||||
ERC20BridgeSource.AaveV2,
|
ERC20BridgeSource.AaveV2,
|
||||||
ERC20BridgeSource.Synapse,
|
ERC20BridgeSource.Synapse,
|
||||||
|
ERC20BridgeSource.GMX,
|
||||||
|
ERC20BridgeSource.Platypus,
|
||||||
]),
|
]),
|
||||||
[ChainId.Fantom]: new SourceFilters([
|
[ChainId.Fantom]: new SourceFilters([
|
||||||
ERC20BridgeSource.MultiHop,
|
ERC20BridgeSource.MultiHop,
|
||||||
@@ -345,6 +345,7 @@ export const BUY_SOURCE_FILTER_BY_CHAIN_ID = valueByChainId<SourceFilters>(
|
|||||||
ERC20BridgeSource.SpookySwap,
|
ERC20BridgeSource.SpookySwap,
|
||||||
ERC20BridgeSource.SushiSwap,
|
ERC20BridgeSource.SushiSwap,
|
||||||
ERC20BridgeSource.Synapse,
|
ERC20BridgeSource.Synapse,
|
||||||
|
ERC20BridgeSource.Yoshi,
|
||||||
]),
|
]),
|
||||||
[ChainId.Celo]: new SourceFilters([
|
[ChainId.Celo]: new SourceFilters([
|
||||||
ERC20BridgeSource.UbeSwap,
|
ERC20BridgeSource.UbeSwap,
|
||||||
@@ -437,6 +438,7 @@ export const MAINNET_TOKENS = {
|
|||||||
RenBTC: '0xeb4c2781e4eba804ce9a9803c67d0893436bb27d',
|
RenBTC: '0xeb4c2781e4eba804ce9a9803c67d0893436bb27d',
|
||||||
sBTC: '0xfe18be6b3bd88a2d2a7f928d00292e7a9963cfc6',
|
sBTC: '0xfe18be6b3bd88a2d2a7f928d00292e7a9963cfc6',
|
||||||
tBTC: '0x8daebade922df735c38c80c7ebd708af50815faa',
|
tBTC: '0x8daebade922df735c38c80c7ebd708af50815faa',
|
||||||
|
tBTCv2: '0x18084fbA666a33d37592fA2633fD49a74DD93a88',
|
||||||
hBTC: '0x0316eb71485b0ab14103307bf65a021042c6d380',
|
hBTC: '0x0316eb71485b0ab14103307bf65a021042c6d380',
|
||||||
pBTC: '0x5228a22e72ccc52d415ecfd199f99d0665e7733b',
|
pBTC: '0x5228a22e72ccc52d415ecfd199f99d0665e7733b',
|
||||||
bBTC: '0x9be89d2a4cd102d8fecc6bf9da793be995c22541',
|
bBTC: '0x9be89d2a4cd102d8fecc6bf9da793be995c22541',
|
||||||
@@ -479,6 +481,7 @@ export const MAINNET_TOKENS = {
|
|||||||
alUSD: '0xbc6da0fe9ad5f3b0d58160288917aa56653660e9',
|
alUSD: '0xbc6da0fe9ad5f3b0d58160288917aa56653660e9',
|
||||||
// Frax ecosystem
|
// Frax ecosystem
|
||||||
FRAX: '0x853d955acef822db058eb8505911ed77f175b99e',
|
FRAX: '0x853d955acef822db058eb8505911ed77f175b99e',
|
||||||
|
cvxFXS: '0xfeef77d3f69374f66429c91d732a244f074bdf74',
|
||||||
FXS: '0x3432b6a60d23ca0dfca7761b7ab56459d9c964d0',
|
FXS: '0x3432b6a60d23ca0dfca7761b7ab56459d9c964d0',
|
||||||
OHM: '0x383518188c0c6d7730d91b2c03a03c837814a899',
|
OHM: '0x383518188c0c6d7730d91b2c03a03c837814a899',
|
||||||
OHMV2: '0x64aa3364f17a4d01c6f1751fd97c2bd3d7e7f1d5',
|
OHMV2: '0x64aa3364f17a4d01c6f1751fd97c2bd3d7e7f1d5',
|
||||||
@@ -524,6 +527,7 @@ export const BSC_TOKENS = {
|
|||||||
renBTC: '0xfce146bf3146100cfe5db4129cf6c82b0ef4ad8c',
|
renBTC: '0xfce146bf3146100cfe5db4129cf6c82b0ef4ad8c',
|
||||||
pBTC: '0xed28a457a5a76596ac48d87c0f577020f6ea1c4c',
|
pBTC: '0xed28a457a5a76596ac48d87c0f577020f6ea1c4c',
|
||||||
nUSD: '0x23b891e5c62e0955ae2bd185990103928ab817b3',
|
nUSD: '0x23b891e5c62e0955ae2bd185990103928ab817b3',
|
||||||
|
BSW: '0x965F527D9159dCe6288a2219DB51fc6Eef120dD1',
|
||||||
};
|
};
|
||||||
|
|
||||||
export const POLYGON_TOKENS = {
|
export const POLYGON_TOKENS = {
|
||||||
@@ -542,6 +546,7 @@ export const POLYGON_TOKENS = {
|
|||||||
BANANA: '0x5d47baba0d66083c52009271faf3f50dcc01023c',
|
BANANA: '0x5d47baba0d66083c52009271faf3f50dcc01023c',
|
||||||
WEXPOLY: '0x4c4bf319237d98a30a929a96112effa8da3510eb',
|
WEXPOLY: '0x4c4bf319237d98a30a929a96112effa8da3510eb',
|
||||||
nUSD: '0xb6c473756050de474286bed418b77aeac39b02af',
|
nUSD: '0xb6c473756050de474286bed418b77aeac39b02af',
|
||||||
|
ANY: '0x6aB6d61428fde76768D7b45D8BFeec19c6eF91A8',
|
||||||
};
|
};
|
||||||
|
|
||||||
export const AVALANCHE_TOKENS = {
|
export const AVALANCHE_TOKENS = {
|
||||||
@@ -551,8 +556,10 @@ export const AVALANCHE_TOKENS = {
|
|||||||
DAI: '0xd586e7f844cea2f87f50152665bcbc2c279d8d70',
|
DAI: '0xd586e7f844cea2f87f50152665bcbc2c279d8d70',
|
||||||
// bridged USDC
|
// bridged USDC
|
||||||
USDC: '0xa7d7079b0fead91f3e65f86e8915cb59c1a4c664',
|
USDC: '0xa7d7079b0fead91f3e65f86e8915cb59c1a4c664',
|
||||||
// native USDC on Avalanche
|
// native USDC on Avalanche usdc.e
|
||||||
nUSDC: '0xb97ef9ef8734c71904d8002f8b6bc66dd9c48a6e',
|
nUSDC: '0xb97ef9ef8734c71904d8002f8b6bc66dd9c48a6e',
|
||||||
|
// usdt.e
|
||||||
|
USDt: '0x9702230a8ea53601f5cd2dc00fdbc13d4df4a8c7',
|
||||||
USDT: '0xc7198437980c041c805a1edcba50c1ce5db95118',
|
USDT: '0xc7198437980c041c805a1edcba50c1ce5db95118',
|
||||||
aDAI: '0x47afa96cdc9fab46904a55a6ad4bf6660b53c38a',
|
aDAI: '0x47afa96cdc9fab46904a55a6ad4bf6660b53c38a',
|
||||||
aUSDC: '0x46a51127c3ce23fb7ab1de06226147f446e4a857',
|
aUSDC: '0x46a51127c3ce23fb7ab1de06226147f446e4a857',
|
||||||
@@ -561,6 +568,11 @@ export const AVALANCHE_TOKENS = {
|
|||||||
nUSD: '0xcfc37a6ab183dd4aed08c204d1c2773c0b1bdf46',
|
nUSD: '0xcfc37a6ab183dd4aed08c204d1c2773c0b1bdf46',
|
||||||
aWETH: '0x53f7c5869a859f0aec3d334ee8b4cf01e3492f21',
|
aWETH: '0x53f7c5869a859f0aec3d334ee8b4cf01e3492f21',
|
||||||
MIM: '0x130966628846bfd36ff31a822705796e8cb8c18d',
|
MIM: '0x130966628846bfd36ff31a822705796e8cb8c18d',
|
||||||
|
MAG: '0x1d60109178C48E4A937D8AB71699D8eBb6F7c5dE',
|
||||||
|
sAVAX: '0x2b2c81e08f1af8835a78bb2a90ae924ace0ea4be',
|
||||||
|
UST: '0xb599c3590f42f8f995ecfa0f85d2980b76862fc1',
|
||||||
|
FRAX: '0xd24c2ad096400b6fbcd2ad8b24e7acbc21a1da64',
|
||||||
|
YUSD: '0x111111111111ed1d73f860f57b2798b683f2d325',
|
||||||
};
|
};
|
||||||
|
|
||||||
export const CELO_TOKENS = {
|
export const CELO_TOKENS = {
|
||||||
@@ -680,6 +692,7 @@ export const CURVE_POOLS = {
|
|||||||
BUSD: '0x4807862aa8b2bf68830e4c8dc86d0e9a998e085a',
|
BUSD: '0x4807862aa8b2bf68830e4c8dc86d0e9a998e085a',
|
||||||
DSU3CRV: '0x6ec80df362d7042c50d4469bcfbc174c9dd9109a',
|
DSU3CRV: '0x6ec80df362d7042c50d4469bcfbc174c9dd9109a',
|
||||||
cvxcrv: '0x9d0464996170c6b9e75eed71c68b99ddedf279e8',
|
cvxcrv: '0x9d0464996170c6b9e75eed71c68b99ddedf279e8',
|
||||||
|
cvxfxs: '0xd658a338613198204dca1143ac3f01a722b5d94a',
|
||||||
mim: '0x5a6a4d54456819380173272a5e8e9b9904bdf41b',
|
mim: '0x5a6a4d54456819380173272a5e8e9b9904bdf41b',
|
||||||
eurt: '0xfd5db7463a3ab53fd211b4af195c5bccc1a03890',
|
eurt: '0xfd5db7463a3ab53fd211b4af195c5bccc1a03890',
|
||||||
ethcrv: '0x8301ae4fc9c624d1d396cbdaa1ed877821d7c511',
|
ethcrv: '0x8301ae4fc9c624d1d396cbdaa1ed877821d7c511',
|
||||||
@@ -737,28 +750,13 @@ export const CURVE_OPTIMISM_POOLS = {
|
|||||||
tri: '0x1337bedc9d22ecbe766df105c9623922a27963ec',
|
tri: '0x1337bedc9d22ecbe766df105c9623922a27963ec',
|
||||||
};
|
};
|
||||||
|
|
||||||
export const SWERVE_POOLS = {
|
|
||||||
y: '0x329239599afb305da0a2ec69c58f8a6697f9f88d',
|
|
||||||
};
|
|
||||||
|
|
||||||
export const SNOWSWAP_POOLS = {
|
|
||||||
yUSD: '0xbf7ccd6c446acfcc5df023043f2167b62e81899b',
|
|
||||||
yVault: '0x4571753311e37ddb44faa8fb78a6df9a6e3c6c0b',
|
|
||||||
// POOL Disabled as it uses WETH over ETH
|
|
||||||
// There is a conflict with Curve and SnowSwap
|
|
||||||
// where Curve uses ETH and SnowSwap uses WETH
|
|
||||||
// To re-enable this we need to flag an WETH
|
|
||||||
// unwrap or not
|
|
||||||
// eth: '0x16bea2e63adade5984298d53a4d4d9c09e278192',
|
|
||||||
};
|
|
||||||
|
|
||||||
export const SMOOTHY_POOLS = {
|
export const SMOOTHY_POOLS = {
|
||||||
syUSD: '0xe5859f4efc09027a9b718781dcb2c6910cac6e91',
|
syUSD: '0xe5859f4efc09027a9b718781dcb2c6910cac6e91',
|
||||||
};
|
};
|
||||||
|
|
||||||
export const SADDLE_POOLS = {
|
export const SADDLE_POOLS = {
|
||||||
stables: '0x3911f80530595fbd01ab1516ab61255d75aeb066',
|
stablesV2: '0xaCb83E0633d6605c5001e2Ab59EF3C745547C8C7',
|
||||||
bitcoins: '0x4f6a43ad7cba042606decaca730d4ce0a57ac62e',
|
bitcoinsV2: '0xdf3309771d2BF82cb2B6C56F9f5365C8bD97c4f2',
|
||||||
alETH: '0xa6018520eaacc06c30ff2e1b3ee2c7c22e64196a',
|
alETH: '0xa6018520eaacc06c30ff2e1b3ee2c7c22e64196a',
|
||||||
d4: '0xc69ddcd4dfef25d8a793241834d4cc4b3668ead6',
|
d4: '0xc69ddcd4dfef25d8a793241834d4cc4b3668ead6',
|
||||||
};
|
};
|
||||||
@@ -837,6 +835,14 @@ export const ACRYPTOS_POOLS = {
|
|||||||
acs3btc: '0xbe7caa236544d1b9a0e7f91e94b9f5bfd3b5ca81',
|
acs3btc: '0xbe7caa236544d1b9a0e7f91e94b9f5bfd3b5ca81',
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const PLATYPUS_AVALANCHE_POOLS = {
|
||||||
|
usd: '0x66357dcace80431aee0a7507e2e361b7e2402370',
|
||||||
|
yusd: '0xc828d995c686aaba78a4ac89dfc8ec0ff4c5be83',
|
||||||
|
frax: '0xb8e567fc23c39c94a1f6359509d7b43d1fbed824',
|
||||||
|
mim: '0x30c30d826be87cd0a4b90855c2f38f7fcfe4eaa7',
|
||||||
|
sAVAX: '0x4658ea7e9960d6158a261104aaa160cc953bb6ba',
|
||||||
|
};
|
||||||
|
|
||||||
export const DEFAULT_INTERMEDIATE_TOKENS_BY_CHAIN_ID = valueByChainId<string[]>(
|
export const DEFAULT_INTERMEDIATE_TOKENS_BY_CHAIN_ID = valueByChainId<string[]>(
|
||||||
{
|
{
|
||||||
[ChainId.Mainnet]: [
|
[ChainId.Mainnet]: [
|
||||||
@@ -878,6 +884,7 @@ export const DEFAULT_INTERMEDIATE_TOKENS_BY_CHAIN_ID = valueByChainId<string[]>(
|
|||||||
AVALANCHE_TOKENS.nUSD,
|
AVALANCHE_TOKENS.nUSD,
|
||||||
AVALANCHE_TOKENS.nETH,
|
AVALANCHE_TOKENS.nETH,
|
||||||
AVALANCHE_TOKENS.aWETH,
|
AVALANCHE_TOKENS.aWETH,
|
||||||
|
AVALANCHE_TOKENS.MIM,
|
||||||
],
|
],
|
||||||
[ChainId.Fantom]: [
|
[ChainId.Fantom]: [
|
||||||
FANTOM_TOKENS.WFTM,
|
FANTOM_TOKENS.WFTM,
|
||||||
@@ -919,6 +926,8 @@ export const DEFAULT_TOKEN_ADJACENCY_GRAPH_BY_CHAIN_ID = valueByChainId<TokenAdj
|
|||||||
builder.add(MAINNET_TOKENS.MIR, MAINNET_TOKENS.UST);
|
builder.add(MAINNET_TOKENS.MIR, MAINNET_TOKENS.UST);
|
||||||
// Convex and Curve
|
// Convex and Curve
|
||||||
builder.add(MAINNET_TOKENS.cvxCRV, MAINNET_TOKENS.CRV).add(MAINNET_TOKENS.CRV, MAINNET_TOKENS.cvxCRV);
|
builder.add(MAINNET_TOKENS.cvxCRV, MAINNET_TOKENS.CRV).add(MAINNET_TOKENS.CRV, MAINNET_TOKENS.cvxCRV);
|
||||||
|
// Convex and FXS
|
||||||
|
builder.add(MAINNET_TOKENS.cvxFXS, MAINNET_TOKENS.FXS).add(MAINNET_TOKENS.FXS, MAINNET_TOKENS.cvxFXS);
|
||||||
// FEI TRIBE liquid in UniV2
|
// FEI TRIBE liquid in UniV2
|
||||||
builder.add(MAINNET_TOKENS.FEI, MAINNET_TOKENS.TRIBE).add(MAINNET_TOKENS.TRIBE, MAINNET_TOKENS.FEI);
|
builder.add(MAINNET_TOKENS.FEI, MAINNET_TOKENS.TRIBE).add(MAINNET_TOKENS.TRIBE, MAINNET_TOKENS.FEI);
|
||||||
// FRAX ecosystem
|
// FRAX ecosystem
|
||||||
@@ -936,15 +945,21 @@ export const DEFAULT_TOKEN_ADJACENCY_GRAPH_BY_CHAIN_ID = valueByChainId<TokenAdj
|
|||||||
}).build(),
|
}).build(),
|
||||||
[ChainId.Polygon]: new TokenAdjacencyGraphBuilder({
|
[ChainId.Polygon]: new TokenAdjacencyGraphBuilder({
|
||||||
default: DEFAULT_INTERMEDIATE_TOKENS_BY_CHAIN_ID[ChainId.Polygon],
|
default: DEFAULT_INTERMEDIATE_TOKENS_BY_CHAIN_ID[ChainId.Polygon],
|
||||||
}).build(),
|
})
|
||||||
|
.tap(builder => {
|
||||||
|
builder.add(POLYGON_TOKENS.QUICK, POLYGON_TOKENS.ANY).add(POLYGON_TOKENS.ANY, POLYGON_TOKENS.QUICK);
|
||||||
|
})
|
||||||
|
.build(),
|
||||||
[ChainId.Avalanche]: new TokenAdjacencyGraphBuilder({
|
[ChainId.Avalanche]: new TokenAdjacencyGraphBuilder({
|
||||||
default: DEFAULT_INTERMEDIATE_TOKENS_BY_CHAIN_ID[ChainId.Avalanche],
|
default: DEFAULT_INTERMEDIATE_TOKENS_BY_CHAIN_ID[ChainId.Avalanche],
|
||||||
})
|
})
|
||||||
.tap(builder => {
|
.tap(builder => {
|
||||||
// Synape nETH/aWETH pool
|
// Synapse nETH/aWETH pool
|
||||||
builder
|
builder
|
||||||
.add(AVALANCHE_TOKENS.aWETH, AVALANCHE_TOKENS.nETH)
|
.add(AVALANCHE_TOKENS.aWETH, AVALANCHE_TOKENS.nETH)
|
||||||
.add(AVALANCHE_TOKENS.nETH, AVALANCHE_TOKENS.aWETH);
|
.add(AVALANCHE_TOKENS.nETH, AVALANCHE_TOKENS.aWETH);
|
||||||
|
// Trader Joe MAG/MIM pool
|
||||||
|
builder.add(AVALANCHE_TOKENS.MIM, AVALANCHE_TOKENS.MAG).add(AVALANCHE_TOKENS.MAG, AVALANCHE_TOKENS.MIM);
|
||||||
})
|
})
|
||||||
.build(),
|
.build(),
|
||||||
[ChainId.Fantom]: new TokenAdjacencyGraphBuilder({
|
[ChainId.Fantom]: new TokenAdjacencyGraphBuilder({
|
||||||
@@ -1359,6 +1374,11 @@ export const CURVE_MAINNET_INFOS: { [name: string]: CurveInfo } = {
|
|||||||
pool: CURVE_POOLS.stgusdc,
|
pool: CURVE_POOLS.stgusdc,
|
||||||
gasSchedule: 250e3,
|
gasSchedule: 250e3,
|
||||||
}),
|
}),
|
||||||
|
[CURVE_POOLS.cvxfxs]: createCurveFactoryCryptoExchangePool({
|
||||||
|
tokens: [MAINNET_TOKENS.FXS, MAINNET_TOKENS.cvxFXS],
|
||||||
|
pool: CURVE_POOLS.cvxfxs,
|
||||||
|
gasSchedule: 390e3,
|
||||||
|
}),
|
||||||
};
|
};
|
||||||
|
|
||||||
export const CURVE_V2_MAINNET_INFOS: { [name: string]: CurveInfo } = {
|
export const CURVE_V2_MAINNET_INFOS: { [name: string]: CurveInfo } = {
|
||||||
@@ -1496,38 +1516,6 @@ export const CURVE_OPTIMISM_INFOS: { [name: string]: CurveInfo } = {
|
|||||||
}),
|
}),
|
||||||
};
|
};
|
||||||
|
|
||||||
export const SWERVE_MAINNET_INFOS: { [name: string]: CurveInfo } = {
|
|
||||||
[SWERVE_POOLS.y]: createCurveExchangePool({
|
|
||||||
tokens: [MAINNET_TOKENS.DAI, MAINNET_TOKENS.USDC, MAINNET_TOKENS.USDT, MAINNET_TOKENS.TUSD],
|
|
||||||
pool: SWERVE_POOLS.y,
|
|
||||||
gasSchedule: 140e3,
|
|
||||||
}),
|
|
||||||
};
|
|
||||||
|
|
||||||
export const SNOWSWAP_MAINNET_INFOS: { [name: string]: CurveInfo } = {
|
|
||||||
[SNOWSWAP_POOLS.yUSD]: createCurveExchangePool({
|
|
||||||
tokens: [MAINNET_TOKENS.yUSD, MAINNET_TOKENS.ybCRV],
|
|
||||||
pool: SNOWSWAP_POOLS.yUSD,
|
|
||||||
gasSchedule: 990e3,
|
|
||||||
}),
|
|
||||||
[SNOWSWAP_POOLS.yUSD]: createCurveExchangeUnderlyingPool({
|
|
||||||
tokens: [MAINNET_TOKENS.yCRV, MAINNET_TOKENS.bCRV],
|
|
||||||
pool: SNOWSWAP_POOLS.yUSD,
|
|
||||||
gasSchedule: 990e3,
|
|
||||||
}),
|
|
||||||
[SNOWSWAP_POOLS.yVault]: createCurveExchangePool({
|
|
||||||
tokens: [MAINNET_TOKENS.yDAI, MAINNET_TOKENS.yUSDC, MAINNET_TOKENS.yUSDT, MAINNET_TOKENS.yTUSD],
|
|
||||||
pool: SNOWSWAP_POOLS.yVault,
|
|
||||||
gasSchedule: 1490e3,
|
|
||||||
}),
|
|
||||||
// Unsupported due to collision with WETH and ETH with execution using MixinCurve
|
|
||||||
// [SNOWSWAP_POOLS.eth]: createCurveExchangePool({
|
|
||||||
// tokens: [MAINNET_TOKENS.WETH, MAINNET_TOKENS.vETH, MAINNET_TOKENS.ankrETH, MAINNET_TOKENS.crETH],
|
|
||||||
// pool: SNOWSWAP_POOLS.eth,
|
|
||||||
// gasSchedule: 990e3,
|
|
||||||
// }),
|
|
||||||
};
|
|
||||||
|
|
||||||
export const BELT_BSC_INFOS: { [name: string]: CurveInfo } = {
|
export const BELT_BSC_INFOS: { [name: string]: CurveInfo } = {
|
||||||
[BELT_POOLS.vPool]: createCurveExchangeUnderlyingPool({
|
[BELT_POOLS.vPool]: createCurveExchangeUnderlyingPool({
|
||||||
tokens: [BSC_TOKENS.DAI, BSC_TOKENS.USDC, BSC_TOKENS.USDT, BSC_TOKENS.BUSD],
|
tokens: [BSC_TOKENS.DAI, BSC_TOKENS.USDC, BSC_TOKENS.USDT, BSC_TOKENS.BUSD],
|
||||||
@@ -1554,21 +1542,21 @@ export const XSIGMA_MAINNET_INFOS: { [name: string]: CurveInfo } = {
|
|||||||
|
|
||||||
// Curve-like sources using custom selectors
|
// Curve-like sources using custom selectors
|
||||||
export const SADDLE_MAINNET_INFOS: { [name: string]: CurveInfo } = {
|
export const SADDLE_MAINNET_INFOS: { [name: string]: CurveInfo } = {
|
||||||
[SADDLE_POOLS.stables]: {
|
[SADDLE_POOLS.stablesV2]: {
|
||||||
exchangeFunctionSelector: CurveFunctionSelectors.swap,
|
exchangeFunctionSelector: CurveFunctionSelectors.swap,
|
||||||
sellQuoteFunctionSelector: CurveFunctionSelectors.calculateSwap,
|
sellQuoteFunctionSelector: CurveFunctionSelectors.calculateSwap,
|
||||||
buyQuoteFunctionSelector: CurveFunctionSelectors.None,
|
buyQuoteFunctionSelector: CurveFunctionSelectors.None,
|
||||||
poolAddress: SADDLE_POOLS.stables,
|
poolAddress: SADDLE_POOLS.stablesV2,
|
||||||
tokens: [MAINNET_TOKENS.DAI, MAINNET_TOKENS.USDC, MAINNET_TOKENS.USDT],
|
tokens: [MAINNET_TOKENS.DAI, MAINNET_TOKENS.USDC, MAINNET_TOKENS.USDT],
|
||||||
metaTokens: undefined,
|
metaTokens: undefined,
|
||||||
gasSchedule: 150e3,
|
gasSchedule: 150e3,
|
||||||
},
|
},
|
||||||
[SADDLE_POOLS.bitcoins]: {
|
[SADDLE_POOLS.bitcoinsV2]: {
|
||||||
exchangeFunctionSelector: CurveFunctionSelectors.swap,
|
exchangeFunctionSelector: CurveFunctionSelectors.swap,
|
||||||
sellQuoteFunctionSelector: CurveFunctionSelectors.calculateSwap,
|
sellQuoteFunctionSelector: CurveFunctionSelectors.calculateSwap,
|
||||||
buyQuoteFunctionSelector: CurveFunctionSelectors.None,
|
buyQuoteFunctionSelector: CurveFunctionSelectors.None,
|
||||||
poolAddress: SADDLE_POOLS.bitcoins,
|
poolAddress: SADDLE_POOLS.bitcoinsV2,
|
||||||
tokens: [MAINNET_TOKENS.tBTC, MAINNET_TOKENS.WBTC, MAINNET_TOKENS.RenBTC, MAINNET_TOKENS.sBTC],
|
tokens: [MAINNET_TOKENS.WBTC, MAINNET_TOKENS.RenBTC, MAINNET_TOKENS.sBTC],
|
||||||
metaTokens: undefined,
|
metaTokens: undefined,
|
||||||
gasSchedule: 150e3,
|
gasSchedule: 150e3,
|
||||||
},
|
},
|
||||||
@@ -1825,6 +1813,40 @@ export const ACRYPTOS_BSC_INFOS: { [name: string]: CurveInfo } = {
|
|||||||
}),
|
}),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const PLATYPUS_AVALANCHE_INFOS: { [name: string]: PlatypusInfo } = {
|
||||||
|
[PLATYPUS_AVALANCHE_POOLS.usd]: {
|
||||||
|
poolAddress: PLATYPUS_AVALANCHE_POOLS.usd,
|
||||||
|
tokens: [
|
||||||
|
AVALANCHE_TOKENS.USDT,
|
||||||
|
AVALANCHE_TOKENS.USDC,
|
||||||
|
AVALANCHE_TOKENS.DAI,
|
||||||
|
AVALANCHE_TOKENS.nUSDC,
|
||||||
|
AVALANCHE_TOKENS.USDt,
|
||||||
|
],
|
||||||
|
gasSchedule: 300e3,
|
||||||
|
},
|
||||||
|
[PLATYPUS_AVALANCHE_POOLS.yusd]: {
|
||||||
|
poolAddress: PLATYPUS_AVALANCHE_POOLS.yusd,
|
||||||
|
tokens: [AVALANCHE_TOKENS.YUSD, AVALANCHE_TOKENS.nUSDC],
|
||||||
|
gasSchedule: 300e3,
|
||||||
|
},
|
||||||
|
[PLATYPUS_AVALANCHE_POOLS.frax]: {
|
||||||
|
poolAddress: PLATYPUS_AVALANCHE_POOLS.frax,
|
||||||
|
tokens: [AVALANCHE_TOKENS.FRAX, AVALANCHE_TOKENS.nUSDC],
|
||||||
|
gasSchedule: 300e3,
|
||||||
|
},
|
||||||
|
[PLATYPUS_AVALANCHE_POOLS.mim]: {
|
||||||
|
poolAddress: PLATYPUS_AVALANCHE_POOLS.mim,
|
||||||
|
tokens: [AVALANCHE_TOKENS.MIM, AVALANCHE_TOKENS.nUSDC],
|
||||||
|
gasSchedule: 300e3,
|
||||||
|
},
|
||||||
|
[PLATYPUS_AVALANCHE_POOLS.sAVAX]: {
|
||||||
|
poolAddress: PLATYPUS_AVALANCHE_POOLS.sAVAX,
|
||||||
|
tokens: [AVALANCHE_TOKENS.WAVAX, AVALANCHE_TOKENS.sAVAX],
|
||||||
|
gasSchedule: 300e3,
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Kyber reserve prefixes
|
* Kyber reserve prefixes
|
||||||
* 0xff Fed price reserve
|
* 0xff Fed price reserve
|
||||||
@@ -1916,11 +1938,6 @@ export const CRYPTO_COM_ROUTER_BY_CHAIN_ID = valueByChainId<string>(
|
|||||||
NULL_ADDRESS,
|
NULL_ADDRESS,
|
||||||
);
|
);
|
||||||
|
|
||||||
export const LINKSWAP_ROUTER_BY_CHAIN_ID = valueByChainId<string>(
|
|
||||||
{ [ChainId.Mainnet]: '0xa7ece0911fe8c60bff9e99f8fafcdbe56e07aff1' },
|
|
||||||
NULL_ADDRESS,
|
|
||||||
);
|
|
||||||
|
|
||||||
export const SHIBASWAP_ROUTER_BY_CHAIN_ID = valueByChainId<string>(
|
export const SHIBASWAP_ROUTER_BY_CHAIN_ID = valueByChainId<string>(
|
||||||
{
|
{
|
||||||
[ChainId.Mainnet]: '0x03f7724180aa6b939894b5ca4314783b0b36b329',
|
[ChainId.Mainnet]: '0x03f7724180aa6b939894b5ca4314783b0b36b329',
|
||||||
@@ -1981,6 +1998,13 @@ export const KYBER_DMM_ROUTER_BY_CHAIN_ID = valueByChainId<string>(
|
|||||||
NULL_ADDRESS,
|
NULL_ADDRESS,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
export const BISWAP_ROUTER_BY_CHAIN_ID = valueByChainId<string>(
|
||||||
|
{
|
||||||
|
[ChainId.BSC]: '0x3a6d8ca21d1cf76f653a67577fa0d27453350dd8',
|
||||||
|
},
|
||||||
|
NULL_ADDRESS,
|
||||||
|
);
|
||||||
|
|
||||||
export const MOONISWAP_REGISTRIES_BY_CHAIN_ID = valueByChainId(
|
export const MOONISWAP_REGISTRIES_BY_CHAIN_ID = valueByChainId(
|
||||||
{
|
{
|
||||||
[ChainId.Mainnet]: ['0xbaf9a5d4b0052359326a6cdab54babaa3a3a9643'],
|
[ChainId.Mainnet]: ['0xbaf9a5d4b0052359326a6cdab54babaa3a3a9643'],
|
||||||
@@ -2355,6 +2379,41 @@ export const SPOOKYSWAP_ROUTER_BY_CHAIN_ID = valueByChainId<string>(
|
|||||||
NULL_ADDRESS,
|
NULL_ADDRESS,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
export const GMX_ROUTER_BY_CHAIN_ID = valueByChainId<string>(
|
||||||
|
{
|
||||||
|
[ChainId.Avalanche]: '0x5f719c2f1095f7b9fc68a68e35b51194f4b6abe8',
|
||||||
|
},
|
||||||
|
NULL_ADDRESS,
|
||||||
|
);
|
||||||
|
|
||||||
|
export const GMX_READER_BY_CHAIN_ID = valueByChainId<string>(
|
||||||
|
{
|
||||||
|
[ChainId.Avalanche]: '0x67b789d48c926006f5132bfce4e976f0a7a63d5d',
|
||||||
|
},
|
||||||
|
NULL_ADDRESS,
|
||||||
|
);
|
||||||
|
|
||||||
|
export const GMX_VAULT_BY_CHAIN_ID = valueByChainId<string>(
|
||||||
|
{
|
||||||
|
[ChainId.Avalanche]: '0x9ab2de34a33fb459b538c43f251eb825645e8595',
|
||||||
|
},
|
||||||
|
NULL_ADDRESS,
|
||||||
|
);
|
||||||
|
|
||||||
|
export const PLATYPUS_ROUTER_BY_CHAIN_ID = valueByChainId<string>(
|
||||||
|
{
|
||||||
|
[ChainId.Avalanche]: '0x73256ec7575d999c360c1eec118ecbefd8da7d12',
|
||||||
|
},
|
||||||
|
NULL_ADDRESS,
|
||||||
|
);
|
||||||
|
|
||||||
|
export const YOSHI_ROUTER_BY_CHAIN_ID = valueByChainId<string>(
|
||||||
|
{
|
||||||
|
[ChainId.Fantom]: '0xe4a4642b19c4d0cba965673cd51422b1eda0a78d',
|
||||||
|
},
|
||||||
|
NULL_ADDRESS,
|
||||||
|
);
|
||||||
|
|
||||||
export const VIP_ERC20_BRIDGE_SOURCES_BY_CHAIN_ID = valueByChainId<ERC20BridgeSource[]>(
|
export const VIP_ERC20_BRIDGE_SOURCES_BY_CHAIN_ID = valueByChainId<ERC20BridgeSource[]>(
|
||||||
{
|
{
|
||||||
[ChainId.Mainnet]: [
|
[ChainId.Mainnet]: [
|
||||||
@@ -2412,12 +2471,9 @@ export const DEFAULT_GAS_SCHEDULE: Required<FeeSchedule> = {
|
|||||||
[ERC20BridgeSource.LiquidityProvider]: fillData => {
|
[ERC20BridgeSource.LiquidityProvider]: fillData => {
|
||||||
return (fillData as LiquidityProviderFillData).gasCost || 100e3;
|
return (fillData as LiquidityProviderFillData).gasCost || 100e3;
|
||||||
},
|
},
|
||||||
[ERC20BridgeSource.Eth2Dai]: () => 400e3,
|
|
||||||
[ERC20BridgeSource.Kyber]: () => 450e3,
|
[ERC20BridgeSource.Kyber]: () => 450e3,
|
||||||
[ERC20BridgeSource.Curve]: fillData => (fillData as CurveFillData).pool.gasSchedule,
|
[ERC20BridgeSource.Curve]: fillData => (fillData as CurveFillData).pool.gasSchedule,
|
||||||
[ERC20BridgeSource.CurveV2]: 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,
|
[ERC20BridgeSource.Nerve]: fillData => (fillData as CurveFillData).pool.gasSchedule,
|
||||||
[ERC20BridgeSource.Synapse]: fillData => (fillData as CurveFillData).pool.gasSchedule,
|
[ERC20BridgeSource.Synapse]: fillData => (fillData as CurveFillData).pool.gasSchedule,
|
||||||
[ERC20BridgeSource.Belt]: fillData => (fillData as CurveFillData).pool.gasSchedule,
|
[ERC20BridgeSource.Belt]: fillData => (fillData as CurveFillData).pool.gasSchedule,
|
||||||
@@ -2432,8 +2488,8 @@ export const DEFAULT_GAS_SCHEDULE: Required<FeeSchedule> = {
|
|||||||
[ERC20BridgeSource.UniswapV2]: uniswapV2CloneGasSchedule,
|
[ERC20BridgeSource.UniswapV2]: uniswapV2CloneGasSchedule,
|
||||||
[ERC20BridgeSource.SushiSwap]: uniswapV2CloneGasSchedule,
|
[ERC20BridgeSource.SushiSwap]: uniswapV2CloneGasSchedule,
|
||||||
[ERC20BridgeSource.CryptoCom]: uniswapV2CloneGasSchedule,
|
[ERC20BridgeSource.CryptoCom]: uniswapV2CloneGasSchedule,
|
||||||
[ERC20BridgeSource.Linkswap]: uniswapV2CloneGasSchedule,
|
|
||||||
[ERC20BridgeSource.ShibaSwap]: uniswapV2CloneGasSchedule,
|
[ERC20BridgeSource.ShibaSwap]: uniswapV2CloneGasSchedule,
|
||||||
|
[ERC20BridgeSource.BiSwap]: uniswapV2CloneGasSchedule,
|
||||||
[ERC20BridgeSource.Balancer]: () => 120e3,
|
[ERC20BridgeSource.Balancer]: () => 120e3,
|
||||||
[ERC20BridgeSource.BalancerV2]: (fillData?: FillData) => {
|
[ERC20BridgeSource.BalancerV2]: (fillData?: FillData) => {
|
||||||
return 100e3 + ((fillData as BalancerV2BatchSwapFillData).swapSteps.length - 1) * 50e3;
|
return 100e3 + ((fillData as BalancerV2BatchSwapFillData).swapSteps.length - 1) * 50e3;
|
||||||
@@ -2473,8 +2529,7 @@ export const DEFAULT_GAS_SCHEDULE: Required<FeeSchedule> = {
|
|||||||
return gas;
|
return gas;
|
||||||
},
|
},
|
||||||
[ERC20BridgeSource.KyberDmm]: (fillData?: FillData) => {
|
[ERC20BridgeSource.KyberDmm]: (fillData?: FillData) => {
|
||||||
// TODO: Different base cost if to/from ETH.
|
let gas = 170e3;
|
||||||
let gas = 95e3;
|
|
||||||
const path = (fillData as UniswapV2FillData).tokenAddressPath;
|
const path = (fillData as UniswapV2FillData).tokenAddressPath;
|
||||||
if (path.length > 2) {
|
if (path.length > 2) {
|
||||||
gas += (path.length - 2) * 65e3; // +65k for each hop.
|
gas += (path.length - 2) * 65e3; // +65k for each hop.
|
||||||
@@ -2560,6 +2615,8 @@ export const DEFAULT_GAS_SCHEDULE: Required<FeeSchedule> = {
|
|||||||
//
|
//
|
||||||
[ERC20BridgeSource.Pangolin]: uniswapV2CloneGasSchedule,
|
[ERC20BridgeSource.Pangolin]: uniswapV2CloneGasSchedule,
|
||||||
[ERC20BridgeSource.TraderJoe]: uniswapV2CloneGasSchedule,
|
[ERC20BridgeSource.TraderJoe]: uniswapV2CloneGasSchedule,
|
||||||
|
[ERC20BridgeSource.GMX]: () => 450e3,
|
||||||
|
[ERC20BridgeSource.Platypus]: () => 450e3,
|
||||||
|
|
||||||
//
|
//
|
||||||
// Celo
|
// Celo
|
||||||
@@ -2572,6 +2629,7 @@ export const DEFAULT_GAS_SCHEDULE: Required<FeeSchedule> = {
|
|||||||
[ERC20BridgeSource.MorpheusSwap]: uniswapV2CloneGasSchedule,
|
[ERC20BridgeSource.MorpheusSwap]: uniswapV2CloneGasSchedule,
|
||||||
[ERC20BridgeSource.SpiritSwap]: uniswapV2CloneGasSchedule,
|
[ERC20BridgeSource.SpiritSwap]: uniswapV2CloneGasSchedule,
|
||||||
[ERC20BridgeSource.SpookySwap]: uniswapV2CloneGasSchedule,
|
[ERC20BridgeSource.SpookySwap]: uniswapV2CloneGasSchedule,
|
||||||
|
[ERC20BridgeSource.Yoshi]: uniswapV2CloneGasSchedule,
|
||||||
[ERC20BridgeSource.Beethovenx]: () => 100e3,
|
[ERC20BridgeSource.Beethovenx]: () => 100e3,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@@ -4,12 +4,15 @@ import * as _ from 'lodash';
|
|||||||
|
|
||||||
import { DEFAULT_INFO_LOGGER, INVALID_SIGNATURE } from '../../constants';
|
import { DEFAULT_INFO_LOGGER, INVALID_SIGNATURE } from '../../constants';
|
||||||
import {
|
import {
|
||||||
|
AltRfqMakerAssetOfferings,
|
||||||
AssetSwapperContractAddresses,
|
AssetSwapperContractAddresses,
|
||||||
MarketOperation,
|
MarketOperation,
|
||||||
NativeOrderWithFillableAmounts,
|
NativeOrderWithFillableAmounts,
|
||||||
SignedNativeOrder,
|
SignedNativeOrder,
|
||||||
} from '../../types';
|
} from '../../types';
|
||||||
import { QuoteRequestor } from '../quote_requestor';
|
import { getAltMarketInfo } from '../alt_mm_implementation_utils';
|
||||||
|
import { QuoteRequestor, V4RFQIndicativeQuoteMM } from '../quote_requestor';
|
||||||
|
import { toSignedNativeOrder } from '../rfq_client_mappers';
|
||||||
import {
|
import {
|
||||||
getNativeAdjustedFillableAmountsFromMakerAmount,
|
getNativeAdjustedFillableAmountsFromMakerAmount,
|
||||||
getNativeAdjustedFillableAmountsFromTakerAmount,
|
getNativeAdjustedFillableAmountsFromTakerAmount,
|
||||||
@@ -663,17 +666,49 @@ export class MarketOperationUtils {
|
|||||||
// Timing of RFQT lifecycle
|
// Timing of RFQT lifecycle
|
||||||
const timeStart = new Date().getTime();
|
const timeStart = new Date().getTime();
|
||||||
const { makerToken, takerToken } = nativeOrders[0].order;
|
const { makerToken, takerToken } = nativeOrders[0].order;
|
||||||
|
|
||||||
|
// Filter Alt Rfq Maker Asset Offerings to the current pair
|
||||||
|
const filteredOfferings: AltRfqMakerAssetOfferings = {};
|
||||||
|
if (rfqt.altRfqAssetOfferings) {
|
||||||
|
const endpoints = Object.keys(rfqt.altRfqAssetOfferings);
|
||||||
|
for (const endpoint of endpoints) {
|
||||||
|
// Get the current pair if being offered
|
||||||
|
const offering = getAltMarketInfo(rfqt.altRfqAssetOfferings[endpoint], makerToken, takerToken);
|
||||||
|
if (offering) {
|
||||||
|
filteredOfferings[endpoint] = [offering];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (rfqt.isIndicative) {
|
if (rfqt.isIndicative) {
|
||||||
// An indicative quote is being requested, and indicative quotes price-aware enabled
|
// An indicative quote is being requested, and indicative quotes price-aware enabled
|
||||||
// Make the RFQT request and then re-run the sampler if new orders come back.
|
// Make the RFQT request and then re-run the sampler if new orders come back.
|
||||||
const indicativeQuotes = await rfqt.quoteRequestor.requestRfqtIndicativeQuotesAsync(
|
|
||||||
makerToken,
|
const indicativeQuotes =
|
||||||
takerToken,
|
rfqt.rfqClient !== undefined
|
||||||
amount,
|
? ((
|
||||||
side,
|
await rfqt.rfqClient.getV1PricesAsync({
|
||||||
wholeOrderPrice,
|
altRfqAssetOfferings: filteredOfferings,
|
||||||
rfqt,
|
assetFillAmount: amount,
|
||||||
);
|
chainId: this._sampler.chainId,
|
||||||
|
comparisonPrice: wholeOrderPrice,
|
||||||
|
integratorId: rfqt.integrator.integratorId,
|
||||||
|
intentOnFilling: rfqt.intentOnFilling,
|
||||||
|
makerToken,
|
||||||
|
marketOperation: side,
|
||||||
|
takerAddress: rfqt.takerAddress,
|
||||||
|
takerToken,
|
||||||
|
txOrigin: rfqt.txOrigin,
|
||||||
|
})
|
||||||
|
).prices as V4RFQIndicativeQuoteMM[])
|
||||||
|
: await rfqt.quoteRequestor.requestRfqtIndicativeQuotesAsync(
|
||||||
|
makerToken,
|
||||||
|
takerToken,
|
||||||
|
amount,
|
||||||
|
side,
|
||||||
|
wholeOrderPrice,
|
||||||
|
rfqt,
|
||||||
|
);
|
||||||
const deltaTime = new Date().getTime() - timeStart;
|
const deltaTime = new Date().getTime() - timeStart;
|
||||||
DEFAULT_INFO_LOGGER({
|
DEFAULT_INFO_LOGGER({
|
||||||
rfqQuoteType: 'indicative',
|
rfqQuoteType: 'indicative',
|
||||||
@@ -687,14 +722,31 @@ export class MarketOperationUtils {
|
|||||||
} else {
|
} else {
|
||||||
// A firm quote is being requested, and firm quotes price-aware enabled.
|
// A firm quote is being requested, and firm quotes price-aware enabled.
|
||||||
// Ensure that `intentOnFilling` is enabled and make the request.
|
// Ensure that `intentOnFilling` is enabled and make the request.
|
||||||
const firmQuotes = await rfqt.quoteRequestor.requestRfqtFirmQuotesAsync(
|
const firmQuotes =
|
||||||
makerToken,
|
rfqt.rfqClient !== undefined
|
||||||
takerToken,
|
? (
|
||||||
amount,
|
await rfqt.rfqClient.getV1QuotesAsync({
|
||||||
side,
|
altRfqAssetOfferings: filteredOfferings,
|
||||||
wholeOrderPrice,
|
assetFillAmount: amount,
|
||||||
rfqt,
|
chainId: this._sampler.chainId,
|
||||||
);
|
comparisonPrice: wholeOrderPrice,
|
||||||
|
integratorId: rfqt.integrator.integratorId,
|
||||||
|
intentOnFilling: rfqt.intentOnFilling,
|
||||||
|
makerToken,
|
||||||
|
marketOperation: side,
|
||||||
|
takerAddress: rfqt.takerAddress,
|
||||||
|
takerToken,
|
||||||
|
txOrigin: rfqt.txOrigin,
|
||||||
|
})
|
||||||
|
).quotes.map(toSignedNativeOrder)
|
||||||
|
: await rfqt.quoteRequestor.requestRfqtFirmQuotesAsync(
|
||||||
|
makerToken,
|
||||||
|
takerToken,
|
||||||
|
amount,
|
||||||
|
side,
|
||||||
|
wholeOrderPrice,
|
||||||
|
rfqt,
|
||||||
|
);
|
||||||
const deltaTime = new Date().getTime() - timeStart;
|
const deltaTime = new Date().getTime() - timeStart;
|
||||||
DEFAULT_INFO_LOGGER({
|
DEFAULT_INFO_LOGGER({
|
||||||
rfqQuoteType: 'firm',
|
rfqQuoteType: 'firm',
|
||||||
@@ -777,7 +829,7 @@ export class MarketOperationUtils {
|
|||||||
private async _refreshPoolCacheIfRequiredAsync(takerToken: string, makerToken: string): Promise<void> {
|
private async _refreshPoolCacheIfRequiredAsync(takerToken: string, makerToken: string): Promise<void> {
|
||||||
void Promise.all(
|
void Promise.all(
|
||||||
Object.values(this._sampler.poolsCaches).map(async cache => {
|
Object.values(this._sampler.poolsCaches).map(async cache => {
|
||||||
if (cache.isFresh(takerToken, makerToken)) {
|
if (!cache || cache.isFresh(takerToken, makerToken)) {
|
||||||
return Promise.resolve([]);
|
return Promise.resolve([]);
|
||||||
}
|
}
|
||||||
return cache.getFreshPoolsForPairAsync(takerToken, makerToken);
|
return cache.getFreshPoolsForPairAsync(takerToken, makerToken);
|
||||||
|
@@ -21,6 +21,7 @@ import {
|
|||||||
FinalUniswapV3FillData,
|
FinalUniswapV3FillData,
|
||||||
GeistFillData,
|
GeistFillData,
|
||||||
GenericRouterFillData,
|
GenericRouterFillData,
|
||||||
|
GMXFillData,
|
||||||
KyberDmmFillData,
|
KyberDmmFillData,
|
||||||
KyberFillData,
|
KyberFillData,
|
||||||
LidoFillData,
|
LidoFillData,
|
||||||
@@ -35,6 +36,7 @@ import {
|
|||||||
OptimizedMarketOrder,
|
OptimizedMarketOrder,
|
||||||
OptimizedMarketOrderBase,
|
OptimizedMarketOrderBase,
|
||||||
OrderDomain,
|
OrderDomain,
|
||||||
|
PlatypusFillData,
|
||||||
ShellFillData,
|
ShellFillData,
|
||||||
UniswapV2FillData,
|
UniswapV2FillData,
|
||||||
UniswapV3FillData,
|
UniswapV3FillData,
|
||||||
@@ -111,24 +113,16 @@ export function getErc20BridgeSourceToBridgeSource(source: ERC20BridgeSource): s
|
|||||||
return encodeBridgeSourceId(BridgeProtocol.Mooniswap, 'Mooniswap');
|
return encodeBridgeSourceId(BridgeProtocol.Mooniswap, 'Mooniswap');
|
||||||
case ERC20BridgeSource.MStable:
|
case ERC20BridgeSource.MStable:
|
||||||
return encodeBridgeSourceId(BridgeProtocol.MStable, 'MStable');
|
return encodeBridgeSourceId(BridgeProtocol.MStable, 'MStable');
|
||||||
case ERC20BridgeSource.Eth2Dai:
|
|
||||||
return encodeBridgeSourceId(BridgeProtocol.Oasis, 'Eth2Dai');
|
|
||||||
case ERC20BridgeSource.Shell:
|
case ERC20BridgeSource.Shell:
|
||||||
return encodeBridgeSourceId(BridgeProtocol.Shell, 'Shell');
|
return encodeBridgeSourceId(BridgeProtocol.Shell, 'Shell');
|
||||||
case ERC20BridgeSource.SnowSwap:
|
|
||||||
return encodeBridgeSourceId(BridgeProtocol.Curve, 'SnowSwap');
|
|
||||||
case ERC20BridgeSource.SushiSwap:
|
case ERC20BridgeSource.SushiSwap:
|
||||||
return encodeBridgeSourceId(BridgeProtocol.UniswapV2, 'SushiSwap');
|
return encodeBridgeSourceId(BridgeProtocol.UniswapV2, 'SushiSwap');
|
||||||
case ERC20BridgeSource.Swerve:
|
|
||||||
return encodeBridgeSourceId(BridgeProtocol.Curve, 'Swerve');
|
|
||||||
case ERC20BridgeSource.Uniswap:
|
case ERC20BridgeSource.Uniswap:
|
||||||
return encodeBridgeSourceId(BridgeProtocol.Uniswap, 'Uniswap');
|
return encodeBridgeSourceId(BridgeProtocol.Uniswap, 'Uniswap');
|
||||||
case ERC20BridgeSource.UniswapV2:
|
case ERC20BridgeSource.UniswapV2:
|
||||||
return encodeBridgeSourceId(BridgeProtocol.UniswapV2, 'UniswapV2');
|
return encodeBridgeSourceId(BridgeProtocol.UniswapV2, 'UniswapV2');
|
||||||
case ERC20BridgeSource.DodoV2:
|
case ERC20BridgeSource.DodoV2:
|
||||||
return encodeBridgeSourceId(BridgeProtocol.DodoV2, 'DodoV2');
|
return encodeBridgeSourceId(BridgeProtocol.DodoV2, 'DodoV2');
|
||||||
case ERC20BridgeSource.Linkswap:
|
|
||||||
return encodeBridgeSourceId(BridgeProtocol.UniswapV2, 'Linkswap');
|
|
||||||
case ERC20BridgeSource.PancakeSwap:
|
case ERC20BridgeSource.PancakeSwap:
|
||||||
return encodeBridgeSourceId(BridgeProtocol.UniswapV2, 'PancakeSwap');
|
return encodeBridgeSourceId(BridgeProtocol.UniswapV2, 'PancakeSwap');
|
||||||
case ERC20BridgeSource.PancakeSwapV2:
|
case ERC20BridgeSource.PancakeSwapV2:
|
||||||
@@ -201,6 +195,8 @@ export function getErc20BridgeSourceToBridgeSource(source: ERC20BridgeSource): s
|
|||||||
return encodeBridgeSourceId(BridgeProtocol.UniswapV2, 'SpookySwap');
|
return encodeBridgeSourceId(BridgeProtocol.UniswapV2, 'SpookySwap');
|
||||||
case ERC20BridgeSource.MorpheusSwap:
|
case ERC20BridgeSource.MorpheusSwap:
|
||||||
return encodeBridgeSourceId(BridgeProtocol.UniswapV2, 'MorpheusSwap');
|
return encodeBridgeSourceId(BridgeProtocol.UniswapV2, 'MorpheusSwap');
|
||||||
|
case ERC20BridgeSource.Yoshi:
|
||||||
|
return encodeBridgeSourceId(BridgeProtocol.UniswapV2, 'Yoshi');
|
||||||
case ERC20BridgeSource.AaveV2:
|
case ERC20BridgeSource.AaveV2:
|
||||||
return encodeBridgeSourceId(BridgeProtocol.AaveV2, 'AaveV2');
|
return encodeBridgeSourceId(BridgeProtocol.AaveV2, 'AaveV2');
|
||||||
case ERC20BridgeSource.Compound:
|
case ERC20BridgeSource.Compound:
|
||||||
@@ -209,6 +205,12 @@ export function getErc20BridgeSourceToBridgeSource(source: ERC20BridgeSource): s
|
|||||||
return encodeBridgeSourceId(BridgeProtocol.AaveV2, 'Geist');
|
return encodeBridgeSourceId(BridgeProtocol.AaveV2, 'Geist');
|
||||||
case ERC20BridgeSource.MobiusMoney:
|
case ERC20BridgeSource.MobiusMoney:
|
||||||
return encodeBridgeSourceId(BridgeProtocol.Nerve, 'MobiusMoney');
|
return encodeBridgeSourceId(BridgeProtocol.Nerve, 'MobiusMoney');
|
||||||
|
case ERC20BridgeSource.BiSwap:
|
||||||
|
return encodeBridgeSourceId(BridgeProtocol.UniswapV2, 'BiSwap');
|
||||||
|
case ERC20BridgeSource.GMX:
|
||||||
|
return encodeBridgeSourceId(BridgeProtocol.GMX, 'GMX');
|
||||||
|
case ERC20BridgeSource.Platypus:
|
||||||
|
return encodeBridgeSourceId(BridgeProtocol.Platypus, 'Platypus');
|
||||||
default:
|
default:
|
||||||
throw new Error(AggregationError.NoBridgeForSource);
|
throw new Error(AggregationError.NoBridgeForSource);
|
||||||
}
|
}
|
||||||
@@ -232,8 +234,6 @@ export function createBridgeDataForBridgeOrder(order: OptimizedMarketBridgeOrder
|
|||||||
switch (order.source) {
|
switch (order.source) {
|
||||||
case ERC20BridgeSource.Curve:
|
case ERC20BridgeSource.Curve:
|
||||||
case ERC20BridgeSource.CurveV2:
|
case ERC20BridgeSource.CurveV2:
|
||||||
case ERC20BridgeSource.Swerve:
|
|
||||||
case ERC20BridgeSource.SnowSwap:
|
|
||||||
case ERC20BridgeSource.Nerve:
|
case ERC20BridgeSource.Nerve:
|
||||||
case ERC20BridgeSource.Synapse:
|
case ERC20BridgeSource.Synapse:
|
||||||
case ERC20BridgeSource.Belt:
|
case ERC20BridgeSource.Belt:
|
||||||
@@ -280,7 +280,6 @@ export function createBridgeDataForBridgeOrder(order: OptimizedMarketBridgeOrder
|
|||||||
case ERC20BridgeSource.UniswapV2:
|
case ERC20BridgeSource.UniswapV2:
|
||||||
case ERC20BridgeSource.SushiSwap:
|
case ERC20BridgeSource.SushiSwap:
|
||||||
case ERC20BridgeSource.CryptoCom:
|
case ERC20BridgeSource.CryptoCom:
|
||||||
case ERC20BridgeSource.Linkswap:
|
|
||||||
case ERC20BridgeSource.PancakeSwap:
|
case ERC20BridgeSource.PancakeSwap:
|
||||||
case ERC20BridgeSource.PancakeSwapV2:
|
case ERC20BridgeSource.PancakeSwapV2:
|
||||||
case ERC20BridgeSource.BakerySwap:
|
case ERC20BridgeSource.BakerySwap:
|
||||||
@@ -301,6 +300,8 @@ export function createBridgeDataForBridgeOrder(order: OptimizedMarketBridgeOrder
|
|||||||
case ERC20BridgeSource.SpiritSwap:
|
case ERC20BridgeSource.SpiritSwap:
|
||||||
case ERC20BridgeSource.SpookySwap:
|
case ERC20BridgeSource.SpookySwap:
|
||||||
case ERC20BridgeSource.MorpheusSwap:
|
case ERC20BridgeSource.MorpheusSwap:
|
||||||
|
case ERC20BridgeSource.BiSwap:
|
||||||
|
case ERC20BridgeSource.Yoshi:
|
||||||
const uniswapV2FillData = (order as OptimizedMarketBridgeOrder<UniswapV2FillData>).fillData;
|
const uniswapV2FillData = (order as OptimizedMarketBridgeOrder<UniswapV2FillData>).fillData;
|
||||||
bridgeData = encoder.encode([uniswapV2FillData.router, uniswapV2FillData.tokenAddressPath]);
|
bridgeData = encoder.encode([uniswapV2FillData.router, uniswapV2FillData.tokenAddressPath]);
|
||||||
break;
|
break;
|
||||||
@@ -337,10 +338,6 @@ export function createBridgeDataForBridgeOrder(order: OptimizedMarketBridgeOrder
|
|||||||
const uniFillData = (order as OptimizedMarketBridgeOrder<GenericRouterFillData>).fillData;
|
const uniFillData = (order as OptimizedMarketBridgeOrder<GenericRouterFillData>).fillData;
|
||||||
bridgeData = encoder.encode([uniFillData.router]);
|
bridgeData = encoder.encode([uniFillData.router]);
|
||||||
break;
|
break;
|
||||||
case ERC20BridgeSource.Eth2Dai:
|
|
||||||
const oasisFillData = (order as OptimizedMarketBridgeOrder<GenericRouterFillData>).fillData;
|
|
||||||
bridgeData = encoder.encode([oasisFillData.router]);
|
|
||||||
break;
|
|
||||||
case ERC20BridgeSource.MStable:
|
case ERC20BridgeSource.MStable:
|
||||||
const mStableFillData = (order as OptimizedMarketBridgeOrder<GenericRouterFillData>).fillData;
|
const mStableFillData = (order as OptimizedMarketBridgeOrder<GenericRouterFillData>).fillData;
|
||||||
bridgeData = encoder.encode([mStableFillData.router]);
|
bridgeData = encoder.encode([mStableFillData.router]);
|
||||||
@@ -377,6 +374,23 @@ export function createBridgeDataForBridgeOrder(order: OptimizedMarketBridgeOrder
|
|||||||
const geistFillData = (order as OptimizedMarketBridgeOrder<GeistFillData>).fillData;
|
const geistFillData = (order as OptimizedMarketBridgeOrder<GeistFillData>).fillData;
|
||||||
bridgeData = encoder.encode([geistFillData.lendingPool, geistFillData.gToken]);
|
bridgeData = encoder.encode([geistFillData.lendingPool, geistFillData.gToken]);
|
||||||
break;
|
break;
|
||||||
|
case ERC20BridgeSource.GMX:
|
||||||
|
const gmxFillData = (order as OptimizedMarketBridgeOrder<GMXFillData>).fillData;
|
||||||
|
bridgeData = encoder.encode([
|
||||||
|
gmxFillData.router,
|
||||||
|
gmxFillData.reader,
|
||||||
|
gmxFillData.vault,
|
||||||
|
gmxFillData.tokenAddressPath,
|
||||||
|
]);
|
||||||
|
break;
|
||||||
|
case ERC20BridgeSource.Platypus:
|
||||||
|
const platypusFillData = (order as OptimizedMarketBridgeOrder<PlatypusFillData>).fillData;
|
||||||
|
bridgeData = encoder.encode([
|
||||||
|
platypusFillData.router,
|
||||||
|
platypusFillData.pool,
|
||||||
|
platypusFillData.tokenAddressPath,
|
||||||
|
]);
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
throw new Error(AggregationError.NoBridgeForSource);
|
throw new Error(AggregationError.NoBridgeForSource);
|
||||||
@@ -463,6 +477,8 @@ const balancerV2Encoder = AbiEncoder.create([
|
|||||||
]);
|
]);
|
||||||
const routerAddressPathEncoder = AbiEncoder.create('(address,address[])');
|
const routerAddressPathEncoder = AbiEncoder.create('(address,address[])');
|
||||||
const tokenAddressEncoder = AbiEncoder.create([{ name: 'tokenAddress', type: 'address' }]);
|
const tokenAddressEncoder = AbiEncoder.create([{ name: 'tokenAddress', type: 'address' }]);
|
||||||
|
const gmxAddressPathEncoder = AbiEncoder.create('(address,address,address,address[])');
|
||||||
|
const platypusAddressPathEncoder = AbiEncoder.create('(address,address[],address[])');
|
||||||
|
|
||||||
export const BRIDGE_ENCODERS: {
|
export const BRIDGE_ENCODERS: {
|
||||||
[key in Exclude<
|
[key in Exclude<
|
||||||
@@ -490,8 +506,6 @@ export const BRIDGE_ENCODERS: {
|
|||||||
// Curve like
|
// Curve like
|
||||||
[ERC20BridgeSource.Curve]: curveEncoder,
|
[ERC20BridgeSource.Curve]: curveEncoder,
|
||||||
[ERC20BridgeSource.CurveV2]: curveEncoder,
|
[ERC20BridgeSource.CurveV2]: curveEncoder,
|
||||||
[ERC20BridgeSource.Swerve]: curveEncoder,
|
|
||||||
[ERC20BridgeSource.SnowSwap]: curveEncoder,
|
|
||||||
[ERC20BridgeSource.Nerve]: curveEncoder,
|
[ERC20BridgeSource.Nerve]: curveEncoder,
|
||||||
[ERC20BridgeSource.Synapse]: curveEncoder,
|
[ERC20BridgeSource.Synapse]: curveEncoder,
|
||||||
[ERC20BridgeSource.Belt]: curveEncoder,
|
[ERC20BridgeSource.Belt]: curveEncoder,
|
||||||
@@ -508,13 +522,17 @@ export const BRIDGE_ENCODERS: {
|
|||||||
[ERC20BridgeSource.UniswapV2]: routerAddressPathEncoder,
|
[ERC20BridgeSource.UniswapV2]: routerAddressPathEncoder,
|
||||||
[ERC20BridgeSource.SushiSwap]: routerAddressPathEncoder,
|
[ERC20BridgeSource.SushiSwap]: routerAddressPathEncoder,
|
||||||
[ERC20BridgeSource.CryptoCom]: routerAddressPathEncoder,
|
[ERC20BridgeSource.CryptoCom]: routerAddressPathEncoder,
|
||||||
[ERC20BridgeSource.Linkswap]: routerAddressPathEncoder,
|
|
||||||
[ERC20BridgeSource.ShibaSwap]: routerAddressPathEncoder,
|
[ERC20BridgeSource.ShibaSwap]: routerAddressPathEncoder,
|
||||||
[ERC20BridgeSource.Pangolin]: routerAddressPathEncoder,
|
[ERC20BridgeSource.Pangolin]: routerAddressPathEncoder,
|
||||||
[ERC20BridgeSource.TraderJoe]: routerAddressPathEncoder,
|
[ERC20BridgeSource.TraderJoe]: routerAddressPathEncoder,
|
||||||
[ERC20BridgeSource.SpiritSwap]: routerAddressPathEncoder,
|
[ERC20BridgeSource.SpiritSwap]: routerAddressPathEncoder,
|
||||||
[ERC20BridgeSource.SpookySwap]: routerAddressPathEncoder,
|
[ERC20BridgeSource.SpookySwap]: routerAddressPathEncoder,
|
||||||
[ERC20BridgeSource.MorpheusSwap]: routerAddressPathEncoder,
|
[ERC20BridgeSource.MorpheusSwap]: routerAddressPathEncoder,
|
||||||
|
[ERC20BridgeSource.BiSwap]: routerAddressPathEncoder,
|
||||||
|
[ERC20BridgeSource.Yoshi]: routerAddressPathEncoder,
|
||||||
|
// Avalanche
|
||||||
|
[ERC20BridgeSource.GMX]: gmxAddressPathEncoder,
|
||||||
|
[ERC20BridgeSource.Platypus]: platypusAddressPathEncoder,
|
||||||
// Celo
|
// Celo
|
||||||
[ERC20BridgeSource.UbeSwap]: routerAddressPathEncoder,
|
[ERC20BridgeSource.UbeSwap]: routerAddressPathEncoder,
|
||||||
// BSC
|
// BSC
|
||||||
@@ -536,7 +554,6 @@ export const BRIDGE_ENCODERS: {
|
|||||||
[ERC20BridgeSource.Shell]: poolEncoder,
|
[ERC20BridgeSource.Shell]: poolEncoder,
|
||||||
[ERC20BridgeSource.Component]: poolEncoder,
|
[ERC20BridgeSource.Component]: poolEncoder,
|
||||||
[ERC20BridgeSource.Mooniswap]: poolEncoder,
|
[ERC20BridgeSource.Mooniswap]: poolEncoder,
|
||||||
[ERC20BridgeSource.Eth2Dai]: poolEncoder,
|
|
||||||
[ERC20BridgeSource.MStable]: poolEncoder,
|
[ERC20BridgeSource.MStable]: poolEncoder,
|
||||||
[ERC20BridgeSource.Balancer]: poolEncoder,
|
[ERC20BridgeSource.Balancer]: poolEncoder,
|
||||||
[ERC20BridgeSource.Cream]: poolEncoder,
|
[ERC20BridgeSource.Cream]: poolEncoder,
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
import { getPoolsWithTokens, parsePoolData } from '@balancer-labs/sor';
|
import { getPoolsWithTokens, parsePoolData } from 'balancer-labs-sor-v1';
|
||||||
import { Pool } from '@balancer-labs/sor/dist/types';
|
import { Pool } from 'balancer-labs-sor-v1/dist/types';
|
||||||
import { gql, request } from 'graphql-request';
|
import { gql, request } from 'graphql-request';
|
||||||
|
|
||||||
import { BALANCER_MAX_POOLS_FETCHED, BALANCER_SUBGRAPH_URL, BALANCER_TOP_POOLS_FETCHED } from '../constants';
|
import { BALANCER_MAX_POOLS_FETCHED, BALANCER_SUBGRAPH_URL, BALANCER_TOP_POOLS_FETCHED } from '../constants';
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
import { ChainId } from '@0x/contract-addresses';
|
import { ChainId } from '@0x/contract-addresses';
|
||||||
import { BigNumber } from '@0x/utils';
|
import { BigNumber } from '@0x/utils';
|
||||||
// import { parsePoolData } from '@balancer-labs'; // TODO - upgrade to v2
|
// import { parsePoolData } from '@balancer-labs'; // TODO - upgrade to v2
|
||||||
import { Pool } from '@balancer-labs/sor/dist/types';
|
import { Pool } from 'balancer-labs-sor-v1/dist/types';
|
||||||
import { gql, request } from 'graphql-request';
|
import { gql, request } from 'graphql-request';
|
||||||
|
|
||||||
import { DEFAULT_WARNING_LOGGER } from '../../../constants';
|
import { DEFAULT_WARNING_LOGGER } from '../../../constants';
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
import { Pool } from '@balancer-labs/sor/dist/types';
|
import { Pool } from 'balancer-labs-sor-v1/dist/types';
|
||||||
import { getPoolsWithTokens, parsePoolData } from 'cream-sor';
|
import { getPoolsWithTokens, parsePoolData } from 'cream-sor';
|
||||||
|
|
||||||
import { BALANCER_MAX_POOLS_FETCHED } from '../constants';
|
import { BALANCER_MAX_POOLS_FETCHED } from '../constants';
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
import { Pool } from '@balancer-labs/sor/dist/types';
|
import { Pool } from 'balancer-labs-sor-v1/dist/types';
|
||||||
|
|
||||||
import { ONE_HOUR_IN_SECONDS, ONE_SECOND_MS } from '../constants';
|
import { ONE_HOUR_IN_SECONDS, ONE_SECOND_MS } from '../constants';
|
||||||
export { Pool };
|
export { Pool };
|
||||||
|
@@ -14,6 +14,7 @@ import {
|
|||||||
getCurveLikeInfosForPair,
|
getCurveLikeInfosForPair,
|
||||||
getDodoV2Offsets,
|
getDodoV2Offsets,
|
||||||
getKyberOffsets,
|
getKyberOffsets,
|
||||||
|
getPlatypusInfoForPair,
|
||||||
getShellLikeInfosForPair,
|
getShellLikeInfosForPair,
|
||||||
isAllowedKyberReserveId,
|
isAllowedKyberReserveId,
|
||||||
isBadTokenForSource,
|
isBadTokenForSource,
|
||||||
@@ -23,6 +24,7 @@ import {
|
|||||||
import { CompoundCTokenCache } from './compound_ctoken_cache';
|
import { CompoundCTokenCache } from './compound_ctoken_cache';
|
||||||
import {
|
import {
|
||||||
AAVE_V2_SUBGRAPH_URL_BY_CHAIN_ID,
|
AAVE_V2_SUBGRAPH_URL_BY_CHAIN_ID,
|
||||||
|
AVALANCHE_TOKENS,
|
||||||
BALANCER_V2_VAULT_ADDRESS_BY_CHAIN,
|
BALANCER_V2_VAULT_ADDRESS_BY_CHAIN,
|
||||||
BANCOR_REGISTRY_BY_CHAIN_ID,
|
BANCOR_REGISTRY_BY_CHAIN_ID,
|
||||||
BEETHOVEN_X_SUBGRAPH_URL_BY_CHAIN,
|
BEETHOVEN_X_SUBGRAPH_URL_BY_CHAIN,
|
||||||
@@ -30,18 +32,20 @@ import {
|
|||||||
COMPOUND_API_URL_BY_CHAIN_ID,
|
COMPOUND_API_URL_BY_CHAIN_ID,
|
||||||
DODOV1_CONFIG_BY_CHAIN_ID,
|
DODOV1_CONFIG_BY_CHAIN_ID,
|
||||||
DODOV2_FACTORIES_BY_CHAIN_ID,
|
DODOV2_FACTORIES_BY_CHAIN_ID,
|
||||||
|
GMX_READER_BY_CHAIN_ID,
|
||||||
|
GMX_ROUTER_BY_CHAIN_ID,
|
||||||
|
GMX_VAULT_BY_CHAIN_ID,
|
||||||
KYBER_CONFIG_BY_CHAIN_ID,
|
KYBER_CONFIG_BY_CHAIN_ID,
|
||||||
KYBER_DMM_ROUTER_BY_CHAIN_ID,
|
KYBER_DMM_ROUTER_BY_CHAIN_ID,
|
||||||
LIDO_INFO_BY_CHAIN,
|
LIDO_INFO_BY_CHAIN,
|
||||||
LINKSWAP_ROUTER_BY_CHAIN_ID,
|
|
||||||
LIQUIDITY_PROVIDER_REGISTRY_BY_CHAIN_ID,
|
LIQUIDITY_PROVIDER_REGISTRY_BY_CHAIN_ID,
|
||||||
MAINNET_TOKENS,
|
|
||||||
MAKER_PSM_INFO_BY_CHAIN_ID,
|
MAKER_PSM_INFO_BY_CHAIN_ID,
|
||||||
MAX_UINT256,
|
MAX_UINT256,
|
||||||
MOONISWAP_REGISTRIES_BY_CHAIN_ID,
|
MOONISWAP_REGISTRIES_BY_CHAIN_ID,
|
||||||
NATIVE_FEE_TOKEN_BY_CHAIN_ID,
|
NATIVE_FEE_TOKEN_BY_CHAIN_ID,
|
||||||
NULL_ADDRESS,
|
NULL_ADDRESS,
|
||||||
NULL_BYTES,
|
NULL_BYTES,
|
||||||
|
PLATYPUS_ROUTER_BY_CHAIN_ID,
|
||||||
SELL_SOURCE_FILTER_BY_CHAIN_ID,
|
SELL_SOURCE_FILTER_BY_CHAIN_ID,
|
||||||
UNISWAPV1_ROUTER_BY_CHAIN_ID,
|
UNISWAPV1_ROUTER_BY_CHAIN_ID,
|
||||||
UNISWAPV3_CONFIG_BY_CHAIN_ID,
|
UNISWAPV3_CONFIG_BY_CHAIN_ID,
|
||||||
@@ -74,6 +78,7 @@ import {
|
|||||||
GeistFillData,
|
GeistFillData,
|
||||||
GeistInfo,
|
GeistInfo,
|
||||||
GenericRouterFillData,
|
GenericRouterFillData,
|
||||||
|
GMXFillData,
|
||||||
HopInfo,
|
HopInfo,
|
||||||
KyberDmmFillData,
|
KyberDmmFillData,
|
||||||
KyberFillData,
|
KyberFillData,
|
||||||
@@ -85,6 +90,7 @@ import {
|
|||||||
MakerPsmFillData,
|
MakerPsmFillData,
|
||||||
MooniswapFillData,
|
MooniswapFillData,
|
||||||
MultiHopFillData,
|
MultiHopFillData,
|
||||||
|
PlatypusFillData,
|
||||||
PsmInfo,
|
PsmInfo,
|
||||||
ShellFillData,
|
ShellFillData,
|
||||||
SourceQuoteOperation,
|
SourceQuoteOperation,
|
||||||
@@ -107,7 +113,7 @@ export const TWO_HOP_SOURCE_FILTERS = SourceFilters.all().exclude([
|
|||||||
export const BATCH_SOURCE_FILTERS = SourceFilters.all().exclude([ERC20BridgeSource.MultiHop, ERC20BridgeSource.Native]);
|
export const BATCH_SOURCE_FILTERS = SourceFilters.all().exclude([ERC20BridgeSource.MultiHop, ERC20BridgeSource.Native]);
|
||||||
|
|
||||||
export type PoolsCacheMap = { [key in Exclude<SourcesWithPoolsCache, ERC20BridgeSource.BalancerV2>]: PoolsCache } & {
|
export type PoolsCacheMap = { [key in Exclude<SourcesWithPoolsCache, ERC20BridgeSource.BalancerV2>]: PoolsCache } & {
|
||||||
[ERC20BridgeSource.BalancerV2]: BalancerV2SwapInfoCache;
|
[ERC20BridgeSource.BalancerV2]: BalancerV2SwapInfoCache | undefined;
|
||||||
};
|
};
|
||||||
|
|
||||||
// tslint:disable:no-inferred-empty-object-type no-unbound-method
|
// tslint:disable:no-inferred-empty-object-type no-unbound-method
|
||||||
@@ -151,7 +157,10 @@ export class SamplerOperations {
|
|||||||
),
|
),
|
||||||
[ERC20BridgeSource.Balancer]: new BalancerPoolsCache(),
|
[ERC20BridgeSource.Balancer]: new BalancerPoolsCache(),
|
||||||
[ERC20BridgeSource.Cream]: new CreamPoolsCache(),
|
[ERC20BridgeSource.Cream]: new CreamPoolsCache(),
|
||||||
[ERC20BridgeSource.BalancerV2]: new BalancerV2SwapInfoCache(chainId),
|
[ERC20BridgeSource.BalancerV2]:
|
||||||
|
BALANCER_V2_VAULT_ADDRESS_BY_CHAIN[chainId] === NULL_ADDRESS
|
||||||
|
? undefined
|
||||||
|
: new BalancerV2SwapInfoCache(chainId),
|
||||||
};
|
};
|
||||||
|
|
||||||
const aaveSubgraphUrl = AAVE_V2_SUBGRAPH_URL_BY_CHAIN_ID[chainId];
|
const aaveSubgraphUrl = AAVE_V2_SUBGRAPH_URL_BY_CHAIN_ID[chainId];
|
||||||
@@ -571,7 +580,7 @@ export class SamplerOperations {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public getBalancerV2MulthopSellQuotes(
|
public getBalancerV2MultihopSellQuotes(
|
||||||
vault: string,
|
vault: string,
|
||||||
quoteSwaps: BalancerSwapInfo, // Should always be sell swap steps.
|
quoteSwaps: BalancerSwapInfo, // Should always be sell swap steps.
|
||||||
fillSwaps: BalancerSwapInfo, // Should always be sell swap steps.
|
fillSwaps: BalancerSwapInfo, // Should always be sell swap steps.
|
||||||
@@ -592,7 +601,7 @@ export class SamplerOperations {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public getBalancerV2MulthopBuyQuotes(
|
public getBalancerV2MultihopBuyQuotes(
|
||||||
vault: string,
|
vault: string,
|
||||||
quoteSwaps: BalancerSwapInfo, // Should always be buy swap steps.
|
quoteSwaps: BalancerSwapInfo, // Should always be buy swap steps.
|
||||||
fillSwaps: BalancerSwapInfo, // Should always be a sell quote.
|
fillSwaps: BalancerSwapInfo, // Should always be a sell quote.
|
||||||
@@ -1264,6 +1273,66 @@ export class SamplerOperations {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public getGMXSellQuotes(
|
||||||
|
router: string,
|
||||||
|
reader: string,
|
||||||
|
vault: string,
|
||||||
|
tokenAddressPath: string[],
|
||||||
|
takerFillAmounts: BigNumber[],
|
||||||
|
): SourceQuoteOperation<GMXFillData> {
|
||||||
|
return new SamplerContractOperation({
|
||||||
|
source: ERC20BridgeSource.GMX,
|
||||||
|
fillData: { router, reader, vault, tokenAddressPath },
|
||||||
|
contract: this._samplerContract,
|
||||||
|
function: this._samplerContract.sampleSellsFromGMX,
|
||||||
|
params: [reader, vault, tokenAddressPath, takerFillAmounts],
|
||||||
|
});
|
||||||
|
}
|
||||||
|
public getGMXBuyQuotes(
|
||||||
|
router: string,
|
||||||
|
reader: string,
|
||||||
|
vault: string,
|
||||||
|
tokenAddressPath: string[],
|
||||||
|
makerFillAmounts: BigNumber[],
|
||||||
|
): SourceQuoteOperation<GMXFillData> {
|
||||||
|
return new SamplerContractOperation({
|
||||||
|
source: ERC20BridgeSource.GMX,
|
||||||
|
fillData: { router, reader, vault, tokenAddressPath },
|
||||||
|
contract: this._samplerContract,
|
||||||
|
function: this._samplerContract.sampleBuysFromGMX,
|
||||||
|
params: [reader, vault, tokenAddressPath, makerFillAmounts],
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public getPlatypusSellQuotes(
|
||||||
|
router: string,
|
||||||
|
pool: string[],
|
||||||
|
tokenAddressPath: string[],
|
||||||
|
takerFillAmounts: BigNumber[],
|
||||||
|
): SourceQuoteOperation<PlatypusFillData> {
|
||||||
|
return new SamplerContractOperation({
|
||||||
|
source: ERC20BridgeSource.Platypus,
|
||||||
|
fillData: { router, pool, tokenAddressPath },
|
||||||
|
contract: this._samplerContract,
|
||||||
|
function: this._samplerContract.sampleSellsFromPlatypus,
|
||||||
|
params: [pool[0], tokenAddressPath, takerFillAmounts],
|
||||||
|
});
|
||||||
|
}
|
||||||
|
public getPlatypusBuyQuotes(
|
||||||
|
router: string,
|
||||||
|
pool: string[],
|
||||||
|
tokenAddressPath: string[],
|
||||||
|
makerFillAmounts: BigNumber[],
|
||||||
|
): SourceQuoteOperation<PlatypusFillData> {
|
||||||
|
return new SamplerContractOperation({
|
||||||
|
source: ERC20BridgeSource.Platypus,
|
||||||
|
fillData: { router, pool, tokenAddressPath },
|
||||||
|
contract: this._samplerContract,
|
||||||
|
function: this._samplerContract.sampleBuysFromPlatypus,
|
||||||
|
params: [pool[0], tokenAddressPath, makerFillAmounts],
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
public getMedianSellRate(
|
public getMedianSellRate(
|
||||||
sources: ERC20BridgeSource[],
|
sources: ERC20BridgeSource[],
|
||||||
makerToken: string,
|
makerToken: string,
|
||||||
@@ -1349,7 +1418,7 @@ export class SamplerOperations {
|
|||||||
takerFillAmounts: BigNumber[],
|
takerFillAmounts: BigNumber[],
|
||||||
tokenAdjacencyGraph: TokenAdjacencyGraph = this.tokenAdjacencyGraph,
|
tokenAdjacencyGraph: TokenAdjacencyGraph = this.tokenAdjacencyGraph,
|
||||||
): SourceQuoteOperation[] {
|
): SourceQuoteOperation[] {
|
||||||
// Find the adjacent tokens in the provided tooken adjacency graph,
|
// Find the adjacent tokens in the provided token adjacency graph,
|
||||||
// e.g if this is DAI->USDC we may check for DAI->WETH->USDC
|
// e.g if this is DAI->USDC we may check for DAI->WETH->USDC
|
||||||
const intermediateTokens = getIntermediateTokens(makerToken, takerToken, tokenAdjacencyGraph);
|
const intermediateTokens = getIntermediateTokens(makerToken, takerToken, tokenAdjacencyGraph);
|
||||||
// Drop out MultiHop and Native as we do not query those here.
|
// Drop out MultiHop and Native as we do not query those here.
|
||||||
@@ -1362,8 +1431,6 @@ export class SamplerOperations {
|
|||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
switch (source) {
|
switch (source) {
|
||||||
case ERC20BridgeSource.Eth2Dai:
|
|
||||||
return [];
|
|
||||||
case ERC20BridgeSource.Uniswap:
|
case ERC20BridgeSource.Uniswap:
|
||||||
return isValidAddress(UNISWAPV1_ROUTER_BY_CHAIN_ID[this.chainId])
|
return isValidAddress(UNISWAPV1_ROUTER_BY_CHAIN_ID[this.chainId])
|
||||||
? this.getUniswapSellQuotes(
|
? this.getUniswapSellQuotes(
|
||||||
@@ -1395,7 +1462,9 @@ export class SamplerOperations {
|
|||||||
case ERC20BridgeSource.UbeSwap:
|
case ERC20BridgeSource.UbeSwap:
|
||||||
case ERC20BridgeSource.SpiritSwap:
|
case ERC20BridgeSource.SpiritSwap:
|
||||||
case ERC20BridgeSource.SpookySwap:
|
case ERC20BridgeSource.SpookySwap:
|
||||||
|
case ERC20BridgeSource.Yoshi:
|
||||||
case ERC20BridgeSource.MorpheusSwap:
|
case ERC20BridgeSource.MorpheusSwap:
|
||||||
|
case ERC20BridgeSource.BiSwap:
|
||||||
const uniLikeRouter = uniswapV2LikeRouterAddress(this.chainId, source);
|
const uniLikeRouter = uniswapV2LikeRouterAddress(this.chainId, source);
|
||||||
if (!isValidAddress(uniLikeRouter)) {
|
if (!isValidAddress(uniLikeRouter)) {
|
||||||
return [];
|
return [];
|
||||||
@@ -1422,8 +1491,6 @@ export class SamplerOperations {
|
|||||||
);
|
);
|
||||||
case ERC20BridgeSource.Curve:
|
case ERC20BridgeSource.Curve:
|
||||||
case ERC20BridgeSource.CurveV2:
|
case ERC20BridgeSource.CurveV2:
|
||||||
case ERC20BridgeSource.Swerve:
|
|
||||||
case ERC20BridgeSource.SnowSwap:
|
|
||||||
case ERC20BridgeSource.Nerve:
|
case ERC20BridgeSource.Nerve:
|
||||||
case ERC20BridgeSource.Synapse:
|
case ERC20BridgeSource.Synapse:
|
||||||
case ERC20BridgeSource.Belt:
|
case ERC20BridgeSource.Belt:
|
||||||
@@ -1499,15 +1566,19 @@ export class SamplerOperations {
|
|||||||
),
|
),
|
||||||
);
|
);
|
||||||
case ERC20BridgeSource.BalancerV2: {
|
case ERC20BridgeSource.BalancerV2: {
|
||||||
const swaps = this.poolsCaches[source].getCachedSwapInfoForPair(takerToken, makerToken);
|
const cache = this.poolsCaches[source];
|
||||||
|
if (!cache) {
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
|
||||||
|
const swaps = cache.getCachedSwapInfoForPair(takerToken, makerToken);
|
||||||
const vault = BALANCER_V2_VAULT_ADDRESS_BY_CHAIN[this.chainId];
|
const vault = BALANCER_V2_VAULT_ADDRESS_BY_CHAIN[this.chainId];
|
||||||
if (!swaps || vault === NULL_ADDRESS) {
|
if (!swaps || vault === NULL_ADDRESS) {
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
// Changed to retrieve queryBatchSwap for swap steps > 1 of length
|
// Changed to retrieve queryBatchSwap for swap steps > 1 of length
|
||||||
return swaps.swapInfoExactIn.map(swapInfo =>
|
return swaps.swapInfoExactIn.map(swapInfo =>
|
||||||
this.getBalancerV2MulthopSellQuotes(vault, swapInfo, swapInfo, takerFillAmounts, source),
|
this.getBalancerV2MultihopSellQuotes(vault, swapInfo, swapInfo, takerFillAmounts, source),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
case ERC20BridgeSource.Beethovenx: {
|
case ERC20BridgeSource.Beethovenx: {
|
||||||
@@ -1579,23 +1650,6 @@ export class SamplerOperations {
|
|||||||
takerToken,
|
takerToken,
|
||||||
takerFillAmounts,
|
takerFillAmounts,
|
||||||
);
|
);
|
||||||
case ERC20BridgeSource.Linkswap:
|
|
||||||
if (!isValidAddress(LINKSWAP_ROUTER_BY_CHAIN_ID[this.chainId])) {
|
|
||||||
return [];
|
|
||||||
}
|
|
||||||
return [
|
|
||||||
[takerToken, makerToken],
|
|
||||||
...getIntermediateTokens(makerToken, takerToken, {
|
|
||||||
default: [MAINNET_TOKENS.LINK, MAINNET_TOKENS.WETH],
|
|
||||||
}).map(t => [takerToken, t, makerToken]),
|
|
||||||
].map(path =>
|
|
||||||
this.getUniswapV2SellQuotes(
|
|
||||||
LINKSWAP_ROUTER_BY_CHAIN_ID[this.chainId],
|
|
||||||
path,
|
|
||||||
takerFillAmounts,
|
|
||||||
ERC20BridgeSource.Linkswap,
|
|
||||||
),
|
|
||||||
);
|
|
||||||
case ERC20BridgeSource.MakerPsm:
|
case ERC20BridgeSource.MakerPsm:
|
||||||
const psmInfo = MAKER_PSM_INFO_BY_CHAIN_ID[this.chainId];
|
const psmInfo = MAKER_PSM_INFO_BY_CHAIN_ID[this.chainId];
|
||||||
if (!isValidAddress(psmInfo.psmAddress)) {
|
if (!isValidAddress(psmInfo.psmAddress)) {
|
||||||
@@ -1664,6 +1718,29 @@ export class SamplerOperations {
|
|||||||
takerFillAmounts,
|
takerFillAmounts,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
case ERC20BridgeSource.GMX: {
|
||||||
|
// low liquidity mim pool dont quote
|
||||||
|
if (takerToken === AVALANCHE_TOKENS.MIM || makerToken === 'AVALANCHE_TOKENS.MIM') {
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
return this.getGMXSellQuotes(
|
||||||
|
GMX_ROUTER_BY_CHAIN_ID[this.chainId],
|
||||||
|
GMX_READER_BY_CHAIN_ID[this.chainId],
|
||||||
|
GMX_VAULT_BY_CHAIN_ID[this.chainId],
|
||||||
|
[takerToken, makerToken],
|
||||||
|
takerFillAmounts,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
case ERC20BridgeSource.Platypus: {
|
||||||
|
return getPlatypusInfoForPair(this.chainId, takerToken, makerToken).map(pool =>
|
||||||
|
this.getPlatypusSellQuotes(
|
||||||
|
PLATYPUS_ROUTER_BY_CHAIN_ID[this.chainId],
|
||||||
|
[pool.poolAddress],
|
||||||
|
[takerToken, makerToken],
|
||||||
|
takerFillAmounts,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
default:
|
default:
|
||||||
throw new Error(`Unsupported sell sample source: ${source}`);
|
throw new Error(`Unsupported sell sample source: ${source}`);
|
||||||
}
|
}
|
||||||
@@ -1685,8 +1762,6 @@ export class SamplerOperations {
|
|||||||
return _.flatten(
|
return _.flatten(
|
||||||
_sources.map((source): SourceQuoteOperation | SourceQuoteOperation[] => {
|
_sources.map((source): SourceQuoteOperation | SourceQuoteOperation[] => {
|
||||||
switch (source) {
|
switch (source) {
|
||||||
case ERC20BridgeSource.Eth2Dai:
|
|
||||||
return [];
|
|
||||||
case ERC20BridgeSource.Uniswap:
|
case ERC20BridgeSource.Uniswap:
|
||||||
return isValidAddress(UNISWAPV1_ROUTER_BY_CHAIN_ID[this.chainId])
|
return isValidAddress(UNISWAPV1_ROUTER_BY_CHAIN_ID[this.chainId])
|
||||||
? this.getUniswapBuyQuotes(
|
? this.getUniswapBuyQuotes(
|
||||||
@@ -1718,7 +1793,9 @@ export class SamplerOperations {
|
|||||||
case ERC20BridgeSource.UbeSwap:
|
case ERC20BridgeSource.UbeSwap:
|
||||||
case ERC20BridgeSource.SpiritSwap:
|
case ERC20BridgeSource.SpiritSwap:
|
||||||
case ERC20BridgeSource.SpookySwap:
|
case ERC20BridgeSource.SpookySwap:
|
||||||
|
case ERC20BridgeSource.Yoshi:
|
||||||
case ERC20BridgeSource.MorpheusSwap:
|
case ERC20BridgeSource.MorpheusSwap:
|
||||||
|
case ERC20BridgeSource.BiSwap:
|
||||||
const uniLikeRouter = uniswapV2LikeRouterAddress(this.chainId, source);
|
const uniLikeRouter = uniswapV2LikeRouterAddress(this.chainId, source);
|
||||||
if (!isValidAddress(uniLikeRouter)) {
|
if (!isValidAddress(uniLikeRouter)) {
|
||||||
return [];
|
return [];
|
||||||
@@ -1745,8 +1822,6 @@ export class SamplerOperations {
|
|||||||
);
|
);
|
||||||
case ERC20BridgeSource.Curve:
|
case ERC20BridgeSource.Curve:
|
||||||
case ERC20BridgeSource.CurveV2:
|
case ERC20BridgeSource.CurveV2:
|
||||||
case ERC20BridgeSource.Swerve:
|
|
||||||
case ERC20BridgeSource.SnowSwap:
|
|
||||||
case ERC20BridgeSource.Nerve:
|
case ERC20BridgeSource.Nerve:
|
||||||
case ERC20BridgeSource.Synapse:
|
case ERC20BridgeSource.Synapse:
|
||||||
case ERC20BridgeSource.Belt:
|
case ERC20BridgeSource.Belt:
|
||||||
@@ -1822,15 +1897,19 @@ export class SamplerOperations {
|
|||||||
),
|
),
|
||||||
);
|
);
|
||||||
case ERC20BridgeSource.BalancerV2: {
|
case ERC20BridgeSource.BalancerV2: {
|
||||||
const swaps = this.poolsCaches[source].getCachedSwapInfoForPair(takerToken, makerToken);
|
const cache = this.poolsCaches[source];
|
||||||
|
if (!cache) {
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
|
||||||
|
const swaps = cache.getCachedSwapInfoForPair(takerToken, makerToken);
|
||||||
const vault = BALANCER_V2_VAULT_ADDRESS_BY_CHAIN[this.chainId];
|
const vault = BALANCER_V2_VAULT_ADDRESS_BY_CHAIN[this.chainId];
|
||||||
if (!swaps || vault === NULL_ADDRESS) {
|
if (!swaps || vault === NULL_ADDRESS) {
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
// Changed to retrieve queryBatchSwap for swap steps > 1 of length
|
// Changed to retrieve queryBatchSwap for swap steps > 1 of length
|
||||||
return swaps.swapInfoExactOut.map((quoteSwapInfo, i) =>
|
return swaps.swapInfoExactOut.map((quoteSwapInfo, i) =>
|
||||||
this.getBalancerV2MulthopBuyQuotes(
|
this.getBalancerV2MultihopBuyQuotes(
|
||||||
vault,
|
vault,
|
||||||
quoteSwapInfo,
|
quoteSwapInfo,
|
||||||
swaps.swapInfoExactIn[i],
|
swaps.swapInfoExactIn[i],
|
||||||
@@ -1902,24 +1981,6 @@ export class SamplerOperations {
|
|||||||
// Unimplemented
|
// Unimplemented
|
||||||
// return this.getBancorBuyQuotes(makerToken, takerToken, makerFillAmounts);
|
// return this.getBancorBuyQuotes(makerToken, takerToken, makerFillAmounts);
|
||||||
return [];
|
return [];
|
||||||
case ERC20BridgeSource.Linkswap:
|
|
||||||
if (!isValidAddress(LINKSWAP_ROUTER_BY_CHAIN_ID[this.chainId])) {
|
|
||||||
return [];
|
|
||||||
}
|
|
||||||
return [
|
|
||||||
[takerToken, makerToken],
|
|
||||||
// LINK is the base asset in many of the pools on Linkswap
|
|
||||||
...getIntermediateTokens(makerToken, takerToken, {
|
|
||||||
default: [MAINNET_TOKENS.LINK, MAINNET_TOKENS.WETH],
|
|
||||||
}).map(t => [takerToken, t, makerToken]),
|
|
||||||
].map(path =>
|
|
||||||
this.getUniswapV2BuyQuotes(
|
|
||||||
LINKSWAP_ROUTER_BY_CHAIN_ID[this.chainId],
|
|
||||||
path,
|
|
||||||
makerFillAmounts,
|
|
||||||
ERC20BridgeSource.Linkswap,
|
|
||||||
),
|
|
||||||
);
|
|
||||||
case ERC20BridgeSource.MakerPsm:
|
case ERC20BridgeSource.MakerPsm:
|
||||||
const psmInfo = MAKER_PSM_INFO_BY_CHAIN_ID[this.chainId];
|
const psmInfo = MAKER_PSM_INFO_BY_CHAIN_ID[this.chainId];
|
||||||
if (!isValidAddress(psmInfo.psmAddress)) {
|
if (!isValidAddress(psmInfo.psmAddress)) {
|
||||||
@@ -1983,6 +2044,29 @@ export class SamplerOperations {
|
|||||||
}
|
}
|
||||||
return this.getCompoundBuyQuotes(cToken.tokenAddress, makerToken, takerToken, makerFillAmounts);
|
return this.getCompoundBuyQuotes(cToken.tokenAddress, makerToken, takerToken, makerFillAmounts);
|
||||||
}
|
}
|
||||||
|
case ERC20BridgeSource.GMX: {
|
||||||
|
// bad mim pool dont quote
|
||||||
|
if (takerToken === 'AVALANCHE_TOKENS.MIM' || makerToken === 'AVALANCHE_TOKENS.MIM') {
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
return this.getGMXBuyQuotes(
|
||||||
|
GMX_ROUTER_BY_CHAIN_ID[this.chainId],
|
||||||
|
GMX_READER_BY_CHAIN_ID[this.chainId],
|
||||||
|
GMX_VAULT_BY_CHAIN_ID[this.chainId],
|
||||||
|
[takerToken, makerToken],
|
||||||
|
makerFillAmounts,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
case ERC20BridgeSource.Platypus: {
|
||||||
|
return getPlatypusInfoForPair(this.chainId, takerToken, makerToken).map(pool =>
|
||||||
|
this.getPlatypusBuyQuotes(
|
||||||
|
PLATYPUS_ROUTER_BY_CHAIN_ID[this.chainId],
|
||||||
|
[pool.poolAddress],
|
||||||
|
[takerToken, makerToken],
|
||||||
|
makerFillAmounts,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
default:
|
default:
|
||||||
throw new Error(`Unsupported buy sample source: ${source}`);
|
throw new Error(`Unsupported buy sample source: ${source}`);
|
||||||
}
|
}
|
||||||
|
@@ -8,6 +8,7 @@ import { BigNumber } from '@0x/utils';
|
|||||||
|
|
||||||
import { NativeOrderWithFillableAmounts, RfqFirmQuoteValidator, RfqRequestOpts } from '../../types';
|
import { NativeOrderWithFillableAmounts, RfqFirmQuoteValidator, RfqRequestOpts } from '../../types';
|
||||||
import { QuoteRequestor, V4RFQIndicativeQuoteMM } from '../../utils/quote_requestor';
|
import { QuoteRequestor, V4RFQIndicativeQuoteMM } from '../../utils/quote_requestor';
|
||||||
|
import { IRfqClient } from '../irfq_client';
|
||||||
import { ExtendedQuoteReportSources, PriceComparisonsReport, QuoteReport } from '../quote_report_generator';
|
import { ExtendedQuoteReportSources, PriceComparisonsReport, QuoteReport } from '../quote_report_generator';
|
||||||
|
|
||||||
import { SourceFilters } from './source_filters';
|
import { SourceFilters } from './source_filters';
|
||||||
@@ -37,7 +38,6 @@ export enum ERC20BridgeSource {
|
|||||||
Native = 'Native',
|
Native = 'Native',
|
||||||
Uniswap = 'Uniswap',
|
Uniswap = 'Uniswap',
|
||||||
UniswapV2 = 'Uniswap_V2',
|
UniswapV2 = 'Uniswap_V2',
|
||||||
Eth2Dai = 'Eth2Dai',
|
|
||||||
Kyber = 'Kyber',
|
Kyber = 'Kyber',
|
||||||
Curve = 'Curve',
|
Curve = 'Curve',
|
||||||
LiquidityProvider = 'LiquidityProvider',
|
LiquidityProvider = 'LiquidityProvider',
|
||||||
@@ -51,13 +51,10 @@ export enum ERC20BridgeSource {
|
|||||||
Mooniswap = 'Mooniswap',
|
Mooniswap = 'Mooniswap',
|
||||||
MultiHop = 'MultiHop',
|
MultiHop = 'MultiHop',
|
||||||
Shell = 'Shell',
|
Shell = 'Shell',
|
||||||
Swerve = 'Swerve',
|
|
||||||
SnowSwap = 'SnowSwap',
|
|
||||||
SushiSwap = 'SushiSwap',
|
SushiSwap = 'SushiSwap',
|
||||||
Dodo = 'DODO',
|
Dodo = 'DODO',
|
||||||
DodoV2 = 'DODO_V2',
|
DodoV2 = 'DODO_V2',
|
||||||
CryptoCom = 'CryptoCom',
|
CryptoCom = 'CryptoCom',
|
||||||
Linkswap = 'Linkswap',
|
|
||||||
KyberDmm = 'KyberDMM',
|
KyberDmm = 'KyberDMM',
|
||||||
Smoothy = 'Smoothy',
|
Smoothy = 'Smoothy',
|
||||||
Component = 'Component',
|
Component = 'Component',
|
||||||
@@ -73,6 +70,7 @@ export enum ERC20BridgeSource {
|
|||||||
// BSC only
|
// BSC only
|
||||||
PancakeSwap = 'PancakeSwap',
|
PancakeSwap = 'PancakeSwap',
|
||||||
PancakeSwapV2 = 'PancakeSwap_V2',
|
PancakeSwapV2 = 'PancakeSwap_V2',
|
||||||
|
BiSwap = 'BiSwap',
|
||||||
BakerySwap = 'BakerySwap',
|
BakerySwap = 'BakerySwap',
|
||||||
Nerve = 'Nerve',
|
Nerve = 'Nerve',
|
||||||
Belt = 'Belt',
|
Belt = 'Belt',
|
||||||
@@ -94,6 +92,9 @@ export enum ERC20BridgeSource {
|
|||||||
// Avalanche
|
// Avalanche
|
||||||
Pangolin = 'Pangolin',
|
Pangolin = 'Pangolin',
|
||||||
TraderJoe = 'TraderJoe',
|
TraderJoe = 'TraderJoe',
|
||||||
|
Platypus = 'Platypus',
|
||||||
|
// tslint:disable: enum-naming
|
||||||
|
GMX = 'GMX',
|
||||||
// Celo only
|
// Celo only
|
||||||
UbeSwap = 'UbeSwap',
|
UbeSwap = 'UbeSwap',
|
||||||
MobiusMoney = 'MobiusMoney',
|
MobiusMoney = 'MobiusMoney',
|
||||||
@@ -102,6 +103,7 @@ export enum ERC20BridgeSource {
|
|||||||
SpookySwap = 'SpookySwap',
|
SpookySwap = 'SpookySwap',
|
||||||
Beethovenx = 'Beethovenx',
|
Beethovenx = 'Beethovenx',
|
||||||
MorpheusSwap = 'MorpheusSwap',
|
MorpheusSwap = 'MorpheusSwap',
|
||||||
|
Yoshi = 'Yoshi',
|
||||||
Geist = 'Geist',
|
Geist = 'Geist',
|
||||||
}
|
}
|
||||||
export type SourcesWithPoolsCache =
|
export type SourcesWithPoolsCache =
|
||||||
@@ -353,6 +355,24 @@ export interface GeistFillData extends FillData {
|
|||||||
takerToken: string;
|
takerToken: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface PlatypusInfo {
|
||||||
|
poolAddress: string;
|
||||||
|
tokens: string[];
|
||||||
|
gasSchedule: number;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface GMXFillData extends FillData {
|
||||||
|
router: string;
|
||||||
|
reader: string;
|
||||||
|
vault: string;
|
||||||
|
tokenAddressPath: string[];
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface PlatypusFillData extends FillData {
|
||||||
|
router: string;
|
||||||
|
pool: string[];
|
||||||
|
tokenAddressPath: string[];
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
* Represents a node on a fill path.
|
* Represents a node on a fill path.
|
||||||
*/
|
*/
|
||||||
@@ -450,6 +470,7 @@ export type OptimizedMarketOrder =
|
|||||||
| OptimizedMarketOrderBase<NativeRfqOrderFillData>;
|
| OptimizedMarketOrderBase<NativeRfqOrderFillData>;
|
||||||
|
|
||||||
export interface GetMarketOrdersRfqOpts extends RfqRequestOpts {
|
export interface GetMarketOrdersRfqOpts extends RfqRequestOpts {
|
||||||
|
rfqClient?: IRfqClient;
|
||||||
quoteRequestor?: QuoteRequestor;
|
quoteRequestor?: QuoteRequestor;
|
||||||
firmQuoteValidator?: RfqFirmQuoteValidator;
|
firmQuoteValidator?: RfqFirmQuoteValidator;
|
||||||
}
|
}
|
||||||
|
@@ -207,7 +207,7 @@ export function generateExtendedQuoteReportSources(
|
|||||||
..._.flatten(
|
..._.flatten(
|
||||||
quotes.dexQuotes.map(dex =>
|
quotes.dexQuotes.map(dex =>
|
||||||
dex
|
dex
|
||||||
.filter(quote => isDexSampleForTotalAmount(quote, marketOperation, amount))
|
.filter(quote => isDexSampleForTotalAmount(quote, amount))
|
||||||
.map(quote => dexSampleToReportSource(quote, marketOperation)),
|
.map(quote => dexSampleToReportSource(quote, marketOperation)),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -306,16 +306,8 @@ export function dexSampleToReportSource(ds: DexSample, marketOperation: MarketOp
|
|||||||
* Checks if a DEX sample is the one that represents the whole amount requested by taker
|
* Checks if a DEX sample is the one that represents the whole amount requested by taker
|
||||||
* NOTE: this is used for the QuoteReport to filter samples
|
* NOTE: this is used for the QuoteReport to filter samples
|
||||||
*/
|
*/
|
||||||
function isDexSampleForTotalAmount(ds: DexSample, marketOperation: MarketOperation, amount: BigNumber): boolean {
|
function isDexSampleForTotalAmount(ds: DexSample, amount: BigNumber): boolean {
|
||||||
// input and output map to different values
|
return ds.input.eq(amount);
|
||||||
// based on the market operation
|
|
||||||
if (marketOperation === MarketOperation.Buy) {
|
|
||||||
return ds.input === amount;
|
|
||||||
} else if (marketOperation === MarketOperation.Sell) {
|
|
||||||
return ds.output === amount;
|
|
||||||
} else {
|
|
||||||
throw new Error(`Unexpected marketOperation ${marketOperation}`);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
16
packages/asset-swapper/src/utils/rfq_client_mappers.ts
Normal file
16
packages/asset-swapper/src/utils/rfq_client_mappers.ts
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
import { FillQuoteTransformerOrderType } from '@0x/protocol-utils';
|
||||||
|
|
||||||
|
import { SignedNativeOrder } from '../types';
|
||||||
|
|
||||||
|
import { RfqClientV1Quote } from './irfq_client';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Converts a RfqClientRfqOrderFirmQuote to a SignedNativeOrder
|
||||||
|
*/
|
||||||
|
export const toSignedNativeOrder = (quote: RfqClientV1Quote): SignedNativeOrder => {
|
||||||
|
return {
|
||||||
|
type: FillQuoteTransformerOrderType.Rfq,
|
||||||
|
order: quote.order,
|
||||||
|
signature: quote.signature,
|
||||||
|
};
|
||||||
|
};
|
@@ -18,14 +18,17 @@ import * as DODOSampler from '../test/generated-artifacts/DODOSampler.json';
|
|||||||
import * as DODOV2Sampler from '../test/generated-artifacts/DODOV2Sampler.json';
|
import * as DODOV2Sampler from '../test/generated-artifacts/DODOV2Sampler.json';
|
||||||
import * as ERC20BridgeSampler from '../test/generated-artifacts/ERC20BridgeSampler.json';
|
import * as ERC20BridgeSampler from '../test/generated-artifacts/ERC20BridgeSampler.json';
|
||||||
import * as FakeTaker from '../test/generated-artifacts/FakeTaker.json';
|
import * as FakeTaker from '../test/generated-artifacts/FakeTaker.json';
|
||||||
|
import * as GMXSampler from '../test/generated-artifacts/GMXSampler.json';
|
||||||
import * as IBalancer from '../test/generated-artifacts/IBalancer.json';
|
import * as IBalancer from '../test/generated-artifacts/IBalancer.json';
|
||||||
import * as IBalancerV2Vault from '../test/generated-artifacts/IBalancerV2Vault.json';
|
import * as IBalancerV2Vault from '../test/generated-artifacts/IBalancerV2Vault.json';
|
||||||
import * as IBancor from '../test/generated-artifacts/IBancor.json';
|
import * as IBancor from '../test/generated-artifacts/IBancor.json';
|
||||||
import * as ICurve from '../test/generated-artifacts/ICurve.json';
|
import * as ICurve from '../test/generated-artifacts/ICurve.json';
|
||||||
|
import * as IGMX from '../test/generated-artifacts/IGMX.json';
|
||||||
import * as IKyberNetwork from '../test/generated-artifacts/IKyberNetwork.json';
|
import * as IKyberNetwork from '../test/generated-artifacts/IKyberNetwork.json';
|
||||||
import * as IMooniswap from '../test/generated-artifacts/IMooniswap.json';
|
import * as IMooniswap from '../test/generated-artifacts/IMooniswap.json';
|
||||||
import * as IMStable from '../test/generated-artifacts/IMStable.json';
|
import * as IMStable from '../test/generated-artifacts/IMStable.json';
|
||||||
import * as IMultiBridge from '../test/generated-artifacts/IMultiBridge.json';
|
import * as IMultiBridge from '../test/generated-artifacts/IMultiBridge.json';
|
||||||
|
import * as IPlatypus from '../test/generated-artifacts/IPlatypus.json';
|
||||||
import * as IShell from '../test/generated-artifacts/IShell.json';
|
import * as IShell from '../test/generated-artifacts/IShell.json';
|
||||||
import * as ISmoothy from '../test/generated-artifacts/ISmoothy.json';
|
import * as ISmoothy from '../test/generated-artifacts/ISmoothy.json';
|
||||||
import * as IUniswapExchangeQuotes from '../test/generated-artifacts/IUniswapExchangeQuotes.json';
|
import * as IUniswapExchangeQuotes from '../test/generated-artifacts/IUniswapExchangeQuotes.json';
|
||||||
@@ -38,6 +41,7 @@ import * as MakerPSMSampler from '../test/generated-artifacts/MakerPSMSampler.js
|
|||||||
import * as MooniswapSampler from '../test/generated-artifacts/MooniswapSampler.json';
|
import * as MooniswapSampler from '../test/generated-artifacts/MooniswapSampler.json';
|
||||||
import * as MStableSampler from '../test/generated-artifacts/MStableSampler.json';
|
import * as MStableSampler from '../test/generated-artifacts/MStableSampler.json';
|
||||||
import * as NativeOrderSampler from '../test/generated-artifacts/NativeOrderSampler.json';
|
import * as NativeOrderSampler from '../test/generated-artifacts/NativeOrderSampler.json';
|
||||||
|
import * as PlatypusSampler from '../test/generated-artifacts/PlatypusSampler.json';
|
||||||
import * as SamplerUtils from '../test/generated-artifacts/SamplerUtils.json';
|
import * as SamplerUtils from '../test/generated-artifacts/SamplerUtils.json';
|
||||||
import * as ShellSampler from '../test/generated-artifacts/ShellSampler.json';
|
import * as ShellSampler from '../test/generated-artifacts/ShellSampler.json';
|
||||||
import * as SmoothySampler from '../test/generated-artifacts/SmoothySampler.json';
|
import * as SmoothySampler from '../test/generated-artifacts/SmoothySampler.json';
|
||||||
@@ -61,6 +65,7 @@ export const artifacts = {
|
|||||||
DODOV2Sampler: DODOV2Sampler as ContractArtifact,
|
DODOV2Sampler: DODOV2Sampler as ContractArtifact,
|
||||||
ERC20BridgeSampler: ERC20BridgeSampler as ContractArtifact,
|
ERC20BridgeSampler: ERC20BridgeSampler as ContractArtifact,
|
||||||
FakeTaker: FakeTaker as ContractArtifact,
|
FakeTaker: FakeTaker as ContractArtifact,
|
||||||
|
GMXSampler: GMXSampler as ContractArtifact,
|
||||||
KyberDmmSampler: KyberDmmSampler as ContractArtifact,
|
KyberDmmSampler: KyberDmmSampler as ContractArtifact,
|
||||||
KyberSampler: KyberSampler as ContractArtifact,
|
KyberSampler: KyberSampler as ContractArtifact,
|
||||||
LidoSampler: LidoSampler as ContractArtifact,
|
LidoSampler: LidoSampler as ContractArtifact,
|
||||||
@@ -69,6 +74,7 @@ export const artifacts = {
|
|||||||
MakerPSMSampler: MakerPSMSampler as ContractArtifact,
|
MakerPSMSampler: MakerPSMSampler as ContractArtifact,
|
||||||
MooniswapSampler: MooniswapSampler as ContractArtifact,
|
MooniswapSampler: MooniswapSampler as ContractArtifact,
|
||||||
NativeOrderSampler: NativeOrderSampler as ContractArtifact,
|
NativeOrderSampler: NativeOrderSampler as ContractArtifact,
|
||||||
|
PlatypusSampler: PlatypusSampler as ContractArtifact,
|
||||||
SamplerUtils: SamplerUtils as ContractArtifact,
|
SamplerUtils: SamplerUtils as ContractArtifact,
|
||||||
ShellSampler: ShellSampler as ContractArtifact,
|
ShellSampler: ShellSampler as ContractArtifact,
|
||||||
SmoothySampler: SmoothySampler as ContractArtifact,
|
SmoothySampler: SmoothySampler as ContractArtifact,
|
||||||
@@ -81,10 +87,12 @@ export const artifacts = {
|
|||||||
IBalancerV2Vault: IBalancerV2Vault as ContractArtifact,
|
IBalancerV2Vault: IBalancerV2Vault as ContractArtifact,
|
||||||
IBancor: IBancor as ContractArtifact,
|
IBancor: IBancor as ContractArtifact,
|
||||||
ICurve: ICurve as ContractArtifact,
|
ICurve: ICurve as ContractArtifact,
|
||||||
|
IGMX: IGMX as ContractArtifact,
|
||||||
IKyberNetwork: IKyberNetwork as ContractArtifact,
|
IKyberNetwork: IKyberNetwork as ContractArtifact,
|
||||||
IMStable: IMStable as ContractArtifact,
|
IMStable: IMStable as ContractArtifact,
|
||||||
IMooniswap: IMooniswap as ContractArtifact,
|
IMooniswap: IMooniswap as ContractArtifact,
|
||||||
IMultiBridge: IMultiBridge as ContractArtifact,
|
IMultiBridge: IMultiBridge as ContractArtifact,
|
||||||
|
IPlatypus: IPlatypus as ContractArtifact,
|
||||||
IShell: IShell as ContractArtifact,
|
IShell: IShell as ContractArtifact,
|
||||||
ISmoothy: ISmoothy as ContractArtifact,
|
ISmoothy: ISmoothy as ContractArtifact,
|
||||||
IUniswapExchangeQuotes: IUniswapExchangeQuotes as ContractArtifact,
|
IUniswapExchangeQuotes: IUniswapExchangeQuotes as ContractArtifact,
|
||||||
|
@@ -11,7 +11,7 @@ import {
|
|||||||
import { FillQuoteTransformerOrderType, LimitOrder, RfqOrder, SignatureType } from '@0x/protocol-utils';
|
import { FillQuoteTransformerOrderType, LimitOrder, RfqOrder, SignatureType } from '@0x/protocol-utils';
|
||||||
import { BigNumber, hexUtils, NULL_BYTES } from '@0x/utils';
|
import { BigNumber, hexUtils, NULL_BYTES } from '@0x/utils';
|
||||||
import { Web3Wrapper } from '@0x/web3-wrapper';
|
import { Web3Wrapper } from '@0x/web3-wrapper';
|
||||||
import { Pool } from '@balancer-labs/sor/dist/types';
|
import { Pool } from 'balancer-labs-sor-v1/dist/types';
|
||||||
import * as _ from 'lodash';
|
import * as _ from 'lodash';
|
||||||
import * as TypeMoq from 'typemoq';
|
import * as TypeMoq from 'typemoq';
|
||||||
|
|
||||||
@@ -49,7 +49,7 @@ const MAKER_TOKEN = randomAddress();
|
|||||||
const TAKER_TOKEN = randomAddress();
|
const TAKER_TOKEN = randomAddress();
|
||||||
|
|
||||||
const DEFAULT_INCLUDED = [
|
const DEFAULT_INCLUDED = [
|
||||||
ERC20BridgeSource.Eth2Dai,
|
ERC20BridgeSource.SushiSwap,
|
||||||
ERC20BridgeSource.Kyber,
|
ERC20BridgeSource.Kyber,
|
||||||
ERC20BridgeSource.Native,
|
ERC20BridgeSource.Native,
|
||||||
ERC20BridgeSource.Uniswap,
|
ERC20BridgeSource.Uniswap,
|
||||||
@@ -319,7 +319,7 @@ describe('MarketOperationUtils tests', () => {
|
|||||||
const DEFAULT_RATES: RatesBySource = {
|
const DEFAULT_RATES: RatesBySource = {
|
||||||
...ZERO_RATES,
|
...ZERO_RATES,
|
||||||
[ERC20BridgeSource.Native]: createDecreasingRates(NUM_SAMPLES),
|
[ERC20BridgeSource.Native]: createDecreasingRates(NUM_SAMPLES),
|
||||||
[ERC20BridgeSource.Eth2Dai]: createDecreasingRates(NUM_SAMPLES),
|
[ERC20BridgeSource.SushiSwap]: createDecreasingRates(NUM_SAMPLES),
|
||||||
[ERC20BridgeSource.Uniswap]: createDecreasingRates(NUM_SAMPLES),
|
[ERC20BridgeSource.Uniswap]: createDecreasingRates(NUM_SAMPLES),
|
||||||
[ERC20BridgeSource.Kyber]: createDecreasingRates(NUM_SAMPLES),
|
[ERC20BridgeSource.Kyber]: createDecreasingRates(NUM_SAMPLES),
|
||||||
};
|
};
|
||||||
@@ -349,28 +349,6 @@ describe('MarketOperationUtils tests', () => {
|
|||||||
fromTokenIdx: 0,
|
fromTokenIdx: 0,
|
||||||
toTokenIdx: 1,
|
toTokenIdx: 1,
|
||||||
},
|
},
|
||||||
[ERC20BridgeSource.Swerve]: {
|
|
||||||
pool: {
|
|
||||||
poolAddress: randomAddress(),
|
|
||||||
tokens: [TAKER_TOKEN, MAKER_TOKEN],
|
|
||||||
exchangeFunctionSelector: hexUtils.random(4),
|
|
||||||
sellQuoteFunctionSelector: hexUtils.random(4),
|
|
||||||
buyQuoteFunctionSelector: hexUtils.random(4),
|
|
||||||
},
|
|
||||||
fromTokenIdx: 0,
|
|
||||||
toTokenIdx: 1,
|
|
||||||
},
|
|
||||||
[ERC20BridgeSource.SnowSwap]: {
|
|
||||||
pool: {
|
|
||||||
poolAddress: randomAddress(),
|
|
||||||
tokens: [TAKER_TOKEN, MAKER_TOKEN],
|
|
||||||
exchangeFunctionSelector: hexUtils.random(4),
|
|
||||||
sellQuoteFunctionSelector: hexUtils.random(4),
|
|
||||||
buyQuoteFunctionSelector: hexUtils.random(4),
|
|
||||||
},
|
|
||||||
fromTokenIdx: 0,
|
|
||||||
toTokenIdx: 1,
|
|
||||||
},
|
|
||||||
[ERC20BridgeSource.Smoothy]: {
|
[ERC20BridgeSource.Smoothy]: {
|
||||||
pool: {
|
pool: {
|
||||||
poolAddress: randomAddress(),
|
poolAddress: randomAddress(),
|
||||||
@@ -404,9 +382,7 @@ describe('MarketOperationUtils tests', () => {
|
|||||||
[ERC20BridgeSource.Dodo]: {},
|
[ERC20BridgeSource.Dodo]: {},
|
||||||
[ERC20BridgeSource.DodoV2]: {},
|
[ERC20BridgeSource.DodoV2]: {},
|
||||||
[ERC20BridgeSource.CryptoCom]: { tokenAddressPath: [] },
|
[ERC20BridgeSource.CryptoCom]: { tokenAddressPath: [] },
|
||||||
[ERC20BridgeSource.Linkswap]: { tokenAddressPath: [] },
|
|
||||||
[ERC20BridgeSource.Uniswap]: { router: randomAddress() },
|
[ERC20BridgeSource.Uniswap]: { router: randomAddress() },
|
||||||
[ERC20BridgeSource.Eth2Dai]: { router: randomAddress() },
|
|
||||||
[ERC20BridgeSource.MakerPsm]: {},
|
[ERC20BridgeSource.MakerPsm]: {},
|
||||||
[ERC20BridgeSource.KyberDmm]: { tokenAddressPath: [], router: randomAddress(), poolsPath: [] },
|
[ERC20BridgeSource.KyberDmm]: { tokenAddressPath: [], router: randomAddress(), poolsPath: [] },
|
||||||
};
|
};
|
||||||
@@ -534,7 +510,7 @@ describe('MarketOperationUtils tests', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('does not poll DEXes in `excludedSources`', async () => {
|
it('does not poll DEXes in `excludedSources`', async () => {
|
||||||
const excludedSources = [ERC20BridgeSource.Uniswap, ERC20BridgeSource.Eth2Dai];
|
const excludedSources = [ERC20BridgeSource.Uniswap, ERC20BridgeSource.SushiSwap];
|
||||||
let sourcesPolled: ERC20BridgeSource[] = [];
|
let sourcesPolled: ERC20BridgeSource[] = [];
|
||||||
replaceSamplerOps({
|
replaceSamplerOps({
|
||||||
getSellQuotes: (sources, makerToken, takerToken, amounts, wethAddress) => {
|
getSellQuotes: (sources, makerToken, takerToken, amounts, wethAddress) => {
|
||||||
@@ -564,7 +540,7 @@ describe('MarketOperationUtils tests', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('only polls DEXes in `includedSources`', async () => {
|
it('only polls DEXes in `includedSources`', async () => {
|
||||||
const includedSources = [ERC20BridgeSource.Uniswap, ERC20BridgeSource.Eth2Dai];
|
const includedSources = [ERC20BridgeSource.Uniswap, ERC20BridgeSource.SushiSwap];
|
||||||
let sourcesPolled: ERC20BridgeSource[] = [];
|
let sourcesPolled: ERC20BridgeSource[] = [];
|
||||||
replaceSamplerOps({
|
replaceSamplerOps({
|
||||||
getSellQuotes: (sources, makerToken, takerToken, amounts, wethAddress) => {
|
getSellQuotes: (sources, makerToken, takerToken, amounts, wethAddress) => {
|
||||||
@@ -1057,7 +1033,7 @@ describe('MarketOperationUtils tests', () => {
|
|||||||
const rates: RatesBySource = { ...DEFAULT_RATES };
|
const rates: RatesBySource = { ...DEFAULT_RATES };
|
||||||
rates[ERC20BridgeSource.Native] = [0.4, 0.3, 0.2, 0.1];
|
rates[ERC20BridgeSource.Native] = [0.4, 0.3, 0.2, 0.1];
|
||||||
rates[ERC20BridgeSource.Uniswap] = [0.5, 0.05, 0.05, 0.05];
|
rates[ERC20BridgeSource.Uniswap] = [0.5, 0.05, 0.05, 0.05];
|
||||||
rates[ERC20BridgeSource.Eth2Dai] = [0.6, 0.05, 0.05, 0.05];
|
rates[ERC20BridgeSource.SushiSwap] = [0.6, 0.05, 0.05, 0.05];
|
||||||
rates[ERC20BridgeSource.Kyber] = [0, 0, 0, 0]; // unused
|
rates[ERC20BridgeSource.Kyber] = [0, 0, 0, 0]; // unused
|
||||||
replaceSamplerOps({
|
replaceSamplerOps({
|
||||||
getSellQuotes: createGetMultipleSellQuotesOperationFromRates(rates),
|
getSellQuotes: createGetMultipleSellQuotesOperationFromRates(rates),
|
||||||
@@ -1071,7 +1047,7 @@ describe('MarketOperationUtils tests', () => {
|
|||||||
const improvedOrders = improvedOrdersResponse.optimizedOrders;
|
const improvedOrders = improvedOrdersResponse.optimizedOrders;
|
||||||
const orderSources = improvedOrders.map(o => o.fills[0].source);
|
const orderSources = improvedOrders.map(o => o.fills[0].source);
|
||||||
const expectedSources = [
|
const expectedSources = [
|
||||||
ERC20BridgeSource.Eth2Dai,
|
ERC20BridgeSource.SushiSwap,
|
||||||
ERC20BridgeSource.Uniswap,
|
ERC20BridgeSource.Uniswap,
|
||||||
ERC20BridgeSource.Native,
|
ERC20BridgeSource.Native,
|
||||||
ERC20BridgeSource.Native,
|
ERC20BridgeSource.Native,
|
||||||
@@ -1089,7 +1065,7 @@ describe('MarketOperationUtils tests', () => {
|
|||||||
const rates: RatesBySource = {
|
const rates: RatesBySource = {
|
||||||
[ERC20BridgeSource.Native]: [1, 0.99, 0.98, 0.97], // Effectively [0.94, 0.93, 0.92, 0.91]
|
[ERC20BridgeSource.Native]: [1, 0.99, 0.98, 0.97], // Effectively [0.94, 0.93, 0.92, 0.91]
|
||||||
[ERC20BridgeSource.Uniswap]: [0.96, 0.1, 0.1, 0.1],
|
[ERC20BridgeSource.Uniswap]: [0.96, 0.1, 0.1, 0.1],
|
||||||
[ERC20BridgeSource.Eth2Dai]: [0.95, 0.1, 0.1, 0.1],
|
[ERC20BridgeSource.SushiSwap]: [0.95, 0.1, 0.1, 0.1],
|
||||||
[ERC20BridgeSource.Kyber]: [0.1, 0.1, 0.1, 0.1],
|
[ERC20BridgeSource.Kyber]: [0.1, 0.1, 0.1, 0.1],
|
||||||
};
|
};
|
||||||
const feeSchedule = {
|
const feeSchedule = {
|
||||||
@@ -1114,7 +1090,7 @@ describe('MarketOperationUtils tests', () => {
|
|||||||
const expectedSources = [
|
const expectedSources = [
|
||||||
ERC20BridgeSource.Native,
|
ERC20BridgeSource.Native,
|
||||||
ERC20BridgeSource.Uniswap,
|
ERC20BridgeSource.Uniswap,
|
||||||
ERC20BridgeSource.Eth2Dai,
|
ERC20BridgeSource.SushiSwap,
|
||||||
ERC20BridgeSource.Native,
|
ERC20BridgeSource.Native,
|
||||||
];
|
];
|
||||||
expect(orderSources.sort()).to.deep.eq(expectedSources.sort());
|
expect(orderSources.sort()).to.deep.eq(expectedSources.sort());
|
||||||
@@ -1127,7 +1103,7 @@ describe('MarketOperationUtils tests', () => {
|
|||||||
const rates: RatesBySource = {
|
const rates: RatesBySource = {
|
||||||
[ERC20BridgeSource.Native]: [0.95, 0.1, 0.1, 0.1],
|
[ERC20BridgeSource.Native]: [0.95, 0.1, 0.1, 0.1],
|
||||||
[ERC20BridgeSource.Kyber]: [0.1, 0.1, 0.1, 0.1],
|
[ERC20BridgeSource.Kyber]: [0.1, 0.1, 0.1, 0.1],
|
||||||
[ERC20BridgeSource.Eth2Dai]: [0.92, 0.1, 0.1, 0.1],
|
[ERC20BridgeSource.SushiSwap]: [0.92, 0.1, 0.1, 0.1],
|
||||||
// Effectively [0.8, ~0.5, ~0, ~0]
|
// Effectively [0.8, ~0.5, ~0, ~0]
|
||||||
[ERC20BridgeSource.Uniswap]: [1, 0.7, 0.2, 0.2],
|
[ERC20BridgeSource.Uniswap]: [1, 0.7, 0.2, 0.2],
|
||||||
};
|
};
|
||||||
@@ -1152,7 +1128,7 @@ describe('MarketOperationUtils tests', () => {
|
|||||||
const orderSources = improvedOrders.map(o => o.fills[0].source);
|
const orderSources = improvedOrders.map(o => o.fills[0].source);
|
||||||
const expectedSources = [
|
const expectedSources = [
|
||||||
ERC20BridgeSource.Native,
|
ERC20BridgeSource.Native,
|
||||||
ERC20BridgeSource.Eth2Dai,
|
ERC20BridgeSource.SushiSwap,
|
||||||
ERC20BridgeSource.Uniswap,
|
ERC20BridgeSource.Uniswap,
|
||||||
];
|
];
|
||||||
expect(orderSources.sort()).to.deep.eq(expectedSources.sort());
|
expect(orderSources.sort()).to.deep.eq(expectedSources.sort());
|
||||||
@@ -1161,7 +1137,7 @@ describe('MarketOperationUtils tests', () => {
|
|||||||
it('can mix one concave source', async () => {
|
it('can mix one concave source', async () => {
|
||||||
const rates: RatesBySource = {
|
const rates: RatesBySource = {
|
||||||
[ERC20BridgeSource.Kyber]: [0, 0, 0, 0], // Won't use
|
[ERC20BridgeSource.Kyber]: [0, 0, 0, 0], // Won't use
|
||||||
[ERC20BridgeSource.Eth2Dai]: [0.5, 0.85, 0.75, 0.75], // Concave
|
[ERC20BridgeSource.SushiSwap]: [0.5, 0.85, 0.75, 0.75], // Concave
|
||||||
[ERC20BridgeSource.Uniswap]: [0.96, 0.2, 0.1, 0.1],
|
[ERC20BridgeSource.Uniswap]: [0.96, 0.2, 0.1, 0.1],
|
||||||
[ERC20BridgeSource.Native]: [0.95, 0.2, 0.2, 0.1],
|
[ERC20BridgeSource.Native]: [0.95, 0.2, 0.2, 0.1],
|
||||||
};
|
};
|
||||||
@@ -1178,7 +1154,7 @@ describe('MarketOperationUtils tests', () => {
|
|||||||
const improvedOrders = improvedOrdersResponse.optimizedOrders;
|
const improvedOrders = improvedOrdersResponse.optimizedOrders;
|
||||||
const orderSources = improvedOrders.map(o => o.fills[0].source);
|
const orderSources = improvedOrders.map(o => o.fills[0].source);
|
||||||
const expectedSources = [
|
const expectedSources = [
|
||||||
ERC20BridgeSource.Eth2Dai,
|
ERC20BridgeSource.SushiSwap,
|
||||||
ERC20BridgeSource.Uniswap,
|
ERC20BridgeSource.Uniswap,
|
||||||
ERC20BridgeSource.Native,
|
ERC20BridgeSource.Native,
|
||||||
];
|
];
|
||||||
@@ -1191,7 +1167,7 @@ describe('MarketOperationUtils tests', () => {
|
|||||||
const rates: RatesBySource = {};
|
const rates: RatesBySource = {};
|
||||||
rates[ERC20BridgeSource.Native] = [1, 1, 0.01, 0.01];
|
rates[ERC20BridgeSource.Native] = [1, 1, 0.01, 0.01];
|
||||||
rates[ERC20BridgeSource.Uniswap] = [1, 1, 0.01, 0.01];
|
rates[ERC20BridgeSource.Uniswap] = [1, 1, 0.01, 0.01];
|
||||||
rates[ERC20BridgeSource.Eth2Dai] = [0.49, 0.49, 0.49, 0.49];
|
rates[ERC20BridgeSource.SushiSwap] = [0.49, 0.49, 0.49, 0.49];
|
||||||
rates[ERC20BridgeSource.Kyber] = [0.35, 0.2, 0.01, 0.01];
|
rates[ERC20BridgeSource.Kyber] = [0.35, 0.2, 0.01, 0.01];
|
||||||
replaceSamplerOps({
|
replaceSamplerOps({
|
||||||
getSellQuotes: createGetMultipleSellQuotesOperationFromRates(rates),
|
getSellQuotes: createGetMultipleSellQuotesOperationFromRates(rates),
|
||||||
@@ -1386,7 +1362,7 @@ describe('MarketOperationUtils tests', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('does not poll DEXes in `excludedSources`', async () => {
|
it('does not poll DEXes in `excludedSources`', async () => {
|
||||||
const excludedSources = [ERC20BridgeSource.Uniswap, ERC20BridgeSource.Eth2Dai];
|
const excludedSources = [ERC20BridgeSource.Uniswap, ERC20BridgeSource.SushiSwap];
|
||||||
let sourcesPolled: ERC20BridgeSource[] = [];
|
let sourcesPolled: ERC20BridgeSource[] = [];
|
||||||
replaceSamplerOps({
|
replaceSamplerOps({
|
||||||
getBuyQuotes: (sources, makerToken, takerToken, amounts, wethAddress) => {
|
getBuyQuotes: (sources, makerToken, takerToken, amounts, wethAddress) => {
|
||||||
@@ -1416,7 +1392,7 @@ describe('MarketOperationUtils tests', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('only polls DEXes in `includedSources`', async () => {
|
it('only polls DEXes in `includedSources`', async () => {
|
||||||
const includedSources = [ERC20BridgeSource.Uniswap, ERC20BridgeSource.Eth2Dai];
|
const includedSources = [ERC20BridgeSource.Uniswap, ERC20BridgeSource.SushiSwap];
|
||||||
let sourcesPolled: ERC20BridgeSource[] = [];
|
let sourcesPolled: ERC20BridgeSource[] = [];
|
||||||
replaceSamplerOps({
|
replaceSamplerOps({
|
||||||
getBuyQuotes: (sources, makerToken, takerToken, amounts, wethAddress) => {
|
getBuyQuotes: (sources, makerToken, takerToken, amounts, wethAddress) => {
|
||||||
@@ -1508,7 +1484,7 @@ describe('MarketOperationUtils tests', () => {
|
|||||||
const rates: RatesBySource = { ...ZERO_RATES };
|
const rates: RatesBySource = { ...ZERO_RATES };
|
||||||
rates[ERC20BridgeSource.Native] = [0.4, 0.3, 0.2, 0.1];
|
rates[ERC20BridgeSource.Native] = [0.4, 0.3, 0.2, 0.1];
|
||||||
rates[ERC20BridgeSource.Uniswap] = [0.5, 0.05, 0.05, 0.05];
|
rates[ERC20BridgeSource.Uniswap] = [0.5, 0.05, 0.05, 0.05];
|
||||||
rates[ERC20BridgeSource.Eth2Dai] = [0.6, 0.05, 0.05, 0.05];
|
rates[ERC20BridgeSource.SushiSwap] = [0.6, 0.05, 0.05, 0.05];
|
||||||
replaceSamplerOps({
|
replaceSamplerOps({
|
||||||
getBuyQuotes: createGetMultipleBuyQuotesOperationFromRates(rates),
|
getBuyQuotes: createGetMultipleBuyQuotesOperationFromRates(rates),
|
||||||
});
|
});
|
||||||
@@ -1521,7 +1497,7 @@ describe('MarketOperationUtils tests', () => {
|
|||||||
const improvedOrders = improvedOrdersResponse.optimizedOrders;
|
const improvedOrders = improvedOrdersResponse.optimizedOrders;
|
||||||
const orderSources = improvedOrders.map(o => o.fills[0].source);
|
const orderSources = improvedOrders.map(o => o.fills[0].source);
|
||||||
const expectedSources = [
|
const expectedSources = [
|
||||||
ERC20BridgeSource.Eth2Dai,
|
ERC20BridgeSource.SushiSwap,
|
||||||
ERC20BridgeSource.Uniswap,
|
ERC20BridgeSource.Uniswap,
|
||||||
ERC20BridgeSource.Native,
|
ERC20BridgeSource.Native,
|
||||||
ERC20BridgeSource.Native,
|
ERC20BridgeSource.Native,
|
||||||
@@ -1540,7 +1516,7 @@ describe('MarketOperationUtils tests', () => {
|
|||||||
...ZERO_RATES,
|
...ZERO_RATES,
|
||||||
[ERC20BridgeSource.Native]: [1, 0.99, 0.98, 0.97], // Effectively [0.94, ~0.93, ~0.92, ~0.91]
|
[ERC20BridgeSource.Native]: [1, 0.99, 0.98, 0.97], // Effectively [0.94, ~0.93, ~0.92, ~0.91]
|
||||||
[ERC20BridgeSource.Uniswap]: [0.96, 0.1, 0.1, 0.1],
|
[ERC20BridgeSource.Uniswap]: [0.96, 0.1, 0.1, 0.1],
|
||||||
[ERC20BridgeSource.Eth2Dai]: [0.95, 0.1, 0.1, 0.1],
|
[ERC20BridgeSource.SushiSwap]: [0.95, 0.1, 0.1, 0.1],
|
||||||
[ERC20BridgeSource.Kyber]: [0.1, 0.1, 0.1, 0.1],
|
[ERC20BridgeSource.Kyber]: [0.1, 0.1, 0.1, 0.1],
|
||||||
};
|
};
|
||||||
const feeSchedule = {
|
const feeSchedule = {
|
||||||
@@ -1564,7 +1540,7 @@ describe('MarketOperationUtils tests', () => {
|
|||||||
const orderSources = improvedOrders.map(o => o.fills[0].source);
|
const orderSources = improvedOrders.map(o => o.fills[0].source);
|
||||||
const expectedSources = [
|
const expectedSources = [
|
||||||
ERC20BridgeSource.Uniswap,
|
ERC20BridgeSource.Uniswap,
|
||||||
ERC20BridgeSource.Eth2Dai,
|
ERC20BridgeSource.SushiSwap,
|
||||||
ERC20BridgeSource.Native,
|
ERC20BridgeSource.Native,
|
||||||
ERC20BridgeSource.Native,
|
ERC20BridgeSource.Native,
|
||||||
];
|
];
|
||||||
@@ -1580,7 +1556,7 @@ describe('MarketOperationUtils tests', () => {
|
|||||||
[ERC20BridgeSource.Native]: [0.95, 0.1, 0.1, 0.1],
|
[ERC20BridgeSource.Native]: [0.95, 0.1, 0.1, 0.1],
|
||||||
// Effectively [0.8, ~0.5, ~0, ~0]
|
// Effectively [0.8, ~0.5, ~0, ~0]
|
||||||
[ERC20BridgeSource.Uniswap]: [1, 0.7, 0.2, 0.2],
|
[ERC20BridgeSource.Uniswap]: [1, 0.7, 0.2, 0.2],
|
||||||
[ERC20BridgeSource.Eth2Dai]: [0.92, 0.1, 0.1, 0.1],
|
[ERC20BridgeSource.SushiSwap]: [0.92, 0.1, 0.1, 0.1],
|
||||||
};
|
};
|
||||||
const feeSchedule = {
|
const feeSchedule = {
|
||||||
[ERC20BridgeSource.Uniswap]: _.constant(
|
[ERC20BridgeSource.Uniswap]: _.constant(
|
||||||
@@ -1603,7 +1579,7 @@ describe('MarketOperationUtils tests', () => {
|
|||||||
const orderSources = improvedOrders.map(o => o.fills[0].source);
|
const orderSources = improvedOrders.map(o => o.fills[0].source);
|
||||||
const expectedSources = [
|
const expectedSources = [
|
||||||
ERC20BridgeSource.Native,
|
ERC20BridgeSource.Native,
|
||||||
ERC20BridgeSource.Eth2Dai,
|
ERC20BridgeSource.SushiSwap,
|
||||||
ERC20BridgeSource.Uniswap,
|
ERC20BridgeSource.Uniswap,
|
||||||
];
|
];
|
||||||
expect(orderSources.sort()).to.deep.eq(expectedSources.sort());
|
expect(orderSources.sort()).to.deep.eq(expectedSources.sort());
|
||||||
@@ -1615,7 +1591,7 @@ describe('MarketOperationUtils tests', () => {
|
|||||||
const rates: RatesBySource = { ...ZERO_RATES };
|
const rates: RatesBySource = { ...ZERO_RATES };
|
||||||
rates[ERC20BridgeSource.Native] = [1, 1, 0.01, 0.01];
|
rates[ERC20BridgeSource.Native] = [1, 1, 0.01, 0.01];
|
||||||
rates[ERC20BridgeSource.Uniswap] = [1, 1, 0.01, 0.01];
|
rates[ERC20BridgeSource.Uniswap] = [1, 1, 0.01, 0.01];
|
||||||
rates[ERC20BridgeSource.Eth2Dai] = [0.49, 0.49, 0.49, 0.49];
|
rates[ERC20BridgeSource.SushiSwap] = [0.49, 0.49, 0.49, 0.49];
|
||||||
replaceSamplerOps({
|
replaceSamplerOps({
|
||||||
getBuyQuotes: createGetMultipleBuyQuotesOperationFromRates(rates),
|
getBuyQuotes: createGetMultipleBuyQuotesOperationFromRates(rates),
|
||||||
});
|
});
|
||||||
|
@@ -16,6 +16,7 @@ export * from '../test/generated-wrappers/d_o_d_o_sampler';
|
|||||||
export * from '../test/generated-wrappers/d_o_d_o_v2_sampler';
|
export * from '../test/generated-wrappers/d_o_d_o_v2_sampler';
|
||||||
export * from '../test/generated-wrappers/erc20_bridge_sampler';
|
export * from '../test/generated-wrappers/erc20_bridge_sampler';
|
||||||
export * from '../test/generated-wrappers/fake_taker';
|
export * from '../test/generated-wrappers/fake_taker';
|
||||||
|
export * from '../test/generated-wrappers/g_m_x_sampler';
|
||||||
export * from '../test/generated-wrappers/i_balancer';
|
export * from '../test/generated-wrappers/i_balancer';
|
||||||
export * from '../test/generated-wrappers/i_balancer_v2_vault';
|
export * from '../test/generated-wrappers/i_balancer_v2_vault';
|
||||||
export * from '../test/generated-wrappers/i_bancor';
|
export * from '../test/generated-wrappers/i_bancor';
|
||||||
@@ -24,10 +25,12 @@ export * from '../test/generated-wrappers/i_kyber_network';
|
|||||||
export * from '../test/generated-wrappers/i_m_stable';
|
export * from '../test/generated-wrappers/i_m_stable';
|
||||||
export * from '../test/generated-wrappers/i_mooniswap';
|
export * from '../test/generated-wrappers/i_mooniswap';
|
||||||
export * from '../test/generated-wrappers/i_multi_bridge';
|
export * from '../test/generated-wrappers/i_multi_bridge';
|
||||||
|
export * from '../test/generated-wrappers/i_platypus';
|
||||||
export * from '../test/generated-wrappers/i_shell';
|
export * from '../test/generated-wrappers/i_shell';
|
||||||
export * from '../test/generated-wrappers/i_smoothy';
|
export * from '../test/generated-wrappers/i_smoothy';
|
||||||
export * from '../test/generated-wrappers/i_uniswap_exchange_quotes';
|
export * from '../test/generated-wrappers/i_uniswap_exchange_quotes';
|
||||||
export * from '../test/generated-wrappers/i_uniswap_v2_router01';
|
export * from '../test/generated-wrappers/i_uniswap_v2_router01';
|
||||||
|
export * from '../test/generated-wrappers/igmx';
|
||||||
export * from '../test/generated-wrappers/kyber_dmm_sampler';
|
export * from '../test/generated-wrappers/kyber_dmm_sampler';
|
||||||
export * from '../test/generated-wrappers/kyber_sampler';
|
export * from '../test/generated-wrappers/kyber_sampler';
|
||||||
export * from '../test/generated-wrappers/lido_sampler';
|
export * from '../test/generated-wrappers/lido_sampler';
|
||||||
@@ -36,6 +39,7 @@ export * from '../test/generated-wrappers/m_stable_sampler';
|
|||||||
export * from '../test/generated-wrappers/maker_p_s_m_sampler';
|
export * from '../test/generated-wrappers/maker_p_s_m_sampler';
|
||||||
export * from '../test/generated-wrappers/mooniswap_sampler';
|
export * from '../test/generated-wrappers/mooniswap_sampler';
|
||||||
export * from '../test/generated-wrappers/native_order_sampler';
|
export * from '../test/generated-wrappers/native_order_sampler';
|
||||||
|
export * from '../test/generated-wrappers/platypus_sampler';
|
||||||
export * from '../test/generated-wrappers/sampler_utils';
|
export * from '../test/generated-wrappers/sampler_utils';
|
||||||
export * from '../test/generated-wrappers/shell_sampler';
|
export * from '../test/generated-wrappers/shell_sampler';
|
||||||
export * from '../test/generated-wrappers/smoothy_sampler';
|
export * from '../test/generated-wrappers/smoothy_sampler';
|
||||||
|
@@ -19,14 +19,17 @@
|
|||||||
"test/generated-artifacts/DODOV2Sampler.json",
|
"test/generated-artifacts/DODOV2Sampler.json",
|
||||||
"test/generated-artifacts/ERC20BridgeSampler.json",
|
"test/generated-artifacts/ERC20BridgeSampler.json",
|
||||||
"test/generated-artifacts/FakeTaker.json",
|
"test/generated-artifacts/FakeTaker.json",
|
||||||
|
"test/generated-artifacts/GMXSampler.json",
|
||||||
"test/generated-artifacts/IBalancer.json",
|
"test/generated-artifacts/IBalancer.json",
|
||||||
"test/generated-artifacts/IBalancerV2Vault.json",
|
"test/generated-artifacts/IBalancerV2Vault.json",
|
||||||
"test/generated-artifacts/IBancor.json",
|
"test/generated-artifacts/IBancor.json",
|
||||||
"test/generated-artifacts/ICurve.json",
|
"test/generated-artifacts/ICurve.json",
|
||||||
|
"test/generated-artifacts/IGMX.json",
|
||||||
"test/generated-artifacts/IKyberNetwork.json",
|
"test/generated-artifacts/IKyberNetwork.json",
|
||||||
"test/generated-artifacts/IMStable.json",
|
"test/generated-artifacts/IMStable.json",
|
||||||
"test/generated-artifacts/IMooniswap.json",
|
"test/generated-artifacts/IMooniswap.json",
|
||||||
"test/generated-artifacts/IMultiBridge.json",
|
"test/generated-artifacts/IMultiBridge.json",
|
||||||
|
"test/generated-artifacts/IPlatypus.json",
|
||||||
"test/generated-artifacts/IShell.json",
|
"test/generated-artifacts/IShell.json",
|
||||||
"test/generated-artifacts/ISmoothy.json",
|
"test/generated-artifacts/ISmoothy.json",
|
||||||
"test/generated-artifacts/IUniswapExchangeQuotes.json",
|
"test/generated-artifacts/IUniswapExchangeQuotes.json",
|
||||||
@@ -39,6 +42,7 @@
|
|||||||
"test/generated-artifacts/MakerPSMSampler.json",
|
"test/generated-artifacts/MakerPSMSampler.json",
|
||||||
"test/generated-artifacts/MooniswapSampler.json",
|
"test/generated-artifacts/MooniswapSampler.json",
|
||||||
"test/generated-artifacts/NativeOrderSampler.json",
|
"test/generated-artifacts/NativeOrderSampler.json",
|
||||||
|
"test/generated-artifacts/PlatypusSampler.json",
|
||||||
"test/generated-artifacts/SamplerUtils.json",
|
"test/generated-artifacts/SamplerUtils.json",
|
||||||
"test/generated-artifacts/ShellSampler.json",
|
"test/generated-artifacts/ShellSampler.json",
|
||||||
"test/generated-artifacts/SmoothySampler.json",
|
"test/generated-artifacts/SmoothySampler.json",
|
||||||
|
@@ -1,4 +1,13 @@
|
|||||||
[
|
[
|
||||||
|
{
|
||||||
|
"version": "6.14.0",
|
||||||
|
"changes": [
|
||||||
|
{
|
||||||
|
"note": "Redeploy FQT on Avalanche and BSC"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"timestamp": 1652919697
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"version": "6.13.0",
|
"version": "6.13.0",
|
||||||
"changes": [
|
"changes": [
|
||||||
|
@@ -5,6 +5,10 @@ Edit the package's CHANGELOG.json file only.
|
|||||||
|
|
||||||
CHANGELOG
|
CHANGELOG
|
||||||
|
|
||||||
|
## v6.14.0 - _May 19, 2022_
|
||||||
|
|
||||||
|
* Redeploy FQT on Avalanche and BSC
|
||||||
|
|
||||||
## v6.13.0 - _April 22, 2022_
|
## v6.13.0 - _April 22, 2022_
|
||||||
|
|
||||||
* Redeploy FQT on mainnet and polygon (#462)
|
* Redeploy FQT on mainnet and polygon (#462)
|
||||||
|
@@ -205,7 +205,7 @@
|
|||||||
"wethTransformer": "0xac3d95668c092e895cd83a9cbafe9c7d9906471f",
|
"wethTransformer": "0xac3d95668c092e895cd83a9cbafe9c7d9906471f",
|
||||||
"payTakerTransformer": "0x4f5e8ca2cadecd4a467ae441e4b03de4278a4574",
|
"payTakerTransformer": "0x4f5e8ca2cadecd4a467ae441e4b03de4278a4574",
|
||||||
"affiliateFeeTransformer": "0x1be34ab9b2acb5c4ddd89454bdce637967e65230",
|
"affiliateFeeTransformer": "0x1be34ab9b2acb5c4ddd89454bdce637967e65230",
|
||||||
"fillQuoteTransformer": "0xfa8ca57cb24cd59e74ae1659a00104188e7e8a3e",
|
"fillQuoteTransformer": "0x0b72d55485e8d877f73cc8b14ea3e010b3e804fd",
|
||||||
"positiveSlippageFeeTransformer": "0x7f5c79ad1788573b1145f4651a248523c54f5d1f"
|
"positiveSlippageFeeTransformer": "0x7f5c79ad1788573b1145f4651a248523c54f5d1f"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -373,7 +373,7 @@
|
|||||||
"wethTransformer": "0x9b8b52391071d71cd4ad1e61d7f273268fa34c6c",
|
"wethTransformer": "0x9b8b52391071d71cd4ad1e61d7f273268fa34c6c",
|
||||||
"payTakerTransformer": "0x898c6fde239d646c73f0a57e3570b6f86a3d62a3",
|
"payTakerTransformer": "0x898c6fde239d646c73f0a57e3570b6f86a3d62a3",
|
||||||
"affiliateFeeTransformer": "0x34617b855411e52fbc05899435f44cbd0503022c",
|
"affiliateFeeTransformer": "0x34617b855411e52fbc05899435f44cbd0503022c",
|
||||||
"fillQuoteTransformer": "0xd421f50b3ae27f223aa35a04944236d257235412",
|
"fillQuoteTransformer": "0xb6c9c52ce7094fc96d8bd5d3ecd0c6feeafe3457",
|
||||||
"positiveSlippageFeeTransformer": "0x470ba89da18a6db6e8a0567b3c9214b960861857"
|
"positiveSlippageFeeTransformer": "0x470ba89da18a6db6e8a0567b3c9214b960861857"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@0x/contract-addresses",
|
"name": "@0x/contract-addresses",
|
||||||
"version": "6.13.0",
|
"version": "6.14.0",
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=6.12"
|
"node": ">=6.12"
|
||||||
},
|
},
|
||||||
|
@@ -1,4 +1,13 @@
|
|||||||
[
|
[
|
||||||
|
{
|
||||||
|
"timestamp": 1652919697,
|
||||||
|
"version": "13.20.2",
|
||||||
|
"changes": [
|
||||||
|
{
|
||||||
|
"note": "Dependencies updated"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"timestamp": 1650611093,
|
"timestamp": 1650611093,
|
||||||
"version": "13.20.1",
|
"version": "13.20.1",
|
||||||
|
@@ -5,6 +5,10 @@ Edit the package's CHANGELOG.json file only.
|
|||||||
|
|
||||||
CHANGELOG
|
CHANGELOG
|
||||||
|
|
||||||
|
## v13.20.2 - _May 19, 2022_
|
||||||
|
|
||||||
|
* Dependencies updated
|
||||||
|
|
||||||
## v13.20.1 - _April 22, 2022_
|
## v13.20.1 - _April 22, 2022_
|
||||||
|
|
||||||
* Dependencies updated
|
* Dependencies updated
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@0x/contract-wrappers",
|
"name": "@0x/contract-wrappers",
|
||||||
"version": "13.20.1",
|
"version": "13.20.2",
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=6.12"
|
"node": ">=6.12"
|
||||||
},
|
},
|
||||||
@@ -57,7 +57,7 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@0x/assert": "^3.0.34",
|
"@0x/assert": "^3.0.34",
|
||||||
"@0x/base-contract": "^6.5.0",
|
"@0x/base-contract": "^6.5.0",
|
||||||
"@0x/contract-addresses": "^6.13.0",
|
"@0x/contract-addresses": "^6.14.0",
|
||||||
"@0x/json-schemas": "^6.4.4",
|
"@0x/json-schemas": "^6.4.4",
|
||||||
"@0x/types": "^3.3.6",
|
"@0x/types": "^3.3.6",
|
||||||
"@0x/utils": "^6.5.3",
|
"@0x/utils": "^6.5.3",
|
||||||
|
@@ -1,4 +1,13 @@
|
|||||||
[
|
[
|
||||||
|
{
|
||||||
|
"timestamp": 1652919697,
|
||||||
|
"version": "8.1.19",
|
||||||
|
"changes": [
|
||||||
|
{
|
||||||
|
"note": "Dependencies updated"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"timestamp": 1650611093,
|
"timestamp": 1650611093,
|
||||||
"version": "8.1.18",
|
"version": "8.1.18",
|
||||||
|
@@ -5,6 +5,10 @@ Edit the package's CHANGELOG.json file only.
|
|||||||
|
|
||||||
CHANGELOG
|
CHANGELOG
|
||||||
|
|
||||||
|
## v8.1.19 - _May 19, 2022_
|
||||||
|
|
||||||
|
* Dependencies updated
|
||||||
|
|
||||||
## v8.1.18 - _April 22, 2022_
|
## v8.1.18 - _April 22, 2022_
|
||||||
|
|
||||||
* Dependencies updated
|
* Dependencies updated
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@0x/migrations",
|
"name": "@0x/migrations",
|
||||||
"version": "8.1.18",
|
"version": "8.1.19",
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=6.12"
|
"node": ">=6.12"
|
||||||
},
|
},
|
||||||
@@ -68,20 +68,20 @@
|
|||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@0x/base-contract": "^6.5.0",
|
"@0x/base-contract": "^6.5.0",
|
||||||
"@0x/contract-addresses": "^6.13.0",
|
"@0x/contract-addresses": "^6.14.0",
|
||||||
"@0x/contracts-asset-proxy": "^3.7.19",
|
"@0x/contracts-asset-proxy": "^3.7.19",
|
||||||
"@0x/contracts-coordinator": "^3.1.38",
|
"@0x/contracts-coordinator": "^3.1.38",
|
||||||
"@0x/contracts-dev-utils": "^1.3.36",
|
"@0x/contracts-dev-utils": "^1.3.36",
|
||||||
"@0x/contracts-erc1155": "^2.1.37",
|
"@0x/contracts-erc1155": "^2.1.37",
|
||||||
"@0x/contracts-erc20": "^3.3.29",
|
"@0x/contracts-erc20": "^3.3.30",
|
||||||
"@0x/contracts-erc721": "^3.1.37",
|
"@0x/contracts-erc721": "^3.1.37",
|
||||||
"@0x/contracts-exchange": "^3.2.38",
|
"@0x/contracts-exchange": "^3.2.38",
|
||||||
"@0x/contracts-exchange-forwarder": "^4.2.38",
|
"@0x/contracts-exchange-forwarder": "^4.2.38",
|
||||||
"@0x/contracts-extensions": "^6.2.32",
|
"@0x/contracts-extensions": "^6.2.32",
|
||||||
"@0x/contracts-multisig": "^4.1.38",
|
"@0x/contracts-multisig": "^4.1.38",
|
||||||
"@0x/contracts-staking": "^2.0.45",
|
"@0x/contracts-staking": "^2.0.45",
|
||||||
"@0x/contracts-utils": "^4.8.10",
|
"@0x/contracts-utils": "^4.8.11",
|
||||||
"@0x/contracts-zero-ex": "^0.32.0",
|
"@0x/contracts-zero-ex": "^0.33.0",
|
||||||
"@0x/sol-compiler": "^4.8.1",
|
"@0x/sol-compiler": "^4.8.1",
|
||||||
"@0x/subproviders": "^6.6.5",
|
"@0x/subproviders": "^6.6.5",
|
||||||
"@0x/typescript-typings": "^5.3.1",
|
"@0x/typescript-typings": "^5.3.1",
|
||||||
|
@@ -1,4 +1,14 @@
|
|||||||
[
|
[
|
||||||
|
{
|
||||||
|
"version": "11.13.0",
|
||||||
|
"changes": [
|
||||||
|
{
|
||||||
|
"note": "Added Support for GMX and Platypus on Avalanche",
|
||||||
|
"pr": 478
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"timestamp": 1652919697
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"version": "11.12.0",
|
"version": "11.12.0",
|
||||||
"changes": [
|
"changes": [
|
||||||
|
@@ -5,6 +5,10 @@ Edit the package's CHANGELOG.json file only.
|
|||||||
|
|
||||||
CHANGELOG
|
CHANGELOG
|
||||||
|
|
||||||
|
## v11.13.0 - _May 19, 2022_
|
||||||
|
|
||||||
|
* Added Support for GMX and Platypus on Avalanche (#478)
|
||||||
|
|
||||||
## v11.12.0 - _April 22, 2022_
|
## v11.12.0 - _April 22, 2022_
|
||||||
|
|
||||||
* Add `BalancerV2Batch` to `BridgeProtocol` enum (#462)
|
* Add `BalancerV2Batch` to `BridgeProtocol` enum (#462)
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@0x/protocol-utils",
|
"name": "@0x/protocol-utils",
|
||||||
"version": "11.12.0",
|
"version": "11.13.0",
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=6.12"
|
"node": ">=6.12"
|
||||||
},
|
},
|
||||||
@@ -63,8 +63,8 @@
|
|||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@0x/assert": "^3.0.34",
|
"@0x/assert": "^3.0.34",
|
||||||
"@0x/contract-addresses": "^6.13.0",
|
"@0x/contract-addresses": "^6.14.0",
|
||||||
"@0x/contract-wrappers": "^13.20.1",
|
"@0x/contract-wrappers": "^13.20.2",
|
||||||
"@0x/json-schemas": "^6.4.4",
|
"@0x/json-schemas": "^6.4.4",
|
||||||
"@0x/subproviders": "^6.6.5",
|
"@0x/subproviders": "^6.6.5",
|
||||||
"@0x/utils": "^6.5.3",
|
"@0x/utils": "^6.5.3",
|
||||||
|
@@ -135,6 +135,8 @@ export enum BridgeProtocol {
|
|||||||
AaveV2,
|
AaveV2,
|
||||||
Compound,
|
Compound,
|
||||||
BalancerV2Batch,
|
BalancerV2Batch,
|
||||||
|
GMX,
|
||||||
|
Platypus,
|
||||||
}
|
}
|
||||||
// tslint:enable: enum-naming
|
// tslint:enable: enum-naming
|
||||||
|
|
||||||
|
73
yarn.lock
73
yarn.lock
@@ -646,7 +646,6 @@
|
|||||||
"@0x/abi-gen@^5.8.0":
|
"@0x/abi-gen@^5.8.0":
|
||||||
version "5.8.0"
|
version "5.8.0"
|
||||||
resolved "https://registry.yarnpkg.com/@0x/abi-gen/-/abi-gen-5.8.0.tgz#d5507de71021ebb121d50dc239c80f9cbe156da2"
|
resolved "https://registry.yarnpkg.com/@0x/abi-gen/-/abi-gen-5.8.0.tgz#d5507de71021ebb121d50dc239c80f9cbe156da2"
|
||||||
integrity sha512-5+dal6EY5Ji13WozUpNsyNvYUP4TW35Z0+t+9dDTtGKtZmxK6KxlNaDTUaK4qZcGy+bv39cYnLHfjDTGOLUCyA==
|
|
||||||
dependencies:
|
dependencies:
|
||||||
"@0x/types" "^3.3.6"
|
"@0x/types" "^3.3.6"
|
||||||
"@0x/typescript-typings" "^5.3.1"
|
"@0x/typescript-typings" "^5.3.1"
|
||||||
@@ -680,7 +679,6 @@
|
|||||||
"@0x/assert@^3.0.34":
|
"@0x/assert@^3.0.34":
|
||||||
version "3.0.34"
|
version "3.0.34"
|
||||||
resolved "https://registry.yarnpkg.com/@0x/assert/-/assert-3.0.34.tgz#aa43642abb969882910f271d9eab957217510807"
|
resolved "https://registry.yarnpkg.com/@0x/assert/-/assert-3.0.34.tgz#aa43642abb969882910f271d9eab957217510807"
|
||||||
integrity sha512-KDdmUs0O055PPnijmdoBOrZwztl2fmjox1peLzeKNl5OfxwpGBxuce4AhUkmcWKI3u7Mj3Az69gUByX6/NLnVg==
|
|
||||||
dependencies:
|
dependencies:
|
||||||
"@0x/json-schemas" "^6.4.4"
|
"@0x/json-schemas" "^6.4.4"
|
||||||
"@0x/typescript-typings" "^5.3.1"
|
"@0x/typescript-typings" "^5.3.1"
|
||||||
@@ -720,7 +718,6 @@
|
|||||||
"@0x/base-contract@^6.5.0":
|
"@0x/base-contract@^6.5.0":
|
||||||
version "6.5.0"
|
version "6.5.0"
|
||||||
resolved "https://registry.yarnpkg.com/@0x/base-contract/-/base-contract-6.5.0.tgz#95b0c3000e571cf4c2a4ee648d029d0ed744b88f"
|
resolved "https://registry.yarnpkg.com/@0x/base-contract/-/base-contract-6.5.0.tgz#95b0c3000e571cf4c2a4ee648d029d0ed744b88f"
|
||||||
integrity sha512-FbtBmF1qKLvbJL7FmFtxI3enCV0a9YKkltlwgCU/CDlGqGH/1ZP0p32cWLP48tRfqrgCcvWlfc4rRTs4aIwlow==
|
|
||||||
dependencies:
|
dependencies:
|
||||||
"@0x/assert" "^3.0.34"
|
"@0x/assert" "^3.0.34"
|
||||||
"@0x/json-schemas" "^6.4.4"
|
"@0x/json-schemas" "^6.4.4"
|
||||||
@@ -838,7 +835,6 @@
|
|||||||
"@0x/contracts-gen@^2.0.46":
|
"@0x/contracts-gen@^2.0.46":
|
||||||
version "2.0.46"
|
version "2.0.46"
|
||||||
resolved "https://registry.yarnpkg.com/@0x/contracts-gen/-/contracts-gen-2.0.46.tgz#3b840b8a56b67abecb2859c1b8e1db36c309dc11"
|
resolved "https://registry.yarnpkg.com/@0x/contracts-gen/-/contracts-gen-2.0.46.tgz#3b840b8a56b67abecb2859c1b8e1db36c309dc11"
|
||||||
integrity sha512-zlFSH+TAtDvAG+fEAjOojMPP4E4tO3usmMQdHP26DzqMaJNLGuquLNsx7RQJkECfl/wfMRHMinhRd18pXlmrNw==
|
|
||||||
dependencies:
|
dependencies:
|
||||||
"@0x/sol-compiler" "^4.8.1"
|
"@0x/sol-compiler" "^4.8.1"
|
||||||
"@0x/sol-resolver" "^3.1.12"
|
"@0x/sol-resolver" "^3.1.12"
|
||||||
@@ -874,7 +870,6 @@
|
|||||||
"@0x/dev-utils@^4.2.14":
|
"@0x/dev-utils@^4.2.14":
|
||||||
version "4.2.14"
|
version "4.2.14"
|
||||||
resolved "https://registry.yarnpkg.com/@0x/dev-utils/-/dev-utils-4.2.14.tgz#2b15b3247ccaf111d8d42689907b603537b0a86c"
|
resolved "https://registry.yarnpkg.com/@0x/dev-utils/-/dev-utils-4.2.14.tgz#2b15b3247ccaf111d8d42689907b603537b0a86c"
|
||||||
integrity sha512-1NY2ito5eNo5r8kb9RUP8xoYj5WxnyrcXBDu34ezKHhTMeMcXw7LvXZWSTqrJ6jlZpWT5BM+bJEXGuHDRYJqRA==
|
|
||||||
dependencies:
|
dependencies:
|
||||||
"@0x/subproviders" "^6.6.5"
|
"@0x/subproviders" "^6.6.5"
|
||||||
"@0x/types" "^3.3.6"
|
"@0x/types" "^3.3.6"
|
||||||
@@ -912,7 +907,6 @@
|
|||||||
"@0x/json-schemas@^6.4.4":
|
"@0x/json-schemas@^6.4.4":
|
||||||
version "6.4.4"
|
version "6.4.4"
|
||||||
resolved "https://registry.yarnpkg.com/@0x/json-schemas/-/json-schemas-6.4.4.tgz#9243c18ef6c1333c3cc47bf2870912d7badb307e"
|
resolved "https://registry.yarnpkg.com/@0x/json-schemas/-/json-schemas-6.4.4.tgz#9243c18ef6c1333c3cc47bf2870912d7badb307e"
|
||||||
integrity sha512-uPl/gGQo3sYHwmoiNRITEyTOdr2bQTmsxzYquVwHIA1ZM6UHSIjiFcbeAO91aSE/U5uiCc9vuz8Ux9x+8F1BWw==
|
|
||||||
dependencies:
|
dependencies:
|
||||||
"@0x/typescript-typings" "^5.3.1"
|
"@0x/typescript-typings" "^5.3.1"
|
||||||
"@types/node" "12.12.54"
|
"@types/node" "12.12.54"
|
||||||
@@ -934,7 +928,6 @@
|
|||||||
"@0x/monorepo-scripts@^3.2.4":
|
"@0x/monorepo-scripts@^3.2.4":
|
||||||
version "3.2.4"
|
version "3.2.4"
|
||||||
resolved "https://registry.yarnpkg.com/@0x/monorepo-scripts/-/monorepo-scripts-3.2.4.tgz#7a089db39a3bd128ee22448d341cdabcc948614b"
|
resolved "https://registry.yarnpkg.com/@0x/monorepo-scripts/-/monorepo-scripts-3.2.4.tgz#7a089db39a3bd128ee22448d341cdabcc948614b"
|
||||||
integrity sha512-Fszb8zo5ao5jRRfugnmoRg1kI8el6q0SXo4Ibnpqj+ahAsjGN/1cgVuhqEzy+3PYU6X7Z/gmV1GE7RYn+mFk1g==
|
|
||||||
dependencies:
|
dependencies:
|
||||||
"@0x/types" "^3.3.6"
|
"@0x/types" "^3.3.6"
|
||||||
"@0x/utils" "^6.5.3"
|
"@0x/utils" "^6.5.3"
|
||||||
@@ -962,7 +955,6 @@
|
|||||||
"@0x/neon-router@^0.3.5":
|
"@0x/neon-router@^0.3.5":
|
||||||
version "0.3.5"
|
version "0.3.5"
|
||||||
resolved "https://registry.yarnpkg.com/@0x/neon-router/-/neon-router-0.3.5.tgz#895e7a2dc65d492a413daaea283cbc0ca6df83fa"
|
resolved "https://registry.yarnpkg.com/@0x/neon-router/-/neon-router-0.3.5.tgz#895e7a2dc65d492a413daaea283cbc0ca6df83fa"
|
||||||
integrity sha512-8wizP3smc5o4jVg1smZzCCFo4ohOrgDhO4JFjF+/oNHbFImlGHOvmH9HQ2FJXAXiLEOTxrbp3T5XxP5GNATq3w==
|
|
||||||
dependencies:
|
dependencies:
|
||||||
"@mapbox/node-pre-gyp" "^1.0.5"
|
"@mapbox/node-pre-gyp" "^1.0.5"
|
||||||
|
|
||||||
@@ -980,6 +972,22 @@
|
|||||||
ethers "~4.0.4"
|
ethers "~4.0.4"
|
||||||
lodash "^4.17.11"
|
lodash "^4.17.11"
|
||||||
|
|
||||||
|
"@0x/protocol-utils@^1.0.1":
|
||||||
|
version "1.11.2"
|
||||||
|
resolved "https://registry.yarnpkg.com/@0x/protocol-utils/-/protocol-utils-1.11.2.tgz#c27ccf3410b99d8c364550bc18dc8b04dc2e967e"
|
||||||
|
dependencies:
|
||||||
|
"@0x/assert" "^3.0.34"
|
||||||
|
"@0x/contract-addresses" "^6.12.1"
|
||||||
|
"@0x/contract-wrappers" "^13.20.0"
|
||||||
|
"@0x/json-schemas" "^6.4.4"
|
||||||
|
"@0x/subproviders" "^6.6.5"
|
||||||
|
"@0x/utils" "^6.5.3"
|
||||||
|
"@0x/web3-wrapper" "^7.6.5"
|
||||||
|
chai "^4.0.1"
|
||||||
|
ethereumjs-util "^7.0.10"
|
||||||
|
ethers "~4.0.4"
|
||||||
|
lodash "^4.17.11"
|
||||||
|
|
||||||
"@0x/quote-server@^6.0.6":
|
"@0x/quote-server@^6.0.6":
|
||||||
version "6.0.6"
|
version "6.0.6"
|
||||||
resolved "https://registry.yarnpkg.com/@0x/quote-server/-/quote-server-6.0.6.tgz#0f0bf50647efc4bff039a491689974af7e8c5776"
|
resolved "https://registry.yarnpkg.com/@0x/quote-server/-/quote-server-6.0.6.tgz#0f0bf50647efc4bff039a491689974af7e8c5776"
|
||||||
@@ -996,7 +1004,6 @@
|
|||||||
"@0x/sol-compiler@^4.8.1":
|
"@0x/sol-compiler@^4.8.1":
|
||||||
version "4.8.1"
|
version "4.8.1"
|
||||||
resolved "https://registry.yarnpkg.com/@0x/sol-compiler/-/sol-compiler-4.8.1.tgz#87340455c1ff7505a6201549910972016524857e"
|
resolved "https://registry.yarnpkg.com/@0x/sol-compiler/-/sol-compiler-4.8.1.tgz#87340455c1ff7505a6201549910972016524857e"
|
||||||
integrity sha512-bTTbrWv8GE0HbPIYK7EVxIWcPxs1R7SPr9G3qiOM+HGg7tHip8t2ehGdoY00zR7UALXVi3lHvKGl/na3uM7t4w==
|
|
||||||
dependencies:
|
dependencies:
|
||||||
"@0x/assert" "^3.0.34"
|
"@0x/assert" "^3.0.34"
|
||||||
"@0x/json-schemas" "^6.4.4"
|
"@0x/json-schemas" "^6.4.4"
|
||||||
@@ -1025,7 +1032,6 @@
|
|||||||
"@0x/sol-coverage@^4.0.45":
|
"@0x/sol-coverage@^4.0.45":
|
||||||
version "4.0.45"
|
version "4.0.45"
|
||||||
resolved "https://registry.yarnpkg.com/@0x/sol-coverage/-/sol-coverage-4.0.45.tgz#5661cfe4eae7c8c8a9d24c9173e269aae54fe366"
|
resolved "https://registry.yarnpkg.com/@0x/sol-coverage/-/sol-coverage-4.0.45.tgz#5661cfe4eae7c8c8a9d24c9173e269aae54fe366"
|
||||||
integrity sha512-6WuGPIax1l1/8dcrvwUTiB3Gz5FIbW9ie2QAiQv8qNJAVmZHDSPX3obd5eCFaVaPEtrLB7fOQpiDoyQJ7mFyZQ==
|
|
||||||
dependencies:
|
dependencies:
|
||||||
"@0x/sol-tracing-utils" "^7.3.1"
|
"@0x/sol-tracing-utils" "^7.3.1"
|
||||||
"@0x/subproviders" "^6.6.5"
|
"@0x/subproviders" "^6.6.5"
|
||||||
@@ -1040,7 +1046,6 @@
|
|||||||
"@0x/sol-profiler@^4.1.35":
|
"@0x/sol-profiler@^4.1.35":
|
||||||
version "4.1.35"
|
version "4.1.35"
|
||||||
resolved "https://registry.yarnpkg.com/@0x/sol-profiler/-/sol-profiler-4.1.35.tgz#aef3a46c11be1caeb0f060a5c3584e7b160ef67c"
|
resolved "https://registry.yarnpkg.com/@0x/sol-profiler/-/sol-profiler-4.1.35.tgz#aef3a46c11be1caeb0f060a5c3584e7b160ef67c"
|
||||||
integrity sha512-Lvs7gyyr8kiiAA2saLLCGHct9VVYC4DB4hNP+/82GDXXBu51ZYxuxE8q9M9fUj6kGyNM1jhd614w2aYUB5MpNw==
|
|
||||||
dependencies:
|
dependencies:
|
||||||
"@0x/sol-tracing-utils" "^7.3.1"
|
"@0x/sol-tracing-utils" "^7.3.1"
|
||||||
"@0x/subproviders" "^6.6.5"
|
"@0x/subproviders" "^6.6.5"
|
||||||
@@ -1055,7 +1060,6 @@
|
|||||||
"@0x/sol-resolver@^3.1.12":
|
"@0x/sol-resolver@^3.1.12":
|
||||||
version "3.1.12"
|
version "3.1.12"
|
||||||
resolved "https://registry.yarnpkg.com/@0x/sol-resolver/-/sol-resolver-3.1.12.tgz#36156ff540751ae8b5e082cfa37ab0d4192580b8"
|
resolved "https://registry.yarnpkg.com/@0x/sol-resolver/-/sol-resolver-3.1.12.tgz#36156ff540751ae8b5e082cfa37ab0d4192580b8"
|
||||||
integrity sha512-r22NN6LKaihc40PSzgpIni0nYRwk7bTu7Yz9mGySb3sgiqRHt+QJV13q5rwBuoIMwLpfmCgiL0qC3NVHcfl1BA==
|
|
||||||
dependencies:
|
dependencies:
|
||||||
"@0x/types" "^3.3.6"
|
"@0x/types" "^3.3.6"
|
||||||
"@0x/typescript-typings" "^5.3.1"
|
"@0x/typescript-typings" "^5.3.1"
|
||||||
@@ -1065,7 +1069,6 @@
|
|||||||
"@0x/sol-trace@^3.0.45":
|
"@0x/sol-trace@^3.0.45":
|
||||||
version "3.0.45"
|
version "3.0.45"
|
||||||
resolved "https://registry.yarnpkg.com/@0x/sol-trace/-/sol-trace-3.0.45.tgz#337bb5ffb362a1b3e9631cf3bb1a40d6e8f4cf3e"
|
resolved "https://registry.yarnpkg.com/@0x/sol-trace/-/sol-trace-3.0.45.tgz#337bb5ffb362a1b3e9631cf3bb1a40d6e8f4cf3e"
|
||||||
integrity sha512-zrWOJ7ut25kxHLhJGItQBt7Z3idUnpEIJlsYLhtmKK+nf3E1QLluhsdn0No0ijtBpIiI3KtlZvFXHyqktH6NCg==
|
|
||||||
dependencies:
|
dependencies:
|
||||||
"@0x/sol-tracing-utils" "^7.3.1"
|
"@0x/sol-tracing-utils" "^7.3.1"
|
||||||
"@0x/subproviders" "^6.6.5"
|
"@0x/subproviders" "^6.6.5"
|
||||||
@@ -1081,7 +1084,6 @@
|
|||||||
"@0x/sol-tracing-utils@^7.3.1":
|
"@0x/sol-tracing-utils@^7.3.1":
|
||||||
version "7.3.1"
|
version "7.3.1"
|
||||||
resolved "https://registry.yarnpkg.com/@0x/sol-tracing-utils/-/sol-tracing-utils-7.3.1.tgz#99a1948d3fac88d442beda73ea53029142e6748b"
|
resolved "https://registry.yarnpkg.com/@0x/sol-tracing-utils/-/sol-tracing-utils-7.3.1.tgz#99a1948d3fac88d442beda73ea53029142e6748b"
|
||||||
integrity sha512-IWMvokOdA83ORwyn3HqjK3+zXEGSr+fRcwNu6khikGDi70gUWVDmkSghHKltEcy05YC8mRRoJgIw8Skrzvbd4w==
|
|
||||||
dependencies:
|
dependencies:
|
||||||
"@0x/dev-utils" "^4.2.14"
|
"@0x/dev-utils" "^4.2.14"
|
||||||
"@0x/sol-compiler" "^4.8.1"
|
"@0x/sol-compiler" "^4.8.1"
|
||||||
@@ -1109,7 +1111,6 @@
|
|||||||
"@0x/subproviders@^6.6.5":
|
"@0x/subproviders@^6.6.5":
|
||||||
version "6.6.5"
|
version "6.6.5"
|
||||||
resolved "https://registry.yarnpkg.com/@0x/subproviders/-/subproviders-6.6.5.tgz#7083abd28aad5564ad5bbf98c9f7d35ebf948aff"
|
resolved "https://registry.yarnpkg.com/@0x/subproviders/-/subproviders-6.6.5.tgz#7083abd28aad5564ad5bbf98c9f7d35ebf948aff"
|
||||||
integrity sha512-tpkKH5XBgrlO4K9dMNqsYiTgrAOJUnThiu73y9tYl4mwX/1gRpyG1EebvD8w6VKPrLjnyPyMw50ZvTyaYgbXNQ==
|
|
||||||
dependencies:
|
dependencies:
|
||||||
"@0x/assert" "^3.0.34"
|
"@0x/assert" "^3.0.34"
|
||||||
"@0x/types" "^3.3.6"
|
"@0x/types" "^3.3.6"
|
||||||
@@ -1187,7 +1188,6 @@
|
|||||||
"@0x/types@^3.3.6":
|
"@0x/types@^3.3.6":
|
||||||
version "3.3.6"
|
version "3.3.6"
|
||||||
resolved "https://registry.yarnpkg.com/@0x/types/-/types-3.3.6.tgz#2746137791d5c8ca6034311a9327fc78b46c5f63"
|
resolved "https://registry.yarnpkg.com/@0x/types/-/types-3.3.6.tgz#2746137791d5c8ca6034311a9327fc78b46c5f63"
|
||||||
integrity sha512-ljtc9X4BnlM+MkcLet6hypsF1og0N4lMxt/2nNuPvbI6qude1kdu7Eyw2yb8fpwQfClTtR4rYUT6DeL0zh7qmQ==
|
|
||||||
dependencies:
|
dependencies:
|
||||||
"@types/node" "12.12.54"
|
"@types/node" "12.12.54"
|
||||||
bignumber.js "~9.0.2"
|
bignumber.js "~9.0.2"
|
||||||
@@ -1229,7 +1229,6 @@
|
|||||||
"@0x/typescript-typings@^5.3.1":
|
"@0x/typescript-typings@^5.3.1":
|
||||||
version "5.3.1"
|
version "5.3.1"
|
||||||
resolved "https://registry.yarnpkg.com/@0x/typescript-typings/-/typescript-typings-5.3.1.tgz#853bcad04fbaee4af63532317d7f9ef486dfbb1a"
|
resolved "https://registry.yarnpkg.com/@0x/typescript-typings/-/typescript-typings-5.3.1.tgz#853bcad04fbaee4af63532317d7f9ef486dfbb1a"
|
||||||
integrity sha512-baxz6gTNDI+q/TBOm8xXeqCiCu/Rw6a/cpuWzjFNPPTMgO7o4nsk6fIGFGJLuSGUmDMOx+YVzUB0emV6dMtMxA==
|
|
||||||
dependencies:
|
dependencies:
|
||||||
"@types/bn.js" "^4.11.0"
|
"@types/bn.js" "^4.11.0"
|
||||||
"@types/node" "12.12.54"
|
"@types/node" "12.12.54"
|
||||||
@@ -1296,7 +1295,6 @@
|
|||||||
"@0x/utils@^6.5.3":
|
"@0x/utils@^6.5.3":
|
||||||
version "6.5.3"
|
version "6.5.3"
|
||||||
resolved "https://registry.yarnpkg.com/@0x/utils/-/utils-6.5.3.tgz#b944ffb197a062e3996a4f2e6e43f7babe21e113"
|
resolved "https://registry.yarnpkg.com/@0x/utils/-/utils-6.5.3.tgz#b944ffb197a062e3996a4f2e6e43f7babe21e113"
|
||||||
integrity sha512-C8Af9MeNvWTtSg5eEOObSZ+7gjOGSHkhqDWv8iPfrMMt7yFkAjHxpXW+xufk6ZG2VTg+hel82GDyhKaGtoQZDA==
|
|
||||||
dependencies:
|
dependencies:
|
||||||
"@0x/types" "^3.3.6"
|
"@0x/types" "^3.3.6"
|
||||||
"@0x/typescript-typings" "^5.3.1"
|
"@0x/typescript-typings" "^5.3.1"
|
||||||
@@ -1330,7 +1328,6 @@
|
|||||||
"@0x/web3-wrapper@^7.6.5":
|
"@0x/web3-wrapper@^7.6.5":
|
||||||
version "7.6.5"
|
version "7.6.5"
|
||||||
resolved "https://registry.yarnpkg.com/@0x/web3-wrapper/-/web3-wrapper-7.6.5.tgz#9e6731663b1856c043e45165ba564ab6ee7b97f6"
|
resolved "https://registry.yarnpkg.com/@0x/web3-wrapper/-/web3-wrapper-7.6.5.tgz#9e6731663b1856c043e45165ba564ab6ee7b97f6"
|
||||||
integrity sha512-AyaisigXUsuwLcLqfji7DzQ+komL9NpaH1k2eTZMn7sxPfZZBSIMFbu3vgSKYvRnJdrXrkeKjE5h0BhIvTngMA==
|
|
||||||
dependencies:
|
dependencies:
|
||||||
"@0x/assert" "^3.0.34"
|
"@0x/assert" "^3.0.34"
|
||||||
"@0x/json-schemas" "^6.4.4"
|
"@0x/json-schemas" "^6.4.4"
|
||||||
@@ -1384,7 +1381,7 @@
|
|||||||
dependencies:
|
dependencies:
|
||||||
regenerator-runtime "^0.13.4"
|
regenerator-runtime "^0.13.4"
|
||||||
|
|
||||||
"@balancer-labs/sdk@^0.1.6":
|
"@balancer-labs/sdk@0.1.6":
|
||||||
version "0.1.6"
|
version "0.1.6"
|
||||||
resolved "https://registry.yarnpkg.com/@balancer-labs/sdk/-/sdk-0.1.6.tgz#1a6f0aacfada7b0afbdf02259ef40ed37d3ecbcb"
|
resolved "https://registry.yarnpkg.com/@balancer-labs/sdk/-/sdk-0.1.6.tgz#1a6f0aacfada7b0afbdf02259ef40ed37d3ecbcb"
|
||||||
integrity sha512-r9s7Y2XJks+8V53kqwaqHDAETipgFSEQxI7TFHYigoOtWp/sUaZnlu0kDMv3NuDvya0+t9gp5a0VxbztLwcn+g==
|
integrity sha512-r9s7Y2XJks+8V53kqwaqHDAETipgFSEQxI7TFHYigoOtWp/sUaZnlu0kDMv3NuDvya0+t9gp5a0VxbztLwcn+g==
|
||||||
@@ -1395,19 +1392,9 @@
|
|||||||
graphql-request "^3.5.0"
|
graphql-request "^3.5.0"
|
||||||
lodash "^4.17.21"
|
lodash "^4.17.21"
|
||||||
|
|
||||||
"@balancer-labs/sor@0.3.2":
|
|
||||||
version "0.3.2"
|
|
||||||
resolved "https://registry.yarnpkg.com/@balancer-labs/sor/-/sor-0.3.2.tgz#b05c63a07031c2ea13ed0d2670f5105cfaa40523"
|
|
||||||
dependencies:
|
|
||||||
bignumber.js "^9.0.0"
|
|
||||||
ethers "^4.0.39"
|
|
||||||
isomorphic-fetch "^2.2.1"
|
|
||||||
typescript "^3.8.3"
|
|
||||||
|
|
||||||
"@balancer-labs/sor@^4.0.0-beta.2":
|
"@balancer-labs/sor@^4.0.0-beta.2":
|
||||||
version "4.0.0-beta.2"
|
version "4.0.0-beta.2"
|
||||||
resolved "https://registry.yarnpkg.com/@balancer-labs/sor/-/sor-4.0.0-beta.2.tgz#17ee901c7434f9a5702653488b1a3ec6e1f926f1"
|
resolved "https://registry.yarnpkg.com/@balancer-labs/sor/-/sor-4.0.0-beta.2.tgz#17ee901c7434f9a5702653488b1a3ec6e1f926f1"
|
||||||
integrity sha512-ylDxsMDKpoynOQIH4PhucYc7bkXddjL6GRFCF2BwnQ4Yoy7vBOT7S0zJvIkKuUG6MSUdoTBaAtWckxXBJiNxyA==
|
|
||||||
dependencies:
|
dependencies:
|
||||||
isomorphic-fetch "^2.2.1"
|
isomorphic-fetch "^2.2.1"
|
||||||
|
|
||||||
@@ -3273,7 +3260,6 @@ axios@^0.21.1:
|
|||||||
axios@^0.24.0:
|
axios@^0.24.0:
|
||||||
version "0.24.0"
|
version "0.24.0"
|
||||||
resolved "https://registry.yarnpkg.com/axios/-/axios-0.24.0.tgz#804e6fa1e4b9c5288501dd9dff56a7a0940d20d6"
|
resolved "https://registry.yarnpkg.com/axios/-/axios-0.24.0.tgz#804e6fa1e4b9c5288501dd9dff56a7a0940d20d6"
|
||||||
integrity sha512-Q6cWsys88HoPgAaFAVUb0WpPk0O8iTeisR9IMqy9G8AbO4NlpVknrnQS03zzF9PGAWgO3cgletO3VjV/P7VztA==
|
|
||||||
dependencies:
|
dependencies:
|
||||||
follow-redirects "^1.14.4"
|
follow-redirects "^1.14.4"
|
||||||
|
|
||||||
@@ -3758,6 +3744,15 @@ balanced-match@^1.0.0:
|
|||||||
version "1.0.0"
|
version "1.0.0"
|
||||||
resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767"
|
resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767"
|
||||||
|
|
||||||
|
"balancer-labs-sor-v1@npm:@balancer-labs/sor@0.3.2":
|
||||||
|
version "0.3.2"
|
||||||
|
resolved "https://registry.yarnpkg.com/@balancer-labs/sor/-/sor-0.3.2.tgz#b05c63a07031c2ea13ed0d2670f5105cfaa40523"
|
||||||
|
dependencies:
|
||||||
|
bignumber.js "^9.0.0"
|
||||||
|
ethers "^4.0.39"
|
||||||
|
isomorphic-fetch "^2.2.1"
|
||||||
|
typescript "^3.8.3"
|
||||||
|
|
||||||
base-x@^3.0.2, base-x@^3.0.8:
|
base-x@^3.0.2, base-x@^3.0.8:
|
||||||
version "3.0.8"
|
version "3.0.8"
|
||||||
resolved "https://registry.yarnpkg.com/base-x/-/base-x-3.0.8.tgz#1e1106c2537f0162e8b52474a557ebb09000018d"
|
resolved "https://registry.yarnpkg.com/base-x/-/base-x-3.0.8.tgz#1e1106c2537f0162e8b52474a557ebb09000018d"
|
||||||
@@ -3801,7 +3796,6 @@ bigi@1.4.2, bigi@^1.1.0:
|
|||||||
bignumber.js@7.2.1, bignumber.js@^9.0.0, bignumber.js@^9.0.2, bignumber.js@~4.1.0, bignumber.js@~9.0.0, bignumber.js@~9.0.2:
|
bignumber.js@7.2.1, bignumber.js@^9.0.0, bignumber.js@^9.0.2, bignumber.js@~4.1.0, bignumber.js@~9.0.0, bignumber.js@~9.0.2:
|
||||||
version "9.0.2"
|
version "9.0.2"
|
||||||
resolved "https://registry.yarnpkg.com/bignumber.js/-/bignumber.js-9.0.2.tgz#71c6c6bed38de64e24a65ebe16cfcf23ae693673"
|
resolved "https://registry.yarnpkg.com/bignumber.js/-/bignumber.js-9.0.2.tgz#71c6c6bed38de64e24a65ebe16cfcf23ae693673"
|
||||||
integrity sha512-GAcQvbpsM0pUb0zw1EI0KhQEZ+lRwR5fYaAp3vPOYuP7aDvGy6cVN6XHLauvF8SOga2y0dcLcjt3iQDTSEliyw==
|
|
||||||
|
|
||||||
binary-extensions@^2.0.0:
|
binary-extensions@^2.0.0:
|
||||||
version "2.1.0"
|
version "2.1.0"
|
||||||
@@ -4583,7 +4577,6 @@ commander@^2.12.1, commander@^2.8.1:
|
|||||||
commander@^8.1.0:
|
commander@^8.1.0:
|
||||||
version "8.3.0"
|
version "8.3.0"
|
||||||
resolved "https://registry.yarnpkg.com/commander/-/commander-8.3.0.tgz#4837ea1b2da67b9c616a67afbb0fafee567bca66"
|
resolved "https://registry.yarnpkg.com/commander/-/commander-8.3.0.tgz#4837ea1b2da67b9c616a67afbb0fafee567bca66"
|
||||||
integrity sha512-OkTL9umf+He2DZkUq8f8J9of7yL6RJKI24dVITBmNfZBmri9zYZQrKkuXiKhyfPSu8tUhnVBB1iKXevvnlR4Ww==
|
|
||||||
|
|
||||||
commondir@^1.0.1:
|
commondir@^1.0.1:
|
||||||
version "1.0.1"
|
version "1.0.1"
|
||||||
@@ -5878,7 +5871,6 @@ ethereum-types@^3.5.0:
|
|||||||
ethereum-types@^3.7.0:
|
ethereum-types@^3.7.0:
|
||||||
version "3.7.0"
|
version "3.7.0"
|
||||||
resolved "https://registry.yarnpkg.com/ethereum-types/-/ethereum-types-3.7.0.tgz#2fec14cebef6e68f3b66a6efd4eaa1003f2c972b"
|
resolved "https://registry.yarnpkg.com/ethereum-types/-/ethereum-types-3.7.0.tgz#2fec14cebef6e68f3b66a6efd4eaa1003f2c972b"
|
||||||
integrity sha512-7gU4cUkpmKbAMgEdF3vWFCcLS1aKdsGxIFbd8WIHgBOHLwlcjfcxtkwrFGXuCc90cg6V4MDA9iOI7W0hQ7eTvQ==
|
|
||||||
dependencies:
|
dependencies:
|
||||||
"@types/node" "12.12.54"
|
"@types/node" "12.12.54"
|
||||||
bignumber.js "~9.0.2"
|
bignumber.js "~9.0.2"
|
||||||
@@ -6543,7 +6535,6 @@ follow-redirects@^1.10.0:
|
|||||||
follow-redirects@^1.12.1, follow-redirects@^1.14.4:
|
follow-redirects@^1.12.1, follow-redirects@^1.14.4:
|
||||||
version "1.14.9"
|
version "1.14.9"
|
||||||
resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.14.9.tgz#dd4ea157de7bfaf9ea9b3fbd85aa16951f78d8d7"
|
resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.14.9.tgz#dd4ea157de7bfaf9ea9b3fbd85aa16951f78d8d7"
|
||||||
integrity sha512-MQDfihBQYMcyy5dhRDJUHcw7lb2Pv/TuE6xP1vyraLukNDHKbDxDNaOE3NbCAdKQApno+GPRyo1YAp89yCjK4w==
|
|
||||||
|
|
||||||
for-each@~0.3.3:
|
for-each@~0.3.3:
|
||||||
version "0.3.3"
|
version "0.3.3"
|
||||||
@@ -7059,7 +7050,6 @@ graphql-request@^3.4.0:
|
|||||||
graphql-request@^3.5.0:
|
graphql-request@^3.5.0:
|
||||||
version "3.7.0"
|
version "3.7.0"
|
||||||
resolved "https://registry.yarnpkg.com/graphql-request/-/graphql-request-3.7.0.tgz#c7406e537084f8b9788541e3e6704340ca13055b"
|
resolved "https://registry.yarnpkg.com/graphql-request/-/graphql-request-3.7.0.tgz#c7406e537084f8b9788541e3e6704340ca13055b"
|
||||||
integrity sha512-dw5PxHCgBneN2DDNqpWu8QkbbJ07oOziy8z+bK/TAXufsOLaETuVO4GkXrbs0WjhdKhBMN3BkpN/RIvUHkmNUQ==
|
|
||||||
dependencies:
|
dependencies:
|
||||||
cross-fetch "^3.0.6"
|
cross-fetch "^3.0.6"
|
||||||
extract-files "^9.0.0"
|
extract-files "^9.0.0"
|
||||||
@@ -7072,7 +7062,6 @@ graphql@^15.4.0:
|
|||||||
graphql@^15.6.1:
|
graphql@^15.6.1:
|
||||||
version "15.8.0"
|
version "15.8.0"
|
||||||
resolved "https://registry.yarnpkg.com/graphql/-/graphql-15.8.0.tgz#33410e96b012fa3bdb1091cc99a94769db212b38"
|
resolved "https://registry.yarnpkg.com/graphql/-/graphql-15.8.0.tgz#33410e96b012fa3bdb1091cc99a94769db212b38"
|
||||||
integrity sha512-5gghUc24tP9HRznNpV2+FIoq3xKkj5dTQqf4v0CpdPbFVwFkWoxOM+o+2OC9ZSvjEMTjfmG9QT+gcvggTwW1zw==
|
|
||||||
|
|
||||||
growl@1.10.5:
|
growl@1.10.5:
|
||||||
version "1.10.5"
|
version "1.10.5"
|
||||||
@@ -8435,7 +8424,6 @@ lodash@4.17.20, lodash@^4.17.11, lodash@^4.17.12, lodash@^4.17.14, lodash@^4.17.
|
|||||||
lodash@^4.17.21:
|
lodash@^4.17.21:
|
||||||
version "4.17.21"
|
version "4.17.21"
|
||||||
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c"
|
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c"
|
||||||
integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==
|
|
||||||
|
|
||||||
log-driver@^1.2.7:
|
log-driver@^1.2.7:
|
||||||
version "1.2.7"
|
version "1.2.7"
|
||||||
@@ -11237,7 +11225,6 @@ socks@~2.3.2:
|
|||||||
solc@^0.8:
|
solc@^0.8:
|
||||||
version "0.8.12"
|
version "0.8.12"
|
||||||
resolved "https://registry.yarnpkg.com/solc/-/solc-0.8.12.tgz#3002ed3092ee2f7672f1a2ab80c0d8df8df3ef2b"
|
resolved "https://registry.yarnpkg.com/solc/-/solc-0.8.12.tgz#3002ed3092ee2f7672f1a2ab80c0d8df8df3ef2b"
|
||||||
integrity sha512-TU3anAhKWBQ/WrerJ9EcHrNwGOA1y5vIk5Flz7dBNamLDkX9VQTIwcKd3FiZsT0Ew8rSU7RTmJyGNHRGzP5TBA==
|
|
||||||
dependencies:
|
dependencies:
|
||||||
command-exists "^1.2.8"
|
command-exists "^1.2.8"
|
||||||
commander "^8.1.0"
|
commander "^8.1.0"
|
||||||
@@ -11267,13 +11254,6 @@ solidity-parser-antlr@^0.4.2:
|
|||||||
version "0.4.11"
|
version "0.4.11"
|
||||||
resolved "https://registry.yarnpkg.com/solidity-parser-antlr/-/solidity-parser-antlr-0.4.11.tgz#af43e1f13b3b88309a875455f5d6e565b05ee5f1"
|
resolved "https://registry.yarnpkg.com/solidity-parser-antlr/-/solidity-parser-antlr-0.4.11.tgz#af43e1f13b3b88309a875455f5d6e565b05ee5f1"
|
||||||
|
|
||||||
"sorV2@npm:@balancer-labs/sor":
|
|
||||||
version "4.0.0-beta.1"
|
|
||||||
resolved "https://registry.yarnpkg.com/@balancer-labs/sor/-/sor-4.0.0-beta.1.tgz#fb8b3f2d9bb5cec5c79446e0062aab7cdfcabccb"
|
|
||||||
integrity sha512-L3eMBRA51egMNKHkLktOr3sNJuqgoz24AfJkpzU4w1I66m9HlOPY/E3FgYKWO+1cXJ2sQZWDH3pEjnWMRnNbNg==
|
|
||||||
dependencies:
|
|
||||||
isomorphic-fetch "^2.2.1"
|
|
||||||
|
|
||||||
sort-keys@^2.0.0:
|
sort-keys@^2.0.0:
|
||||||
version "2.0.0"
|
version "2.0.0"
|
||||||
resolved "https://registry.yarnpkg.com/sort-keys/-/sort-keys-2.0.0.tgz#658535584861ec97d730d6cf41822e1f56684128"
|
resolved "https://registry.yarnpkg.com/sort-keys/-/sort-keys-2.0.0.tgz#658535584861ec97d730d6cf41822e1f56684128"
|
||||||
@@ -12190,7 +12170,6 @@ typescript@3.7.x:
|
|||||||
typescript@4.6.3:
|
typescript@4.6.3:
|
||||||
version "4.6.3"
|
version "4.6.3"
|
||||||
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.6.3.tgz#eefeafa6afdd31d725584c67a0eaba80f6fc6c6c"
|
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.6.3.tgz#eefeafa6afdd31d725584c67a0eaba80f6fc6c6c"
|
||||||
integrity sha512-yNIatDa5iaofVozS/uQJEl3JRWLKKGJKh6Yaiv0GLGSuhpFJe7P3SbHZ8/yjAHRQwKRoA6YZqlfjXWmVzoVSMw==
|
|
||||||
|
|
||||||
typescript@^3.8.3:
|
typescript@^3.8.3:
|
||||||
version "3.9.7"
|
version "3.9.7"
|
||||||
|
Reference in New Issue
Block a user