comments and renaming
This commit is contained in:
parent
a03d0800b0
commit
85fde8f9a5
@ -123,4 +123,10 @@ export const constants = {
|
|||||||
DEFAULT_WARNING_LOGGER,
|
DEFAULT_WARNING_LOGGER,
|
||||||
};
|
};
|
||||||
|
|
||||||
export const ENABLE_PRICE_AWARE_RFQ: boolean = false;
|
// This feature flag allows us to merge the price-aware RFQ pricing
|
||||||
|
// project while still controlling when to activate the feature. We plan to do some
|
||||||
|
// data analysis work and address some of the issues with maker fillable amounts
|
||||||
|
// in later milestones. Once the feature is fully rolled out and is providing value
|
||||||
|
// and we have assessed that there is no user impact, we will proceed in cleaning up
|
||||||
|
// the feature flag.
|
||||||
|
export const IS_PRICE_AWARE_RFQ_ENABLED: boolean = false;
|
||||||
|
@ -8,7 +8,7 @@ import { BlockParamLiteral, SupportedProvider, ZeroExProvider } from 'ethereum-t
|
|||||||
import * as _ from 'lodash';
|
import * as _ from 'lodash';
|
||||||
|
|
||||||
import { artifacts } from './artifacts';
|
import { artifacts } from './artifacts';
|
||||||
import { constants, ENABLE_PRICE_AWARE_RFQ } from './constants';
|
import { constants, IS_PRICE_AWARE_RFQ_ENABLED } from './constants';
|
||||||
import {
|
import {
|
||||||
CalculateSwapQuoteOpts,
|
CalculateSwapQuoteOpts,
|
||||||
LiquidityForTakerMakerAssetDataPair,
|
LiquidityForTakerMakerAssetDataPair,
|
||||||
@ -697,7 +697,7 @@ export class SwapQuoter {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (
|
if (
|
||||||
!ENABLE_PRICE_AWARE_RFQ && // Price-aware RFQ is disabled.
|
!IS_PRICE_AWARE_RFQ_ENABLED && // Price-aware RFQ is disabled.
|
||||||
opts.rfqt && // This is an RFQT-enabled API request
|
opts.rfqt && // This is an RFQT-enabled API request
|
||||||
opts.rfqt.intentOnFilling && // The requestor is asking for a firm quote
|
opts.rfqt.intentOnFilling && // The requestor is asking for a firm quote
|
||||||
opts.rfqt.apiKey &&
|
opts.rfqt.apiKey &&
|
||||||
|
@ -4,7 +4,7 @@ import { RFQTIndicativeQuote } from '@0x/quote-server';
|
|||||||
import { SignedOrder } from '@0x/types';
|
import { SignedOrder } from '@0x/types';
|
||||||
import { BigNumber, NULL_ADDRESS } from '@0x/utils';
|
import { BigNumber, NULL_ADDRESS } from '@0x/utils';
|
||||||
import * as _ from 'lodash';
|
import * as _ from 'lodash';
|
||||||
import { ENABLE_PRICE_AWARE_RFQ } from '../../constants';
|
import { IS_PRICE_AWARE_RFQ_ENABLED } from '../../constants';
|
||||||
|
|
||||||
import { MarketOperation, Omit } from '../../types';
|
import { MarketOperation, Omit } from '../../types';
|
||||||
import { QuoteRequestor } from '../quote_requestor';
|
import { QuoteRequestor } from '../quote_requestor';
|
||||||
@ -217,7 +217,7 @@ export class MarketOperationUtils {
|
|||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
const rfqtPromise = !ENABLE_PRICE_AWARE_RFQ && quoteSourceFilters.isAllowed(ERC20BridgeSource.Native)
|
const rfqtPromise = !IS_PRICE_AWARE_RFQ_ENABLED && quoteSourceFilters.isAllowed(ERC20BridgeSource.Native)
|
||||||
? getRfqtIndicativeQuotesAsync(
|
? getRfqtIndicativeQuotesAsync(
|
||||||
nativeOrders[0].makerAssetData,
|
nativeOrders[0].makerAssetData,
|
||||||
nativeOrders[0].takerAssetData,
|
nativeOrders[0].takerAssetData,
|
||||||
@ -364,7 +364,7 @@ export class MarketOperationUtils {
|
|||||||
this._liquidityProviderRegistry,
|
this._liquidityProviderRegistry,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
const rfqtPromise = !ENABLE_PRICE_AWARE_RFQ && quoteSourceFilters.isAllowed(ERC20BridgeSource.Native)
|
const rfqtPromise = !IS_PRICE_AWARE_RFQ_ENABLED && quoteSourceFilters.isAllowed(ERC20BridgeSource.Native)
|
||||||
? getRfqtIndicativeQuotesAsync(
|
? getRfqtIndicativeQuotesAsync(
|
||||||
nativeOrders[0].makerAssetData,
|
nativeOrders[0].makerAssetData,
|
||||||
nativeOrders[0].takerAssetData,
|
nativeOrders[0].takerAssetData,
|
||||||
@ -675,7 +675,7 @@ export class MarketOperationUtils {
|
|||||||
|
|
||||||
// If RFQ liquidity is enabled, make a request to check RFQ liquidity
|
// If RFQ liquidity is enabled, make a request to check RFQ liquidity
|
||||||
const { rfqt } = _opts;
|
const { rfqt } = _opts;
|
||||||
if (ENABLE_PRICE_AWARE_RFQ && rfqt && rfqt.quoteRequestor && marketSideLiquidity.quoteSourceFilters.isAllowed(ERC20BridgeSource.Native)) {
|
if (IS_PRICE_AWARE_RFQ_ENABLED && rfqt && rfqt.quoteRequestor && marketSideLiquidity.quoteSourceFilters.isAllowed(ERC20BridgeSource.Native)) {
|
||||||
// Calculate a suggested price. For now, this is simply the overall price of the aggregation.
|
// Calculate a suggested price. For now, this is simply the overall price of the aggregation.
|
||||||
let comparisonPrice: BigNumber | undefined;
|
let comparisonPrice: BigNumber | undefined;
|
||||||
if (optimizerResult) {
|
if (optimizerResult) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user