@@ -11,7 +11,7 @@ import { OrderPrunerPermittedFeeTypes } from '@0x/asset-swapper/lib/src/types';
1111import { getContractAddressesForChainOrThrow } from '@0x/contract-addresses' ;
1212import { ERC20TokenContract , WETH9Contract } from '@0x/contract-wrappers' ;
1313import { assetDataUtils , SupportedProvider } from '@0x/order-utils' ;
14- import { BigNumber , decodeThrownErrorAsRevertError , RevertError } from '@0x/utils' ;
14+ import { BigNumber , decodeThrownErrorAsRevertError , NULL_ADDRESS , RevertError } from '@0x/utils' ;
1515import { TxData , Web3Wrapper } from '@0x/web3-wrapper' ;
1616import * as _ from 'lodash' ;
1717
@@ -190,7 +190,9 @@ export class SwapService {
190190 // returns price in sellToken units, e.g What is the price of 1 ZRX (in DAI)
191191 // Equivalent to performing multiple swap quotes selling sellToken and buying 1 whole buy token
192192 const takerAssetData = assetDataUtils . encodeERC20AssetData ( sellToken . tokenAddress ) ;
193- const queryAssetData = TokenMetadatasForChains . filter ( m => m . symbol !== sellToken . symbol ) ;
193+ const queryAssetData = TokenMetadatasForChains . filter ( m => m . symbol !== sellToken . symbol ) . filter (
194+ m => m . tokenAddresses [ CHAIN_ID ] !== NULL_ADDRESS ,
195+ ) ;
194196 const chunkSize = 20 ;
195197 const assetDataChunks = _ . chunk ( queryAssetData , chunkSize ) ;
196198 const allResults = _ . flatten (
@@ -226,7 +228,7 @@ export class SwapService {
226228 const { makerAssetAmount, totalTakerAssetAmount } = quote . bestCaseQuoteInfo ;
227229 const unitMakerAssetAmount = Web3Wrapper . toUnitAmount ( makerAssetAmount , buyTokenDecimals ) ;
228230 const unitTakerAssetAmount = Web3Wrapper . toUnitAmount ( totalTakerAssetAmount , sellTokenDecimals ) ;
229- const price = unitTakerAssetAmount . dividedBy ( unitMakerAssetAmount ) . decimalPlaces ( buyTokenDecimals ) ;
231+ const price = unitTakerAssetAmount . dividedBy ( unitMakerAssetAmount ) . decimalPlaces ( sellTokenDecimals ) ;
230232 return {
231233 symbol : queryAssetData [ i ] . symbol ,
232234 price,
0 commit comments