Skip to content

Commit

Permalink
fix: disable v4 cached routes set caching (#984)
Browse files Browse the repository at this point in the history
* fix: disable v4 cached routes set caching

* skip unit test
  • Loading branch information
jsy1218 authored Jan 29, 2025
1 parent 572d0a9 commit fd544ac
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ export class DynamoRouteCachingProvider extends IRouteCachingProvider {
const { currencyIn, currencyOut } = this.determineCurrencyInOut(amount, quoteCurrency, tradeType)

// for getting the cached routes, we dont know if the cached route will contains a v4 pool or not, so we try to see if the input protocols contain v4
const includesV4Pool = protocols.includes(Protocol.V4)
const includesV4Pool = false // TODO: re-enable v4 protocols.includes(Protocol.V4)

const partitionKey = new PairTradeTypeChainId({
currencyIn: PairTradeTypeChainId.deriveCurrencyAddress(includesV4Pool, currencyIn),
Expand Down Expand Up @@ -338,7 +338,7 @@ export class DynamoRouteCachingProvider extends IRouteCachingProvider {
// if no Item is found it means we need to send a caching request
if (shouldSendCachingRequest) {
metric.putMetric('CachingQuoteForRoutesDbRequestSent', 1, MetricLoggerUnit.Count)
this.sendAsyncCachingRequest(partitionKey, [Protocol.V2, Protocol.V3, Protocol.V4, Protocol.MIXED], amount)
this.sendAsyncCachingRequest(partitionKey, [Protocol.V2, Protocol.V3, Protocol.MIXED], amount)
this.setRoutesDbCachingIntentFlag(partitionKey, amount, currentBlockNumber)
} else {
metric.putMetric('CachingQuoteForRoutesDbRequestNotNeeded', 1, MetricLoggerUnit.Count)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ describe('DynamoRouteCachingProvider', async () => {
sinon.assert.called(spy)
})

it('Caches routes properly for a token pair that has its cache configured to Livemode', async () => {
it.skip('Caches routes properly for a token pair that has its cache configured to Livemode', async () => {
const currencyAmount = CurrencyAmount.fromRawAmount(WETH, JSBI.BigInt(1 * 10 ** WETH.decimals))
const currencyAmountETH = CurrencyAmount.fromRawAmount(
nativeOnChain(ChainId.MAINNET),
Expand Down

0 comments on commit fd544ac

Please sign in to comment.