further fixes in market operation utils
This commit is contained in:
parent
4803e2f68c
commit
ef65aa5bf6
@ -54,7 +54,7 @@ export class CreamPoolsCache {
|
||||
makerToken: string,
|
||||
isAllowedSource: boolean,
|
||||
): { onChain: boolean; offChain: boolean } {
|
||||
// If Balancer is excluded as a source, do not sample.
|
||||
// If CREAM is excluded as a source, do not sample.
|
||||
if (!isAllowedSource) {
|
||||
return { onChain: false, offChain: false };
|
||||
}
|
||||
@ -63,7 +63,7 @@ export class CreamPoolsCache {
|
||||
// - Cached values are not stale
|
||||
// - There is at least one CREAM pool for this pair
|
||||
const onChain = cachedCreamPools !== undefined && cachedCreamPools.length > 0;
|
||||
// Sample Balancer off-chain (i.e. via GraphQL query + `computeCreamBuy/SellQuote`)
|
||||
// Sample CREAM off-chain (i.e. via GraphQL query + `computeCreamBuy/SellQuote`)
|
||||
// if cached values are stale
|
||||
const offChain = cachedCreamPools === undefined;
|
||||
return { onChain, offChain };
|
||||
|
@ -520,7 +520,7 @@ export class SamplerOperations {
|
||||
makerToken: string,
|
||||
takerToken: string,
|
||||
makerFillAmounts: BigNumber[],
|
||||
): Promise<Array<Array<DexSample<BalancerFillData>>>> {
|
||||
): Promise<Array<Array<DexSample<CreamFillData>>>> {
|
||||
const pools = await this.creamPoolsCache.getPoolsForPairAsync(takerToken, makerToken);
|
||||
return pools.map(pool =>
|
||||
makerFillAmounts.map(amount => ({
|
||||
@ -1109,7 +1109,7 @@ export class SamplerOperations {
|
||||
return this.creamPoolsCache
|
||||
.getCachedPoolAddressesForPair(takerToken, makerToken)!
|
||||
.map(poolAddress =>
|
||||
this.getBalancerSellQuotes(poolAddress, makerToken, takerToken, takerFillAmounts),
|
||||
this.getCreamSellQuotes(poolAddress, makerToken, takerToken, takerFillAmounts),
|
||||
);
|
||||
case ERC20BridgeSource.Shell:
|
||||
return this.getShellSellQuotes(makerToken, takerToken, takerFillAmounts);
|
||||
@ -1206,7 +1206,7 @@ export class SamplerOperations {
|
||||
return this.creamPoolsCache
|
||||
.getCachedPoolAddressesForPair(takerToken, makerToken)!
|
||||
.map(poolAddress =>
|
||||
this.getBalancerBuyQuotes(poolAddress, makerToken, takerToken, makerFillAmounts),
|
||||
this.getCreamBuyQuotes(poolAddress, makerToken, takerToken, makerFillAmounts),
|
||||
);
|
||||
case ERC20BridgeSource.Shell:
|
||||
return this.getShellBuyQuotes(makerToken, takerToken, makerFillAmounts);
|
||||
|
Loading…
x
Reference in New Issue
Block a user