Compare commits
4 Commits
@0x/contra
...
chore/curv
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
dd98c95711 | ||
|
|
96e1ca004d | ||
|
|
80bf9fd320 | ||
|
|
ca9c0808c2 |
12
CODEOWNERS
12
CODEOWNERS
@@ -6,15 +6,15 @@
|
||||
|
||||
# https://git-scm.com/docs/gitignore#_pattern_format
|
||||
|
||||
packages/asset-swapper/ @dekz @dextracker @kyu-c
|
||||
packages/asset-swapper/ @dekz @mzhu25 @dextracker @kh-chang
|
||||
|
||||
# Dev tools & setup
|
||||
|
||||
.circleci/ @dekz
|
||||
packages/contract-addresses/ @dekz @dextracker @kyu-c
|
||||
packages/contract-artifacts/ @dekz
|
||||
packages/protocol-utils/ @dekz
|
||||
.circleci/ @dekz @mzhu25
|
||||
packages/contract-addresses/ @dekz @mzhu25 @dextracker @kh-chang
|
||||
packages/contract-artifacts/ @dekz @mzhu25
|
||||
packages/protocol-utils/ @dekz @mzhu25
|
||||
|
||||
# Protocol/smart contracts
|
||||
|
||||
contracts/ @dekz @dextracker
|
||||
contracts/ @dekz @mzhu25 @dextracker
|
||||
|
||||
@@ -1,13 +1,4 @@
|
||||
[
|
||||
{
|
||||
"timestamp": 1658950329,
|
||||
"version": "3.3.33",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1655244958,
|
||||
"version": "3.3.32",
|
||||
|
||||
@@ -5,10 +5,6 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v3.3.33 - _July 27, 2022_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v3.3.32 - _June 14, 2022_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/contracts-erc20",
|
||||
"version": "3.3.33",
|
||||
"version": "3.3.32",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -53,8 +53,8 @@
|
||||
"devDependencies": {
|
||||
"@0x/abi-gen": "^5.8.0",
|
||||
"@0x/contracts-gen": "^2.0.46",
|
||||
"@0x/contracts-test-utils": "^5.4.24",
|
||||
"@0x/contracts-utils": "^4.8.14",
|
||||
"@0x/contracts-test-utils": "^5.4.23",
|
||||
"@0x/contracts-utils": "^4.8.13",
|
||||
"@0x/dev-utils": "^4.2.14",
|
||||
"@0x/sol-compiler": "^4.8.1",
|
||||
"@0x/ts-doc-gen": "^0.0.28",
|
||||
|
||||
@@ -1,13 +1,4 @@
|
||||
[
|
||||
{
|
||||
"timestamp": 1658950329,
|
||||
"version": "5.4.24",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1655244958,
|
||||
"version": "5.4.23",
|
||||
|
||||
@@ -5,10 +5,6 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v5.4.24 - _July 27, 2022_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v5.4.23 - _June 14, 2022_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/contracts-test-utils",
|
||||
"version": "5.4.24",
|
||||
"version": "5.4.23",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -44,7 +44,7 @@
|
||||
"dependencies": {
|
||||
"@0x/assert": "^3.0.34",
|
||||
"@0x/base-contract": "^6.5.0",
|
||||
"@0x/contract-addresses": "^6.17.0",
|
||||
"@0x/contract-addresses": "^6.16.0",
|
||||
"@0x/dev-utils": "^4.2.14",
|
||||
"@0x/json-schemas": "^6.4.4",
|
||||
"@0x/order-utils": "^10.4.28",
|
||||
|
||||
@@ -1,13 +1,4 @@
|
||||
[
|
||||
{
|
||||
"timestamp": 1658950329,
|
||||
"version": "1.4.16",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1655244958,
|
||||
"version": "1.4.15",
|
||||
|
||||
@@ -5,10 +5,6 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v1.4.16 - _July 27, 2022_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v1.4.15 - _June 14, 2022_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/contracts-treasury",
|
||||
"version": "1.4.16",
|
||||
"version": "1.4.15",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -47,12 +47,12 @@
|
||||
"homepage": "https://github.com/0xProject/protocol/tree/main/contracts/treasury",
|
||||
"devDependencies": {
|
||||
"@0x/abi-gen": "^5.8.0",
|
||||
"@0x/contract-addresses": "^6.17.0",
|
||||
"@0x/contract-addresses": "^6.16.0",
|
||||
"@0x/contracts-asset-proxy": "^3.7.19",
|
||||
"@0x/contracts-erc20": "^3.3.33",
|
||||
"@0x/contracts-erc20": "^3.3.32",
|
||||
"@0x/contracts-gen": "^2.0.46",
|
||||
"@0x/contracts-staking": "^2.0.45",
|
||||
"@0x/contracts-test-utils": "^5.4.24",
|
||||
"@0x/contracts-test-utils": "^5.4.23",
|
||||
"@0x/sol-compiler": "^4.8.1",
|
||||
"@0x/ts-doc-gen": "^0.0.28",
|
||||
"@0x/tslint-config": "^4.1.4",
|
||||
@@ -73,7 +73,7 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@0x/base-contract": "^6.5.0",
|
||||
"@0x/protocol-utils": "^11.16.0",
|
||||
"@0x/protocol-utils": "^11.15.0",
|
||||
"@0x/subproviders": "^6.6.5",
|
||||
"@0x/types": "^3.3.6",
|
||||
"@0x/typescript-typings": "^5.3.1",
|
||||
|
||||
@@ -1,13 +1,4 @@
|
||||
[
|
||||
{
|
||||
"timestamp": 1658950329,
|
||||
"version": "4.8.14",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1655244958,
|
||||
"version": "4.8.13",
|
||||
|
||||
@@ -5,10 +5,6 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v4.8.14 - _July 27, 2022_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v4.8.13 - _June 14, 2022_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/contracts-utils",
|
||||
"version": "4.8.14",
|
||||
"version": "4.8.13",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -52,7 +52,7 @@
|
||||
"devDependencies": {
|
||||
"@0x/abi-gen": "^5.8.0",
|
||||
"@0x/contracts-gen": "^2.0.46",
|
||||
"@0x/contracts-test-utils": "^5.4.24",
|
||||
"@0x/contracts-test-utils": "^5.4.23",
|
||||
"@0x/dev-utils": "^4.2.14",
|
||||
"@0x/order-utils": "^10.4.28",
|
||||
"@0x/sol-compiler": "^4.8.1",
|
||||
|
||||
@@ -1,14 +1,4 @@
|
||||
[
|
||||
{
|
||||
"version": "0.36.0",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Add Synthetix support in Ethereum and Optimism bridge adapters",
|
||||
"pr": 518
|
||||
}
|
||||
],
|
||||
"timestamp": 1658950329
|
||||
},
|
||||
{
|
||||
"version": "0.35.0",
|
||||
"changes": [
|
||||
|
||||
@@ -5,10 +5,6 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v0.36.0 - _July 27, 2022_
|
||||
|
||||
* Add Synthetix support in Ethereum and Optimism bridge adapters (#518)
|
||||
|
||||
## v0.35.0 - _June 14, 2022_
|
||||
|
||||
* Adds support for Velodrome OptimismBridgeAdapter (#494)
|
||||
|
||||
@@ -57,5 +57,4 @@ library BridgeProtocols {
|
||||
uint128 internal constant PLATYPUS = 27;
|
||||
uint128 internal constant BANCORV3 = 28;
|
||||
uint128 internal constant VELODROME = 29;
|
||||
uint128 internal constant SYNTHETIX = 30;
|
||||
}
|
||||
|
||||
@@ -37,10 +37,10 @@ import "./mixins/MixinDodoV2.sol";
|
||||
import "./mixins/MixinKyberDmm.sol";
|
||||
import "./mixins/MixinLido.sol";
|
||||
import "./mixins/MixinMakerPSM.sol";
|
||||
import "./mixins/MixinMooniswap.sol";
|
||||
import "./mixins/MixinMStable.sol";
|
||||
import "./mixins/MixinNerve.sol";
|
||||
import "./mixins/MixinShell.sol";
|
||||
import "./mixins/MixinSynthetix.sol";
|
||||
import "./mixins/MixinUniswap.sol";
|
||||
import "./mixins/MixinUniswapV2.sol";
|
||||
import "./mixins/MixinUniswapV3.sol";
|
||||
@@ -63,10 +63,10 @@ contract EthereumBridgeAdapter is
|
||||
MixinKyberDmm,
|
||||
MixinLido,
|
||||
MixinMakerPSM,
|
||||
MixinMooniswap,
|
||||
MixinMStable,
|
||||
MixinNerve,
|
||||
MixinShell,
|
||||
MixinSynthetix,
|
||||
MixinUniswap,
|
||||
MixinUniswapV2,
|
||||
MixinUniswapV3,
|
||||
@@ -79,6 +79,7 @@ contract EthereumBridgeAdapter is
|
||||
MixinCompound(weth)
|
||||
MixinCurve(weth)
|
||||
MixinLido(weth)
|
||||
MixinMooniswap(weth)
|
||||
MixinUniswap(weth)
|
||||
{}
|
||||
|
||||
@@ -162,6 +163,14 @@ contract EthereumBridgeAdapter is
|
||||
sellAmount,
|
||||
order.bridgeData
|
||||
);
|
||||
} else if (protocolId == BridgeProtocols.MOONISWAP) {
|
||||
if (dryRun) { return (0, true); }
|
||||
boughtAmount = _tradeMooniswap(
|
||||
sellToken,
|
||||
buyToken,
|
||||
sellAmount,
|
||||
order.bridgeData
|
||||
);
|
||||
} else if (protocolId == BridgeProtocols.MSTABLE) {
|
||||
if (dryRun) { return (0, true); }
|
||||
boughtAmount = _tradeMStable(
|
||||
@@ -251,12 +260,6 @@ contract EthereumBridgeAdapter is
|
||||
sellAmount,
|
||||
order.bridgeData
|
||||
);
|
||||
} else if (protocolId == BridgeProtocols.SYNTHETIX) {
|
||||
if (dryRun) { return (0, true); }
|
||||
boughtAmount = _tradeSynthetix(
|
||||
sellAmount,
|
||||
order.bridgeData
|
||||
);
|
||||
} else if (protocolId == BridgeProtocols.UNKNOWN) {
|
||||
if (dryRun) { return (0, true); }
|
||||
boughtAmount = _tradeZeroExBridge(
|
||||
|
||||
@@ -25,7 +25,6 @@ import "./BridgeProtocols.sol";
|
||||
import "./mixins/MixinCurve.sol";
|
||||
import "./mixins/MixinCurveV2.sol";
|
||||
import "./mixins/MixinNerve.sol";
|
||||
import "./mixins/MixinSynthetix.sol";
|
||||
import "./mixins/MixinUniswapV3.sol";
|
||||
import "./mixins/MixinVelodrome.sol";
|
||||
import "./mixins/MixinZeroExBridge.sol";
|
||||
@@ -35,7 +34,6 @@ contract OptimismBridgeAdapter is
|
||||
MixinCurve,
|
||||
MixinCurveV2,
|
||||
MixinNerve,
|
||||
MixinSynthetix,
|
||||
MixinUniswapV3,
|
||||
MixinVelodrome,
|
||||
MixinZeroExBridge
|
||||
@@ -95,12 +93,6 @@ contract OptimismBridgeAdapter is
|
||||
sellAmount,
|
||||
order.bridgeData
|
||||
);
|
||||
} else if (protocolId == BridgeProtocols.SYNTHETIX) {
|
||||
if (dryRun) { return (0, true); }
|
||||
boughtAmount = _tradeSynthetix(
|
||||
sellAmount,
|
||||
order.bridgeData
|
||||
);
|
||||
} else if (protocolId == BridgeProtocols.UNKNOWN) {
|
||||
if (dryRun) { return (0, true); }
|
||||
boughtAmount = _tradeZeroExBridge(
|
||||
|
||||
@@ -1,99 +0,0 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
/*
|
||||
|
||||
Copyright 2022 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;
|
||||
|
||||
interface ISynthetix {
|
||||
// Ethereum Mainnet
|
||||
function exchangeAtomically(
|
||||
bytes32 sourceCurrencyKey,
|
||||
uint256 sourceAmount,
|
||||
bytes32 destinationCurrencyKey,
|
||||
bytes32 trackingCode,
|
||||
uint256 minAmount
|
||||
) external returns (uint256 amountReceived);
|
||||
|
||||
// Optimism
|
||||
function exchangeWithTracking(
|
||||
bytes32 sourceCurrencyKey,
|
||||
uint256 sourceAmount,
|
||||
bytes32 destinationCurrencyKey,
|
||||
address rewardAddress,
|
||||
bytes32 trackingCode
|
||||
) external returns (uint256 amountReceived);
|
||||
}
|
||||
|
||||
contract MixinSynthetix {
|
||||
address private constant rewardAddress =
|
||||
0x5C80239D97E1eB216b5c3D8fBa5DE5Be5d38e4C9;
|
||||
bytes32 constant trackingCode =
|
||||
0x3058000000000000000000000000000000000000000000000000000000000000;
|
||||
|
||||
function _tradeSynthetix(uint256 sellAmount, bytes memory bridgeData)
|
||||
public
|
||||
returns (uint256 boughtAmount)
|
||||
{
|
||||
(
|
||||
ISynthetix synthetix,
|
||||
bytes32 sourceCurrencyKey,
|
||||
bytes32 destinationCurrencyKey
|
||||
) = abi.decode(
|
||||
bridgeData,
|
||||
(ISynthetix, bytes32, bytes32)
|
||||
);
|
||||
|
||||
boughtAmount = exchange(
|
||||
synthetix,
|
||||
sourceCurrencyKey,
|
||||
destinationCurrencyKey,
|
||||
sellAmount
|
||||
);
|
||||
}
|
||||
|
||||
function exchange(
|
||||
ISynthetix synthetix,
|
||||
bytes32 sourceCurrencyKey,
|
||||
bytes32 destinationCurrencyKey,
|
||||
uint256 sellAmount
|
||||
) internal returns (uint256 boughtAmount) {
|
||||
uint256 chainId;
|
||||
assembly {
|
||||
chainId := chainid()
|
||||
}
|
||||
|
||||
if (chainId == 1) {
|
||||
boughtAmount = synthetix.exchangeAtomically(
|
||||
sourceCurrencyKey,
|
||||
sellAmount,
|
||||
destinationCurrencyKey,
|
||||
trackingCode,
|
||||
0
|
||||
);
|
||||
} else {
|
||||
boughtAmount = synthetix.exchangeWithTracking(
|
||||
sourceCurrencyKey,
|
||||
sellAmount,
|
||||
destinationCurrencyKey,
|
||||
rewardAddress,
|
||||
trackingCode
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/contracts-zero-ex",
|
||||
"version": "0.36.0",
|
||||
"version": "0.35.0",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -43,7 +43,7 @@
|
||||
"config": {
|
||||
"publicInterfaceContracts": "IZeroEx,ZeroEx,FullMigration,InitialMigration,IFlashWallet,IERC20Transformer,IOwnableFeature,ISimpleFunctionRegistryFeature,ITransformERC20Feature,FillQuoteTransformer,PayTakerTransformer,PositiveSlippageFeeTransformer,WethTransformer,OwnableFeature,SimpleFunctionRegistryFeature,TransformERC20Feature,AffiliateFeeTransformer,MetaTransactionsFeature,LogMetadataTransformer,LiquidityProviderFeature,ILiquidityProviderFeature,NativeOrdersFeature,INativeOrdersFeature,FeeCollectorController,FeeCollector,CurveLiquidityProvider,BatchFillNativeOrdersFeature,IBatchFillNativeOrdersFeature,MultiplexFeature,IMultiplexFeature,OtcOrdersFeature,IOtcOrdersFeature,AvalancheBridgeAdapter,BSCBridgeAdapter,CeloBridgeAdapter,EthereumBridgeAdapter,FantomBridgeAdapter,OptimismBridgeAdapter,PolygonBridgeAdapter",
|
||||
"abis:comment": "This list is auto-generated by contracts-gen. Don't edit manually.",
|
||||
"abis": "./test/generated-artifacts/@(AbstractBridgeAdapter|AffiliateFeeTransformer|AvalancheBridgeAdapter|BSCBridgeAdapter|BatchFillNativeOrdersFeature|BootstrapFeature|BridgeProtocols|CeloBridgeAdapter|CurveLiquidityProvider|ERC1155OrdersFeature|ERC165Feature|ERC721OrdersFeature|EthereumBridgeAdapter|FantomBridgeAdapter|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|MixinBancorV3|MixinCompound|MixinCryptoCom|MixinCurve|MixinCurveV2|MixinDodo|MixinDodoV2|MixinGMX|MixinKyberDmm|MixinLido|MixinMStable|MixinMakerPSM|MixinMooniswap|MixinNerve|MixinPlatypus|MixinShell|MixinSynthetix|MixinUniswap|MixinUniswapV2|MixinUniswapV3|MixinVelodrome|MixinZeroExBridge|MooniswapLiquidityProvider|MultiplexFeature|MultiplexLiquidityProvider|MultiplexOtc|MultiplexRfq|MultiplexTransformERC20|MultiplexUniswapV2|MultiplexUniswapV3|NFTOrders|NativeOrdersCancellation|NativeOrdersFeature|NativeOrdersInfo|NativeOrdersProtocolFees|NativeOrdersSettlement|OptimismBridgeAdapter|OtcOrdersFeature|OwnableFeature|PancakeSwapFeature|PayTakerTransformer|PermissionlessTransformerDeployer|PolygonBridgeAdapter|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/@(AbstractBridgeAdapter|AffiliateFeeTransformer|AvalancheBridgeAdapter|BSCBridgeAdapter|BatchFillNativeOrdersFeature|BootstrapFeature|BridgeProtocols|CeloBridgeAdapter|CurveLiquidityProvider|ERC1155OrdersFeature|ERC165Feature|ERC721OrdersFeature|EthereumBridgeAdapter|FantomBridgeAdapter|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|MixinBancorV3|MixinCompound|MixinCryptoCom|MixinCurve|MixinCurveV2|MixinDodo|MixinDodoV2|MixinGMX|MixinKyberDmm|MixinLido|MixinMStable|MixinMakerPSM|MixinMooniswap|MixinNerve|MixinPlatypus|MixinShell|MixinUniswap|MixinUniswapV2|MixinUniswapV3|MixinVelodrome|MixinZeroExBridge|MooniswapLiquidityProvider|MultiplexFeature|MultiplexLiquidityProvider|MultiplexOtc|MultiplexRfq|MultiplexTransformERC20|MultiplexUniswapV2|MultiplexUniswapV3|NFTOrders|NativeOrdersCancellation|NativeOrdersFeature|NativeOrdersInfo|NativeOrdersProtocolFees|NativeOrdersSettlement|OptimismBridgeAdapter|OtcOrdersFeature|OwnableFeature|PancakeSwapFeature|PayTakerTransformer|PermissionlessTransformerDeployer|PolygonBridgeAdapter|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": {
|
||||
"type": "git",
|
||||
@@ -56,10 +56,10 @@
|
||||
"homepage": "https://github.com/0xProject/protocol/tree/main/contracts/zero-ex",
|
||||
"devDependencies": {
|
||||
"@0x/abi-gen": "^5.8.0",
|
||||
"@0x/contract-addresses": "^6.17.0",
|
||||
"@0x/contracts-erc20": "^3.3.33",
|
||||
"@0x/contract-addresses": "^6.16.0",
|
||||
"@0x/contracts-erc20": "^3.3.32",
|
||||
"@0x/contracts-gen": "^2.0.46",
|
||||
"@0x/contracts-test-utils": "^5.4.24",
|
||||
"@0x/contracts-test-utils": "^5.4.23",
|
||||
"@0x/dev-utils": "^4.2.14",
|
||||
"@0x/order-utils": "^10.4.28",
|
||||
"@0x/sol-compiler": "^4.8.1",
|
||||
@@ -83,7 +83,7 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@0x/base-contract": "^6.5.0",
|
||||
"@0x/protocol-utils": "^11.16.0",
|
||||
"@0x/protocol-utils": "^11.15.0",
|
||||
"@0x/subproviders": "^6.6.5",
|
||||
"@0x/types": "^3.3.6",
|
||||
"@0x/typescript-typings": "^5.3.1",
|
||||
|
||||
@@ -124,7 +124,6 @@ import * as MixinMStable from '../test/generated-artifacts/MixinMStable.json';
|
||||
import * as MixinNerve from '../test/generated-artifacts/MixinNerve.json';
|
||||
import * as MixinPlatypus from '../test/generated-artifacts/MixinPlatypus.json';
|
||||
import * as MixinShell from '../test/generated-artifacts/MixinShell.json';
|
||||
import * as MixinSynthetix from '../test/generated-artifacts/MixinSynthetix.json';
|
||||
import * as MixinUniswap from '../test/generated-artifacts/MixinUniswap.json';
|
||||
import * as MixinUniswapV2 from '../test/generated-artifacts/MixinUniswapV2.json';
|
||||
import * as MixinUniswapV3 from '../test/generated-artifacts/MixinUniswapV3.json';
|
||||
@@ -348,7 +347,6 @@ export const artifacts = {
|
||||
MixinNerve: MixinNerve as ContractArtifact,
|
||||
MixinPlatypus: MixinPlatypus as ContractArtifact,
|
||||
MixinShell: MixinShell as ContractArtifact,
|
||||
MixinSynthetix: MixinSynthetix as ContractArtifact,
|
||||
MixinUniswap: MixinUniswap as ContractArtifact,
|
||||
MixinUniswapV2: MixinUniswapV2 as ContractArtifact,
|
||||
MixinUniswapV3: MixinUniswapV3 as ContractArtifact,
|
||||
|
||||
@@ -122,7 +122,6 @@ export * from '../test/generated-wrappers/mixin_mooniswap';
|
||||
export * from '../test/generated-wrappers/mixin_nerve';
|
||||
export * from '../test/generated-wrappers/mixin_platypus';
|
||||
export * from '../test/generated-wrappers/mixin_shell';
|
||||
export * from '../test/generated-wrappers/mixin_synthetix';
|
||||
export * from '../test/generated-wrappers/mixin_uniswap';
|
||||
export * from '../test/generated-wrappers/mixin_uniswap_v2';
|
||||
export * from '../test/generated-wrappers/mixin_uniswap_v3';
|
||||
|
||||
@@ -161,7 +161,6 @@
|
||||
"test/generated-artifacts/MixinNerve.json",
|
||||
"test/generated-artifacts/MixinPlatypus.json",
|
||||
"test/generated-artifacts/MixinShell.json",
|
||||
"test/generated-artifacts/MixinSynthetix.json",
|
||||
"test/generated-artifacts/MixinUniswap.json",
|
||||
"test/generated-artifacts/MixinUniswapV2.json",
|
||||
"test/generated-artifacts/MixinUniswapV3.json",
|
||||
|
||||
@@ -1,37 +1,12 @@
|
||||
[
|
||||
{
|
||||
"version": "16.64.0",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Refactor `TokenAdjacency` and `TokenAdjacencyBuilder`",
|
||||
"pr": 517
|
||||
},
|
||||
{
|
||||
"note": "Add Synthetix support`",
|
||||
"pr": 518
|
||||
},
|
||||
{
|
||||
"note": "Replace Beethoven X subgraph URL",
|
||||
"pr": 519
|
||||
},
|
||||
{
|
||||
"note": "Remove Mooniswap on Ethereum mainnet",
|
||||
"pr": 529
|
||||
}
|
||||
],
|
||||
"timestamp": 1658950329
|
||||
},
|
||||
{
|
||||
"version": "16.63.1",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Better error handling for balancer cache",
|
||||
"pr": 515
|
||||
"note": "Add debridge curve pools",
|
||||
"pr": 512
|
||||
}
|
||||
],
|
||||
"timestamp": 1657661207
|
||||
},
|
||||
{
|
||||
]
|
||||
"version": "16.63.0",
|
||||
"changes": [
|
||||
{
|
||||
|
||||
@@ -5,17 +5,6 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v16.64.0 - _July 27, 2022_
|
||||
|
||||
* Refactor `TokenAdjacency` and `TokenAdjacencyBuilder` (#517)
|
||||
* Add Synthetix support` (#518)
|
||||
* Replace Beethoven X subgraph URL (#519)
|
||||
* Remove Mooniswap on Ethereum mainnet (#529)
|
||||
|
||||
## v16.63.1 - _July 12, 2022_
|
||||
|
||||
* Better error handling for balancer cache (#515)
|
||||
|
||||
## v16.63.0 - _June 29, 2022_
|
||||
|
||||
* Remove JS router (#480)
|
||||
|
||||
@@ -39,7 +39,6 @@ import "./MooniswapSampler.sol";
|
||||
import "./NativeOrderSampler.sol";
|
||||
import "./PlatypusSampler.sol";
|
||||
import "./ShellSampler.sol";
|
||||
import "./SynthetixSampler.sol";
|
||||
import "./TwoHopSampler.sol";
|
||||
import "./UniswapSampler.sol";
|
||||
import "./UniswapV2Sampler.sol";
|
||||
@@ -68,7 +67,6 @@ contract ERC20BridgeSampler is
|
||||
NativeOrderSampler,
|
||||
PlatypusSampler,
|
||||
ShellSampler,
|
||||
SynthetixSampler,
|
||||
TwoHopSampler,
|
||||
UniswapSampler,
|
||||
UniswapV2Sampler,
|
||||
|
||||
@@ -1,173 +0,0 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
/*
|
||||
|
||||
Copyright 2022 ZeroEx Intl.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
|
||||
*/
|
||||
|
||||
pragma solidity ^0.6;
|
||||
pragma experimental ABIEncoderV2;
|
||||
|
||||
interface IReadProxyAddressResolver {
|
||||
function target() external view returns (address);
|
||||
}
|
||||
|
||||
interface IAddressResolver {
|
||||
function getAddress(bytes32 name) external view returns (address);
|
||||
}
|
||||
|
||||
interface IExchanger {
|
||||
// Ethereum Mainnet
|
||||
function getAmountsForAtomicExchange(
|
||||
uint256 sourceAmount,
|
||||
bytes32 sourceCurrencyKey,
|
||||
bytes32 destinationCurrencyKey
|
||||
)
|
||||
external
|
||||
view
|
||||
returns (
|
||||
uint256 amountReceived,
|
||||
uint256 fee,
|
||||
uint256 exchangeFeeRate
|
||||
);
|
||||
|
||||
// Optimism
|
||||
function getAmountsForExchange(
|
||||
uint256 sourceAmount,
|
||||
bytes32 sourceCurrencyKey,
|
||||
bytes32 destinationCurrencyKey
|
||||
)
|
||||
external
|
||||
view
|
||||
returns (
|
||||
uint256 amountReceived,
|
||||
uint256 fee,
|
||||
uint256 exchangeFeeRate
|
||||
);
|
||||
}
|
||||
|
||||
contract SynthetixSampler {
|
||||
|
||||
/// @dev Sample sell quotes from Synthetix Atomic Swap.
|
||||
/// @param takerTokenSymbol Symbol (currency key) of the taker token (what to sell).
|
||||
/// @param makerTokenSymbol Symbol (currency key) of the maker token (what to buy).
|
||||
/// @param takerTokenAmounts Taker token sell amount for each sample (sorted in ascending order).
|
||||
/// @return synthetix Synthetix address.
|
||||
/// @return makerTokenAmounts Maker amounts bought at each taker token amount.
|
||||
function sampleSellsFromSynthetix(
|
||||
IReadProxyAddressResolver readProxy,
|
||||
bytes32 takerTokenSymbol,
|
||||
bytes32 makerTokenSymbol,
|
||||
uint256[] memory takerTokenAmounts
|
||||
) public view returns (address synthetix, uint256[] memory makerTokenAmounts) {
|
||||
synthetix = getSynthetixAddress(readProxy);
|
||||
uint256 numSamples = takerTokenAmounts.length;
|
||||
makerTokenAmounts = new uint256[](numSamples);
|
||||
if (numSamples == 0) {
|
||||
return (synthetix, makerTokenAmounts);
|
||||
}
|
||||
|
||||
makerTokenAmounts[0] = exchange(
|
||||
readProxy,
|
||||
takerTokenAmounts[0],
|
||||
takerTokenSymbol,
|
||||
makerTokenSymbol
|
||||
);
|
||||
|
||||
// Synthetix atomic swap has a fixed rate. Calculate the rest based on the first value (and save gas).
|
||||
for (uint256 i = 1; i < numSamples; i++) {
|
||||
makerTokenAmounts[i] =
|
||||
(makerTokenAmounts[0] * takerTokenAmounts[i]) /
|
||||
takerTokenAmounts[0];
|
||||
}
|
||||
}
|
||||
|
||||
/// @dev Sample buy quotes from Synthetix Atomic Swap.
|
||||
/// @param takerTokenSymbol Symbol (currency key) of the taker token (what to sell).
|
||||
/// @param makerTokenSymbol Symbol (currency key) of the maker token (what to buy).
|
||||
/// @param makerTokenAmounts Maker token buy amount for each sample (sorted in ascending order).
|
||||
/// @return synthetix Synthetix address.
|
||||
/// @return takerTokenAmounts Taker amounts sold at each maker token amount.
|
||||
function sampleBuysFromSynthetix(
|
||||
IReadProxyAddressResolver readProxy,
|
||||
bytes32 takerTokenSymbol,
|
||||
bytes32 makerTokenSymbol,
|
||||
uint256[] memory makerTokenAmounts
|
||||
) public view returns (address synthetix, uint256[] memory takerTokenAmounts) {
|
||||
synthetix = getSynthetixAddress(readProxy);
|
||||
// Since Synthetix atomic have a fixed rate, we can pick any reasonablely size takerTokenAmount (fixed to 1 ether here) and calculate the rest.
|
||||
uint256 amountReceivedForEther = exchange(
|
||||
readProxy,
|
||||
1 ether,
|
||||
takerTokenSymbol,
|
||||
makerTokenSymbol
|
||||
);
|
||||
|
||||
uint256 numSamples = makerTokenAmounts.length;
|
||||
takerTokenAmounts = new uint256[](numSamples);
|
||||
|
||||
for (uint256 i = 0; i < numSamples; i++) {
|
||||
takerTokenAmounts[i] =
|
||||
(1 ether * makerTokenAmounts[i]) /
|
||||
amountReceivedForEther;
|
||||
}
|
||||
}
|
||||
|
||||
function exchange(
|
||||
IReadProxyAddressResolver readProxy,
|
||||
uint256 sourceAmount,
|
||||
bytes32 sourceCurrencyKey,
|
||||
bytes32 destinationCurrencyKey
|
||||
) private view returns (uint256 amountReceived) {
|
||||
IExchanger exchanger = getExchanger(readProxy);
|
||||
uint256 chainId;
|
||||
assembly {
|
||||
chainId := chainid()
|
||||
}
|
||||
|
||||
if (chainId == 1) {
|
||||
(amountReceived, , ) = exchanger.getAmountsForAtomicExchange(
|
||||
sourceAmount,
|
||||
sourceCurrencyKey,
|
||||
destinationCurrencyKey
|
||||
);
|
||||
} else {
|
||||
(amountReceived, , ) = exchanger.getAmountsForExchange(
|
||||
sourceAmount,
|
||||
sourceCurrencyKey,
|
||||
destinationCurrencyKey
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
function getSynthetixAddress(IReadProxyAddressResolver readProxy)
|
||||
private
|
||||
view
|
||||
returns (address)
|
||||
{
|
||||
return IAddressResolver(readProxy.target()).getAddress("Synthetix");
|
||||
}
|
||||
|
||||
function getExchanger(IReadProxyAddressResolver readProxy)
|
||||
private
|
||||
view
|
||||
returns (IExchanger)
|
||||
{
|
||||
return
|
||||
IExchanger(
|
||||
IAddressResolver(readProxy.target()).getAddress("Exchanger")
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/asset-swapper",
|
||||
"version": "16.64.0",
|
||||
"version": "16.63.0",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -40,7 +40,7 @@
|
||||
"config": {
|
||||
"publicInterfaceContracts": "ERC20BridgeSampler,BalanceChecker,FakeTaker",
|
||||
"abis:comment": "This list is auto-generated by contracts-gen. Don't edit manually.",
|
||||
"abis": "./test/generated-artifacts/@(ApproximateBuys|BalanceChecker|BalancerSampler|BalancerV2BatchSampler|BalancerV2Common|BalancerV2Sampler|BancorSampler|BancorV3Sampler|CompoundSampler|CurveSampler|DODOSampler|DODOV2Sampler|ERC20BridgeSampler|FakeTaker|GMXSampler|IBalancer|IBalancerV2Vault|IBancor|IBancorV3|ICurve|IGMX|IMStable|IMooniswap|IMultiBridge|IPlatypus|IShell|IUniswapExchangeQuotes|IUniswapV2Router01|KyberDmmSampler|LidoSampler|LiquidityProviderSampler|MStableSampler|MakerPSMSampler|MooniswapSampler|NativeOrderSampler|PlatypusSampler|SamplerUtils|ShellSampler|SynthetixSampler|TestNativeOrderSampler|TwoHopSampler|UniswapSampler|UniswapV2Sampler|UniswapV3Sampler|UtilitySampler|VelodromeSampler).json",
|
||||
"abis": "./test/generated-artifacts/@(ApproximateBuys|BalanceChecker|BalancerSampler|BalancerV2BatchSampler|BalancerV2Common|BalancerV2Sampler|BancorSampler|BancorV3Sampler|CompoundSampler|CurveSampler|DODOSampler|DODOV2Sampler|ERC20BridgeSampler|FakeTaker|GMXSampler|IBalancer|IBalancerV2Vault|IBancor|IBancorV3|ICurve|IGMX|IMStable|IMooniswap|IMultiBridge|IPlatypus|IShell|IUniswapExchangeQuotes|IUniswapV2Router01|KyberDmmSampler|LidoSampler|LiquidityProviderSampler|MStableSampler|MakerPSMSampler|MooniswapSampler|NativeOrderSampler|PlatypusSampler|SamplerUtils|ShellSampler|TestNativeOrderSampler|TwoHopSampler|UniswapSampler|UniswapV2Sampler|UniswapV3Sampler|UtilitySampler|VelodromeSampler).json",
|
||||
"postpublish": {
|
||||
"assets": []
|
||||
}
|
||||
@@ -61,16 +61,17 @@
|
||||
"dependencies": {
|
||||
"@0x/assert": "^3.0.34",
|
||||
"@0x/base-contract": "^6.5.0",
|
||||
"@0x/contract-addresses": "^6.17.0",
|
||||
"@0x/contract-wrappers": "^13.20.5",
|
||||
"@0x/contracts-erc20": "^3.3.33",
|
||||
"@0x/contracts-zero-ex": "^0.36.0",
|
||||
"@0x/contract-addresses": "^6.16.0",
|
||||
"@0x/contract-wrappers": "^13.20.4",
|
||||
"@0x/contracts-erc20": "^3.3.32",
|
||||
"@0x/contracts-zero-ex": "^0.35.0",
|
||||
"@0x/dev-utils": "^4.2.14",
|
||||
"@0x/json-schemas": "^6.4.4",
|
||||
"@0x/neon-router": "^0.3.5",
|
||||
"@0x/protocol-utils": "^11.16.0",
|
||||
"@0x/protocol-utils": "^11.15.0",
|
||||
"@0x/quote-server": "^6.0.6",
|
||||
"@0x/types": "^3.3.6",
|
||||
"@0x/typescript-typings": "^5.3.1",
|
||||
"@0x/utils": "^6.5.3",
|
||||
"@0x/web3-wrapper": "^7.6.5",
|
||||
"@balancer-labs/sdk": "0.1.6",
|
||||
@@ -84,7 +85,9 @@
|
||||
"axios-mock-adapter": "^1.19.0",
|
||||
"balancer-labs-sor-v1": "npm:@balancer-labs/sor@0.3.2",
|
||||
"cream-sor": "^0.3.3",
|
||||
"decimal.js": "^10.2.0",
|
||||
"ethereum-types": "^3.7.0",
|
||||
"ethereumjs-util": "^7.0.10",
|
||||
"fast-abi": "^0.0.4",
|
||||
"graphql": "^15.4.0",
|
||||
"graphql-request": "^3.4.0",
|
||||
@@ -93,8 +96,13 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@0x/abi-gen": "^5.8.0",
|
||||
"@0x/contracts-asset-proxy": "^3.7.19",
|
||||
"@0x/contracts-exchange": "^3.2.38",
|
||||
"@0x/contracts-exchange-libs": "^4.3.37",
|
||||
"@0x/contracts-gen": "^2.0.46",
|
||||
"@0x/contracts-test-utils": "^5.4.24",
|
||||
"@0x/contracts-test-utils": "^5.4.23",
|
||||
"@0x/contracts-utils": "^4.8.13",
|
||||
"@0x/mesh-rpc-client": "^9.4.2",
|
||||
"@0x/sol-compiler": "^4.8.1",
|
||||
"@0x/subproviders": "^6.6.5",
|
||||
"@0x/ts-doc-gen": "^0.0.28",
|
||||
@@ -108,6 +116,7 @@
|
||||
"chai-bignumber": "^3.0.0",
|
||||
"dirty-chai": "^2.0.1",
|
||||
"gitpkg": "https://github.com/0xProject/gitpkg.git",
|
||||
"make-promises-safe": "^1.1.0",
|
||||
"mocha": "^6.2.0",
|
||||
"npm-run-all": "^4.1.2",
|
||||
"nyc": "^11.0.1",
|
||||
|
||||
@@ -166,10 +166,9 @@ export {
|
||||
NativeFillData,
|
||||
OptimizedMarketOrder,
|
||||
SourceQuoteOperation,
|
||||
TokenAdjacencyGraph,
|
||||
UniswapV2FillData,
|
||||
} from './utils/market_operation_utils/types';
|
||||
|
||||
export { TokenAdjacencyGraph, TokenAdjacencyGraphBuilder } from './utils/token_adjacency_graph';
|
||||
export { IdentityFillAdjustor } from './utils/market_operation_utils/identity_fill_adjustor';
|
||||
export { ProtocolFeeUtils } from './utils/protocol_fee_utils';
|
||||
export {
|
||||
|
||||
@@ -32,13 +32,16 @@ import {
|
||||
import { assert } from '../utils/assert';
|
||||
import {
|
||||
CURVE_LIQUIDITY_PROVIDER_BY_CHAIN_ID,
|
||||
MOONISWAP_LIQUIDITY_PROVIDER_BY_CHAIN_ID,
|
||||
NATIVE_FEE_TOKEN_BY_CHAIN_ID,
|
||||
} from '../utils/market_operation_utils/constants';
|
||||
import { poolEncoder } from '../utils/market_operation_utils/orders';
|
||||
import {
|
||||
CurveFillData,
|
||||
ERC20BridgeSource,
|
||||
FinalUniswapV3FillData,
|
||||
LiquidityProviderFillData,
|
||||
MooniswapFillData,
|
||||
NativeRfqOrderFillData,
|
||||
OptimizedMarketBridgeOrder,
|
||||
OptimizedMarketOrder,
|
||||
@@ -304,6 +307,30 @@ export class ExchangeProxySwapQuoteConsumer implements SwapQuoteConsumerBase {
|
||||
};
|
||||
}
|
||||
|
||||
if (
|
||||
this.chainId === ChainId.Mainnet &&
|
||||
isDirectSwapCompatible(quote, optsWithDefaults, [ERC20BridgeSource.Mooniswap])
|
||||
) {
|
||||
const fillData = slippedOrders[0].fillData as MooniswapFillData;
|
||||
return {
|
||||
calldataHexString: this._exchangeProxy
|
||||
.sellToLiquidityProvider(
|
||||
isFromETH ? ETH_TOKEN_ADDRESS : sellToken,
|
||||
isToETH ? ETH_TOKEN_ADDRESS : buyToken,
|
||||
MOONISWAP_LIQUIDITY_PROVIDER_BY_CHAIN_ID[this.chainId],
|
||||
NULL_ADDRESS,
|
||||
sellAmount,
|
||||
minBuyAmount,
|
||||
poolEncoder.encode([fillData.poolAddress]),
|
||||
)
|
||||
.getABIEncodedTransactionData(),
|
||||
ethAmount: isFromETH ? sellAmount : ZERO_AMOUNT,
|
||||
toAddress: this._exchangeProxy.address,
|
||||
allowanceTarget: this.contractAddresses.exchangeProxy,
|
||||
gasOverhead: ZERO_AMOUNT,
|
||||
};
|
||||
}
|
||||
|
||||
// RFQT VIP
|
||||
if (
|
||||
[ChainId.Mainnet, ChainId.Polygon].includes(this.chainId) &&
|
||||
|
||||
@@ -17,13 +17,11 @@ import {
|
||||
GetMarketOrdersOpts,
|
||||
LiquidityProviderRegistry,
|
||||
OptimizedMarketOrder,
|
||||
TokenAdjacencyGraph,
|
||||
} from './utils/market_operation_utils/types';
|
||||
export { SamplerMetrics } from './utils/market_operation_utils/types';
|
||||
import { ExtendedQuoteReportSources, PriceComparisonsReport, QuoteReport } from './utils/quote_report_generator';
|
||||
import { MetricsProxy } from './utils/quote_requestor';
|
||||
import { TokenAdjacencyGraph } from './utils/token_adjacency_graph';
|
||||
|
||||
export type Address = string;
|
||||
|
||||
/**
|
||||
* expiryBufferMs: The number of seconds to add when calculating whether an order is expired or not. Defaults to 300s (5m).
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { ChainId, getContractAddressesForChainOrThrow } from '@0x/contract-addresses';
|
||||
import { FillQuoteTransformerOrderType } from '@0x/protocol-utils';
|
||||
import { BigNumber } from '@0x/utils';
|
||||
import { formatBytes32String, parseBytes32String } from '@ethersproject/strings';
|
||||
import { formatBytes32String } from '@ethersproject/strings';
|
||||
|
||||
import { TokenAdjacencyGraph, TokenAdjacencyGraphBuilder } from '../token_adjacency_graph';
|
||||
import { TokenAdjacencyGraphBuilder } from '../token_adjacency_graph_builder';
|
||||
|
||||
import { IdentityFillAdjustor } from './identity_fill_adjustor';
|
||||
import { SourceFilters } from './source_filters';
|
||||
@@ -32,7 +32,7 @@ import {
|
||||
MultiHopFillData,
|
||||
PlatypusInfo,
|
||||
PsmInfo,
|
||||
SynthetixFillData,
|
||||
TokenAdjacencyGraph,
|
||||
UniswapV2FillData,
|
||||
UniswapV3FillData,
|
||||
} from './types';
|
||||
@@ -60,7 +60,6 @@ function valueByChainId<T>(rest: Partial<{ [key in ChainId]: T }>, defaultValue:
|
||||
[ChainId.Mainnet]: defaultValue,
|
||||
[ChainId.Ropsten]: defaultValue,
|
||||
[ChainId.Rinkeby]: defaultValue,
|
||||
[ChainId.Goerli]: defaultValue,
|
||||
[ChainId.Kovan]: defaultValue,
|
||||
[ChainId.Ganache]: defaultValue,
|
||||
[ChainId.BSC]: defaultValue,
|
||||
@@ -89,6 +88,7 @@ export const SELL_SOURCE_FILTER_BY_CHAIN_ID = valueByChainId<SourceFilters>(
|
||||
ERC20BridgeSource.Bancor,
|
||||
ERC20BridgeSource.BancorV3,
|
||||
ERC20BridgeSource.MStable,
|
||||
ERC20BridgeSource.Mooniswap,
|
||||
ERC20BridgeSource.SushiSwap,
|
||||
ERC20BridgeSource.Shell,
|
||||
ERC20BridgeSource.MultiHop,
|
||||
@@ -107,7 +107,6 @@ export const SELL_SOURCE_FILTER_BY_CHAIN_ID = valueByChainId<SourceFilters>(
|
||||
ERC20BridgeSource.CurveV2,
|
||||
ERC20BridgeSource.ShibaSwap,
|
||||
ERC20BridgeSource.Synapse,
|
||||
ERC20BridgeSource.Synthetix,
|
||||
// TODO: enable after FQT has been redeployed on Ethereum mainnet
|
||||
// ERC20BridgeSource.AaveV2,
|
||||
// ERC20BridgeSource.Compound,
|
||||
@@ -119,17 +118,10 @@ export const SELL_SOURCE_FILTER_BY_CHAIN_ID = valueByChainId<SourceFilters>(
|
||||
ERC20BridgeSource.UniswapV2,
|
||||
ERC20BridgeSource.UniswapV3,
|
||||
ERC20BridgeSource.Curve,
|
||||
ERC20BridgeSource.Mooniswap,
|
||||
]),
|
||||
[ChainId.Rinkeby]: new SourceFilters([ERC20BridgeSource.Native]),
|
||||
[ChainId.Kovan]: new SourceFilters([ERC20BridgeSource.Native]),
|
||||
[ChainId.Goerli]: new SourceFilters([
|
||||
ERC20BridgeSource.Native,
|
||||
ERC20BridgeSource.SushiSwap,
|
||||
ERC20BridgeSource.Uniswap,
|
||||
ERC20BridgeSource.UniswapV2,
|
||||
ERC20BridgeSource.UniswapV3,
|
||||
]),
|
||||
[ChainId.PolygonMumbai]: new SourceFilters([ERC20BridgeSource.Native, ERC20BridgeSource.UniswapV3]),
|
||||
[ChainId.Ganache]: new SourceFilters([ERC20BridgeSource.Native]),
|
||||
[ChainId.BSC]: new SourceFilters([
|
||||
ERC20BridgeSource.BakerySwap,
|
||||
@@ -216,7 +208,6 @@ export const SELL_SOURCE_FILTER_BY_CHAIN_ID = valueByChainId<SourceFilters>(
|
||||
ERC20BridgeSource.CurveV2,
|
||||
ERC20BridgeSource.MultiHop,
|
||||
ERC20BridgeSource.Velodrome,
|
||||
ERC20BridgeSource.Synthetix,
|
||||
]),
|
||||
},
|
||||
new SourceFilters([]),
|
||||
@@ -237,6 +228,7 @@ export const BUY_SOURCE_FILTER_BY_CHAIN_ID = valueByChainId<SourceFilters>(
|
||||
// ERC20BridgeSource.Bancor, // FIXME: Bancor Buys not implemented in Sampler
|
||||
ERC20BridgeSource.BancorV3,
|
||||
ERC20BridgeSource.MStable,
|
||||
ERC20BridgeSource.Mooniswap,
|
||||
ERC20BridgeSource.Shell,
|
||||
ERC20BridgeSource.SushiSwap,
|
||||
ERC20BridgeSource.MultiHop,
|
||||
@@ -255,7 +247,6 @@ export const BUY_SOURCE_FILTER_BY_CHAIN_ID = valueByChainId<SourceFilters>(
|
||||
ERC20BridgeSource.CurveV2,
|
||||
ERC20BridgeSource.ShibaSwap,
|
||||
ERC20BridgeSource.Synapse,
|
||||
ERC20BridgeSource.Synthetix,
|
||||
// TODO: enable after FQT has been redeployed on Ethereum mainnet
|
||||
// ERC20BridgeSource.AaveV2,
|
||||
// ERC20BridgeSource.Compound,
|
||||
@@ -267,15 +258,8 @@ export const BUY_SOURCE_FILTER_BY_CHAIN_ID = valueByChainId<SourceFilters>(
|
||||
ERC20BridgeSource.UniswapV2,
|
||||
ERC20BridgeSource.UniswapV3,
|
||||
ERC20BridgeSource.Curve,
|
||||
ERC20BridgeSource.Mooniswap,
|
||||
]),
|
||||
[ChainId.Goerli]: new SourceFilters([
|
||||
ERC20BridgeSource.Native,
|
||||
ERC20BridgeSource.SushiSwap,
|
||||
ERC20BridgeSource.Uniswap,
|
||||
ERC20BridgeSource.UniswapV2,
|
||||
ERC20BridgeSource.UniswapV3,
|
||||
]),
|
||||
[ChainId.PolygonMumbai]: new SourceFilters([ERC20BridgeSource.Native, ERC20BridgeSource.UniswapV3]),
|
||||
[ChainId.Rinkeby]: new SourceFilters([ERC20BridgeSource.Native]),
|
||||
[ChainId.Kovan]: new SourceFilters([ERC20BridgeSource.Native]),
|
||||
[ChainId.Ganache]: new SourceFilters([ERC20BridgeSource.Native]),
|
||||
@@ -364,7 +348,6 @@ export const BUY_SOURCE_FILTER_BY_CHAIN_ID = valueByChainId<SourceFilters>(
|
||||
ERC20BridgeSource.CurveV2,
|
||||
ERC20BridgeSource.MultiHop,
|
||||
ERC20BridgeSource.Velodrome,
|
||||
ERC20BridgeSource.Synthetix,
|
||||
]),
|
||||
},
|
||||
new SourceFilters([]),
|
||||
@@ -383,8 +366,6 @@ export const FEE_QUOTE_SOURCES_BY_CHAIN_ID = valueByChainId<ERC20BridgeSource[]>
|
||||
[ChainId.Mainnet]: [ERC20BridgeSource.UniswapV2, ERC20BridgeSource.SushiSwap, ERC20BridgeSource.UniswapV3],
|
||||
[ChainId.BSC]: [ERC20BridgeSource.PancakeSwap, ERC20BridgeSource.Mooniswap, ERC20BridgeSource.SushiSwap],
|
||||
[ChainId.Ropsten]: [ERC20BridgeSource.UniswapV2, ERC20BridgeSource.SushiSwap],
|
||||
[ChainId.Goerli]: [ERC20BridgeSource.UniswapV2, ERC20BridgeSource.SushiSwap],
|
||||
[ChainId.PolygonMumbai]: [ERC20BridgeSource.UniswapV3],
|
||||
[ChainId.Polygon]: [ERC20BridgeSource.QuickSwap, ERC20BridgeSource.SushiSwap, ERC20BridgeSource.UniswapV3],
|
||||
[ChainId.Avalanche]: [ERC20BridgeSource.Pangolin, ERC20BridgeSource.TraderJoe, ERC20BridgeSource.SushiSwap],
|
||||
[ChainId.Fantom]: [ERC20BridgeSource.SpiritSwap, ERC20BridgeSource.SpookySwap, ERC20BridgeSource.SushiSwap],
|
||||
@@ -461,11 +442,6 @@ export const MAINNET_TOKENS = {
|
||||
EURS: '0xdb25f211ab05b1c97d595516f45794528a807ad8',
|
||||
sEUR: '0xd71ecff9342a5ced620049e616c5035f1db98620',
|
||||
sETH: '0x5e74c9036fb86bd7ecdcb084a0673efc32ea31cb',
|
||||
sJPY: '0xf6b1c627e95bfc3c1b4c9b825a032ff0fbf3e07d',
|
||||
sGBP: '0x97fe22e7341a0cd8db6f6c021a24dc8f4dad855f',
|
||||
sAUD: '0xf48e200eaf9906362bb1442fca31e0835773b8b4',
|
||||
sKRW: '0x269895a3df4d73b077fc823dd6da1b95f72aaf9b',
|
||||
sCHF: '0x0f83287ff768d1c1e17a42f44d644d7f22e8ee1d',
|
||||
stETH: '0xae7ab96520de3a18e5e111b5eaab095312d7fe84',
|
||||
wstETH: '0x7f39c581f595b53c5cb19bd0b3f8da6c935e2ca0',
|
||||
LINK: '0x514910771af9ca656af840dff83e8264ecf986ca',
|
||||
@@ -560,7 +536,8 @@ export const POLYGON_TOKENS = {
|
||||
BANANA: '0x5d47baba0d66083c52009271faf3f50dcc01023c',
|
||||
WEXPOLY: '0x4c4bf319237d98a30a929a96112effa8da3510eb',
|
||||
nUSD: '0xb6c473756050de474286bed418b77aeac39b02af',
|
||||
ANY: '0x6aB6d61428fde76768D7b45D8BFeec19c6eF91A8',
|
||||
ANY: '0x6ab6d61428fde76768d7b45d8bfeec19c6ef91a8',
|
||||
deUSDC: '0x1ddcaa4ed761428ae348befc6718bcb12e63bfaa',
|
||||
};
|
||||
|
||||
export const AVALANCHE_TOKENS = {
|
||||
@@ -587,6 +564,7 @@ export const AVALANCHE_TOKENS = {
|
||||
UST: '0xb599c3590f42f8f995ecfa0f85d2980b76862fc1',
|
||||
FRAX: '0xd24c2ad096400b6fbcd2ad8b24e7acbc21a1da64',
|
||||
YUSD: '0x111111111111ed1d73f860f57b2798b683f2d325',
|
||||
deUSDC: '0x28690ec942671aC8d9Bc442B667EC338eDE6dFd3',
|
||||
};
|
||||
|
||||
export const CELO_TOKENS = {
|
||||
@@ -648,6 +626,10 @@ export const FANTOM_TOKENS = {
|
||||
gMIM: '0xc664fc7b8487a3e10824cda768c1d239f2403bbe',
|
||||
};
|
||||
|
||||
export const GEIST_FANTOM_POOLS = {
|
||||
lendingPool: '0x9fad24f572045c7869117160a571b2e50b10d068',
|
||||
};
|
||||
|
||||
export const OPTIMISM_TOKENS = {
|
||||
WETH: '0x4200000000000000000000000000000000000006',
|
||||
USDC: '0x7f5c764cbc14f9669b88837ca1490cca17c31607',
|
||||
@@ -656,21 +638,6 @@ export const OPTIMISM_TOKENS = {
|
||||
WBTC: '0x68f180fcce6836688e9084f035309e29bf0a2095',
|
||||
nETH: '0x809dc529f07651bd43a172e8db6f4a7a0d771036',
|
||||
sWETH: '0x121ab82b49b2bc4c7901ca46b8277962b4350204',
|
||||
// Synthetix synths:
|
||||
sAAVE: '0x00b8d5a5e1ac97cb4341c4bc4367443c8776e8d9',
|
||||
sAVAX: '0xb2b42b231c68cbb0b4bf2ffebf57782fd97d3da4',
|
||||
sBTC: '0x298b9b95708152ff6968aafd889c6586e9169f1d',
|
||||
sETH: '0xe405de8f52ba7559f9df3c368500b6e6ae6cee49',
|
||||
sEUR: '0xfbc4198702e81ae77c06d58f81b629bdf36f0a71',
|
||||
sLINK: '0xc5db22719a06418028a40a9b5e9a7c02959d0d08',
|
||||
sMATIC: '0x81ddfac111913d3d5218dea999216323b7cd6356',
|
||||
sSOL: '0x8b2f7ae8ca8ee8428b6d76de88326bb413db2766',
|
||||
sUNI: '0xf5a6115aa582fd1beea22bc93b7dc7a785f60d03',
|
||||
sUSD: '0x8c6f28f2f1a3c87f0f938b96d27520d9751ec8d9',
|
||||
};
|
||||
|
||||
export const GEIST_FANTOM_POOLS = {
|
||||
lendingPool: '0x9fad24f572045c7869117160a571b2e50b10d068',
|
||||
};
|
||||
|
||||
export const CURVE_POOLS = {
|
||||
@@ -742,6 +709,7 @@ export const CURVE_V2_POOLS = {
|
||||
export const CURVE_POLYGON_POOLS = {
|
||||
aave: '0x445fe580ef8d70ff569ab36e80c647af338db351',
|
||||
ren: '0xc2d95eef97ec6c17551d45e77b590dc1f9117c67',
|
||||
deUSDC: '0xda43bfd7ecc6835aa6f1761ced30b986a574c0d2',
|
||||
};
|
||||
|
||||
export const CURVE_V2_POLYGON_POOLS = {
|
||||
@@ -752,6 +720,7 @@ export const CURVE_AVALANCHE_POOLS = {
|
||||
aave: '0x7f90122bf0700f9e7e1f688fe926940e8839f353',
|
||||
mim: '0xaea2e71b631fa93683bcf256a8689dfa0e094fcd',
|
||||
USDC: '0x3a43a5851a3e3e0e25a3c1089670269786be1577',
|
||||
deUSDC: '0xd39016475200ab8957e9C772C949Ef54bDA69111',
|
||||
};
|
||||
|
||||
export const CURVE_V2_AVALANCHE_POOLS = {
|
||||
@@ -887,15 +856,6 @@ export const DEFAULT_INTERMEDIATE_TOKENS_BY_CHAIN_ID = valueByChainId<string[]>(
|
||||
'0xad6d458402f60fd3bd25163575031acdce07538d', // DAI
|
||||
'0x07865c6e87b9f70255377e024ace6630c1eaa37f', // USDC
|
||||
],
|
||||
[ChainId.Goerli]: [
|
||||
getContractAddressesForChainOrThrow(ChainId.Goerli).etherToken,
|
||||
'0x11fE4B6AE13d2a6055C8D9cF65c55bac32B5d844', // DAI
|
||||
'0x07865c6E87B9F70255377e024ace6630C1Eaa37F', // USDC
|
||||
],
|
||||
[ChainId.PolygonMumbai]: [
|
||||
getContractAddressesForChainOrThrow(ChainId.PolygonMumbai).etherToken,
|
||||
'0xe6b8a5CF854791412c1f6EFC7CAf629f5Df1c747', // USDC
|
||||
],
|
||||
[ChainId.Polygon]: [
|
||||
POLYGON_TOKENS.WMATIC,
|
||||
POLYGON_TOKENS.WETH,
|
||||
@@ -947,74 +907,65 @@ export const DEFAULT_INTERMEDIATE_TOKENS_BY_CHAIN_ID = valueByChainId<string[]>(
|
||||
// attaching to a default intermediary token (stables or ETH etc) can have a large impact
|
||||
export const DEFAULT_TOKEN_ADJACENCY_GRAPH_BY_CHAIN_ID = valueByChainId<TokenAdjacencyGraph>(
|
||||
{
|
||||
[ChainId.Mainnet]: new TokenAdjacencyGraphBuilder(DEFAULT_INTERMEDIATE_TOKENS_BY_CHAIN_ID[ChainId.Mainnet])
|
||||
[ChainId.Mainnet]: new TokenAdjacencyGraphBuilder({
|
||||
default: DEFAULT_INTERMEDIATE_TOKENS_BY_CHAIN_ID[ChainId.Mainnet],
|
||||
})
|
||||
.tap(builder => {
|
||||
// Mirror Protocol
|
||||
builder.add(MAINNET_TOKENS.MIR, MAINNET_TOKENS.UST);
|
||||
// Convex and Curve
|
||||
builder.addBidirectional(MAINNET_TOKENS.cvxCRV, MAINNET_TOKENS.CRV);
|
||||
builder.add(MAINNET_TOKENS.cvxCRV, MAINNET_TOKENS.CRV).add(MAINNET_TOKENS.CRV, MAINNET_TOKENS.cvxCRV);
|
||||
// Convex and FXS
|
||||
builder.addBidirectional(MAINNET_TOKENS.cvxFXS, MAINNET_TOKENS.FXS);
|
||||
builder.add(MAINNET_TOKENS.cvxFXS, MAINNET_TOKENS.FXS).add(MAINNET_TOKENS.FXS, MAINNET_TOKENS.cvxFXS);
|
||||
// FEI TRIBE liquid in UniV2
|
||||
builder.addBidirectional(MAINNET_TOKENS.FEI, MAINNET_TOKENS.TRIBE);
|
||||
builder.add(MAINNET_TOKENS.FEI, MAINNET_TOKENS.TRIBE).add(MAINNET_TOKENS.TRIBE, MAINNET_TOKENS.FEI);
|
||||
// FRAX ecosystem
|
||||
builder.addBidirectional(MAINNET_TOKENS.FRAX, MAINNET_TOKENS.FXS);
|
||||
builder.addBidirectional(MAINNET_TOKENS.FRAX, MAINNET_TOKENS.OHM);
|
||||
builder.add(MAINNET_TOKENS.FRAX, MAINNET_TOKENS.FXS).add(MAINNET_TOKENS.FXS, MAINNET_TOKENS.FRAX);
|
||||
builder.add(MAINNET_TOKENS.FRAX, MAINNET_TOKENS.OHM).add(MAINNET_TOKENS.OHM, MAINNET_TOKENS.FRAX);
|
||||
// REDACTED CARTEL
|
||||
builder.addBidirectional(MAINNET_TOKENS.OHMV2, MAINNET_TOKENS.BTRFLY);
|
||||
builder
|
||||
.add(MAINNET_TOKENS.OHMV2, MAINNET_TOKENS.BTRFLY)
|
||||
.add(MAINNET_TOKENS.BTRFLY, MAINNET_TOKENS.OHMV2);
|
||||
// Lido
|
||||
builder.addBidirectional(MAINNET_TOKENS.stETH, MAINNET_TOKENS.wstETH);
|
||||
// Synthetix Atomic Swap
|
||||
builder.addCompleteSubgraph([
|
||||
MAINNET_TOKENS.sBTC,
|
||||
MAINNET_TOKENS.sETH,
|
||||
MAINNET_TOKENS.sUSD,
|
||||
MAINNET_TOKENS.sEUR,
|
||||
MAINNET_TOKENS.sJPY,
|
||||
MAINNET_TOKENS.sGBP,
|
||||
MAINNET_TOKENS.sAUD,
|
||||
MAINNET_TOKENS.sKRW,
|
||||
MAINNET_TOKENS.sCHF,
|
||||
]);
|
||||
builder
|
||||
.add(MAINNET_TOKENS.stETH, MAINNET_TOKENS.wstETH)
|
||||
.add(MAINNET_TOKENS.wstETH, MAINNET_TOKENS.stETH);
|
||||
})
|
||||
// Build
|
||||
.build(),
|
||||
[ChainId.BSC]: new TokenAdjacencyGraphBuilder(DEFAULT_INTERMEDIATE_TOKENS_BY_CHAIN_ID[ChainId.BSC]).build(),
|
||||
[ChainId.Polygon]: new TokenAdjacencyGraphBuilder(DEFAULT_INTERMEDIATE_TOKENS_BY_CHAIN_ID[ChainId.Polygon])
|
||||
[ChainId.BSC]: new TokenAdjacencyGraphBuilder({
|
||||
default: DEFAULT_INTERMEDIATE_TOKENS_BY_CHAIN_ID[ChainId.BSC],
|
||||
}).build(),
|
||||
[ChainId.Polygon]: new TokenAdjacencyGraphBuilder({
|
||||
default: DEFAULT_INTERMEDIATE_TOKENS_BY_CHAIN_ID[ChainId.Polygon],
|
||||
})
|
||||
.tap(builder => {
|
||||
builder.addBidirectional(POLYGON_TOKENS.QUICK, POLYGON_TOKENS.ANY);
|
||||
builder.add(POLYGON_TOKENS.QUICK, POLYGON_TOKENS.ANY).add(POLYGON_TOKENS.ANY, POLYGON_TOKENS.QUICK);
|
||||
})
|
||||
.build(),
|
||||
[ChainId.Avalanche]: new TokenAdjacencyGraphBuilder(DEFAULT_INTERMEDIATE_TOKENS_BY_CHAIN_ID[ChainId.Avalanche])
|
||||
[ChainId.Avalanche]: new TokenAdjacencyGraphBuilder({
|
||||
default: DEFAULT_INTERMEDIATE_TOKENS_BY_CHAIN_ID[ChainId.Avalanche],
|
||||
})
|
||||
.tap(builder => {
|
||||
// Synapse nETH/aWETH pool
|
||||
builder.addBidirectional(AVALANCHE_TOKENS.aWETH, AVALANCHE_TOKENS.nETH);
|
||||
builder
|
||||
.add(AVALANCHE_TOKENS.aWETH, AVALANCHE_TOKENS.nETH)
|
||||
.add(AVALANCHE_TOKENS.nETH, AVALANCHE_TOKENS.aWETH);
|
||||
// Trader Joe MAG/MIM pool
|
||||
builder.addBidirectional(AVALANCHE_TOKENS.MIM, AVALANCHE_TOKENS.MAG);
|
||||
})
|
||||
.build(),
|
||||
[ChainId.Fantom]: new TokenAdjacencyGraphBuilder(
|
||||
DEFAULT_INTERMEDIATE_TOKENS_BY_CHAIN_ID[ChainId.Fantom],
|
||||
).build(),
|
||||
[ChainId.Celo]: new TokenAdjacencyGraphBuilder(DEFAULT_INTERMEDIATE_TOKENS_BY_CHAIN_ID[ChainId.Celo]).build(),
|
||||
[ChainId.Optimism]: new TokenAdjacencyGraphBuilder(DEFAULT_INTERMEDIATE_TOKENS_BY_CHAIN_ID[ChainId.Optimism])
|
||||
.tap(builder => {
|
||||
// Synthetix Atomic Swap
|
||||
builder.addCompleteSubgraph([
|
||||
OPTIMISM_TOKENS.sAAVE,
|
||||
OPTIMISM_TOKENS.sAVAX,
|
||||
OPTIMISM_TOKENS.sBTC,
|
||||
OPTIMISM_TOKENS.sETH,
|
||||
OPTIMISM_TOKENS.sEUR,
|
||||
OPTIMISM_TOKENS.sLINK,
|
||||
OPTIMISM_TOKENS.sMATIC,
|
||||
OPTIMISM_TOKENS.sSOL,
|
||||
OPTIMISM_TOKENS.sUNI,
|
||||
OPTIMISM_TOKENS.sUSD,
|
||||
]);
|
||||
builder.add(AVALANCHE_TOKENS.MIM, AVALANCHE_TOKENS.MAG).add(AVALANCHE_TOKENS.MAG, AVALANCHE_TOKENS.MIM);
|
||||
})
|
||||
.build(),
|
||||
[ChainId.Fantom]: new TokenAdjacencyGraphBuilder({
|
||||
default: DEFAULT_INTERMEDIATE_TOKENS_BY_CHAIN_ID[ChainId.Fantom],
|
||||
}).build(),
|
||||
[ChainId.Celo]: new TokenAdjacencyGraphBuilder({
|
||||
default: DEFAULT_INTERMEDIATE_TOKENS_BY_CHAIN_ID[ChainId.Celo],
|
||||
}).build(),
|
||||
[ChainId.Optimism]: new TokenAdjacencyGraphBuilder({
|
||||
default: DEFAULT_INTERMEDIATE_TOKENS_BY_CHAIN_ID[ChainId.Optimism],
|
||||
}).build(),
|
||||
},
|
||||
TokenAdjacencyGraph.getEmptyGraph(),
|
||||
new TokenAdjacencyGraphBuilder({ default: [] }).build(),
|
||||
);
|
||||
|
||||
export const NATIVE_FEE_TOKEN_BY_CHAIN_ID = valueByChainId<string>(
|
||||
@@ -1023,8 +974,6 @@ export const NATIVE_FEE_TOKEN_BY_CHAIN_ID = valueByChainId<string>(
|
||||
[ChainId.BSC]: getContractAddressesForChainOrThrow(ChainId.BSC).etherToken,
|
||||
[ChainId.Ganache]: getContractAddressesForChainOrThrow(ChainId.Ganache).etherToken,
|
||||
[ChainId.Ropsten]: getContractAddressesForChainOrThrow(ChainId.Ropsten).etherToken,
|
||||
[ChainId.Goerli]: getContractAddressesForChainOrThrow(ChainId.Goerli).etherToken,
|
||||
[ChainId.PolygonMumbai]: getContractAddressesForChainOrThrow(ChainId.PolygonMumbai).etherToken,
|
||||
[ChainId.Rinkeby]: getContractAddressesForChainOrThrow(ChainId.Rinkeby).etherToken,
|
||||
[ChainId.Kovan]: getContractAddressesForChainOrThrow(ChainId.Kovan).etherToken,
|
||||
[ChainId.Polygon]: getContractAddressesForChainOrThrow(ChainId.Polygon).etherToken,
|
||||
@@ -1454,6 +1403,11 @@ export const CURVE_POLYGON_INFOS: { [name: string]: CurveInfo } = {
|
||||
pool: CURVE_POLYGON_POOLS.ren,
|
||||
gasSchedule: 350e3,
|
||||
}),
|
||||
[CURVE_POLYGON_POOLS.deUSDC]: createCurveExchangeUnderlyingPool({
|
||||
tokens: [POLYGON_TOKENS.deUSDC, POLYGON_TOKENS.DAI, POLYGON_TOKENS.USDC, POLYGON_TOKENS.USDT],
|
||||
pool: CURVE_POLYGON_POOLS.deUSDC,
|
||||
gasSchedule: 150e3,
|
||||
}),
|
||||
};
|
||||
|
||||
export const CURVE_V2_POLYGON_INFOS: { [name: string]: CurveInfo } = {
|
||||
@@ -1485,6 +1439,11 @@ export const CURVE_AVALANCHE_INFOS: { [name: string]: CurveInfo } = {
|
||||
pool: CURVE_AVALANCHE_POOLS.USDC,
|
||||
gasSchedule: 150e3,
|
||||
}),
|
||||
[CURVE_AVALANCHE_POOLS.deUSDC]: createCurveExchangePool({
|
||||
tokens: [AVALANCHE_TOKENS.deUSDC, AVALANCHE_TOKENS.DAI, AVALANCHE_TOKENS.USDC, AVALANCHE_TOKENS.USDT],
|
||||
pool: CURVE_AVALANCHE_POOLS.USDC,
|
||||
gasSchedule: 150e3,
|
||||
}),
|
||||
};
|
||||
|
||||
export const CURVE_V2_AVALANCHE_INFOS: { [name: string]: CurveInfo } = {
|
||||
@@ -1888,7 +1847,6 @@ export const UNISWAPV1_ROUTER_BY_CHAIN_ID = valueByChainId<string>(
|
||||
{
|
||||
[ChainId.Mainnet]: '0xc0a47dfe034b400b47bdad5fecda2621de6c4d95',
|
||||
[ChainId.Ropsten]: '0x9c83dce8ca20e9aaf9d3efc003b2ea62abc08351',
|
||||
[ChainId.Goerli]: '0x6Ce570d02D73d4c384b46135E87f8C592A8c86dA',
|
||||
},
|
||||
NULL_ADDRESS,
|
||||
);
|
||||
@@ -1897,7 +1855,6 @@ export const UNISWAPV2_ROUTER_BY_CHAIN_ID = valueByChainId<string>(
|
||||
{
|
||||
[ChainId.Mainnet]: '0xf164fc0ec4e93095b804a4795bbe1e041497b92a',
|
||||
[ChainId.Ropsten]: '0xf164fc0ec4e93095b804a4795bbe1e041497b92a',
|
||||
[ChainId.Goerli]: '0xf164fc0ec4e93095b804a4795bbe1e041497b92a',
|
||||
},
|
||||
NULL_ADDRESS,
|
||||
);
|
||||
@@ -1907,7 +1864,6 @@ export const SUSHISWAP_ROUTER_BY_CHAIN_ID = valueByChainId<string>(
|
||||
[ChainId.Mainnet]: '0xd9e1ce17f2641f24ae83637ab66a2cca9c378b9f',
|
||||
[ChainId.BSC]: '0x1b02da8cb0d097eb8d57a175b88c7d8b47997506',
|
||||
[ChainId.Ropsten]: '0x1b02da8cb0d097eb8d57a175b88c7d8b47997506',
|
||||
[ChainId.Goerli]: '0x1b02da8cb0d097eb8d57a175b88c7d8b47997506',
|
||||
[ChainId.Polygon]: '0x1b02da8cb0d097eb8d57a175b88c7d8b47997506',
|
||||
[ChainId.Avalanche]: '0x1b02da8cb0d097eb8d57a175b88c7d8b47997506',
|
||||
[ChainId.Fantom]: '0x1b02da8cb0d097eb8d57a175b88c7d8b47997506',
|
||||
@@ -1999,6 +1955,7 @@ export const KNIGHTSWAP_ROUTER_BY_CHAIN_ID = valueByChainId<string>(
|
||||
|
||||
export const MOONISWAP_REGISTRIES_BY_CHAIN_ID = valueByChainId(
|
||||
{
|
||||
[ChainId.Mainnet]: ['0xbaf9a5d4b0052359326a6cdab54babaa3a3a9643'],
|
||||
[ChainId.BSC]: ['0xd41b24bba51fac0e4827b6f94c0d6ddeb183cd64'],
|
||||
},
|
||||
[] as string[],
|
||||
@@ -2068,6 +2025,14 @@ export const MAKER_PSM_INFO_BY_CHAIN_ID = valueByChainId<PsmInfo>(
|
||||
},
|
||||
);
|
||||
|
||||
export const MOONISWAP_LIQUIDITY_PROVIDER_BY_CHAIN_ID = valueByChainId<string>(
|
||||
{
|
||||
[ChainId.Mainnet]: '0xa2033d6ba88756ce6a87584d69dc87bda9a4f889',
|
||||
[ChainId.Ropsten]: '0x87e0393aee0fb8c10b8653c6507c182264fe5a34',
|
||||
},
|
||||
NULL_ADDRESS,
|
||||
);
|
||||
|
||||
export const BANCOR_REGISTRY_BY_CHAIN_ID = valueByChainId<string>(
|
||||
{
|
||||
[ChainId.Mainnet]: '0x52Ae12ABe5D8BD778BD5397F99cA900624CfADD4',
|
||||
@@ -2188,6 +2153,13 @@ export const BALANCER_V2_SUBGRAPH_URL_BY_CHAIN = valueByChainId(
|
||||
null,
|
||||
);
|
||||
|
||||
export const BEETHOVEN_X_SUBGRAPH_URL_BY_CHAIN = valueByChainId<string>(
|
||||
{
|
||||
[ChainId.Fantom]: 'https://graph-node.beets-ftm-node.com/subgraphs/name/beethovenx',
|
||||
},
|
||||
'https://graph-node.beets-ftm-node.com/subgraphs/name/beethovenx',
|
||||
);
|
||||
|
||||
export const UNISWAPV3_CONFIG_BY_CHAIN_ID = valueByChainId(
|
||||
{
|
||||
[ChainId.Mainnet]: {
|
||||
@@ -2198,14 +2170,6 @@ export const UNISWAPV3_CONFIG_BY_CHAIN_ID = valueByChainId(
|
||||
quoter: '0x61ffe014ba17989e743c5f6cb21bf9697530b21e',
|
||||
router: '0xe592427a0aece92de3edee1f18e0157c05861564',
|
||||
},
|
||||
[ChainId.Goerli]: {
|
||||
quoter: '0x61ffe014ba17989e743c5f6cb21bf9697530b21e',
|
||||
router: '0xe592427a0aece92de3edee1f18e0157c05861564',
|
||||
},
|
||||
[ChainId.PolygonMumbai]: {
|
||||
quoter: '0x61ffe014ba17989e743c5f6cb21bf9697530b21e',
|
||||
router: '0xe592427a0aece92de3edee1f18e0157c05861564',
|
||||
},
|
||||
[ChainId.Polygon]: {
|
||||
quoter: '0x61ffe014ba17989e743c5f6cb21bf9697530b21e',
|
||||
router: '0xe592427a0aece92de3edee1f18e0157c05861564',
|
||||
@@ -2391,47 +2355,6 @@ export const VELODROME_ROUTER_BY_CHAIN_ID = valueByChainId<string>(
|
||||
NULL_ADDRESS,
|
||||
);
|
||||
|
||||
export const SYNTHETIX_READ_PROXY_BY_CHAIN_ID = valueByChainId<string>(
|
||||
{
|
||||
[ChainId.Mainnet]: '0x4e3b31eb0e5cb73641ee1e65e7dcefe520ba3ef2',
|
||||
[ChainId.Optimism]: '0x1cb059b7e74fd21665968c908806143e744d5f30',
|
||||
},
|
||||
NULL_ADDRESS,
|
||||
);
|
||||
|
||||
export const SYNTHETIX_CURRENCY_KEYS_BY_CHAIN_ID = valueByChainId<Map<string, string>>(
|
||||
{
|
||||
// There is no easy way to find out what synths are supported on mainnet.
|
||||
// The below list is based on https://sips.synthetix.io/sccp/sccp-190.
|
||||
[ChainId.Mainnet]: new Map([
|
||||
[MAINNET_TOKENS.sAUD, 'sAUD'],
|
||||
[MAINNET_TOKENS.sBTC, 'sBTC'],
|
||||
[MAINNET_TOKENS.sCHF, 'sCHF'],
|
||||
[MAINNET_TOKENS.sETH, 'sETH'],
|
||||
[MAINNET_TOKENS.sEUR, 'sEUR'],
|
||||
[MAINNET_TOKENS.sGBP, 'sGBP'],
|
||||
[MAINNET_TOKENS.sJPY, 'sJPY'],
|
||||
[MAINNET_TOKENS.sKRW, 'sKRW'],
|
||||
[MAINNET_TOKENS.sUSD, 'sUSD'],
|
||||
]),
|
||||
// Supported assets can be find through SynthUtil::synthsRates.
|
||||
// Low liquidity tokens can be excluded.
|
||||
[ChainId.Optimism]: new Map([
|
||||
[OPTIMISM_TOKENS.sAAVE, 'sAAVE'],
|
||||
[OPTIMISM_TOKENS.sAVAX, 'sAVAX'],
|
||||
[OPTIMISM_TOKENS.sBTC, 'sBTC'],
|
||||
[OPTIMISM_TOKENS.sETH, 'sETH'],
|
||||
[OPTIMISM_TOKENS.sEUR, 'sEUR'],
|
||||
[OPTIMISM_TOKENS.sLINK, 'sLINK'],
|
||||
[OPTIMISM_TOKENS.sMATIC, 'sMATIC'],
|
||||
[OPTIMISM_TOKENS.sSOL, 'sSOL'],
|
||||
[OPTIMISM_TOKENS.sUNI, 'sUNI'],
|
||||
[OPTIMISM_TOKENS.sUSD, 'sUSD'],
|
||||
]),
|
||||
},
|
||||
new Map(),
|
||||
);
|
||||
|
||||
export const VIP_ERC20_BRIDGE_SOURCES_BY_CHAIN_ID = valueByChainId<ERC20BridgeSource[]>(
|
||||
{
|
||||
[ChainId.Mainnet]: [
|
||||
@@ -2615,28 +2538,7 @@ export const DEFAULT_GAS_SCHEDULE: Required<GasSchedule> = {
|
||||
return compoundFillData.takerToken === wethAddress ? 210e3 : 250e3;
|
||||
}
|
||||
},
|
||||
[ERC20BridgeSource.Synthetix]: (fillData?: FillData) => {
|
||||
const { chainId, makerTokenSymbolBytes32, takerTokenSymbolBytes32 } = fillData as SynthetixFillData;
|
||||
const makerTokenSymbol = parseBytes32String(makerTokenSymbolBytes32);
|
||||
const takerTokenSymbol = parseBytes32String(takerTokenSymbolBytes32);
|
||||
|
||||
// Gas cost widely varies by token on mainnet.
|
||||
if (chainId === ChainId.Mainnet) {
|
||||
if (takerTokenSymbol === 'sBTC' || makerTokenSymbol === 'sBTC') {
|
||||
return 800e3;
|
||||
}
|
||||
if (takerTokenSymbol === 'sETH' || makerTokenSymbol === 'sETH') {
|
||||
return 700e3;
|
||||
}
|
||||
return 580e3;
|
||||
}
|
||||
|
||||
// Optimism
|
||||
if (takerTokenSymbol === 'sUSD' || makerTokenSymbol === 'sUSD') {
|
||||
return 480e3;
|
||||
}
|
||||
return 580e3;
|
||||
},
|
||||
//
|
||||
// BSC
|
||||
//
|
||||
@@ -2716,7 +2618,7 @@ export const DEFAULT_GET_MARKET_ORDERS_OPTS: Omit<GetMarketOrdersOpts, 'gasPrice
|
||||
allowFallback: true,
|
||||
shouldGenerateQuoteReport: true,
|
||||
shouldIncludePriceComparisonsReport: false,
|
||||
tokenAdjacencyGraph: TokenAdjacencyGraph.getEmptyGraph(),
|
||||
tokenAdjacencyGraph: { default: [] },
|
||||
neonRouterNumSamples: 14,
|
||||
fillAdjustor: new IdentityFillAdjustor(),
|
||||
};
|
||||
|
||||
@@ -12,8 +12,26 @@ import {
|
||||
FillAdjustor,
|
||||
MarketSideLiquidity,
|
||||
MultiHopFillData,
|
||||
TokenAdjacencyGraph,
|
||||
} from './types';
|
||||
|
||||
/**
|
||||
* Given a token pair, returns the intermediate tokens to consider for two-hop routes.
|
||||
*/
|
||||
export function getIntermediateTokens(
|
||||
makerToken: string,
|
||||
takerToken: string,
|
||||
tokenAdjacencyGraph: TokenAdjacencyGraph,
|
||||
): string[] {
|
||||
const intermediateTokens = _.union(
|
||||
_.get(tokenAdjacencyGraph, takerToken, tokenAdjacencyGraph.default),
|
||||
_.get(tokenAdjacencyGraph, makerToken, tokenAdjacencyGraph.default),
|
||||
);
|
||||
return _.uniqBy(intermediateTokens, a => a.toLowerCase()).filter(
|
||||
token => token.toLowerCase() !== makerToken.toLowerCase() && token.toLowerCase() !== takerToken.toLowerCase(),
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the best two-hop quote and the fee-adjusted rate of that quote.
|
||||
*/
|
||||
|
||||
@@ -38,7 +38,6 @@ import {
|
||||
OrderDomain,
|
||||
PlatypusFillData,
|
||||
ShellFillData,
|
||||
SynthetixFillData,
|
||||
UniswapV2FillData,
|
||||
UniswapV3FillData,
|
||||
UniswapV3PathAmount,
|
||||
@@ -211,8 +210,6 @@ export function getErc20BridgeSourceToBridgeSource(source: ERC20BridgeSource): s
|
||||
return encodeBridgeSourceId(BridgeProtocol.BancorV3, 'BancorV3');
|
||||
case ERC20BridgeSource.Velodrome:
|
||||
return encodeBridgeSourceId(BridgeProtocol.Velodrome, 'Velodrome');
|
||||
case ERC20BridgeSource.Synthetix:
|
||||
return encodeBridgeSourceId(BridgeProtocol.Synthetix, 'Synthetix');
|
||||
default:
|
||||
throw new Error(AggregationError.NoBridgeForSource);
|
||||
}
|
||||
@@ -394,14 +391,6 @@ export function createBridgeDataForBridgeOrder(order: OptimizedMarketBridgeOrder
|
||||
const velodromeFillData = (order as OptimizedMarketBridgeOrder<VelodromeFillData>).fillData;
|
||||
bridgeData = encoder.encode([velodromeFillData.router, velodromeFillData.stable]);
|
||||
break;
|
||||
case ERC20BridgeSource.Synthetix:
|
||||
const fillData = (order as OptimizedMarketBridgeOrder<SynthetixFillData>).fillData;
|
||||
bridgeData = encoder.encode([
|
||||
fillData.synthetix,
|
||||
fillData.takerTokenSymbolBytes32,
|
||||
fillData.makerTokenSymbolBytes32,
|
||||
]);
|
||||
break;
|
||||
default:
|
||||
throw new Error(AggregationError.NoBridgeForSource);
|
||||
}
|
||||
@@ -528,7 +517,6 @@ export const BRIDGE_ENCODERS: {
|
||||
[ERC20BridgeSource.Compound]: AbiEncoder.create('(address)'),
|
||||
[ERC20BridgeSource.Geist]: AbiEncoder.create('(address,address)'),
|
||||
[ERC20BridgeSource.Velodrome]: AbiEncoder.create('(address,bool)'),
|
||||
[ERC20BridgeSource.Synthetix]: AbiEncoder.create('(address,bytes32,bytes32)'),
|
||||
};
|
||||
|
||||
function getFillTokenAmounts(fill: Fill, side: MarketOperation): [BigNumber, BigNumber] {
|
||||
|
||||
@@ -2,8 +2,6 @@ import { getPoolsWithTokens, parsePoolData } from 'balancer-labs-sor-v1';
|
||||
import { Pool } from 'balancer-labs-sor-v1/dist/types';
|
||||
import { gql, request } from 'graphql-request';
|
||||
|
||||
import { DEFAULT_WARNING_LOGGER } from '../../../constants';
|
||||
import { LogFunction } from '../../../types';
|
||||
import { BALANCER_MAX_POOLS_FETCHED, BALANCER_SUBGRAPH_URL, BALANCER_TOP_POOLS_FETCHED } from '../constants';
|
||||
|
||||
import { CacheValue, PoolsCache } from './pools_cache';
|
||||
@@ -26,7 +24,6 @@ export class BalancerPoolsCache extends PoolsCache {
|
||||
cache: { [key: string]: CacheValue } = {},
|
||||
private readonly maxPoolsFetched: number = BALANCER_MAX_POOLS_FETCHED,
|
||||
private readonly _topPoolsFetched: number = BALANCER_TOP_POOLS_FETCHED,
|
||||
private readonly _warningLogger: LogFunction = DEFAULT_WARNING_LOGGER,
|
||||
) {
|
||||
super(cache);
|
||||
void this._loadTopPoolsAsync();
|
||||
@@ -52,14 +49,7 @@ export class BalancerPoolsCache extends PoolsCache {
|
||||
[from: string]: { [to: string]: Pool[] };
|
||||
} = {};
|
||||
|
||||
let pools: BalancerPoolResponse[];
|
||||
try {
|
||||
pools = await this._fetchTopPoolsAsync();
|
||||
} catch (err) {
|
||||
this._warningLogger(err, 'Failed to fetch top pools for Balancer V1');
|
||||
return;
|
||||
}
|
||||
|
||||
const pools = await this._fetchTopPoolsAsync();
|
||||
for (const pool of pools) {
|
||||
const { tokensList } = pool;
|
||||
for (const from of tokensList) {
|
||||
|
||||
@@ -6,15 +6,15 @@ import { gql, request } from 'graphql-request';
|
||||
|
||||
import { DEFAULT_WARNING_LOGGER } from '../../../constants';
|
||||
import { LogFunction } from '../../../types';
|
||||
import { BALANCER_MAX_POOLS_FETCHED, BALANCER_TOP_POOLS_FETCHED } from '../constants';
|
||||
import {
|
||||
BALANCER_MAX_POOLS_FETCHED,
|
||||
BALANCER_TOP_POOLS_FETCHED,
|
||||
BALANCER_V2_SUBGRAPH_URL_BY_CHAIN,
|
||||
} from '../constants';
|
||||
|
||||
import { parsePoolData } from './balancer_sor_v2';
|
||||
import { CacheValue, PoolsCache } from './pools_cache';
|
||||
|
||||
const BEETHOVEN_X_SUBGRAPH_URL_BY_CHAIN = new Map<ChainId, string>([
|
||||
[ChainId.Fantom, 'https://api.thegraph.com/subgraphs/name/beethovenxfi/beethovenx'],
|
||||
]);
|
||||
|
||||
// tslint:disable-next-line:custom-no-magic-numbers
|
||||
const ONE_DAY_MS = 24 * 60 * 60 * 1000;
|
||||
|
||||
@@ -29,15 +29,6 @@ interface BalancerPoolResponse {
|
||||
}
|
||||
|
||||
export class BalancerV2PoolsCache extends PoolsCache {
|
||||
public static createBeethovenXPoolCache(chainId: ChainId): BalancerV2PoolsCache | undefined {
|
||||
const subgraphUrl = BEETHOVEN_X_SUBGRAPH_URL_BY_CHAIN.get(chainId);
|
||||
if (subgraphUrl === undefined) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
return new BalancerV2PoolsCache(subgraphUrl);
|
||||
}
|
||||
|
||||
private static _parseSubgraphPoolData(pool: any, takerToken: string, makerToken: string): Pool {
|
||||
const tToken = pool.tokens.find((t: any) => t.address === takerToken);
|
||||
const mToken = pool.tokens.find((t: any) => t.address === makerToken);
|
||||
@@ -59,7 +50,8 @@ export class BalancerV2PoolsCache extends PoolsCache {
|
||||
}
|
||||
|
||||
constructor(
|
||||
private readonly subgraphUrl: string,
|
||||
chainId: ChainId,
|
||||
private readonly subgraphUrl: string = BALANCER_V2_SUBGRAPH_URL_BY_CHAIN[chainId]!,
|
||||
private readonly maxPoolsFetched: number = BALANCER_MAX_POOLS_FETCHED,
|
||||
private readonly _topPoolsFetched: number = BALANCER_TOP_POOLS_FETCHED,
|
||||
private readonly _warningLogger: LogFunction = DEFAULT_WARNING_LOGGER,
|
||||
@@ -71,6 +63,19 @@ export class BalancerV2PoolsCache extends PoolsCache {
|
||||
setInterval(async () => void this._loadTopPoolsAsync(), ONE_DAY_MS / 2);
|
||||
}
|
||||
|
||||
// protected async _fetchPoolsForPairAsync(takerToken: string, makerToken: string): Promise<Pool[]> {
|
||||
// try {
|
||||
// const poolData = (await getPoolsWithTokens(takerToken, makerToken)).pools;
|
||||
// // Sort by maker token balance (descending)
|
||||
// const pools = parsePoolData(poolData, takerToken, makerToken).sort((a, b) =>
|
||||
// b.balanceOut.minus(a.balanceOut).toNumber(),
|
||||
// );
|
||||
// return pools.length > this.maxPoolsFetched ? pools.slice(0, this.maxPoolsFetched) : pools;
|
||||
// } catch (err) {
|
||||
// return [];
|
||||
// }
|
||||
// }
|
||||
|
||||
protected async _fetchTopPoolsAsync(): Promise<BalancerPoolResponse[]> {
|
||||
const query = gql`
|
||||
query fetchTopPools($topPoolsFetched: Int!) {
|
||||
@@ -109,14 +114,7 @@ export class BalancerV2PoolsCache extends PoolsCache {
|
||||
[from: string]: { [to: string]: Pool[] };
|
||||
} = {};
|
||||
|
||||
let pools: BalancerPoolResponse[];
|
||||
try {
|
||||
pools = await this._fetchTopPoolsAsync();
|
||||
} catch (err) {
|
||||
this._warningLogger(err, 'Failed to fetch top pools for Balancer V2');
|
||||
return;
|
||||
}
|
||||
|
||||
const pools = await this._fetchTopPoolsAsync();
|
||||
for (const pool of pools) {
|
||||
const { tokensList } = pool;
|
||||
for (const from of tokensList) {
|
||||
|
||||
@@ -3,11 +3,10 @@ import { BigNumber, NULL_BYTES } from '@0x/utils';
|
||||
|
||||
import { SamplerOverrides } from '../../types';
|
||||
import { ERC20BridgeSamplerContract } from '../../wrappers';
|
||||
import { TokenAdjacencyGraph } from '../token_adjacency_graph';
|
||||
|
||||
import { BancorService } from './bancor_service';
|
||||
import { PoolsCacheMap, SamplerOperations } from './sampler_operations';
|
||||
import { BatchedOperation, LiquidityProviderRegistry } from './types';
|
||||
import { BatchedOperation, LiquidityProviderRegistry, TokenAdjacencyGraph } from './types';
|
||||
|
||||
/**
|
||||
* Generate sample amounts up to `maxFillAmount`.
|
||||
|
||||
@@ -1,14 +1,12 @@
|
||||
import { ChainId } from '@0x/contract-addresses';
|
||||
import { LimitOrderFields } from '@0x/protocol-utils';
|
||||
import { BigNumber, logUtils } from '@0x/utils';
|
||||
import { formatBytes32String } from '@ethersproject/strings';
|
||||
import * as _ from 'lodash';
|
||||
|
||||
import { AaveV2Sampler } from '../../noop_samplers/AaveV2Sampler';
|
||||
import { GeistSampler } from '../../noop_samplers/GeistSampler';
|
||||
import { SamplerCallResult, SignedNativeOrder } from '../../types';
|
||||
import { ERC20BridgeSamplerContract } from '../../wrappers';
|
||||
import { TokenAdjacencyGraph } from '../token_adjacency_graph';
|
||||
|
||||
import { AaveV2ReservesCache } from './aave_reserves_cache';
|
||||
import { BancorService } from './bancor_service';
|
||||
@@ -29,6 +27,7 @@ import {
|
||||
BANCOR_REGISTRY_BY_CHAIN_ID,
|
||||
BANCORV3_NETWORK_BY_CHAIN_ID,
|
||||
BANCORV3_NETWORK_INFO_BY_CHAIN_ID,
|
||||
BEETHOVEN_X_SUBGRAPH_URL_BY_CHAIN,
|
||||
BEETHOVEN_X_VAULT_ADDRESS_BY_CHAIN,
|
||||
COMPOUND_API_URL_BY_CHAIN_ID,
|
||||
DODOV1_CONFIG_BY_CHAIN_ID,
|
||||
@@ -47,8 +46,6 @@ import {
|
||||
NULL_ADDRESS,
|
||||
PLATYPUS_ROUTER_BY_CHAIN_ID,
|
||||
SELL_SOURCE_FILTER_BY_CHAIN_ID,
|
||||
SYNTHETIX_CURRENCY_KEYS_BY_CHAIN_ID,
|
||||
SYNTHETIX_READ_PROXY_BY_CHAIN_ID,
|
||||
UNISWAPV1_ROUTER_BY_CHAIN_ID,
|
||||
UNISWAPV3_CONFIG_BY_CHAIN_ID,
|
||||
VELODROME_ROUTER_BY_CHAIN_ID,
|
||||
@@ -56,7 +53,8 @@ import {
|
||||
} from './constants';
|
||||
import { getGeistInfoForPair } from './geist_utils';
|
||||
import { getLiquidityProvidersForPair } from './liquidity_provider_utils';
|
||||
import { BalancerPoolsCache, BalancerV2PoolsCache, CreamPoolsCache } from './pools_cache';
|
||||
import { getIntermediateTokens } from './multihop_utils';
|
||||
import { BalancerPoolsCache, BalancerV2PoolsCache, CreamPoolsCache, PoolsCache } from './pools_cache';
|
||||
import { BalancerV2SwapInfoCache } from './pools_cache/balancer_v2_utils_new';
|
||||
import { SamplerContractOperation } from './sampler_contract_operation';
|
||||
import { SamplerNoOperation } from './sampler_no_operation';
|
||||
@@ -95,7 +93,8 @@ import {
|
||||
PsmInfo,
|
||||
ShellFillData,
|
||||
SourceQuoteOperation,
|
||||
SynthetixFillData,
|
||||
SourcesWithPoolsCache,
|
||||
TokenAdjacencyGraph,
|
||||
UniswapV2FillData,
|
||||
UniswapV3FillData,
|
||||
VelodromeFillData,
|
||||
@@ -113,12 +112,9 @@ export const TWO_HOP_SOURCE_FILTERS = SourceFilters.all().exclude([
|
||||
*/
|
||||
export const BATCH_SOURCE_FILTERS = SourceFilters.all().exclude([ERC20BridgeSource.MultiHop, ERC20BridgeSource.Native]);
|
||||
|
||||
export interface PoolsCacheMap {
|
||||
[ERC20BridgeSource.Balancer]: BalancerPoolsCache;
|
||||
export type PoolsCacheMap = { [key in Exclude<SourcesWithPoolsCache, ERC20BridgeSource.BalancerV2>]: PoolsCache } & {
|
||||
[ERC20BridgeSource.BalancerV2]: BalancerV2SwapInfoCache | undefined;
|
||||
[ERC20BridgeSource.Beethovenx]: BalancerV2PoolsCache | undefined;
|
||||
[ERC20BridgeSource.Cream]: CreamPoolsCache;
|
||||
}
|
||||
};
|
||||
|
||||
// tslint:disable:no-inferred-empty-object-type no-unbound-method
|
||||
|
||||
@@ -144,7 +140,7 @@ export class SamplerOperations {
|
||||
public readonly chainId: ChainId,
|
||||
protected readonly _samplerContract: ERC20BridgeSamplerContract,
|
||||
poolsCaches?: PoolsCacheMap,
|
||||
protected readonly tokenAdjacencyGraph: TokenAdjacencyGraph = TokenAdjacencyGraph.getEmptyGraph(),
|
||||
protected readonly tokenAdjacencyGraph: TokenAdjacencyGraph = { default: [] },
|
||||
liquidityProviderRegistry: LiquidityProviderRegistry = {},
|
||||
bancorServiceFn: () => Promise<BancorService | undefined> = async () => undefined,
|
||||
) {
|
||||
@@ -155,7 +151,10 @@ export class SamplerOperations {
|
||||
this.poolsCaches = poolsCaches
|
||||
? poolsCaches
|
||||
: {
|
||||
[ERC20BridgeSource.Beethovenx]: BalancerV2PoolsCache.createBeethovenXPoolCache(chainId),
|
||||
[ERC20BridgeSource.Beethovenx]: new BalancerV2PoolsCache(
|
||||
chainId,
|
||||
BEETHOVEN_X_SUBGRAPH_URL_BY_CHAIN[chainId],
|
||||
),
|
||||
[ERC20BridgeSource.Balancer]: new BalancerPoolsCache(),
|
||||
[ERC20BridgeSource.Cream]: new CreamPoolsCache(),
|
||||
[ERC20BridgeSource.BalancerV2]:
|
||||
@@ -811,7 +810,7 @@ export class SamplerOperations {
|
||||
if (_sources.length === 0) {
|
||||
return SamplerOperations.constant([]);
|
||||
}
|
||||
const intermediateTokens = this.tokenAdjacencyGraph.getIntermediateTokens(makerToken, takerToken);
|
||||
const intermediateTokens = getIntermediateTokens(makerToken, takerToken, this.tokenAdjacencyGraph);
|
||||
const subOps = intermediateTokens.map(intermediateToken => {
|
||||
const firstHopOps = this._getSellQuoteOperations(_sources, intermediateToken, takerToken, [ZERO_AMOUNT]);
|
||||
const secondHopOps = this._getSellQuoteOperations(_sources, makerToken, intermediateToken, [ZERO_AMOUNT]);
|
||||
@@ -866,7 +865,7 @@ export class SamplerOperations {
|
||||
if (_sources.length === 0) {
|
||||
return SamplerOperations.constant([]);
|
||||
}
|
||||
const intermediateTokens = this.tokenAdjacencyGraph.getIntermediateTokens(makerToken, takerToken);
|
||||
const intermediateTokens = getIntermediateTokens(makerToken, takerToken, this.tokenAdjacencyGraph);
|
||||
const subOps = intermediateTokens.map(intermediateToken => {
|
||||
const firstHopOps = this._getBuyQuoteOperations(_sources, intermediateToken, takerToken, [
|
||||
new BigNumber(0),
|
||||
@@ -1311,60 +1310,6 @@ export class SamplerOperations {
|
||||
});
|
||||
}
|
||||
|
||||
public getSynthetixSellQuotes(
|
||||
readProxy: string,
|
||||
takerTokenSymbol: string,
|
||||
makerTokenSymbol: string,
|
||||
takerFillAmounts: BigNumber[],
|
||||
): SourceQuoteOperation<SynthetixFillData> {
|
||||
const takerTokenSymbolBytes32 = formatBytes32String(takerTokenSymbol);
|
||||
const makerTokenSymbolBytes32 = formatBytes32String(makerTokenSymbol);
|
||||
return new SamplerContractOperation({
|
||||
source: ERC20BridgeSource.Synthetix,
|
||||
contract: this._samplerContract,
|
||||
function: this._samplerContract.sampleSellsFromSynthetix,
|
||||
params: [readProxy, takerTokenSymbolBytes32, makerTokenSymbolBytes32, takerFillAmounts],
|
||||
callback: (callResults: string, fillData: SynthetixFillData): BigNumber[] => {
|
||||
const [synthetix, samples] = this._samplerContract.getABIDecodedReturnData<[string, BigNumber[]]>(
|
||||
'sampleSellsFromSynthetix',
|
||||
callResults,
|
||||
);
|
||||
fillData.synthetix = synthetix;
|
||||
fillData.takerTokenSymbolBytes32 = takerTokenSymbolBytes32;
|
||||
fillData.makerTokenSymbolBytes32 = makerTokenSymbolBytes32;
|
||||
fillData.chainId = this.chainId;
|
||||
return samples;
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
public getSynthetixBuyQuotes(
|
||||
readProxy: string,
|
||||
takerTokenSymbol: string,
|
||||
makerTokenSymbol: string,
|
||||
makerFillAmounts: BigNumber[],
|
||||
): SourceQuoteOperation<SynthetixFillData> {
|
||||
const takerTokenSymbolBytes32 = formatBytes32String(takerTokenSymbol);
|
||||
const makerTokenSymbolBytes32 = formatBytes32String(makerTokenSymbol);
|
||||
return new SamplerContractOperation({
|
||||
source: ERC20BridgeSource.Synthetix,
|
||||
contract: this._samplerContract,
|
||||
function: this._samplerContract.sampleBuysFromSynthetix,
|
||||
params: [readProxy, takerTokenSymbolBytes32, makerTokenSymbolBytes32, makerFillAmounts],
|
||||
callback: (callResults: string, fillData: SynthetixFillData): BigNumber[] => {
|
||||
const [synthetix, samples] = this._samplerContract.getABIDecodedReturnData<[string, BigNumber[]]>(
|
||||
'sampleBuysFromSynthetix',
|
||||
callResults,
|
||||
);
|
||||
fillData.synthetix = synthetix;
|
||||
fillData.takerTokenSymbolBytes32 = takerTokenSymbolBytes32;
|
||||
fillData.makerTokenSymbolBytes32 = makerTokenSymbolBytes32;
|
||||
fillData.chainId = this.chainId;
|
||||
return samples;
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the best price for the native token
|
||||
* Best is calculated according to the fee schedule, so the price of the
|
||||
@@ -1380,13 +1325,9 @@ export class SamplerOperations {
|
||||
if (makerToken.toLowerCase() === nativeToken.toLowerCase()) {
|
||||
return SamplerOperations.constant(new BigNumber(1));
|
||||
}
|
||||
const subOps = this._getSellQuoteOperations(
|
||||
sources,
|
||||
makerToken,
|
||||
nativeToken,
|
||||
[nativeFillAmount],
|
||||
TokenAdjacencyGraph.getEmptyGraph(),
|
||||
);
|
||||
const subOps = this._getSellQuoteOperations(sources, makerToken, nativeToken, [nativeFillAmount], {
|
||||
default: [],
|
||||
});
|
||||
return this._createBatch(
|
||||
subOps,
|
||||
(samples: BigNumber[][]) => {
|
||||
@@ -1482,7 +1423,7 @@ export class SamplerOperations {
|
||||
): SourceQuoteOperation[] {
|
||||
// Find the adjacent tokens in the provided token adjacency graph,
|
||||
// e.g if this is DAI->USDC we may check for DAI->WETH->USDC
|
||||
const intermediateTokens = tokenAdjacencyGraph.getIntermediateTokens(makerToken, takerToken);
|
||||
const intermediateTokens = getIntermediateTokens(makerToken, takerToken, tokenAdjacencyGraph);
|
||||
// Drop out MultiHop and Native as we do not query those here.
|
||||
const _sources = SELL_SOURCE_FILTER_BY_CHAIN_ID[this.chainId]
|
||||
.exclude([ERC20BridgeSource.MultiHop, ERC20BridgeSource.Native])
|
||||
@@ -1623,11 +1564,8 @@ export class SamplerOperations {
|
||||
);
|
||||
}
|
||||
case ERC20BridgeSource.Beethovenx: {
|
||||
const cache = this.poolsCaches[source];
|
||||
if (cache === undefined) {
|
||||
return [];
|
||||
}
|
||||
const poolIds = cache.getCachedPoolAddressesForPair(takerToken, makerToken) || [];
|
||||
const poolIds =
|
||||
this.poolsCaches[source].getCachedPoolAddressesForPair(takerToken, makerToken) || [];
|
||||
|
||||
const vault = BEETHOVEN_X_VAULT_ADDRESS_BY_CHAIN[this.chainId];
|
||||
if (vault === NULL_ADDRESS) {
|
||||
@@ -1757,8 +1695,8 @@ export class SamplerOperations {
|
||||
);
|
||||
}
|
||||
case ERC20BridgeSource.GMX: {
|
||||
// MIM has no liquidity.
|
||||
if (takerToken === AVALANCHE_TOKENS.MIM || makerToken === AVALANCHE_TOKENS.MIM) {
|
||||
// low liquidity mim pool dont quote
|
||||
if (takerToken === AVALANCHE_TOKENS.MIM || makerToken === 'AVALANCHE_TOKENS.MIM') {
|
||||
return [];
|
||||
}
|
||||
return this.getGMXSellQuotes(
|
||||
@@ -1795,21 +1733,6 @@ export class SamplerOperations {
|
||||
takerFillAmounts,
|
||||
);
|
||||
}
|
||||
case ERC20BridgeSource.Synthetix: {
|
||||
const readProxy = SYNTHETIX_READ_PROXY_BY_CHAIN_ID[this.chainId];
|
||||
const currencyKeyMap = SYNTHETIX_CURRENCY_KEYS_BY_CHAIN_ID[this.chainId];
|
||||
const takerTokenSymbol = currencyKeyMap.get(takerToken.toLowerCase());
|
||||
const makerTokenSymbol = currencyKeyMap.get(makerToken.toLowerCase());
|
||||
if (takerTokenSymbol === undefined || makerTokenSymbol === undefined) {
|
||||
return [];
|
||||
}
|
||||
return this.getSynthetixSellQuotes(
|
||||
readProxy,
|
||||
takerTokenSymbol,
|
||||
makerTokenSymbol,
|
||||
takerFillAmounts,
|
||||
);
|
||||
}
|
||||
default:
|
||||
throw new Error(`Unsupported sell sample source: ${source}`);
|
||||
}
|
||||
@@ -1844,7 +1767,7 @@ export class SamplerOperations {
|
||||
): SourceQuoteOperation[] {
|
||||
// Find the adjacent tokens in the provided token adjacency graph,
|
||||
// e.g if this is DAI->USDC we may check for DAI->WETH->USDC
|
||||
const intermediateTokens = this.tokenAdjacencyGraph.getIntermediateTokens(makerToken, takerToken);
|
||||
const intermediateTokens = getIntermediateTokens(makerToken, takerToken, this.tokenAdjacencyGraph);
|
||||
const _sources = BATCH_SOURCE_FILTERS.getAllowed(sources);
|
||||
return _.flatten(
|
||||
_sources.map((source): SourceQuoteOperation | SourceQuoteOperation[] => {
|
||||
@@ -1985,11 +1908,8 @@ export class SamplerOperations {
|
||||
);
|
||||
}
|
||||
case ERC20BridgeSource.Beethovenx: {
|
||||
const cache = this.poolsCaches[source];
|
||||
if (cache === undefined) {
|
||||
return [];
|
||||
}
|
||||
const poolIds = cache.getCachedPoolAddressesForPair(takerToken, makerToken) || [];
|
||||
const poolIds =
|
||||
this.poolsCaches[source].getCachedPoolAddressesForPair(takerToken, makerToken) || [];
|
||||
|
||||
const vault = BEETHOVEN_X_VAULT_ADDRESS_BY_CHAIN[this.chainId];
|
||||
if (vault === NULL_ADDRESS) {
|
||||
@@ -2107,8 +2027,8 @@ export class SamplerOperations {
|
||||
return this.getCompoundBuyQuotes(cToken.tokenAddress, makerToken, takerToken, makerFillAmounts);
|
||||
}
|
||||
case ERC20BridgeSource.GMX: {
|
||||
// MIM has no liquidity.
|
||||
if (takerToken === AVALANCHE_TOKENS.MIM || makerToken === AVALANCHE_TOKENS.MIM) {
|
||||
// bad mim pool dont quote
|
||||
if (takerToken === 'AVALANCHE_TOKENS.MIM' || makerToken === 'AVALANCHE_TOKENS.MIM') {
|
||||
return [];
|
||||
}
|
||||
return this.getGMXBuyQuotes(
|
||||
@@ -2145,21 +2065,6 @@ export class SamplerOperations {
|
||||
makerFillAmounts,
|
||||
);
|
||||
}
|
||||
case ERC20BridgeSource.Synthetix: {
|
||||
const readProxy = SYNTHETIX_READ_PROXY_BY_CHAIN_ID[this.chainId];
|
||||
const currencyKeyMap = SYNTHETIX_CURRENCY_KEYS_BY_CHAIN_ID[this.chainId];
|
||||
const takerTokenSymbol = currencyKeyMap.get(takerToken.toLowerCase());
|
||||
const makerTokenSymbol = currencyKeyMap.get(makerToken.toLowerCase());
|
||||
if (takerTokenSymbol === undefined || makerTokenSymbol === undefined) {
|
||||
return [];
|
||||
}
|
||||
return this.getSynthetixBuyQuotes(
|
||||
readProxy,
|
||||
takerTokenSymbol,
|
||||
makerTokenSymbol,
|
||||
makerFillAmounts,
|
||||
);
|
||||
}
|
||||
default:
|
||||
throw new Error(`Unsupported buy sample source: ${source}`);
|
||||
}
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import { ChainId } from '@0x/contract-addresses';
|
||||
import {
|
||||
FillQuoteTransformerLimitOrderInfo,
|
||||
FillQuoteTransformerOrderType,
|
||||
@@ -11,7 +10,6 @@ import { NativeOrderWithFillableAmounts, RfqFirmQuoteValidator, RfqRequestOpts }
|
||||
import { QuoteRequestor, V4RFQIndicativeQuoteMM } from '../../utils/quote_requestor';
|
||||
import { IRfqClient } from '../irfq_client';
|
||||
import { ExtendedQuoteReportSources, PriceComparisonsReport, QuoteReport } from '../quote_report_generator';
|
||||
import { TokenAdjacencyGraph } from '../token_adjacency_graph';
|
||||
|
||||
import { SourceFilters } from './source_filters';
|
||||
|
||||
@@ -68,7 +66,6 @@ export enum ERC20BridgeSource {
|
||||
Compound = 'Compound',
|
||||
Synapse = 'Synapse',
|
||||
BancorV3 = 'BancorV3',
|
||||
Synthetix = 'Synthetix',
|
||||
// BSC only
|
||||
PancakeSwap = 'PancakeSwap',
|
||||
PancakeSwapV2 = 'PancakeSwap_V2',
|
||||
@@ -108,6 +105,11 @@ export enum ERC20BridgeSource {
|
||||
// Optimism
|
||||
Velodrome = 'Velodrome',
|
||||
}
|
||||
export type SourcesWithPoolsCache =
|
||||
| ERC20BridgeSource.Balancer
|
||||
| ERC20BridgeSource.BalancerV2
|
||||
| ERC20BridgeSource.Beethovenx
|
||||
| ERC20BridgeSource.Cream;
|
||||
|
||||
// tslint:disable: enum-naming
|
||||
/**
|
||||
@@ -378,14 +380,6 @@ export interface VelodromeFillData extends FillData {
|
||||
stable: boolean;
|
||||
}
|
||||
|
||||
export interface SynthetixFillData extends FillData {
|
||||
synthetix: string;
|
||||
takerTokenSymbolBytes32: string;
|
||||
makerTokenSymbolBytes32: string;
|
||||
// Only needed for gas estimation.
|
||||
chainId: ChainId;
|
||||
}
|
||||
|
||||
/**
|
||||
* Represents a node on a fill path.
|
||||
*/
|
||||
@@ -648,6 +642,11 @@ export interface RawQuotes {
|
||||
dexQuotes: Array<Array<DexSample<FillData>>>;
|
||||
}
|
||||
|
||||
export interface TokenAdjacencyGraph {
|
||||
[token: string]: string[];
|
||||
default: string[];
|
||||
}
|
||||
|
||||
export interface LiquidityProviderRegistry {
|
||||
[address: string]: {
|
||||
tokens: string[];
|
||||
|
||||
@@ -1,84 +0,0 @@
|
||||
import * as _ from 'lodash';
|
||||
|
||||
import { Address } from '../types';
|
||||
|
||||
export class TokenAdjacencyGraph {
|
||||
private readonly _graph: Map<Address, Address[]>;
|
||||
private readonly _defaultTokens: readonly Address[];
|
||||
|
||||
public static getEmptyGraph(): TokenAdjacencyGraph {
|
||||
return new TokenAdjacencyGraphBuilder().build();
|
||||
}
|
||||
|
||||
/** Prefer using {@link TokenAdjacencyGraphBuilder}. */
|
||||
constructor(graph: Map<Address, Address[]>, defaultTokens: readonly Address[]) {
|
||||
this._graph = graph;
|
||||
this._defaultTokens = defaultTokens;
|
||||
}
|
||||
|
||||
public getAdjacentTokens(fromToken: Address): readonly Address[] {
|
||||
return this._graph.get(fromToken.toLowerCase()) || this._defaultTokens;
|
||||
}
|
||||
|
||||
/** Given a token pair, returns the intermediate tokens to consider for two-hop routes. */
|
||||
public getIntermediateTokens(takerToken: Address, makerToken: Address): Address[] {
|
||||
// NOTE: it seems it should be a union of `to` tokens of `takerToken` and `from` tokens of `makerToken`,
|
||||
// leaving it as same as the initial implementation for now.
|
||||
return _.union(this.getAdjacentTokens(takerToken), this.getAdjacentTokens(makerToken)).filter(
|
||||
token => token !== takerToken.toLowerCase() && token !== makerToken.toLowerCase(),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// tslint:disable-next-line: max-classes-per-file
|
||||
export class TokenAdjacencyGraphBuilder {
|
||||
private readonly _graph: Map<Address, Address[]>;
|
||||
private readonly _defaultTokens: readonly Address[];
|
||||
|
||||
constructor(defaultTokens: readonly string[] = []) {
|
||||
this._graph = new Map();
|
||||
this._defaultTokens = defaultTokens.map(addr => addr.toLowerCase());
|
||||
}
|
||||
|
||||
public add(fromToken: Address, toToken: Address): TokenAdjacencyGraphBuilder {
|
||||
const fromLower = fromToken.toLowerCase();
|
||||
const toLower = toToken.toLowerCase();
|
||||
|
||||
if (fromLower === toLower) {
|
||||
throw new Error(`from token (${fromToken}) must be different from to token (${toToken})`);
|
||||
}
|
||||
|
||||
if (!this._graph.has(fromLower)) {
|
||||
this._graph.set(fromLower, [...this._defaultTokens]);
|
||||
}
|
||||
|
||||
const toTokens = this._graph.get(fromLower)!;
|
||||
if (!toTokens.includes(toLower)) {
|
||||
toTokens.push(toLower);
|
||||
}
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
public addBidirectional(tokenA: Address, tokenB: Address): TokenAdjacencyGraphBuilder {
|
||||
return this.add(tokenA, tokenB).add(tokenB, tokenA);
|
||||
}
|
||||
|
||||
public addCompleteSubgraph(tokens: Address[]): TokenAdjacencyGraphBuilder {
|
||||
for (let i = 0; i < tokens.length; i++) {
|
||||
for (let j = i + 1; j < tokens.length; j++) {
|
||||
this.addBidirectional(tokens[i], tokens[j]);
|
||||
}
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
public tap(cb: (graph: TokenAdjacencyGraphBuilder) => void): TokenAdjacencyGraphBuilder {
|
||||
cb(this);
|
||||
return this;
|
||||
}
|
||||
|
||||
public build(): TokenAdjacencyGraph {
|
||||
return new TokenAdjacencyGraph(this._graph, this._defaultTokens);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
import _ = require('lodash');
|
||||
|
||||
import { TokenAdjacencyGraph } from './market_operation_utils/types';
|
||||
|
||||
export class TokenAdjacencyGraphBuilder {
|
||||
constructor(private readonly tokenAdjacency: TokenAdjacencyGraph) {}
|
||||
|
||||
public add(from: string, to: string | string[]): TokenAdjacencyGraphBuilder {
|
||||
if (!this.tokenAdjacency[from]) {
|
||||
this.tokenAdjacency[from] = [...this.tokenAdjacency.default];
|
||||
}
|
||||
this.tokenAdjacency[from] = [...(Array.isArray(to) ? to : [to]), ...this.tokenAdjacency[from]];
|
||||
this.tokenAdjacency[from] = _.uniqBy(this.tokenAdjacency[from], a => a.toLowerCase());
|
||||
return this;
|
||||
}
|
||||
|
||||
public tap(cb: (builder: TokenAdjacencyGraphBuilder) => void): TokenAdjacencyGraphBuilder {
|
||||
cb(this);
|
||||
return this;
|
||||
}
|
||||
|
||||
public build(): TokenAdjacencyGraph {
|
||||
return this.tokenAdjacency;
|
||||
}
|
||||
}
|
||||
@@ -43,7 +43,6 @@ import * as NativeOrderSampler from '../test/generated-artifacts/NativeOrderSamp
|
||||
import * as PlatypusSampler from '../test/generated-artifacts/PlatypusSampler.json';
|
||||
import * as SamplerUtils from '../test/generated-artifacts/SamplerUtils.json';
|
||||
import * as ShellSampler from '../test/generated-artifacts/ShellSampler.json';
|
||||
import * as SynthetixSampler from '../test/generated-artifacts/SynthetixSampler.json';
|
||||
import * as TestNativeOrderSampler from '../test/generated-artifacts/TestNativeOrderSampler.json';
|
||||
import * as TwoHopSampler from '../test/generated-artifacts/TwoHopSampler.json';
|
||||
import * as UniswapSampler from '../test/generated-artifacts/UniswapSampler.json';
|
||||
@@ -77,7 +76,6 @@ export const artifacts = {
|
||||
PlatypusSampler: PlatypusSampler as ContractArtifact,
|
||||
SamplerUtils: SamplerUtils as ContractArtifact,
|
||||
ShellSampler: ShellSampler as ContractArtifact,
|
||||
SynthetixSampler: SynthetixSampler as ContractArtifact,
|
||||
TwoHopSampler: TwoHopSampler as ContractArtifact,
|
||||
UniswapSampler: UniswapSampler as ContractArtifact,
|
||||
UniswapV2Sampler: UniswapV2Sampler as ContractArtifact,
|
||||
|
||||
@@ -13,8 +13,7 @@ import * as _ from 'lodash';
|
||||
|
||||
import { SignedOrder } from '../src/types';
|
||||
import { DexOrderSampler, getSampleAmounts } from '../src/utils/market_operation_utils/sampler';
|
||||
import { ERC20BridgeSource } from '../src/utils/market_operation_utils/types';
|
||||
import { TokenAdjacencyGraphBuilder } from '../src/utils/token_adjacency_graph';
|
||||
import { ERC20BridgeSource, TokenAdjacencyGraph } from '../src/utils/market_operation_utils/types';
|
||||
|
||||
import { MockSamplerContract } from './utils/mock_sampler_contract';
|
||||
import { generatePseudoRandomSalt } from './utils/utils';
|
||||
@@ -30,7 +29,7 @@ describe('DexSampler tests', () => {
|
||||
const wethAddress = getContractAddressesForChainOrThrow(CHAIN_ID).etherToken;
|
||||
const exchangeProxyAddress = getContractAddressesForChainOrThrow(CHAIN_ID).exchangeProxy;
|
||||
|
||||
const tokenAdjacencyGraph = new TokenAdjacencyGraphBuilder([wethAddress]).build();
|
||||
const tokenAdjacencyGraph: TokenAdjacencyGraph = { default: [wethAddress] };
|
||||
|
||||
describe('getSampleAmounts()', () => {
|
||||
const FILL_AMOUNT = getRandomInteger(1, 1e18);
|
||||
|
||||
@@ -15,7 +15,7 @@ import { Pool } from 'balancer-labs-sor-v1/dist/types';
|
||||
import * as _ from 'lodash';
|
||||
import * as TypeMoq from 'typemoq';
|
||||
|
||||
import { MarketOperation, QuoteRequestor, RfqRequestOpts, SignedNativeOrder, TokenAdjacencyGraph } from '../src';
|
||||
import { MarketOperation, QuoteRequestor, RfqRequestOpts, SignedNativeOrder } from '../src';
|
||||
import { Integrator } from '../src/types';
|
||||
import { MarketOperationUtils } from '../src/utils/market_operation_utils/';
|
||||
import {
|
||||
@@ -39,6 +39,7 @@ import {
|
||||
MarketSideLiquidity,
|
||||
OptimizedMarketBridgeOrder,
|
||||
OptimizerResultWithReport,
|
||||
TokenAdjacencyGraph,
|
||||
} from '../src/utils/market_operation_utils/types';
|
||||
|
||||
const MAKER_TOKEN = randomAddress();
|
||||
@@ -56,7 +57,7 @@ const DEFAULT_EXCLUDED = SELL_SOURCE_FILTER_BY_CHAIN_ID[ChainId.Mainnet].sources
|
||||
);
|
||||
const BUY_SOURCES = BUY_SOURCE_FILTER_BY_CHAIN_ID[ChainId.Mainnet].sources;
|
||||
const SELL_SOURCES = SELL_SOURCE_FILTER_BY_CHAIN_ID[ChainId.Mainnet].sources;
|
||||
const TOKEN_ADJACENCY_GRAPH = TokenAdjacencyGraph.getEmptyGraph();
|
||||
const TOKEN_ADJACENCY_GRAPH: TokenAdjacencyGraph = { default: [] };
|
||||
|
||||
const SIGNATURE = { v: 1, r: NULL_BYTES, s: NULL_BYTES, signatureType: SignatureType.EthSign };
|
||||
const FOO_INTEGRATOR: Integrator = {
|
||||
|
||||
@@ -17,6 +17,8 @@ const expect = chai.expect;
|
||||
const usdcAddress = '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48';
|
||||
const daiAddress = '0x6b175474e89094c44da98b954eedeac495271d0f';
|
||||
const wethAddress = '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2';
|
||||
const wbtcAddress = '0x2260fac5e5542a773aa44fbcfedf7c193bc2c599';
|
||||
const balAddress = '0xba100000625a3754423978a60c9317c58a424e3d';
|
||||
const creamAddress = '0x2ba592f78db6436527729929aaf6c908497cb200';
|
||||
|
||||
const timeoutMs = 5000;
|
||||
@@ -41,26 +43,22 @@ describe('Pools Caches for Balancer-based sampling', () => {
|
||||
[daiAddress, wethAddress],
|
||||
];
|
||||
await Promise.all(
|
||||
pairs.map(async ([takerToken, makerToken]) => fetchAndAssertPoolsAsync(cache, takerToken, makerToken)),
|
||||
// tslint:disable-next-line:promise-function-async
|
||||
pairs.map(([takerToken, makerToken]) => fetchAndAssertPoolsAsync(cache, takerToken, makerToken)),
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
describe('BalancerV2PoolsCache', () => {
|
||||
it('fetches pools (Beethoven X - Fantom)', async () => {
|
||||
const cache = BalancerV2PoolsCache.createBeethovenXPoolCache(ChainId.Fantom);
|
||||
const wftmAddress = '0x21be370d5312f44cb42ce377bc9b8a0cef1a4c83';
|
||||
const beetsAddress = '0xf24bcf4d1e507740041c9cfd2dddb29585adce1e';
|
||||
const fantomWethAddress = '0x74b23882a30290451a17c44f4f05243b6b58c76d';
|
||||
|
||||
const cache = new BalancerV2PoolsCache(ChainId.Mainnet);
|
||||
it('fetches pools', async () => {
|
||||
const pairs = [
|
||||
[wftmAddress, beetsAddress],
|
||||
[wftmAddress, fantomWethAddress],
|
||||
[wethAddress, wbtcAddress],
|
||||
[wethAddress, balAddress],
|
||||
];
|
||||
|
||||
expect(cache).not.null();
|
||||
await Promise.all(
|
||||
pairs.map(async ([takerToken, makerToken]) => fetchAndAssertPoolsAsync(cache!, takerToken, makerToken)),
|
||||
// tslint:disable-next-line:promise-function-async
|
||||
pairs.map(([takerToken, makerToken]) => fetchAndAssertPoolsAsync(cache, takerToken, makerToken)),
|
||||
);
|
||||
});
|
||||
});
|
||||
@@ -73,7 +71,8 @@ describe('Pools Caches for Balancer-based sampling', () => {
|
||||
[creamAddress, wethAddress],
|
||||
];
|
||||
await Promise.all(
|
||||
pairs.map(async ([takerToken, makerToken]) => fetchAndAssertPoolsAsync(cache, takerToken, makerToken)),
|
||||
// tslint:disable-next-line:promise-function-async
|
||||
pairs.map(([takerToken, makerToken]) => fetchAndAssertPoolsAsync(cache, takerToken, makerToken)),
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -1,108 +0,0 @@
|
||||
import * as chai from 'chai';
|
||||
import 'mocha';
|
||||
|
||||
import { TokenAdjacencyGraphBuilder } from '../src/utils/token_adjacency_graph';
|
||||
|
||||
import { chaiSetup } from './utils/chai_setup';
|
||||
|
||||
chaiSetup.configure();
|
||||
const expect = chai.expect;
|
||||
|
||||
describe('TokenAdjacencyGraphBuilder and TokenAdjacencyGraph', () => {
|
||||
describe('constructor', () => {
|
||||
it('sanitizes passed default tokens to lower case', async () => {
|
||||
const graph = new TokenAdjacencyGraphBuilder(['DEFAULT_1', 'DEFAULT_2']).build();
|
||||
|
||||
expect(graph.getAdjacentTokens('random_token')).to.deep.eq(['default_1', 'default_2']);
|
||||
});
|
||||
});
|
||||
|
||||
describe('add', () => {
|
||||
it('adds a new token path to the graph', async () => {
|
||||
const graph = new TokenAdjacencyGraphBuilder(['default_1', 'default_2']).add('token_a', 'token_b').build();
|
||||
|
||||
expect(graph.getAdjacentTokens('token_a')).to.deep.eq(['default_1', 'default_2', 'token_b']);
|
||||
});
|
||||
|
||||
it('adds lower-cased token path to the graph', async () => {
|
||||
const graph = new TokenAdjacencyGraphBuilder(['default_1', 'default_2']).add('TOKEN_A', 'TOKEN_B').build();
|
||||
|
||||
expect(graph.getAdjacentTokens('token_a')).to.deep.eq(['default_1', 'default_2', 'token_b']);
|
||||
});
|
||||
|
||||
it('ignores an existing to token', async () => {
|
||||
const graph = new TokenAdjacencyGraphBuilder()
|
||||
.add('token_a', 'token_b')
|
||||
.add('token_a', 'token_b')
|
||||
.build();
|
||||
|
||||
expect(graph.getAdjacentTokens('token_a')).to.deep.eq(['token_b']);
|
||||
});
|
||||
});
|
||||
|
||||
describe('addBidirectional', () => {
|
||||
it('adds a bidirectional path to the graph', async () => {
|
||||
const graph = new TokenAdjacencyGraphBuilder(['default_1']).addBidirectional('token_a', 'token_b').build();
|
||||
|
||||
expect(graph.getAdjacentTokens('token_a')).to.deep.eq(['default_1', 'token_b']);
|
||||
expect(graph.getAdjacentTokens('token_b')).to.deep.eq(['default_1', 'token_a']);
|
||||
});
|
||||
});
|
||||
|
||||
describe('addCompleteSubgraph', () => {
|
||||
it('adds a complete subgraph to the graph', async () => {
|
||||
const graph = new TokenAdjacencyGraphBuilder(['default_1'])
|
||||
.addCompleteSubgraph(['token_a', 'token_b', 'token_c', 'token_d'])
|
||||
.build();
|
||||
|
||||
expect(graph.getAdjacentTokens('token_a')).to.deep.eq(['default_1', 'token_b', 'token_c', 'token_d']);
|
||||
expect(graph.getAdjacentTokens('token_b')).to.deep.eq(['default_1', 'token_a', 'token_c', 'token_d']);
|
||||
expect(graph.getAdjacentTokens('token_c')).to.deep.eq(['default_1', 'token_a', 'token_b', 'token_d']);
|
||||
expect(graph.getAdjacentTokens('token_d')).to.deep.eq(['default_1', 'token_a', 'token_b', 'token_c']);
|
||||
});
|
||||
});
|
||||
|
||||
describe('tap', () => {
|
||||
it('applies callback correctly', async () => {
|
||||
const graph = new TokenAdjacencyGraphBuilder(['default_1'])
|
||||
.tap(g => {
|
||||
g.add('token_a', 'token_b');
|
||||
g.add('token_c', 'token_d');
|
||||
})
|
||||
.build();
|
||||
|
||||
expect(graph.getAdjacentTokens('token_a')).to.deep.eq(['default_1', 'token_b']);
|
||||
expect(graph.getAdjacentTokens('token_c')).to.deep.eq(['default_1', 'token_d']);
|
||||
});
|
||||
});
|
||||
|
||||
describe('getIntermediateTokens', () => {
|
||||
it('returns intermediate tokens without a duplicate ', async () => {
|
||||
const graph = new TokenAdjacencyGraphBuilder(['default_1'])
|
||||
.add('token_a', 'token_b')
|
||||
.add('token_c', 'token_b')
|
||||
.build();
|
||||
|
||||
expect(graph.getIntermediateTokens('token_a', 'token_c')).to.deep.eq(['default_1', 'token_b']);
|
||||
});
|
||||
|
||||
it('returns intermediate tokens after lower-casing taker and maker tokens', async () => {
|
||||
const graph = new TokenAdjacencyGraphBuilder(['default_1'])
|
||||
.add('token_a', 'token_b')
|
||||
.add('token_c', 'token_d')
|
||||
.build();
|
||||
|
||||
expect(graph.getIntermediateTokens('TOKEN_a', 'token_C')).to.deep.eq(['default_1', 'token_b', 'token_d']);
|
||||
});
|
||||
|
||||
it('returns intermediate tokens excluding taker token or maker token ', async () => {
|
||||
const graph = new TokenAdjacencyGraphBuilder(['default_1'])
|
||||
.addBidirectional('token_a', 'token_b')
|
||||
.addBidirectional('token_b', 'token_c')
|
||||
.addBidirectional('token_c', 'token_a')
|
||||
.build();
|
||||
|
||||
expect(graph.getIntermediateTokens('token_a', 'token_c')).to.deep.eq(['default_1', 'token_b']);
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -41,7 +41,6 @@ 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/shell_sampler';
|
||||
export * from '../test/generated-wrappers/synthetix_sampler';
|
||||
export * from '../test/generated-wrappers/test_native_order_sampler';
|
||||
export * from '../test/generated-wrappers/two_hop_sampler';
|
||||
export * from '../test/generated-wrappers/uniswap_sampler';
|
||||
|
||||
@@ -44,7 +44,6 @@
|
||||
"test/generated-artifacts/PlatypusSampler.json",
|
||||
"test/generated-artifacts/SamplerUtils.json",
|
||||
"test/generated-artifacts/ShellSampler.json",
|
||||
"test/generated-artifacts/SynthetixSampler.json",
|
||||
"test/generated-artifacts/TestNativeOrderSampler.json",
|
||||
"test/generated-artifacts/TwoHopSampler.json",
|
||||
"test/generated-artifacts/UniswapSampler.json",
|
||||
|
||||
@@ -1,17 +1,4 @@
|
||||
[
|
||||
{
|
||||
"version": "6.17.0",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Goerli and Mumbai"
|
||||
},
|
||||
{
|
||||
"note": "Redeploy FQT on Mainnet and Optimism",
|
||||
"pr": 530
|
||||
}
|
||||
],
|
||||
"timestamp": 1658950329
|
||||
},
|
||||
{
|
||||
"version": "6.16.0",
|
||||
"changes": [
|
||||
|
||||
@@ -5,11 +5,6 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v6.17.0 - _July 27, 2022_
|
||||
|
||||
* Goerli and Mumbai
|
||||
* Redeploy FQT on Mainnet and Optimism (#530)
|
||||
|
||||
## v6.16.0 - _June 14, 2022_
|
||||
|
||||
* Redeploy FQT on Mainnet and Optimism
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
"wethTransformer": "0xb2bc06a4efb20fc6553a69dbfa49b7be938034a7",
|
||||
"payTakerTransformer": "0x4638a7ebe75b911b995d0ec73a81e4f85f41f24e",
|
||||
"affiliateFeeTransformer": "0xda6d9fc5998f550a094585cf9171f0e8ee3ac59f",
|
||||
"fillQuoteTransformer": "0xd75a9019a2a1782ea670e4f4a55f04b43514ed53",
|
||||
"fillQuoteTransformer": "0x26b2d9ea76f24206805d17565a5e0efcf787e0ae",
|
||||
"positiveSlippageFeeTransformer": "0xa9416ce1dbde8d331210c07b5c253d94ee4cc3fd"
|
||||
}
|
||||
},
|
||||
@@ -125,48 +125,6 @@
|
||||
"positiveSlippageFeeTransformer": "0x0000000000000000000000000000000000000000"
|
||||
}
|
||||
},
|
||||
"5": {
|
||||
"erc20Proxy": "0x0000000000000000000000000000000000000000",
|
||||
"erc721Proxy": "0x0000000000000000000000000000000000000000",
|
||||
"zrxToken": "0x0000000000000000000000000000000000000000",
|
||||
"etherToken": "0xb4fbf271143f4fbf7b91a5ded31805e42b2208d6",
|
||||
"exchangeV2": "0x0000000000000000000000000000000000000000",
|
||||
"exchange": "0x0000000000000000000000000000000000000000",
|
||||
"assetProxyOwner": "0x0000000000000000000000000000000000000000",
|
||||
"zeroExGovernor": "0x0000000000000000000000000000000000000000",
|
||||
"forwarder": "0x0000000000000000000000000000000000000000",
|
||||
"coordinatorRegistry": "0x0000000000000000000000000000000000000000",
|
||||
"coordinator": "0x0000000000000000000000000000000000000000",
|
||||
"multiAssetProxy": "0x0000000000000000000000000000000000000000",
|
||||
"staticCallProxy": "0x0000000000000000000000000000000000000000",
|
||||
"erc1155Proxy": "0x0000000000000000000000000000000000000000",
|
||||
"devUtils": "0x0000000000000000000000000000000000000000",
|
||||
"zrxVault": "0x0000000000000000000000000000000000000000",
|
||||
"staking": "0x0000000000000000000000000000000000000000",
|
||||
"stakingProxy": "0x0000000000000000000000000000000000000000",
|
||||
"erc20BridgeProxy": "0x0000000000000000000000000000000000000000",
|
||||
"erc20BridgeSampler": "0x0000000000000000000000000000000000000000",
|
||||
"chaiBridge": "0x0000000000000000000000000000000000000000",
|
||||
"dydxBridge": "0x0000000000000000000000000000000000000000",
|
||||
"godsUnchainedValidator": "0x0000000000000000000000000000000000000000",
|
||||
"broker": "0x0000000000000000000000000000000000000000",
|
||||
"chainlinkStopLimit": "0x0000000000000000000000000000000000000000",
|
||||
"maximumGasPrice": "0x0000000000000000000000000000000000000000",
|
||||
"dexForwarderBridge": "0x0000000000000000000000000000000000000000",
|
||||
"exchangeProxyGovernor": "0x7cee06249e371a1ecf8107e912294432f7f70832",
|
||||
"exchangeProxy": "0xdef1c0ded9bec7f1a1670819833240f027b25eff",
|
||||
"exchangeProxyTransformerDeployer": "0x2bef57ffde3098eeed9fa4f9166a81d7377533dc",
|
||||
"exchangeProxyFlashWallet": "0xdb6f1920a889355780af7570773609bd8cb1f498",
|
||||
"exchangeProxyLiquidityProviderSandbox": "0x0000000000000000000000000000000000000000",
|
||||
"zrxTreasury": "0x0000000000000000000000000000000000000000",
|
||||
"transformers": {
|
||||
"wethTransformer": "0xad550dbef7b93a42e335062e808d66a70eca5a0a",
|
||||
"payTakerTransformer": "0xbd3fec19e4d91a79b329b6b4a6f210c66a40a97f",
|
||||
"affiliateFeeTransformer": "0x59e7371b613a6f3879694bf9db2fe3117c92a927",
|
||||
"fillQuoteTransformer": "0x3edbf102250d59230ff6d3fc648f97c094f3cb27",
|
||||
"positiveSlippageFeeTransformer": "0x48997b11bbc15c2fa2f141c9e93a0a2ab789a761"
|
||||
}
|
||||
},
|
||||
"42": {
|
||||
"erc20Proxy": "0xaa460127562482faa5df42f2c39a025cd4a1cc0a",
|
||||
"erc721Proxy": "0x7b70a148e20b348c320208df84fdd642aab49fd0",
|
||||
@@ -541,7 +499,7 @@
|
||||
"wethTransformer": "0x02ce7af6520e2862f961f5d7eda746642865179c",
|
||||
"payTakerTransformer": "0x085d10a34f14f6a631ea8ff7d016782ee3ffaa11",
|
||||
"affiliateFeeTransformer": "0x55cf1d7535250db75bf0190493f55781ee583553",
|
||||
"fillQuoteTransformer": "0x96499c097efc56ba5cf6b2a474392db17790ce96",
|
||||
"fillQuoteTransformer": "0xfae0ce3841afbf5625a15f0c73e03ba6660e575f",
|
||||
"positiveSlippageFeeTransformer": "0xb11e14565dfbeb702dea9bc0cb47f1a8b32f4783"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/contract-addresses",
|
||||
"version": "6.17.0",
|
||||
"version": "6.16.0",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
|
||||
@@ -47,7 +47,6 @@ export enum ChainId {
|
||||
Mainnet = 1,
|
||||
Ropsten = 3,
|
||||
Rinkeby = 4,
|
||||
Goerli = 5,
|
||||
Kovan = 42,
|
||||
Ganache = 1337,
|
||||
BSC = 56,
|
||||
@@ -56,7 +55,6 @@ export enum ChainId {
|
||||
Avalanche = 43114,
|
||||
Fantom = 250,
|
||||
Celo = 42220,
|
||||
// Arbitrum = 42161,
|
||||
Optimism = 10,
|
||||
}
|
||||
|
||||
|
||||
@@ -1,13 +1,4 @@
|
||||
[
|
||||
{
|
||||
"timestamp": 1658950329,
|
||||
"version": "13.20.5",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1655244958,
|
||||
"version": "13.20.4",
|
||||
|
||||
@@ -5,10 +5,6 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v13.20.5 - _July 27, 2022_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v13.20.4 - _June 14, 2022_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/contract-wrappers",
|
||||
"version": "13.20.5",
|
||||
"version": "13.20.4",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -57,7 +57,7 @@
|
||||
"dependencies": {
|
||||
"@0x/assert": "^3.0.34",
|
||||
"@0x/base-contract": "^6.5.0",
|
||||
"@0x/contract-addresses": "^6.17.0",
|
||||
"@0x/contract-addresses": "^6.16.0",
|
||||
"@0x/json-schemas": "^6.4.4",
|
||||
"@0x/types": "^3.3.6",
|
||||
"@0x/utils": "^6.5.3",
|
||||
|
||||
@@ -1,14 +1,4 @@
|
||||
[
|
||||
{
|
||||
"version": "11.16.0",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Add Synthetix support`",
|
||||
"pr": 518
|
||||
}
|
||||
],
|
||||
"timestamp": 1658950329
|
||||
},
|
||||
{
|
||||
"version": "11.15.0",
|
||||
"changes": [
|
||||
|
||||
@@ -5,10 +5,6 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v11.16.0 - _July 27, 2022_
|
||||
|
||||
* Add Synthetix support` (#518)
|
||||
|
||||
## v11.15.0 - _June 14, 2022_
|
||||
|
||||
* Add Velodrome support (#494)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/protocol-utils",
|
||||
"version": "11.16.0",
|
||||
"version": "11.15.0",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -63,8 +63,8 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@0x/assert": "^3.0.34",
|
||||
"@0x/contract-addresses": "^6.17.0",
|
||||
"@0x/contract-wrappers": "^13.20.5",
|
||||
"@0x/contract-addresses": "^6.16.0",
|
||||
"@0x/contract-wrappers": "^13.20.4",
|
||||
"@0x/json-schemas": "^6.4.4",
|
||||
"@0x/subproviders": "^6.6.5",
|
||||
"@0x/utils": "^6.5.3",
|
||||
|
||||
@@ -140,7 +140,6 @@ export enum BridgeProtocol {
|
||||
Platypus,
|
||||
BancorV3,
|
||||
Velodrome,
|
||||
Synthetix,
|
||||
}
|
||||
// tslint:enable: enum-naming
|
||||
|
||||
|
||||
240
yarn.lock
240
yarn.lock
@@ -687,6 +687,17 @@
|
||||
lodash "^4.17.11"
|
||||
valid-url "^1.0.9"
|
||||
|
||||
"@0x/assert@^3.0.6":
|
||||
version "3.0.21"
|
||||
resolved "https://registry.yarnpkg.com/@0x/assert/-/assert-3.0.21.tgz#b385868d1833625912fd9173a2477be5a4090aed"
|
||||
dependencies:
|
||||
"@0x/json-schemas" "^5.4.1"
|
||||
"@0x/typescript-typings" "^5.1.6"
|
||||
"@0x/utils" "^6.2.0"
|
||||
"@types/node" "12.12.54"
|
||||
lodash "^4.17.11"
|
||||
valid-url "^1.0.9"
|
||||
|
||||
"@0x/base-contract@^6.4.0":
|
||||
version "6.4.0"
|
||||
resolved "https://registry.yarnpkg.com/@0x/base-contract/-/base-contract-6.4.0.tgz#7ffcb18b0b8d522545074cada1f4d62dce0a88ec"
|
||||
@@ -738,6 +749,13 @@
|
||||
ethereum-types "^3.5.0"
|
||||
lodash "^4.17.11"
|
||||
|
||||
"@0x/contracts-dev-utils@^1.3.36":
|
||||
version "1.3.36"
|
||||
resolved "https://registry.yarnpkg.com/@0x/contracts-dev-utils/-/contracts-dev-utils-1.3.36.tgz#f29304a0d7375001165ef6e66695d14b6a153fd7"
|
||||
dependencies:
|
||||
"@0x/base-contract" "^6.4.0"
|
||||
"@types/node" "12.12.54"
|
||||
|
||||
"@0x/contracts-erc1155@^2.1.37":
|
||||
version "2.1.37"
|
||||
resolved "https://registry.yarnpkg.com/@0x/contracts-erc1155/-/contracts-erc1155-2.1.37.tgz#98dc158ffd00f80771e4232ed2a5246ab4ab73c1"
|
||||
@@ -767,6 +785,19 @@
|
||||
"@0x/utils" "^6.4.3"
|
||||
ethereum-types "^3.5.0"
|
||||
|
||||
"@0x/contracts-exchange@^3.2.38":
|
||||
version "3.2.38"
|
||||
resolved "https://registry.yarnpkg.com/@0x/contracts-exchange/-/contracts-exchange-3.2.38.tgz#51b12882283c816eebdb53f1c77805956112dfee"
|
||||
dependencies:
|
||||
"@0x/base-contract" "^6.4.0"
|
||||
"@0x/contracts-dev-utils" "^1.3.36"
|
||||
"@0x/contracts-erc1155" "^2.1.37"
|
||||
"@0x/contracts-erc20" "^3.3.16"
|
||||
"@0x/contracts-erc721" "^3.1.37"
|
||||
"@0x/order-utils" "^10.4.28"
|
||||
"@0x/utils" "^6.4.3"
|
||||
lodash "^4.17.11"
|
||||
|
||||
"@0x/contracts-gen@^2.0.46":
|
||||
version "2.0.46"
|
||||
resolved "https://registry.yarnpkg.com/@0x/contracts-gen/-/contracts-gen-2.0.46.tgz#3b840b8a56b67abecb2859c1b8e1db36c309dc11"
|
||||
@@ -813,6 +844,15 @@
|
||||
lodash "^4.17.11"
|
||||
web3-provider-engine "14.0.6"
|
||||
|
||||
"@0x/json-schemas@^5.4.1":
|
||||
version "5.4.1"
|
||||
resolved "https://registry.yarnpkg.com/@0x/json-schemas/-/json-schemas-5.4.1.tgz#488cae01fbb7f37fa9043e426f52ff32de69f6e0"
|
||||
dependencies:
|
||||
"@0x/typescript-typings" "^5.1.6"
|
||||
"@types/node" "12.12.54"
|
||||
jsonschema "^1.2.0"
|
||||
lodash.values "^4.3.0"
|
||||
|
||||
"@0x/json-schemas@^6.0.1", "@0x/json-schemas@^6.1.3":
|
||||
version "6.1.3"
|
||||
resolved "https://registry.yarnpkg.com/@0x/json-schemas/-/json-schemas-6.1.3.tgz#da71ed2e50ae6813a6d4d0fe5f8ad69b8e6a7435"
|
||||
@@ -831,6 +871,18 @@
|
||||
ajv "^6.12.5"
|
||||
lodash.values "^4.3.0"
|
||||
|
||||
"@0x/mesh-rpc-client@^9.4.2":
|
||||
version "9.4.2"
|
||||
resolved "https://registry.yarnpkg.com/@0x/mesh-rpc-client/-/mesh-rpc-client-9.4.2.tgz#6f9690fb1cb37fb0c2fd3907241af0e543c78451"
|
||||
dependencies:
|
||||
"@0x/assert" "^3.0.6"
|
||||
"@0x/types" "^3.1.2"
|
||||
"@0x/typescript-typings" "^5.0.2"
|
||||
"@0x/utils" "^5.4.0"
|
||||
uuid "^3.3.2"
|
||||
web3-providers "^2.0.0-alpha.1"
|
||||
websocket "^1.0.29"
|
||||
|
||||
"@0x/monorepo-scripts@^3.2.4":
|
||||
version "3.2.4"
|
||||
resolved "https://registry.yarnpkg.com/@0x/monorepo-scripts/-/monorepo-scripts-3.2.4.tgz#7a089db39a3bd128ee22448d341cdabcc948614b"
|
||||
@@ -1067,6 +1119,14 @@
|
||||
tslint-react "^3.2.0"
|
||||
tsutils "3.0.0"
|
||||
|
||||
"@0x/types@^3.1.2", "@0x/types@^3.3.1":
|
||||
version "3.3.1"
|
||||
resolved "https://registry.yarnpkg.com/@0x/types/-/types-3.3.1.tgz#24f3f805d89c1235602abbef12bbeb7e92db9d63"
|
||||
dependencies:
|
||||
"@types/node" "12.12.54"
|
||||
bignumber.js "~9.0.0"
|
||||
ethereum-types "^3.4.0"
|
||||
|
||||
"@0x/types@^3.3.0":
|
||||
version "3.3.0"
|
||||
resolved "https://registry.yarnpkg.com/@0x/types/-/types-3.3.0.tgz#98c5ee91b66c7cc1719cfece6c3e5477c90bf9c5"
|
||||
@@ -1102,6 +1162,17 @@
|
||||
ethereum-types "^3.3.3"
|
||||
popper.js "1.14.3"
|
||||
|
||||
"@0x/typescript-typings@^5.0.2", "@0x/typescript-typings@^5.1.6":
|
||||
version "5.1.6"
|
||||
resolved "https://registry.yarnpkg.com/@0x/typescript-typings/-/typescript-typings-5.1.6.tgz#f6a64c1038930fc822606f543c5bce66c2113141"
|
||||
dependencies:
|
||||
"@types/bn.js" "^4.11.0"
|
||||
"@types/node" "12.12.54"
|
||||
"@types/react" "*"
|
||||
bignumber.js "~9.0.0"
|
||||
ethereum-types "^3.4.0"
|
||||
popper.js "1.14.3"
|
||||
|
||||
"@0x/typescript-typings@^5.2.0":
|
||||
version "5.2.0"
|
||||
resolved "https://registry.yarnpkg.com/@0x/typescript-typings/-/typescript-typings-5.2.0.tgz#3eba353a27a83697f6f4f6d65ce14506687f52b7"
|
||||
@@ -1124,7 +1195,7 @@
|
||||
ethereum-types "^3.7.0"
|
||||
popper.js "1.14.3"
|
||||
|
||||
"@0x/utils@^5.1.1", "@0x/utils@^5.4.1":
|
||||
"@0x/utils@^5.1.1", "@0x/utils@^5.4.0", "@0x/utils@^5.4.1":
|
||||
version "5.6.4"
|
||||
resolved "https://registry.yarnpkg.com/@0x/utils/-/utils-5.6.4.tgz#0158ec3243bbee444d90afbd79981321d19ccdfd"
|
||||
dependencies:
|
||||
@@ -1142,6 +1213,24 @@
|
||||
js-sha3 "^0.7.0"
|
||||
lodash "^4.17.11"
|
||||
|
||||
"@0x/utils@^6.2.0":
|
||||
version "6.2.0"
|
||||
resolved "https://registry.yarnpkg.com/@0x/utils/-/utils-6.2.0.tgz#07708d87691ac260163c01713ffac7a7f8e4c795"
|
||||
dependencies:
|
||||
"@0x/types" "^3.3.1"
|
||||
"@0x/typescript-typings" "^5.1.6"
|
||||
"@types/node" "12.12.54"
|
||||
abortcontroller-polyfill "^1.1.9"
|
||||
bignumber.js "~9.0.0"
|
||||
chalk "^2.3.0"
|
||||
detect-node "2.0.3"
|
||||
ethereum-types "^3.4.0"
|
||||
ethereumjs-util "^5.1.1"
|
||||
ethers "~4.0.4"
|
||||
isomorphic-fetch "2.2.1"
|
||||
js-sha3 "^0.7.0"
|
||||
lodash "^4.17.11"
|
||||
|
||||
"@0x/utils@^6.4.3":
|
||||
version "6.4.3"
|
||||
resolved "https://registry.yarnpkg.com/@0x/utils/-/utils-6.4.3.tgz#d7c710a8d8b8f2ee3a4e324dc71423078d93ff37"
|
||||
@@ -1244,6 +1333,12 @@
|
||||
dependencies:
|
||||
regenerator-runtime "^0.13.4"
|
||||
|
||||
"@babel/runtime@^7.3.1":
|
||||
version "7.12.13"
|
||||
resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.12.13.tgz#0a21452352b02542db0ffb928ac2d3ca7cb6d66d"
|
||||
dependencies:
|
||||
regenerator-runtime "^0.13.4"
|
||||
|
||||
"@balancer-labs/sdk@0.1.6":
|
||||
version "0.1.6"
|
||||
resolved "https://registry.yarnpkg.com/@balancer-labs/sdk/-/sdk-0.1.6.tgz#1a6f0aacfada7b0afbdf02259ef40ed37d3ecbcb"
|
||||
@@ -2516,7 +2611,7 @@
|
||||
dependencies:
|
||||
defer-to-connect "^1.0.1"
|
||||
|
||||
"@types/bn.js@^4.11.0", "@types/bn.js@^4.11.3", "@types/bn.js@^4.11.5":
|
||||
"@types/bn.js@^4.11.0", "@types/bn.js@^4.11.3", "@types/bn.js@^4.11.4", "@types/bn.js@^4.11.5":
|
||||
version "4.11.6"
|
||||
resolved "https://registry.yarnpkg.com/@types/bn.js/-/bn.js-4.11.6.tgz#c306c70d9358aaea33cd4eda092a742b9505967c"
|
||||
dependencies:
|
||||
@@ -2634,6 +2729,10 @@
|
||||
version "12.12.54"
|
||||
resolved "https://registry.yarnpkg.com/@types/node/-/node-12.12.54.tgz#a4b58d8df3a4677b6c08bfbc94b7ad7a7a5f82d1"
|
||||
|
||||
"@types/node@^10.12.18":
|
||||
version "10.17.51"
|
||||
resolved "https://registry.yarnpkg.com/@types/node/-/node-10.17.51.tgz#639538575befbcf3d3861f95c41de8e47124d674"
|
||||
|
||||
"@types/node@^10.3.2":
|
||||
version "10.17.44"
|
||||
resolved "https://registry.yarnpkg.com/@types/node/-/node-10.17.44.tgz#3945e6b702cb6403f22b779c8ea9e5c3f44ead40"
|
||||
@@ -2642,6 +2741,10 @@
|
||||
version "12.19.3"
|
||||
resolved "https://registry.yarnpkg.com/@types/node/-/node-12.19.3.tgz#a6e252973214079155f749e8bef99cc80af182fa"
|
||||
|
||||
"@types/node@^12.6.1":
|
||||
version "12.19.16"
|
||||
resolved "https://registry.yarnpkg.com/@types/node/-/node-12.19.16.tgz#15753af35cbef636182d8d8ca55b37c8583cecb3"
|
||||
|
||||
"@types/normalize-package-data@^2.4.0":
|
||||
version "2.4.0"
|
||||
resolved "https://registry.yarnpkg.com/@types/normalize-package-data/-/normalize-package-data-2.4.0.tgz#e486d0d97396d79beedd0a6e33f4534ff6b4973e"
|
||||
@@ -5709,6 +5812,13 @@ ethereum-types@^3.3.3:
|
||||
"@types/node" "12.12.54"
|
||||
bignumber.js "~9.0.0"
|
||||
|
||||
ethereum-types@^3.4.0:
|
||||
version "3.4.0"
|
||||
resolved "https://registry.yarnpkg.com/ethereum-types/-/ethereum-types-3.4.0.tgz#866091997c052db6a075e01e857bbfa04ca9e28b"
|
||||
dependencies:
|
||||
"@types/node" "12.12.54"
|
||||
bignumber.js "~9.0.0"
|
||||
|
||||
ethereum-types@^3.5.0:
|
||||
version "3.5.0"
|
||||
resolved "https://registry.yarnpkg.com/ethereum-types/-/ethereum-types-3.5.0.tgz#27393f0d86f55bb1dcbff8a6af55a39c1f751c0d"
|
||||
@@ -5964,7 +6074,7 @@ ethers@^4.0.39, ethers@~4.0.4:
|
||||
uuid "2.0.1"
|
||||
xmlhttprequest "1.8.0"
|
||||
|
||||
ethjs-unit@0.1.6:
|
||||
ethjs-unit@0.1.6, ethjs-unit@^0.1.6:
|
||||
version "0.1.6"
|
||||
resolved "https://registry.yarnpkg.com/ethjs-unit/-/ethjs-unit-0.1.6.tgz#c665921e476e87bce2a9d588a6fe0405b2c41699"
|
||||
dependencies:
|
||||
@@ -5978,6 +6088,10 @@ ethjs-util@0.1.6, ethjs-util@^0.1.3:
|
||||
is-hex-prefixed "1.0.0"
|
||||
strip-hex-prefix "1.0.0"
|
||||
|
||||
eventemitter3@3.1.0:
|
||||
version "3.1.0"
|
||||
resolved "https://registry.yarnpkg.com/eventemitter3/-/eventemitter3-3.1.0.tgz#090b4d6cdbd645ed10bf750d4b5407942d7ba163"
|
||||
|
||||
eventemitter3@3.1.2, eventemitter3@^3.1.0:
|
||||
version "3.1.2"
|
||||
resolved "https://registry.yarnpkg.com/eventemitter3/-/eventemitter3-3.1.2.tgz#2d3d48f9c346698fce83a85d7d664e98535df6e7"
|
||||
@@ -5986,6 +6100,10 @@ eventemitter3@4.0.4:
|
||||
version "4.0.4"
|
||||
resolved "https://registry.yarnpkg.com/eventemitter3/-/eventemitter3-4.0.4.tgz#b5463ace635a083d018bdc7c917b4c5f10a85384"
|
||||
|
||||
eventemitter3@^4.0.0:
|
||||
version "4.0.7"
|
||||
resolved "https://registry.yarnpkg.com/eventemitter3/-/eventemitter3-4.0.7.tgz#2de9b68f6528d5644ef5c59526a1b4a07306169f"
|
||||
|
||||
events@^3.0.0:
|
||||
version "3.2.0"
|
||||
resolved "https://registry.yarnpkg.com/events/-/events-3.2.0.tgz#93b87c18f8efcd4202a461aec4dfc0556b639379"
|
||||
@@ -7926,6 +8044,10 @@ jsonparse@^1.2.0:
|
||||
version "1.3.1"
|
||||
resolved "https://registry.yarnpkg.com/jsonparse/-/jsonparse-1.3.1.tgz#3f4dae4a91fac315f71062f8521cc239f1366280"
|
||||
|
||||
jsonschema@^1.2.0:
|
||||
version "1.4.0"
|
||||
resolved "https://registry.yarnpkg.com/jsonschema/-/jsonschema-1.4.0.tgz#1afa34c4bc22190d8e42271ec17ac8b3404f87b2"
|
||||
|
||||
jsprim@^1.2.2:
|
||||
version "1.4.1"
|
||||
resolved "https://registry.yarnpkg.com/jsprim/-/jsprim-1.4.1.tgz#313e66bc1e5cc06e438bc1b7499c2e5c56acb6a2"
|
||||
@@ -10164,6 +10286,10 @@ query-string@^5.0.1:
|
||||
object-assign "^4.1.0"
|
||||
strict-uri-encode "^1.0.0"
|
||||
|
||||
querystringify@^2.0.0:
|
||||
version "2.2.0"
|
||||
resolved "https://registry.yarnpkg.com/querystringify/-/querystringify-2.2.0.tgz#3345941b4153cb9d082d8eee4cda2016a9aef7f6"
|
||||
|
||||
quick-lru@^1.0.0:
|
||||
version "1.1.0"
|
||||
resolved "https://registry.yarnpkg.com/quick-lru/-/quick-lru-1.1.0.tgz#4360b17c61136ad38078397ff11416e186dcfbb8"
|
||||
@@ -10542,6 +10668,10 @@ require-main-filename@^2.0.0:
|
||||
version "2.0.0"
|
||||
resolved "https://registry.yarnpkg.com/require-main-filename/-/require-main-filename-2.0.0.tgz#d0b329ecc7cc0f61649f62215be69af54aa8989b"
|
||||
|
||||
requires-port@^1.0.0:
|
||||
version "1.0.0"
|
||||
resolved "https://registry.yarnpkg.com/requires-port/-/requires-port-1.0.0.tgz#925d2601d39ac485e091cf0da5c6e694dc3dcaff"
|
||||
|
||||
resolve-cwd@^2.0.0:
|
||||
version "2.0.0"
|
||||
resolved "https://registry.yarnpkg.com/resolve-cwd/-/resolve-cwd-2.0.0.tgz#00a9f7387556e27038eae232caa372a6a59b665a"
|
||||
@@ -12149,6 +12279,13 @@ url-parse-lax@^3.0.0:
|
||||
dependencies:
|
||||
prepend-http "^2.0.0"
|
||||
|
||||
url-parse@1.4.4:
|
||||
version "1.4.4"
|
||||
resolved "https://registry.yarnpkg.com/url-parse/-/url-parse-1.4.4.tgz#cac1556e95faa0303691fec5cf9d5a1bc34648f8"
|
||||
dependencies:
|
||||
querystringify "^2.0.0"
|
||||
requires-port "^1.0.0"
|
||||
|
||||
url-set-query@^1.0.0:
|
||||
version "1.0.0"
|
||||
resolved "https://registry.yarnpkg.com/url-set-query/-/url-set-query-1.0.0.tgz#016e8cfd7c20ee05cafe7795e892bd0702faa339"
|
||||
@@ -12175,6 +12312,10 @@ utf-8-validate@^5.0.2:
|
||||
dependencies:
|
||||
node-gyp-build "~3.7.0"
|
||||
|
||||
utf8@2.1.1:
|
||||
version "2.1.1"
|
||||
resolved "https://registry.yarnpkg.com/utf8/-/utf8-2.1.1.tgz#2e01db02f7d8d0944f77104f1609eb0c304cf768"
|
||||
|
||||
utf8@3.0.0, utf8@^3.0.0:
|
||||
version "3.0.0"
|
||||
resolved "https://registry.yarnpkg.com/utf8/-/utf8-3.0.0.tgz#f052eed1364d696e769ef058b183df88c87f69d1"
|
||||
@@ -12354,6 +12495,16 @@ web3-core-helpers@1.2.11:
|
||||
web3-eth-iban "1.2.11"
|
||||
web3-utils "1.2.11"
|
||||
|
||||
web3-core-helpers@2.0.0-alpha.1:
|
||||
version "2.0.0-alpha.1"
|
||||
resolved "https://registry.yarnpkg.com/web3-core-helpers/-/web3-core-helpers-2.0.0-alpha.1.tgz#d20db557fe8740578105fb6b5790eb22097d1974"
|
||||
dependencies:
|
||||
"@babel/runtime" "^7.3.1"
|
||||
lodash "^4.17.11"
|
||||
web3-core "2.0.0-alpha.1"
|
||||
web3-eth-iban "2.0.0-alpha.1"
|
||||
web3-utils "2.0.0-alpha.1"
|
||||
|
||||
web3-core-method@1.2.1:
|
||||
version "1.2.1"
|
||||
resolved "https://registry.yarnpkg.com/web3-core-method/-/web3-core-method-1.2.1.tgz#9df1bafa2cd8be9d9937e01c6a47fc768d15d90a"
|
||||
@@ -12375,6 +12526,19 @@ web3-core-method@1.2.11:
|
||||
web3-core-subscriptions "1.2.11"
|
||||
web3-utils "1.2.11"
|
||||
|
||||
web3-core-method@2.0.0-alpha.1:
|
||||
version "2.0.0-alpha.1"
|
||||
resolved "https://registry.yarnpkg.com/web3-core-method/-/web3-core-method-2.0.0-alpha.1.tgz#6fd59cd229550bd08cb8922c095870fc9bf35f66"
|
||||
dependencies:
|
||||
"@babel/runtime" "^7.3.1"
|
||||
eventemitter3 "3.1.0"
|
||||
lodash "^4.17.11"
|
||||
rxjs "^6.4.0"
|
||||
web3-core "2.0.0-alpha.1"
|
||||
web3-core-helpers "2.0.0-alpha.1"
|
||||
web3-core-subscriptions "2.0.0-alpha.1"
|
||||
web3-utils "2.0.0-alpha.1"
|
||||
|
||||
web3-core-promievent@1.2.1:
|
||||
version "1.2.1"
|
||||
resolved "https://registry.yarnpkg.com/web3-core-promievent/-/web3-core-promievent-1.2.1.tgz#003e8a3eb82fb27b6164a6d5b9cad04acf733838"
|
||||
@@ -12424,6 +12588,14 @@ web3-core-subscriptions@1.2.11:
|
||||
underscore "1.9.1"
|
||||
web3-core-helpers "1.2.11"
|
||||
|
||||
web3-core-subscriptions@2.0.0-alpha.1:
|
||||
version "2.0.0-alpha.1"
|
||||
resolved "https://registry.yarnpkg.com/web3-core-subscriptions/-/web3-core-subscriptions-2.0.0-alpha.1.tgz#5c2164ce8649645f6809dcdc34626ae12ec0d19b"
|
||||
dependencies:
|
||||
"@babel/runtime" "^7.3.1"
|
||||
eventemitter3 "^4.0.0"
|
||||
lodash "^4.17.11"
|
||||
|
||||
web3-core@1.2.1:
|
||||
version "1.2.1"
|
||||
resolved "https://registry.yarnpkg.com/web3-core/-/web3-core-1.2.1.tgz#7278b58fb6495065e73a77efbbce781a7fddf1a9"
|
||||
@@ -12445,6 +12617,18 @@ web3-core@1.2.11:
|
||||
web3-core-requestmanager "1.2.11"
|
||||
web3-utils "1.2.11"
|
||||
|
||||
web3-core@2.0.0-alpha.1:
|
||||
version "2.0.0-alpha.1"
|
||||
resolved "https://registry.yarnpkg.com/web3-core/-/web3-core-2.0.0-alpha.1.tgz#4bb87b860a0bbf9fd19ae380a4773e12ac3b3010"
|
||||
dependencies:
|
||||
"@babel/runtime" "^7.3.1"
|
||||
"@types/bn.js" "^4.11.4"
|
||||
"@types/node" "^12.6.1"
|
||||
lodash "^4.17.11"
|
||||
web3-core-method "2.0.0-alpha.1"
|
||||
web3-providers "2.0.0-alpha.1"
|
||||
web3-utils "2.0.0-alpha.1"
|
||||
|
||||
web3-eth-abi@1.2.1:
|
||||
version "1.2.1"
|
||||
resolved "https://registry.yarnpkg.com/web3-eth-abi/-/web3-eth-abi-1.2.1.tgz#9b915b1c9ebf82f70cca631147035d5419064689"
|
||||
@@ -12569,6 +12753,14 @@ web3-eth-iban@1.2.11:
|
||||
bn.js "^4.11.9"
|
||||
web3-utils "1.2.11"
|
||||
|
||||
web3-eth-iban@2.0.0-alpha.1:
|
||||
version "2.0.0-alpha.1"
|
||||
resolved "https://registry.yarnpkg.com/web3-eth-iban/-/web3-eth-iban-2.0.0-alpha.1.tgz#79f1f6061b95b5bb64eb4243a6c65dadf542077c"
|
||||
dependencies:
|
||||
"@babel/runtime" "^7.3.1"
|
||||
bn.js "4.11.8"
|
||||
web3-utils "2.0.0-alpha.1"
|
||||
|
||||
web3-eth-personal@1.2.1:
|
||||
version "1.2.1"
|
||||
resolved "https://registry.yarnpkg.com/web3-eth-personal/-/web3-eth-personal-1.2.1.tgz#244e9911b7b482dc17c02f23a061a627c6e47faf"
|
||||
@@ -12740,6 +12932,22 @@ web3-providers-ws@1.2.11:
|
||||
web3-core-helpers "1.2.11"
|
||||
websocket "^1.0.31"
|
||||
|
||||
web3-providers@2.0.0-alpha.1, web3-providers@^2.0.0-alpha.1:
|
||||
version "2.0.0-alpha.1"
|
||||
resolved "https://registry.yarnpkg.com/web3-providers/-/web3-providers-2.0.0-alpha.1.tgz#19486aed4b014ec5d7687fac4eef2042db8b338c"
|
||||
dependencies:
|
||||
"@babel/runtime" "^7.3.1"
|
||||
"@types/node" "^10.12.18"
|
||||
eventemitter3 "3.1.0"
|
||||
lodash "^4.17.11"
|
||||
url-parse "1.4.4"
|
||||
web3-core "2.0.0-alpha.1"
|
||||
web3-core-helpers "2.0.0-alpha.1"
|
||||
web3-core-method "2.0.0-alpha.1"
|
||||
web3-utils "2.0.0-alpha.1"
|
||||
websocket "github:web3-js/WebSocket-Node#polyfill/globalThis"
|
||||
xhr2-cookies "1.1.0"
|
||||
|
||||
web3-shh@1.2.1:
|
||||
version "1.2.1"
|
||||
resolved "https://registry.yarnpkg.com/web3-shh/-/web3-shh-1.2.1.tgz#4460e3c1e07faf73ddec24ccd00da46f89152b0c"
|
||||
@@ -12802,6 +13010,21 @@ web3-utils@1.3.0:
|
||||
underscore "1.9.1"
|
||||
utf8 "3.0.0"
|
||||
|
||||
web3-utils@2.0.0-alpha.1:
|
||||
version "2.0.0-alpha.1"
|
||||
resolved "https://registry.yarnpkg.com/web3-utils/-/web3-utils-2.0.0-alpha.1.tgz#231442adea3b58bca0c7185ee5b7743c01938682"
|
||||
dependencies:
|
||||
"@babel/runtime" "^7.3.1"
|
||||
"@types/bn.js" "^4.11.4"
|
||||
"@types/node" "^12.6.1"
|
||||
bn.js "4.11.8"
|
||||
eth-lib "0.2.8"
|
||||
ethjs-unit "^0.1.6"
|
||||
lodash "^4.17.11"
|
||||
number-to-bn "1.7.0"
|
||||
randombytes "^2.1.0"
|
||||
utf8 "2.1.1"
|
||||
|
||||
web3@1.2.1:
|
||||
version "1.2.1"
|
||||
resolved "https://registry.yarnpkg.com/web3/-/web3-1.2.1.tgz#5d8158bcca47838ab8c2b784a2dee4c3ceb4179b"
|
||||
@@ -12841,6 +13064,17 @@ websocket@1.0.32, websocket@^1.0.31:
|
||||
utf-8-validate "^5.0.2"
|
||||
yaeti "^0.0.6"
|
||||
|
||||
websocket@^1.0.29:
|
||||
version "1.0.33"
|
||||
resolved "https://registry.yarnpkg.com/websocket/-/websocket-1.0.33.tgz#407f763fc58e74a3fa41ca3ae5d78d3f5e3b82a5"
|
||||
dependencies:
|
||||
bufferutil "^4.0.1"
|
||||
debug "^2.2.0"
|
||||
es5-ext "^0.10.50"
|
||||
typedarray-to-buffer "^3.1.5"
|
||||
utf-8-validate "^5.0.2"
|
||||
yaeti "^0.0.6"
|
||||
|
||||
"websocket@github:web3-js/WebSocket-Node#polyfill/globalThis":
|
||||
version "1.0.29"
|
||||
resolved "https://codeload.github.com/web3-js/WebSocket-Node/tar.gz/ef5ea2f41daf4a2113b80c9223df884b4d56c400"
|
||||
|
||||
Reference in New Issue
Block a user