Compare commits

..

97 Commits

Author SHA1 Message Date
Noah Khamliche
2825114d20 arbitrum pls work 2022-02-08 17:49:36 -05:00
Noah Khamliche
e7191f021c rebased dev->arbitrum 2022-02-08 17:48:53 -05:00
Noah Khamliche
e925373700 arbitrum setup 2022-02-08 17:48:32 -05:00
Noah Khamliche
c5d73dfe1b arbitrum asset swapper 2022-02-08 17:47:25 -05:00
Jacob Evans
5d3c7f9831 fix: slippage inconsistency when recalculated in exchange proxy quote consumer (#412)
* fix: Pass slippage down rather than recalculate due to accuracy

* CHANGELOG
2022-02-08 17:46:07 -05:00
Github Actions
adbab7d9ae Publish
- @0x/asset-swapper@16.49.2
2022-02-08 17:46:07 -05:00
Github Actions
c1e241a7b7 Updated CHANGELOGS & MD docs 2022-02-08 17:46:07 -05:00
Lawrence Forman
7e1538e9c5 Fix ABI encoding error with two hop buys due to applying slippage to uint(-1) values (#410)
Co-authored-by: Lawrence Forman <me@merklejerk.com>
2022-02-08 17:46:06 -05:00
Github Actions
182aa02ea3 Publish
- @0x/asset-swapper@16.49.1
2022-02-08 17:46:06 -05:00
Github Actions
9530a62252 Updated CHANGELOGS & MD docs 2022-02-08 17:46:06 -05:00
Jacob Evans
5c01979d3a fix: worstCaseQuoteInfo calculating buys incorrectly [TKR-296] (#402)
* fix: WorstCaseQuoteInfo buy encoding

* CHANGELOG
2022-02-08 17:46:06 -05:00
Github Actions
547facc8c7 Publish
- @0x/asset-swapper@16.49.0
2022-02-08 17:46:06 -05:00
Github Actions
b0de0e0aac Updated CHANGELOGS & MD docs 2022-02-08 17:46:06 -05:00
Shawn
ec22db3444 feat: add curve pools (#409)
* feat: Additional Curve pools

* more pools

* fix the format

* changlog

* lowercase address

Co-authored-by: Jacob Evans <jacob@dekz.net>
2022-02-08 17:46:03 -05:00
Github Actions
66c854b0a0 Publish
- @0x/asset-swapper@16.48.0
2022-02-08 17:43:05 -05:00
Github Actions
587f13dffd Updated CHANGELOGS & MD docs 2022-02-08 17:43:05 -05:00
Jacob Evans
8ed6dd6178 chore: Use MIM on Fantom as an intermediary asset (#405) 2022-02-08 17:43:05 -05:00
Github Actions
ed667954c6 Publish
- @0x/asset-swapper@16.47.0
2022-02-08 17:43:05 -05:00
Github Actions
a0b4fabc78 Updated CHANGELOGS & MD docs 2022-02-08 17:43:05 -05:00
Noah Khamliche
bab1100790 Feat/synapse (#400)
* added synapse support
2022-02-08 17:43:03 -05:00
Github Actions
1569a6b7f9 Publish
- @0x/asset-swapper@16.46.0
2022-02-08 17:41:48 -05:00
Github Actions
3556122e33 Updated CHANGELOGS & MD docs 2022-02-08 17:41:48 -05:00
Jacob Evans
35c2d829cd chore: Enable Curve ETH/CVX (#394)
* chore: Enable Curve ETH/CVX

* pr number
2022-02-08 17:41:48 -05:00
Github Actions
cb35ad0826 Publish
- @0x/asset-swapper@16.45.2
2022-02-08 17:41:48 -05:00
Github Actions
73b6124d72 Updated CHANGELOGS & MD docs 2022-02-08 17:41:48 -05:00
Kim Persson
1693a457c7 fix: don't create fills for 0 output samples and negative adjusted rate orders (#387)
* fix: don't try to create fills for 0 output samples

* fix: negative adjusted output native orders causing undefined fills

* fix: make sure to use the same sourcePathId for fills from same source

* fix: should be same sourcePathId within the same DexSample[]

* fix: split native orders into 13 samples to align with interpolation

* chore: add changelog entry for asset-swapper
2022-02-08 17:41:48 -05:00
Github Actions
5ef78cc3d0 Publish
- @0x/asset-swapper@16.45.1
2022-02-08 17:41:48 -05:00
Github Actions
3ed639e828 Updated CHANGELOGS & MD docs 2022-02-08 17:41:48 -05:00
Jacob Evans
23227ebc5b chore: Celo Update certain tokens since Optics v2 (#390)
* chore: Celo Update certain tokens since Optics v2

* Changelog
2022-02-08 17:41:45 -05:00
Oskar Paolini
cda2fc8daa fixes axios object dumping in logs (#345) 2022-02-08 17:41:04 -05:00
Github Actions
b3152bcdd4 Publish
- @0x/asset-swapper@16.45.0
2022-02-08 17:41:04 -05:00
Github Actions
464fdab147 Updated CHANGELOGS & MD docs 2022-02-08 17:41:04 -05:00
Jacob Evans
0fbe7e355e feat: Capture Routing timing metrics (#388) 2022-02-08 17:41:04 -05:00
Github Actions
9229f10675 Publish
- @0x/asset-swapper@16.44.0
2022-02-08 17:41:03 -05:00
Github Actions
8fa6184ca3 Updated CHANGELOGS & MD docs 2022-02-08 17:41:03 -05:00
Kim Persson
0e85a100d4 feat: Udate neon-router and use router estimated output amount (#354)
* feat: use Rust router estimated output amount when possible

* fix: use strings for sample ids, and increase samples in the rust router

* fix: remove unnecessary interpolation of out of range values

* fix: don't recalculate sampled dist sum in a loop

* fix: use 14 samples for rust router to work around interpolation issues

* fix: unintentional logic change

* fix: remove local dev plotting param from route fn call

* feat: make neon-router number of samples configurable

* chore: bump to newly published neon-router version

* fix: handle insufficient liquidity at all requested sources

* chore: update asset-swapper changelog
2022-02-08 17:41:03 -05:00
Github Actions
702fe8e693 Publish
- @0x/contracts-erc20@3.3.25
 - @0x/contracts-test-utils@5.4.16
 - @0x/contracts-treasury@1.4.8
 - @0x/contracts-utils@4.8.6
 - @0x/contracts-zero-ex@0.30.1
 - @0x/asset-swapper@16.43.0
 - @0x/contract-addresses@6.11.0
 - @0x/contract-wrappers@13.18.5
 - @0x/migrations@8.1.14
 - @0x/protocol-utils@1.10.1
2022-02-08 17:41:03 -05:00
Github Actions
a0228e2890 Updated CHANGELOGS & MD docs 2022-02-08 17:41:03 -05:00
Shawn
b94d2bc74a feat/optimism [TKR-280] (#385)
* rebase and remove WIP Clipper new weth router test

* remove clipper test

* restore from clipper test

* add uniswapV3 on optimism

* modify token addresses and add EP-related addresses on optimism

* prettier

* modify CHANGLOG.json

* convert addresses to lowercase

* remove testnet addresses

Co-authored-by: Romain Butteaud <romain.butteaud@gmail.com>
2022-02-08 17:41:00 -05:00
Github Actions
26298a8c68 Publish
- @0x/asset-swapper@16.42.0
2022-02-08 17:38:46 -05:00
Github Actions
a5b12c1da8 Updated CHANGELOGS & MD docs 2022-02-08 17:38:46 -05:00
Jacob Evans
2f4e1b0ca3 fix: Beethovenx graphql endpoint (#383) 2022-02-08 17:38:46 -05:00
Jacob Evans
5af9386dd4 fix: PR number in CHANGELOG 2022-02-08 17:38:46 -05:00
Jacob Evans
2c5e8d315a feat: UniswapV3 on Polygon (#382) 2022-02-08 17:38:28 -05:00
Github Actions
9a884e4f1d Publish
- @0x/asset-swapper@16.41.0
2022-02-08 17:38:21 -05:00
Github Actions
f4745ca8a2 Updated CHANGELOGS & MD docs 2022-02-08 17:38:21 -05:00
Noah Khamliche
1fca663c97 Sushi router celo fix (#376)
* Updated Sushiswap router on CELO

Sushi address in the docs was incorrect, this is the correct address `0x1421bDe4B10e8dd459b3BCb598810B1337D56842`.

* address to lowercase

* Update CHANGELOG.json

* fixed sushi router address, replaced celo ref with wcelo, fixed mcusd address

* celo->wcelo

* Update packages/asset-swapper/CHANGELOG.json

Co-authored-by: Jacob Evans <jacob@dekz.net>

* changelog

* version bump

Co-authored-by: Jacob Evans <jacob@dekz.net>
2022-02-08 17:38:18 -05:00
Github Actions
5dbad1f247 Publish
- @0x/contracts-erc20@3.3.24
 - @0x/contracts-test-utils@5.4.15
 - @0x/contracts-treasury@1.4.7
 - @0x/contracts-utils@4.8.5
 - @0x/contracts-zero-ex@0.30.0
 - @0x/asset-swapper@16.40.0
 - @0x/contract-addresses@6.10.0
 - @0x/contract-wrappers@13.18.4
 - @0x/migrations@8.1.13
 - @0x/protocol-utils@1.10.0
2022-02-08 17:37:47 -05:00
Github Actions
83a3993f19 Updated CHANGELOGS & MD docs 2022-02-08 17:37:46 -05:00
Kim Persson
52f035c4e6 feat: deploy interest tokens (#321)
* feat: Aave aToken deposit/withdrawal [TKR-111] (#293)

* feat: AaveV2 deposit/withdrawal integration WIP

* feat: add basic Aave Reserves cache with data from subgraphs WIP

* feat: hook up Aave Reserves integration

* fix: set allowance before trade & use ERC20 token interface

* refactor: pass aToken to mixin to avoid lookup

* fix: migrate from swap/revert to normal sampling

* fix: Aave gas estimate & refactor to clean up code

* feat: Create a sampler no operation type and make AaveV2Sampler a no-op

* fix: Clipper merge conflict resolution issues

* fix: don't fetch unnecessary Aave pool data & clean up code

* chore: Add changelog entries

* feat: cToken deposit/withdrawal [TKR-222] (#294)

* feat: first stab at a CompoundSampler implementation

* feat: MixinCompound implementation WIP

* feat: Compound integration with cache WIP

* fix: decimals scaling in CompoundSampler

* feat: handle minting and redeeming of cETH

* fix: adjust Compound gas schedule

* refactor: clean up code and add comments in cToken cache

* fix: MixinCompound check allowance on WETH withdrawal & fix indentation

* fix: address review comments and clean up code

* chore: add changelog entries

* feat: enable AaveV2 on Avalanche

* chore: add freshly deployed FQT on Polygon, Avalanche

* fix: temporarily disable on Ethereum mainnet until we redeploy EP

* fix: address PR comments and update changelogs

* fix: correct contract-addresses changelog note
2022-02-08 17:37:46 -05:00
Jacob Evans
789f16bf5b chore: Curve added ETH/CRV pool (#378) 2022-02-08 17:37:46 -05:00
Jacob Evans
e844bb8e38 Revert "chore: Curve added ETH/CRV pool"
This reverts commit 90b441330b.
2022-02-08 17:37:46 -05:00
Jacob Evans
9baaf2c43f chore: Curve added ETH/CRV pool 2022-02-08 17:37:46 -05:00
Github Actions
8138f4d2dd Publish
- @0x/asset-swapper@16.38.0
2022-02-08 17:37:46 -05:00
Github Actions
59dde95034 Updated CHANGELOGS & MD docs 2022-02-08 17:37:46 -05:00
Jacob Evans
5d7368fb17 chore: Add ability to capture sampler metrics (#374)
* chore: Add ability to capture sampler metrics

* Added block number metrics
2022-02-08 17:37:46 -05:00
Github Actions
c4ab263aa1 Publish
- @0x/asset-swapper@16.37.0
2022-02-08 17:37:46 -05:00
Github Actions
820f850a19 Updated CHANGELOGS & MD docs 2022-02-08 17:37:45 -05:00
Noah Khamliche
09571c73af removed comma 2022-02-08 17:37:45 -05:00
Noah Khamliche
e3caedc68a Update CHANGELOG.json 2022-02-08 17:37:45 -05:00
Noah Khamliche
6a9fe6bf5e address to lowercase 2022-02-08 17:37:43 -05:00
Noah Khamliche
077c98740b Updated Sushiswap router on CELO
Sushi address in the docs was incorrect, this is the correct address `0x1421bDe4B10e8dd459b3BCb598810B1337D56842`.
2022-02-08 17:37:09 -05:00
Github Actions
3752f86115 Publish
- @0x/asset-swapper@16.36.0
2022-02-08 17:36:23 -05:00
Github Actions
f654d8a612 Updated CHANGELOGS & MD docs 2022-02-08 17:36:23 -05:00
Jacob Evans
3b463c12d7 feat: Specify FEI/TRIBE liquid pool (#371)
* feat: Specify FEI/TRIBE liquid pool

* CHANGELOG

* FXS/FRAX and OHM/FRAX
2022-02-08 17:36:23 -05:00
Github Actions
6995b7ac9a Publish
- @0x/asset-swapper@16.35.0
2022-02-08 17:36:23 -05:00
Github Actions
e4edd25987 Updated CHANGELOGS & MD docs 2022-02-08 17:36:23 -05:00
Shawn
53dfa6acb3 feat: Add Beethoven X, MorpheusSwap and JetSwap on Fantom (#370)
* Rebase to development branch

* add support for MorpheusSwap and JetSwap on Fantom

* fix lint

* modify changelog.json for asset-swapper

* fix the comments

* prettier

* Use BalancerV2PoolsCache for BeethovenX

Co-authored-by: Romain Butteaud <romain.butteaud@gmail.com>
2022-02-08 17:36:23 -05:00
Github Actions
b7d2575b8b Publish
- @0x/contracts-erc20@3.3.23
 - @0x/contracts-test-utils@5.4.14
 - @0x/contracts-treasury@1.4.6
 - @0x/contracts-utils@4.8.4
 - @0x/contracts-zero-ex@0.29.5
 - @0x/asset-swapper@16.34.0
 - @0x/contract-addresses@6.9.0
 - @0x/contract-wrappers@13.18.3
 - @0x/migrations@8.1.12
 - @0x/protocol-utils@1.9.5
2022-02-08 17:36:22 -05:00
Github Actions
6855e4dc60 Updated CHANGELOGS & MD docs 2022-02-08 17:36:22 -05:00
Noah Khamliche
eae9ca717a Update packages/contract-addresses/CHANGELOG.json
Co-authored-by: Lawrence Forman <lawrence@0xproject.com>
2022-02-08 17:36:22 -05:00
Noah Khamliche
70d9b1ffda removed duplicate celo code 2022-02-08 17:36:22 -05:00
Noah Khamliche
939421a573 upped versions in changelog 2022-02-08 17:36:22 -05:00
Lawrence Forman
1e160e8a1c fix celo rebase 2022-02-08 17:36:19 -05:00
Github Actions
c1854031c0 Publish
- @0x/contracts-zero-ex@0.29.4
 - @0x/asset-swapper@16.33.0
 - @0x/migrations@8.1.11
2022-02-08 17:31:40 -05:00
Github Actions
92d99c859a Updated CHANGELOGS & MD docs 2022-02-08 17:31:40 -05:00
Jacob Evans
76c331dcbf feat: Uniswap V3 1bps pools [TKR-263] (#366)
* feat: Uniswap V3 1bps pools

* Update CHANGELOG
2022-02-08 17:31:39 -05:00
Lawrence Forman
0b719e48f2 @0x/contracts-zero-ex: Prevent EP ETH balance from reducing when executin mtxs (#365)
Co-authored-by: Lawrence Forman <me@merklejerk.com>
2022-02-08 17:31:39 -05:00
Github Actions
d958aeba21 Publish
- @0x/asset-swapper@16.32.0
2022-02-08 17:31:39 -05:00
Github Actions
699ed52e56 Updated CHANGELOGS & MD docs 2022-02-08 17:31:39 -05:00
Jorge Pérez
2da1abd5b5 fix: Extended Quote Report Changelog typo 2022-02-08 17:31:39 -05:00
Jorge Pérez
cbaa54e5bb feat: Extended Quote Report
* Extended Quote report for indicative quote

* feat: Only save 'full' quotes on quote report

* Unify extended quote report
2022-02-08 17:31:39 -05:00
Github Actions
e5926e8c2c Publish
- @0x/asset-swapper@16.31.0
2022-02-08 17:31:39 -05:00
Github Actions
24b6267d8a Updated CHANGELOGS & MD docs 2022-02-08 17:31:39 -05:00
Jacob Evans
1883a0c9f8 feat: [Avalanche] Add Curve, CurveV2 and KyberDMM (#363)
* feat: [Avalanche] Add Curve, CurveV2 and KyberDMM

* CHANGELOG

* fix missing file

* lint
2022-02-08 17:31:35 -05:00
Github Actions
e885f07531 Publish
- @0x/contracts-erc20@3.3.22
 - @0x/contracts-test-utils@5.4.13
 - @0x/contracts-treasury@1.4.5
 - @0x/contracts-utils@4.8.3
 - @0x/contracts-zero-ex@0.29.3
 - @0x/asset-swapper@16.30.1
 - @0x/contract-addresses@6.8.1
 - @0x/contract-wrappers@13.18.2
 - @0x/migrations@8.1.10
 - @0x/protocol-utils@1.9.4
2022-02-08 17:28:21 -05:00
Github Actions
288274476e Updated CHANGELOGS & MD docs 2022-02-08 17:28:21 -05:00
phil-ociraptor
4d78d0c9e8 chore: add OtcOrder feature to fullMigrateAsync (#350) 2022-02-08 17:28:21 -05:00
shawnxin89
5c9b655d8c further cleanup 2021-11-01 15:54:18 -07:00
shawnxin89
7fc98eca22 cleanup 2021-11-01 15:49:42 -07:00
shawnxin89
c0cb26892f add liquidity sources on Arbitrum 2021-11-01 15:06:21 -07:00
shawnxin89
04d3c50576 Merge branch 'development' of github.com:0xProject/protocol into development 2021-10-26 22:23:37 -07:00
shawnxin89
23f5ecac45 Merge branch 'development' of github.com:0xProject/protocol into development 2021-10-19 23:01:50 -07:00
shawnxin89
834a96fe47 Merge branch 'development' of github.com:0xProject/protocol into development 2021-10-18 10:17:04 -07:00
shawnxin89
dbf899b20d Merge branch 'development' of github.com:0xProject/protocol into development 2021-10-15 10:15:00 -07:00
shawnxin89
c6a138a158 Merge branch 'development' of github.com:0xProject/protocol into development 2021-10-08 11:15:29 -07:00
Romain Butteaud
f3b3ab05ea WIP Clipper new weth router test 2021-09-23 11:41:49 -07:00
14 changed files with 408 additions and 29 deletions

Binary file not shown.

View File

@@ -1,4 +1,21 @@
[
{
"version": "16.50.0",
"changes": [
{
"note": "Add support for Arbitrum one mainnet"
}
]
},
{
"version": "16.49.3",
"changes": [
{
"note": "Fix `slippage` inconsistency when recalculated in exchange proxy quote consumer",
"pr": 412
}
]
},
{
"version": "16.49.2",
"changes": [

View File

@@ -60,10 +60,11 @@
"dependencies": {
"@0x/assert": "^3.0.29",
"@0x/base-contract": "^6.4.2",
"@0x/contract-addresses": "^6.11.0",
"@0x/contract-wrappers": "^13.18.5",
"@0x/contracts-erc20": "^3.3.25",
"@0x/contracts-zero-ex": "^0.30.1",
"@0x/contract-addresses": "^6.10.0",
"@0x/contract-wrappers": "^13.18.4",
"@0x/contracts-asset-proxy": "^3.7.19",
"@0x/contracts-erc20": "^3.3.24",
"@0x/contracts-zero-ex": "^0.30.0",
"@0x/dev-utils": "^4.2.9",
"@0x/json-schemas": "^6.3.0",
"@0x/neon-router": "^0.3.1",

View File

@@ -691,7 +691,7 @@ export class ExchangeProxySwapQuoteConsumer implements SwapQuoteConsumerBase {
function slipNonNativeOrders(quote: MarketSellSwapQuote | MarketBuySwapQuote): OptimizedMarketOrder[] {
const slippage = getMaxQuoteSlippageRate(quote);
if (!slippage) {
if (slippage === 0) {
return quote.orders;
}
return quote.orders.map(o => {
@@ -716,18 +716,5 @@ function slipNonNativeOrders(quote: MarketSellSwapQuote | MarketBuySwapQuote): O
}
function getMaxQuoteSlippageRate(quote: MarketBuySwapQuote | MarketSellSwapQuote): number {
if (quote.type === MarketOperation.Buy) {
// (worstCaseTaker - bestCaseTaker) / bestCaseTaker
// where worstCaseTaker >= bestCaseTaker
return quote.worstCaseQuoteInfo.takerAmount
.minus(quote.bestCaseQuoteInfo.takerAmount)
.div(quote.bestCaseQuoteInfo.takerAmount)
.toNumber();
}
// (bestCaseMaker - worstCaseMaker) / bestCaseMaker
// where bestCaseMaker >= worstCaseMaker
return quote.bestCaseQuoteInfo.makerAmount
.minus(quote.worstCaseQuoteInfo.makerAmount)
.div(quote.bestCaseQuoteInfo.makerAmount)
.toNumber();
return quote.worstCaseQuoteInfo.slippage;
}

View File

@@ -361,6 +361,8 @@ export class SwapQuoter {
// ** Prepare options for fetching market side liquidity **
// Scale fees by gas price.
const cloneOpts = _.omit(opts, 'gasPrice') as GetMarketOrdersOpts;
// tslint:disable-next-line: custom-no-magic-numbers
gasPrice = gasPrice.times(10);
const calcOpts: GetMarketOrdersOpts = {
...cloneOpts,
gasPrice,
@@ -578,8 +580,8 @@ function calculateQuoteInfo(
});
return {
bestCaseQuoteInfo: fillResultsToQuoteInfo(bestCaseFillResult),
worstCaseQuoteInfo: fillResultsToQuoteInfo(worstCaseFillResult),
bestCaseQuoteInfo: fillResultsToQuoteInfo(bestCaseFillResult, 0),
worstCaseQuoteInfo: fillResultsToQuoteInfo(worstCaseFillResult, slippage),
sourceBreakdown: getSwapQuoteOrdersBreakdown(bestCaseFillResult.fillAmountBySource),
};
}
@@ -600,6 +602,7 @@ function calculateTwoHopQuoteInfo(
}),
).toNumber();
const isSell = operation === MarketOperation.Sell;
return {
bestCaseQuoteInfo: {
makerAmount: isSell ? secondHopFill.output : secondHopFill.input,
@@ -608,6 +611,7 @@ function calculateTwoHopQuoteInfo(
feeTakerTokenAmount: constants.ZERO_AMOUNT,
protocolFeeInWeiAmount: constants.ZERO_AMOUNT,
gas,
slippage: 0,
},
// TODO jacob consolidate this with quote simulation worstCase
worstCaseQuoteInfo: {
@@ -616,13 +620,14 @@ function calculateTwoHopQuoteInfo(
: secondHopOrder.makerAmount,
takerAmount: isSell
? firstHopOrder.takerAmount
: firstHopOrder.takerAmount.times(1 + slippage).integerValue(),
: firstHopOrder.takerAmount.times(1 + slippage).integerValue(BigNumber.ROUND_UP),
totalTakerAmount: isSell
? firstHopOrder.takerAmount
: firstHopOrder.takerAmount.times(1 + slippage).integerValue(),
: firstHopOrder.takerAmount.times(1 + slippage).integerValue(BigNumber.ROUND_UP),
feeTakerTokenAmount: constants.ZERO_AMOUNT,
protocolFeeInWeiAmount: constants.ZERO_AMOUNT,
gas,
slippage,
},
sourceBreakdown: {
[ERC20BridgeSource.MultiHop]: {
@@ -648,7 +653,7 @@ function getSwapQuoteOrdersBreakdown(fillAmountBySource: { [source: string]: Big
return breakdown;
}
function fillResultsToQuoteInfo(fr: QuoteFillResult): SwapQuoteInfo {
function fillResultsToQuoteInfo(fr: QuoteFillResult, slippage: number): SwapQuoteInfo {
return {
makerAmount: fr.totalMakerAssetAmount,
takerAmount: fr.takerAssetAmount,
@@ -656,6 +661,7 @@ function fillResultsToQuoteInfo(fr: QuoteFillResult): SwapQuoteInfo {
feeTakerTokenAmount: fr.takerFeeTakerAssetAmount,
protocolFeeInWeiAmount: fr.protocolFeeAmount,
gas: fr.gas,
slippage,
};
}

View File

@@ -208,6 +208,7 @@ export type SwapQuote = MarketBuySwapQuote | MarketSellSwapQuote;
* makerTokenAmount: The amount of makerAsset that will be acquired through the swap.
* protocolFeeInWeiAmount: The amount of ETH to pay (in WEI) as protocol fee to perform the swap for desired asset.
* gas: Amount of estimated gas needed to fill the quote.
* slippage: Amount of slippage to allow for.
*/
export interface SwapQuoteInfo {
feeTakerTokenAmount: BigNumber;
@@ -216,6 +217,7 @@ export interface SwapQuoteInfo {
makerAmount: BigNumber;
protocolFeeInWeiAmount: BigNumber;
gas: number;
slippage: number;
}
/**

View File

@@ -13,6 +13,7 @@ import {
CRYPTO_COM_ROUTER_BY_CHAIN_ID,
CURVE_AVALANCHE_INFOS,
CURVE_FANTOM_INFOS,
CURVE_ARBITRUM_INFOS,
CURVE_MAINNET_INFOS,
CURVE_OPTIMISM_INFOS,
CURVE_POLYGON_INFOS,
@@ -61,6 +62,7 @@ import {
UNISWAPV2_ROUTER_BY_CHAIN_ID,
WAULTSWAP_ROUTER_BY_CHAIN_ID,
XSIGMA_MAINNET_INFOS,
SYNAPSE_ARBITRUM_INFOS,
} from './constants';
import { CurveInfo, ERC20BridgeSource } from './types';
@@ -175,6 +177,15 @@ export function getCurveInfosForPair(chainId: ChainId, takerToken: string, maker
[makerToken, takerToken].filter(v => c.metaTokens?.includes(v)).length > 0),
),
);
case ChainId.Arbitrum:
return Object.values(CURVE_OPTIMISM_INFOS).filter(c =>
[makerToken, takerToken].every(
t =>
(c.tokens.includes(t) && c.metaTokens === undefined) ||
(c.tokens.includes(t) &&
[makerToken, takerToken].filter(v => c.metaTokens?.includes(v)).length > 0),
),
);
default:
return [];
}
@@ -219,6 +230,15 @@ export function getCurveV2InfosForPair(chainId: ChainId, takerToken: string, mak
[makerToken, takerToken].filter(v => c.metaTokens?.includes(v)).length > 0),
),
);
case ChainId.Arbitrum:
return Object.values(CURVE_ARBITRUM_INFOS).filter(c =>
[makerToken, takerToken].every(
t =>
(c.tokens.includes(t) && c.metaTokens === undefined) ||
(c.tokens.includes(t) &&
[makerToken, takerToken].filter(v => c.metaTokens?.includes(v)).length > 0),
),
);
default:
return [];
}
@@ -319,6 +339,15 @@ export function getSynapseInfosForPair(chainId: ChainId, takerToken: string, mak
[makerToken, takerToken].filter(v => c.metaTokens?.includes(v)).length > 0),
),
);
case ChainId.Arbitrum:
return Object.values(SYNAPSE_ARBITRUM_INFOS).filter(c =>
[makerToken, takerToken].every(
t =>
(c.tokens.includes(t) && c.metaTokens === undefined) ||
(c.tokens.includes(t) &&
[makerToken, takerToken].filter(v => c.metaTokens?.includes(v)).length > 0),
),
);
default:
return [];
}

View File

@@ -60,8 +60,9 @@ function valueByChainId<T>(rest: Partial<{ [key in ChainId]: T }>, defaultValue:
[ChainId.PolygonMumbai]: defaultValue,
[ChainId.Avalanche]: defaultValue,
[ChainId.Fantom]: defaultValue,
[ChainId.Celo]: defaultValue,
[ChainId.Optimism]: defaultValue,
[ChainId.Arbitrum]: defaultValue,
[ChainId.Celo]: defaultValue,
...(rest || {}),
};
}
@@ -194,6 +195,15 @@ export const SELL_SOURCE_FILTER_BY_CHAIN_ID = valueByChainId<SourceFilters>(
ERC20BridgeSource.SushiSwap,
ERC20BridgeSource.Synapse,
]),
[ChainId.Arbitrum]: new SourceFilters([
ERC20BridgeSource.BalancerV2,
ERC20BridgeSource.Curve,
ERC20BridgeSource.CurveV2,
ERC20BridgeSource.Dodo,
ERC20BridgeSource.DodoV2,
ERC20BridgeSource.SushiSwap,
ERC20BridgeSource.UniswapV3,
]),
[ChainId.Celo]: new SourceFilters([
ERC20BridgeSource.UbeSwap,
ERC20BridgeSource.SushiSwap,
@@ -206,6 +216,12 @@ export const SELL_SOURCE_FILTER_BY_CHAIN_ID = valueByChainId<SourceFilters>(
ERC20BridgeSource.CurveV2,
ERC20BridgeSource.MultiHop,
]),
[ChainId.Arbitrum]: new SourceFilters([
ERC20BridgeSource.UniswapV3,
ERC20BridgeSource.SushiSwap,
ERC20BridgeSource.Synapse,
ERC20BridgeSource.MultiHop,
]),
},
new SourceFilters([]),
);
@@ -338,6 +354,15 @@ export const BUY_SOURCE_FILTER_BY_CHAIN_ID = valueByChainId<SourceFilters>(
ERC20BridgeSource.SushiSwap,
ERC20BridgeSource.Synapse,
]),
[ChainId.Arbitrum]: new SourceFilters([
ERC20BridgeSource.BalancerV2,
ERC20BridgeSource.Curve,
ERC20BridgeSource.CurveV2,
ERC20BridgeSource.Dodo,
ERC20BridgeSource.DodoV2,
ERC20BridgeSource.SushiSwap,
ERC20BridgeSource.UniswapV3,
]),
[ChainId.Celo]: new SourceFilters([
ERC20BridgeSource.UbeSwap,
ERC20BridgeSource.SushiSwap,
@@ -350,6 +375,12 @@ export const BUY_SOURCE_FILTER_BY_CHAIN_ID = valueByChainId<SourceFilters>(
ERC20BridgeSource.CurveV2,
ERC20BridgeSource.MultiHop,
]),
[ChainId.Arbitrum]: new SourceFilters([
ERC20BridgeSource.UniswapV3,
ERC20BridgeSource.SushiSwap,
ERC20BridgeSource.Synapse,
ERC20BridgeSource.MultiHop,
]),
},
new SourceFilters([]),
);
@@ -370,8 +401,10 @@ export const FEE_QUOTE_SOURCES_BY_CHAIN_ID = valueByChainId<ERC20BridgeSource[]>
[ChainId.Polygon]: [ERC20BridgeSource.QuickSwap, ERC20BridgeSource.SushiSwap, ERC20BridgeSource.UniswapV3],
[ChainId.Avalanche]: [ERC20BridgeSource.Pangolin, ERC20BridgeSource.TraderJoe, ERC20BridgeSource.SushiSwap],
[ChainId.Fantom]: [ERC20BridgeSource.SpiritSwap, ERC20BridgeSource.SpookySwap, ERC20BridgeSource.SushiSwap],
[ChainId.Arbitrum]: [ERC20BridgeSource.SushiSwap],
[ChainId.Celo]: [ERC20BridgeSource.UbeSwap, ERC20BridgeSource.SushiSwap],
[ChainId.Optimism]: [ERC20BridgeSource.UniswapV3],
[ChainId.Arbitrum]: [ERC20BridgeSource.UniswapV3, ERC20BridgeSource.SushiSwap],
},
[],
);
@@ -586,6 +619,31 @@ export const FANTOM_TOKENS = {
FRAX: '0xdc301622e621166bd8e82f2ca0a26c13ad0be355',
};
<<<<<<< HEAD
<<<<<<< HEAD
export const ARBITRUM_TOKENS = {
WETH: '0x82af49447d8a07e3bd95bd0d56f35241523fbab1',
USDC: '0xff970a61a04b1ca14834a43f5de4533ebddb5cc8',
DAI: '0xda10009cbd5d07dd0cecc66161fc93d7c9000da1',
USDT: '0xfd086bc7cd5c481dcc9c85ebe478a1c0b69fcbb9',
WBTC: '0x2f2a2543b76a4166549f7aab2e75bef0aefc5b0f',
renBTC: '0xdbf31df14b66535af65aac99c32e9ea844e14501',
};
=======
<<<<<<< HEAD
=======
export const ARBITRUM_TOKENS = {
WETH: '0x82af49447d8a07e3bd95bd0d56f35241523fbab1',
WBTC: '0x2f2a2543B76A4166549F7aaB2e75Bef0aefC5B0f',
USDC: '0xff970a61a04b1ca14834a43f5de4533ebddb5cc8',
DAI: '0xda10009cbd5d07dd0cecc66161fc93d7c9000da1',
};
>>>>>>> 732b2ba24 (arbitrum setup)
>>>>>>> 5eaa4f825 (arbitrum setup)
=======
>>>>>>> ec4e5bfe5 (rebased dev->arbitrum)
export const OPTIMISM_TOKENS = {
WETH: '0x4200000000000000000000000000000000000006',
USDC: '0x7f5c764cbc14f9669b88837ca1490cca17c31607',
@@ -596,6 +654,17 @@ export const OPTIMISM_TOKENS = {
sWETH: '0x121ab82b49b2bc4c7901ca46b8277962b4350204',
};
export const ARBITRUM_TOKENS = {
WETH: '0x82af49447d8a07e3bd95bd0d56f35241523fbab1',
WBTC: '0x2f2a2543B76A4166549F7aaB2e75Bef0aefC5B0f',
USDC: '0xff970a61a04b1ca14834a43f5de4533ebddb5cc8',
DAI: '0xda10009cbd5d07dd0cecc66161fc93d7c9000da1',
nETH: '0x3ea9b0ab55f34fb188824ee288ceaefc63cf908e',
nUSD: '0x2913e812cf0dcca30fb28e6cac3d2dcff4497688',
USDT: '0xfd086bc7cd5c481dcc9c85ebe478a1c0b69fcbb9',
MIM: ' 0xfea7a6a0b346362bf88a9e4a88416b77a57d6c2a',
};
export const CURVE_POOLS = {
compound: '0xa2b47e3d5c44877cca798226b7b8118f9bfb7a56', // 0.Compound
// 1.USDT is dead
@@ -690,9 +759,18 @@ export const CURVE_V2_FANTOM_POOLS = {
tricrypto: '0x3a1659ddcf2339be3aea159ca010979fb49155ff',
};
export const CURVE_ARBITRUM_POOLS = {
twoPool: '0x7f90122bf0700f9e7e1f688fe926940e8839f353',
ren: '0x3e01dd8a5e1fb3481f0f589056b428fc308af0fb',
};
export const CURVE_V2_ARBITRUM_POOLS = {
tricrypto: '0x960ea3e3c7fb317332d990873d354e18d7645590',
};
export const CURVE_OPTIMISM_POOLS = {
tri: '0x1337bedc9d22ecbe766df105c9623922a27963ec',
};
}
export const SWERVE_POOLS = {
y: '0x329239599afb305da0a2ec69c58f8a6697f9f88d',
@@ -755,7 +833,7 @@ export const SYNAPSE_AVALANCHE_POOLS = {
};
export const SYNAPSE_ARBITRUM_POOLS = {
nUSDLP: '0x0db3fe3b770c95a0b99d1ed6f2627933466c0dd8',
nUSDLP: '0xadeac0343c2ac62dfe5a5f51e896aefff5ab513e',
nETHLP: '0xd70a52248e546a3b260849386410c7170c7bd1e9',
};
@@ -837,6 +915,22 @@ export const DEFAULT_INTERMEDIATE_TOKENS_BY_CHAIN_ID = valueByChainId<string[]>(
FANTOM_TOKENS.nETH,
FANTOM_TOKENS.MIM,
],
<<<<<<< HEAD
[ChainId.Fantom]: [FANTOM_TOKENS.WFTM, FANTOM_TOKENS.WETH, FANTOM_TOKENS.DAI, FANTOM_TOKENS.USDC],
<<<<<<< HEAD
<<<<<<< HEAD
[ChainId.Arbitrum]: [ARBITRUM_TOKENS.WETH, ARBITRUM_TOKENS.DAI, ARBITRUM_TOKENS.USDC, ARBITRUM_TOKENS.WBTC],
=======
[ChainId.Celo]: [CELO_TOKENS.mCUSD, CELO_TOKENS.WETH, CELO_TOKENS.WCELO],
<<<<<<< HEAD
>>>>>>> 4170f970d (Sushi router celo fix (#376))
=======
=======
[ChainId.Celo]: [CELO_TOKENS.WCELO, CELO_TOKENS.mCUSD, CELO_TOKENS.WETH, CELO_TOKENS.amCUSD, CELO_TOKENS.WBTC],
>>>>>>> 1993929be (chore: Celo Update certain tokens since Optics v2 (#390))
[ChainId.Optimism]: [OPTIMISM_TOKENS.WETH, OPTIMISM_TOKENS.DAI, OPTIMISM_TOKENS.USDC],
>>>>>>> a3c912c2a (feat/optimism [TKR-280] (#385))
=======
[ChainId.Celo]: [CELO_TOKENS.WCELO, CELO_TOKENS.mCUSD, CELO_TOKENS.WETH, CELO_TOKENS.amCUSD, CELO_TOKENS.WBTC],
[ChainId.Optimism]: [
OPTIMISM_TOKENS.WETH,
@@ -846,6 +940,35 @@ export const DEFAULT_INTERMEDIATE_TOKENS_BY_CHAIN_ID = valueByChainId<string[]>(
OPTIMISM_TOKENS.nETH,
OPTIMISM_TOKENS.sWETH,
],
<<<<<<< HEAD
<<<<<<< HEAD
<<<<<<< HEAD
<<<<<<< HEAD
>>>>>>> 9d08fefa1 (Feat/synapse (#400))
=======
[ChainId.Arbitrum]: [ARBITRUM_TOKENS.WETH, ARBITRUM_TOKENS.WBTC,ARBITRUM_TOKENS.USDC,ARBITRUM_TOKENS.DAI],
>>>>>>> ebd39d2b0 (arbitrum asset swapper)
=======
[ChainId.Arbitrum]: [ARBITRUM_TOKENS.WETH, ARBITRUM_TOKENS.WBTC,ARBITRUM_TOKENS.USDC,ARBITRUM_TOKENS.DAI],
=======
[ChainId.Arbitrum]: [ARBITRUM_TOKENS.WETH, ARBITRUM_TOKENS.WBTC, ARBITRUM_TOKENS.USDC, ARBITRUM_TOKENS.DAI],
[ChainId.Fantom]: [FANTOM_TOKENS.WFTM, FANTOM_TOKENS.WETH, FANTOM_TOKENS.DAI, FANTOM_TOKENS.USDC],
[ChainId.Celo]: [CELO_TOKENS.mCUSD, CELO_TOKENS.WETH, CELO_TOKENS.WCELO],
[ChainId.Optimism]: [OPTIMISM_TOKENS.WETH, OPTIMISM_TOKENS.DAI, OPTIMISM_TOKENS.USDC],
>>>>>>> 732b2ba24 (arbitrum setup)
>>>>>>> 5eaa4f825 (arbitrum setup)
=======
[ChainId.Arbitrum]: [ARBITRUM_TOKENS.WETH, ARBITRUM_TOKENS.WBTC, ARBITRUM_TOKENS.USDC, ARBITRUM_TOKENS.DAI],
>>>>>>> ec4e5bfe5 (rebased dev->arbitrum)
=======
[ChainId.Arbitrum]: [
ARBITRUM_TOKENS.WETH,
ARBITRUM_TOKENS.WBTC,
ARBITRUM_TOKENS.USDC,
ARBITRUM_TOKENS.DAI,
ARBITRUM_TOKENS.USDT,
],
>>>>>>> 7f8ee74ff (arbitrum pls work)
},
[],
);
@@ -889,12 +1012,20 @@ export const DEFAULT_TOKEN_ADJACENCY_GRAPH_BY_CHAIN_ID = valueByChainId<TokenAdj
[ChainId.Fantom]: new TokenAdjacencyGraphBuilder({
default: DEFAULT_INTERMEDIATE_TOKENS_BY_CHAIN_ID[ChainId.Fantom],
}).build(),
<<<<<<< HEAD
[ChainId.Arbitrum]: new TokenAdjacencyGraphBuilder({
default: DEFAULT_INTERMEDIATE_TOKENS_BY_CHAIN_ID[ChainId.Arbitrum],
=======
[ChainId.Celo]: new TokenAdjacencyGraphBuilder({
default: DEFAULT_INTERMEDIATE_TOKENS_BY_CHAIN_ID[ChainId.Celo],
>>>>>>> 602290925 (fix celo rebase)
}).build(),
[ChainId.Optimism]: new TokenAdjacencyGraphBuilder({
default: DEFAULT_INTERMEDIATE_TOKENS_BY_CHAIN_ID[ChainId.Optimism],
}).build(),
[ChainId.Arbitrum]: new TokenAdjacencyGraphBuilder({
default: DEFAULT_INTERMEDIATE_TOKENS_BY_CHAIN_ID[ChainId.Arbitrum],
}).build(),
},
new TokenAdjacencyGraphBuilder({ default: [] }).build(),
);
@@ -910,8 +1041,35 @@ export const NATIVE_FEE_TOKEN_BY_CHAIN_ID = valueByChainId<string>(
[ChainId.Polygon]: getContractAddressesForChainOrThrow(ChainId.Polygon).etherToken,
[ChainId.Avalanche]: getContractAddressesForChainOrThrow(ChainId.Avalanche).etherToken,
[ChainId.Fantom]: getContractAddressesForChainOrThrow(ChainId.Fantom).etherToken,
<<<<<<< HEAD
[ChainId.Arbitrum]: getContractAddressesForChainOrThrow(ChainId.Arbitrum).etherToken,
=======
[ChainId.Celo]: getContractAddressesForChainOrThrow(ChainId.Celo).etherToken,
<<<<<<< HEAD
<<<<<<< HEAD
<<<<<<< HEAD
>>>>>>> 602290925 (fix celo rebase)
=======
=======
>>>>>>> 5eaa4f825 (arbitrum setup)
=======
>>>>>>> ec4e5bfe5 (rebased dev->arbitrum)
[ChainId.Optimism]: getContractAddressesForChainOrThrow(ChainId.Optimism).etherToken,
<<<<<<< HEAD
>>>>>>> a3c912c2a (feat/optimism [TKR-280] (#385))
=======
[ChainId.Arbitrum]: getContractAddressesForChainOrThrow(ChainId.Arbitrum).etherToken,
<<<<<<< HEAD
<<<<<<< HEAD
>>>>>>> ebd39d2b0 (arbitrum asset swapper)
=======
=======
[ChainId.Arbitrum]: getContractAddressesForChainOrThrow(ChainId.Arbitrum).etherToken,
[ChainId.Optimism]: getContractAddressesForChainOrThrow(ChainId.Optimism).etherToken,
>>>>>>> 732b2ba24 (arbitrum setup)
>>>>>>> 5eaa4f825 (arbitrum setup)
=======
>>>>>>> ec4e5bfe5 (rebased dev->arbitrum)
},
NULL_ADDRESS,
);
@@ -1393,6 +1551,19 @@ export const CURVE_V2_FANTOM_INFOS: { [name: string]: CurveInfo } = {
}),
};
export const CURVE_ARBITRUM_INFOS: { [name: string]: CurveInfo } = {
[CURVE_ARBITRUM_POOLS.ren]: createCurveExchangePool({
tokens: [ARBITRUM_TOKENS.WBTC, ARBITRUM_TOKENS.renBTC],
pool: CURVE_ARBITRUM_POOLS.ren,
gasSchedule: 171e3,
}),
[CURVE_ARBITRUM_POOLS.twoPool]: createCurveExchangePool({
tokens: [ARBITRUM_TOKENS.USDC, ARBITRUM_TOKENS.USDT],
pool: CURVE_ARBITRUM_POOLS.twoPool,
gasSchedule: 176e3,
}),
};
export const CURVE_OPTIMISM_INFOS: { [name: string]: CurveInfo } = {
[CURVE_OPTIMISM_POOLS.tri]: createCurveExchangePool({
tokens: [OPTIMISM_TOKENS.DAI, OPTIMISM_TOKENS.USDC, OPTIMISM_TOKENS.USDT],
@@ -1602,6 +1773,27 @@ export const SYNAPSE_OPTIMISM_INFOS: { [name: string]: CurveInfo } = {
},
};
export const SYNAPSE_ARBITRUM_INFOS: { [name: string]: CurveInfo } = {
[SYNAPSE_ARBITRUM_POOLS.nETHLP]: {
exchangeFunctionSelector: CurveFunctionSelectors.swap,
sellQuoteFunctionSelector: CurveFunctionSelectors.calculateSwap,
buyQuoteFunctionSelector: CurveFunctionSelectors.None,
poolAddress: SYNAPSE_ARBITRUM_POOLS.nETHLP,
tokens: [ARBITRUM_TOKENS.nETH, ARBITRUM_TOKENS.WETH],
metaTokens: undefined,
gasSchedule: 140e3,
},
[SYNAPSE_ARBITRUM_POOLS.nUSDLP]: {
exchangeFunctionSelector: CurveFunctionSelectors.swap,
sellQuoteFunctionSelector: CurveFunctionSelectors.calculateSwap,
buyQuoteFunctionSelector: CurveFunctionSelectors.None,
poolAddress: SYNAPSE_ARBITRUM_POOLS.nUSDLP,
tokens: [ARBITRUM_TOKENS.USDC, ARBITRUM_TOKENS.USDT, ARBITRUM_TOKENS.nUSD],
metaTokens: undefined,
gasSchedule: 140e3,
},
};
export const SYNAPSE_POLYGON_INFOS: { [name: string]: CurveInfo } = {
[SYNAPSE_POLYGON_POOLS.nUSDLP]: {
exchangeFunctionSelector: CurveFunctionSelectors.swap,
@@ -1776,7 +1968,23 @@ export const SUSHISWAP_ROUTER_BY_CHAIN_ID = valueByChainId<string>(
[ChainId.Polygon]: '0x1b02da8cb0d097eb8d57a175b88c7d8b47997506',
[ChainId.Avalanche]: '0x1b02da8cb0d097eb8d57a175b88c7d8b47997506',
[ChainId.Fantom]: '0x1b02da8cb0d097eb8d57a175b88c7d8b47997506',
<<<<<<< HEAD
<<<<<<< HEAD
<<<<<<< HEAD
[ChainId.Arbitrum]: '0x1b02da8cb0d097eb8d57a175b88c7d8b47997506',
=======
[ChainId.Celo]: '0x1b02da8cb0d097eb8d57a175b88c7d8b47997506',
>>>>>>> 602290925 (fix celo rebase)
=======
[ChainId.Celo]: '0x1421bDe4B10e8dd459b3BCb598810B1337D56842',
>>>>>>> 6ef4d9504 (Updated Sushiswap router on CELO )
=======
[ChainId.Celo]: '0x1421bde4b10e8dd459b3bcb598810b1337d56842',
<<<<<<< HEAD
>>>>>>> 82d42eeed (address to lowercase)
=======
[ChainId.Arbitrum]: '0x1b02dA8Cb0d097eB8D57A175b88c7D8b47997506',
>>>>>>> ebd39d2b0 (arbitrum asset swapper)
},
NULL_ADDRESS,
);
@@ -1875,6 +2083,10 @@ export const DODOV1_CONFIG_BY_CHAIN_ID = valueByChainId(
helper: '0xdfaf9584f5d229a9dbe5978523317820a8897c5a',
registry: '0x357c5e9cfa8b834edcef7c7aabd8f9db09119d11',
},
[ChainId.Arbitrum]: {
helper: '0xa5f36e822540efd11fcd77ec46626b916b217c3e',
registry: '0xbcc3401e16c25eaf4d3fed632ce3288503883b1f',
},
},
{ helper: NULL_ADDRESS, registry: NULL_ADDRESS },
);
@@ -1896,6 +2108,11 @@ export const DODOV2_FACTORIES_BY_CHAIN_ID = valueByChainId<string[]>(
'0x79887f65f83bdf15bcc8736b5e5bcdb48fb8fe13', // Vending Machine
'0x43c49f8dd240e1545f147211ec9f917376ac1e87', // Stability Pool
],
[ChainId.Arbitrum]: [
'0xa6cf3d163358af376ec5e8b7cc5e102a05fde63d', // Private Pool
'0xda4c4411c55b0785e501332354a036c04833b72b', // Vending Machine
'0xc8fe2440744dcd733246a4db14093664defd5a53', // Stability Pool
],
},
[] as string[],
);
@@ -1994,6 +2211,7 @@ export const BALANCER_V2_VAULT_ADDRESS_BY_CHAIN = valueByChainId<string>(
{
[ChainId.Mainnet]: '0xba12222222228d8ba445958a75a0704d566bf2c8',
[ChainId.Polygon]: '0xba12222222228d8ba445958a75a0704d566bf2c8',
[ChainId.Arbitrum]: '0xba12222222228d8ba445958a75a0704d566bf2c8',
},
NULL_ADDRESS,
);
@@ -2025,6 +2243,7 @@ export const BALANCER_MAX_POOLS_FETCHED = 3;
export const BALANCER_V2_SUBGRAPH_URL_BY_CHAIN = valueByChainId<string>(
{
[ChainId.Polygon]: 'https://api.thegraph.com/subgraphs/name/balancer-labs/balancer-polygon-v2',
[ChainId.Arbitrum]: 'https://api.thegraph.com/subgraphs/name/balancer-labs/balancer-arbitrum-v2',
},
'https://api.thegraph.com/subgraphs/name/balancer-labs/balancer-v2',
);
@@ -2046,7 +2265,23 @@ export const UNISWAPV3_CONFIG_BY_CHAIN_ID = valueByChainId(
quoter: '0x2f9e608fd881861b8916257b76613cb22ee0652c',
router: '0x03782388516e94fcd4c18666303601a12aa729ea',
},
<<<<<<< HEAD
<<<<<<< HEAD
<<<<<<< HEAD
[ChainId.Arbitrum]: {
=======
=======
=======
[ChainId.Arbitrum]: {
quoter: '0xb27308f9f90d607463bb33ea1bebb41c27ce5ab6',
router: '0xe592427a0aece92de3edee1f18e0157c05861564',
},
>>>>>>> 732b2ba24 (arbitrum setup)
>>>>>>> 5eaa4f825 (arbitrum setup)
=======
>>>>>>> ec4e5bfe5 (rebased dev->arbitrum)
[ChainId.Polygon]: {
>>>>>>> 813d703d1 (feat: UniswapV3 on Polygon (#382))
quoter: '0xb27308f9f90d607463bb33ea1bebb41c27ce5ab6',
router: '0xe592427a0aece92de3edee1f18e0157c05861564',
},
@@ -2054,6 +2289,10 @@ export const UNISWAPV3_CONFIG_BY_CHAIN_ID = valueByChainId(
quoter: '0xb27308f9f90d607463bb33ea1bebb41c27ce5ab6',
router: '0xe592427a0aece92de3edee1f18e0157c05861564',
},
[ChainId.Arbitrum]: {
quoter: '0xb27308f9f90d607463bb33ea1bebb41c27ce5ab6',
router: '0xe592427a0aece92de3edee1f18e0157c05861564',
},
},
{ quoter: NULL_ADDRESS, router: NULL_ADDRESS },
);
@@ -2238,7 +2477,7 @@ export const VIP_ERC20_BRIDGE_SOURCES_BY_CHAIN_ID = valueByChainId<ERC20BridgeSo
const uniswapV2CloneGasSchedule = (fillData?: FillData) => {
// TODO: Different base cost if to/from ETH.
let gas = 90e3;
let gas = 209e3;
const path = (fillData as UniswapV2FillData).tokenAddressPath;
if (path.length > 2) {
gas += (path.length - 2) * 60e3; // +60k for each hop.
@@ -2334,7 +2573,7 @@ export const DEFAULT_GAS_SCHEDULE: Required<FeeSchedule> = {
return gas;
},
[ERC20BridgeSource.UniswapV3]: (fillData?: FillData) => {
let gas = 100e3;
let gas = 280e3;
const path = (fillData as UniswapV3FillData).tokenAddressPath;
if (path.length > 2) {
gas += (path.length - 2) * 32e3; // +32k for each hop.

View File

@@ -125,6 +125,7 @@ describe('ExchangeProxySwapQuoteConsumer', () => {
gas: Math.floor(Math.random() * 8e6),
protocolFeeInWeiAmount: getRandomAmount(),
feeTakerTokenAmount: getRandomAmount(),
slippage: 0,
},
worstCaseQuoteInfo: {
makerAmount: makerTokenFillAmount,
@@ -133,6 +134,7 @@ describe('ExchangeProxySwapQuoteConsumer', () => {
gas: Math.floor(Math.random() * 8e6),
protocolFeeInWeiAmount: getRandomAmount(),
feeTakerTokenAmount: getRandomAmount(),
slippage: 0,
},
makerAmountPerEth: getRandomInteger(1, 1e9),
takerAmountPerEth: getRandomInteger(1, 1e9),

View File

@@ -24,6 +24,7 @@ export async function getFullyFillableSwapQuoteWithNoFeesAsync(
totalTakerAmount: takerAmount,
protocolFeeInWeiAmount: protocolFeePerOrder.times(orders.length),
gas: 200e3,
slippage: 0,
};
const breakdown = {

View File

@@ -1,4 +1,12 @@
[
{
"version": "6.12.0",
"changes": [
{
"note": "Add Support for Arbitrum One Mainnet"
}
]
},
{
"version": "6.11.0",
"changes": [

View File

@@ -419,6 +419,48 @@
"positiveSlippageFeeTransformer": "0xe87d69b285005cc82b53b844322652c49ed64600"
}
},
"42161": {
"erc20Proxy": "0x0000000000000000000000000000000000000000",
"erc721Proxy": "0x0000000000000000000000000000000000000000",
"zrxToken": "0x0000000000000000000000000000000000000000",
"etherToken": "0x21be370d5312f44cb42ce377bc9b8a0cef1a4c83",
"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": "0xf760c5b88d970d6f97e64e264dac5a3767dafd74",
"exchangeProxy": "0xdef189deaef76e379df891899eb5a00a94cbc250",
"exchangeProxyTransformerDeployer": "0x47f01db18a38261e4cb153bae6db7d3743acb33c",
"exchangeProxyFlashWallet": "0xb4d961671cadfed687e040b076eee29840c142e5",
"exchangeProxyLiquidityProviderSandbox": "0xca64d4225804f2ae069760cb5ff2f1d8bac1c2f9",
"zrxTreasury": "0x0000000000000000000000000000000000000000",
"transformers": {
"wethTransformer": "0x9b6aa8f26a92108e7d1f66373d757bb955112703",
"payTakerTransformer": "0x32df54951d33d7460e15fa59b1fcc262183ce4c2",
"affiliateFeeTransformer": "0x67efa679a4b56c38713d478e649c88247f4f8e88",
"fillQuoteTransformer": "0x71de60a1b160094a3f6c7e1b883ff9337d639131",
"positiveSlippageFeeTransformer": "0xe87d69b285005cc82b53b844322652c49ed64600"
}
},
"42220": {
"erc20Proxy": "0x0000000000000000000000000000000000000000",
"erc721Proxy": "0x0000000000000000000000000000000000000000",
@@ -502,5 +544,47 @@
"fillQuoteTransformer": "0x3543ef833d28b7e983c293856561f21a7f089f1d",
"positiveSlippageFeeTransformer": "0xb11e14565dfbeb702dea9bc0cb47f1a8b32f4783"
}
},
"42161": {
"erc20Proxy": "0x0000000000000000000000000000000000000000",
"erc721Proxy": "0x0000000000000000000000000000000000000000",
"zrxToken": "0x0000000000000000000000000000000000000000",
"etherToken": "0x82af49447d8a07e3bd95bd0d56f35241523fbab1",
"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": "0x1fe80d5ad9464dba2d60b88e449305f184823f8a",
"exchangeProxy": "0xdef1c0ded9bec7f1a1670819833240f027b25eff",
"exchangeProxyTransformerDeployer": "0x29f80c1f685e19ae1807063eda432f431ac623d0",
"exchangeProxyFlashWallet": "0xdb6f1920a889355780af7570773609bd8cb1f498",
"exchangeProxyLiquidityProviderSandbox": "0x0000000000000000000000000000000000000000",
"zrxTreasury": "0x0000000000000000000000000000000000000000",
"transformers": {
"wethTransformer": "0x10e968968f49dd66a5efeebbb2edcb9c49c4fc49",
"payTakerTransformer": "0xae3e8cf7bf340d7084f312dfae2aa8b01c885b02",
"affiliateFeeTransformer": "0x05a24978471869327904ea13da3c4322128e2aaa",
"fillQuoteTransformer": "0x5a653323c2a47a8e1b69fb3d0f15858bfc7fe205",
"positiveSlippageFeeTransformer": "0xD56B9C014b45ED95e2a048A0C28121Db30265F13"
}
}
}

View File

@@ -54,8 +54,10 @@ export enum ChainId {
PolygonMumbai = 80001,
Avalanche = 43114,
Fantom = 250,
Arbitrum = 42161,
Celo = 42220,
Optimism = 10,
Arbitrum = 42161,
}
/**

View File

@@ -738,6 +738,7 @@
"@0x/contracts-asset-proxy@^3.7.19":
version "3.7.19"
resolved "https://registry.yarnpkg.com/@0x/contracts-asset-proxy/-/contracts-asset-proxy-3.7.19.tgz#ee621a233f4d77b439c74c5b8d70db2e1ed001c4"
integrity sha512-6lTgz8JdmceaSnqpJrbyKJXUIyAA2HZrXel+ZWpgMtO7qaSSQDRUcWUBwejTE588BcVxhNFQ7tHvOK3/QGnpHw==
dependencies:
"@0x/base-contract" "^6.4.0"
"@0x/contracts-erc1155" "^2.1.37"