DefiLlama/defillama-app

Inconsistent trade volume of Wombat Exchange

Closed this issue ยท 12 comments

Hi DefiLlama's team,

I found that the TVL of Wombat Exchange is inconsistent: right side is ~3 bil, while left side is ~2 bil. Right side seems to have the correct number since it is what Wombat Subgraph returns (totalTradeVolumeUSD; protocol with id = 1 in https://thegraph.com/hosted-service/subgraph/wombat-exchange/wombat-exchange-bsc):

{
  "data": {
    "protocol": {
      "boostedRatio": "0.8475009493225679104402404997056709",
      "createdTimestamp": "1673416609",
      "id": "1",
      "lastUpdate": "1696848543",
      "network": "BSC",
      "totalBoostedTvlUSD": "16585122.24270364537002951499796613",
      "totalCashUSD": "29184917.3645072730734600445059978",
      "totalBribeRevenueUSD": "459497.1204152359117686787120471265",
      "totalCollectedFeeUSD": "214010.8615076372022459763183952743",
      "totalLiabilityUSD": "29657858.89525576780054838715076453",
      "totalSharedFeeUSD": "139630.1393333452487672786562995004",
      "totalTradeVolumeUSD": "3215759655.999092051518885902475963",
      "totalTvlUSD": "19569443.85249434187719452938480407",
      "version": "MasterWombatV3"
    }
  }
}

image

It seems like totalTvlUSD (for locked value) is used for the left side instead of totalTradeVolumeUSD. Can you guys fix this?

Many thanks!

Hi. DefiLlama's team. I checked the page and it still doesn't reflect the true number. Can you guys have a look again? Thanks!

image

@mintdart Can you clarify the ownership of the relevant code? Is this owned by defi llama or by project (wombat)? If we find bug in the future, where can we send PR to fix it?

@mintdart Can you clarify the ownership of the relevant code? Is this owned by defi llama or by project (wombat)? If we find bug in the future, where can we send PR to fix it?

you can send a PR here https://github.com/DefiLlama/dimension-adapters/blob/92abe9310af9ec28de909c7343777c9d2c18d6b5/dexs/wombat-exchange/index.ts#L53 to fix it

@dtmkeng just wanted to follow up on this issue as it's still not fixed

For context, totalTvlUSD (for locked value) seems to be used for the left side instead of totalTradeVolumeUSD. Can you guys fix this?

image

@dtmkeng just wanted to follow up on this issue as it's still not fixed

For context, totalTvlUSD (for locked value) seems to be used for the left side instead of totalTradeVolumeUSD. Can you guys fix this?

image
cumulate is sum of daiyVolume is does not match on All time volume because all time volume is use field total volume from wombat the graph, i can hide all time volume if you need

image example scroll just have one record show 6.6k but all time use field totalVolume some all chain Dexs for 14/11/2023 _______________________________________

BSC ๐Ÿ‘‡
Backfill start time: 18/4/2022
NO METHODOLOGY SPECIFIED
Daily volume: 6510757.766154698
Total volume: 1801430196.1393697
Timestamp: 1699920000

ARBITRUM ๐Ÿ‘‡
Backfill start time: 26/3/2023
NO METHODOLOGY SPECIFIED
Daily volume: 8308036.847981841
Total volume: 536161756.0312576
Timestamp: 1699920000

ETHEREUM ๐Ÿ‘‡
Backfill start time: 6/8/2023
NO METHODOLOGY SPECIFIED
Daily volume: 144740.80991423602
Total volume: 7763957.726592733
Timestamp: 1699920000

SCROLL ๐Ÿ‘‡
Backfill start time: 16/10/2023
NO METHODOLOGY SPECIFIED
Daily volume: 6613.9867515
Total volume: 267621.510305
Timestamp: 1699920000

AVAX ๐Ÿ‘‡
Backfill start time: 16/10/2023
NO METHODOLOGY SPECIFIED
Daily volume: 166531.74262613038
Total volume: 975209.1976846711
Timestamp: 1699920000

Hi @dtmkeng, from what you've said

cumulate is sum of daiyVolume is does not match on All time volume because all time volume is use field total volume from wombat the graph, i can hide all time volume if you need

Do you mean:

  • On the left side, we use totalTradeVolumeUSD
  • On the right side, we are summing dailyTradeVolumeUSD snapshots (one record for each day)

And the two number don't match?

Hi @dtmkeng, from what you've said

cumulate is sum of daiyVolume is does not match on All time volume because all time volume is use field total volume from wombat the graph, i can hide all time volume if you need

Do you mean:

  • On the left side, we use totalTradeVolumeUSD
  • On the right side, we are summing dailyTradeVolume snapshots (one record for each day)

And the two number don't match?

yes

Or maybe:

  • On the left side, we are summing dailyTradeVolumeUSD
  • On the right side, we are using totalTradeVolumeUSD

Because I have just checked. totalTradeVolumeUSD of Wombat on BSC is >3.6 billion, similar to the number on the right side:

{
  "data": {
    "protocol": {
      "id": "1",
      "lastUpdate": "1700462434",
      "network": "BSC",
      "totalBoostedTvlUSD": "15412125.92108635045775546454084197",
      "totalBribeRevenueUSD": "718310.8377190397098982869702961826",
      "totalCashUSD": "28215860.39973941754837918050479102",
      "totalCollectedFeeUSD": "219379.9356032231073151398715542453",
      "totalLiabilityUSD": "28720425.92220678833193332796420532",
      "totalSharedFeeUSD": "145011.5328529913987361344229943948",
      "totalTradeVolumeUSD": "3662916804.772211434825406657044326",
      "totalTvlUSD": "18679316.00716494191978842178649464",
      "version": "MasterWombatV3"
    }
  }
}

Either case, I'm not sure how did we get 2.4 billion on the left side.

image

The code pointer you gave (https://github.com/DefiLlama/dimension-adapters/blob/master/dexs/wombat-exchange/index.ts) seems to be correct though:

    const query = gql`
      {
          protocolDayData(id: "${dayID}") {
              dayID
              dailyTradeVolumeUSD
          },
          protocols(block: { number: ${todaysBlock} }) {
            totalTradeVolumeUSD
          }
      }`;
    const response: IData = await request(endpoints[chain], query);
    const dailyVolume =
      Number(response.protocolDayData.dailyTradeVolumeUSD) / 2;
    const totalTradeVolumeUSD =
      Number(response.protocols[0].totalTradeVolumeUSD) / 2;
    return {
      dailyVolume: dailyVolume ? `${dailyVolume}` : undefined,
      totalVolume: totalTradeVolumeUSD ? `${totalTradeVolumeUSD}` : undefined,
      timestamp: dayTimestamp,
    };

sorry not sure will refill data again