White-Whale-Defi-Platform / white-whale-frontend

An open-source interface for multiple CosmWasm decentralized exchanges across chains. Additionally there are Pools and Flashloan enabled Vaults deployed on each chain as part of the White Whale's Liquidity Platform.
https://app.whitewhale.money
Apache License 2.0
24 stars 25 forks source link

[BUG] Total Liquidity calculation not correct #277

Closed 0xphilipp closed 1 year ago

0xphilipp commented 1 year ago

image

image

silvermind commented 1 year ago

seems fixed on terra:

image

silvermind commented 1 year ago

looks like the bWHALE-WHALE pool has the same issue. on terra https://app.whitewhale.money/terra/pools

liquidity is not 6M$

image

looks like the bug comes from this endpoint call @Sen-Com, so the issue is from coinhall.

https://app.whitewhale.money/api/cors?url=https://api.seer.coinhall.org/api/coinhall/pools?addresses=terra1qdu4g5zxxtmwsd95v8vjslq5874nkcull7ejycm0gy2v7p5qc67qenkf8t,terra1ntx595elf3ukxcd0wy76h24rzztcv2p6n3wmfd358ks95prv42fs9mn63n,terra1j9jmsplecj9ay2py27953p84nfmv7f6ce75ms5fleyhd0aecpc7q0hgmsa,terra1frfcj4xhvx0emkup4vel5jun9zun0797j5yhn7ant3r4jzy9mkxqzcwev6,terra17l9xj8f6m8smumhn8wgpgnswr3mu60wfkcm6pjc69drxp0t398rs7335vn,terra1e6t37fgjkxrzdx2s95fyq6jdra5s82720vhtmxvx4yhcvnsrey4ssmrya6,terra1ck8nkz35sa8mmqez3lqrm77vh36n2gd2f0dxjde4uemkwsjt22pqgk49zj,terra1j5znhs9jeyty9u9jcagl3vefkvzwqp6u9tq9a3e5qrz4gmj2udyqp0z0xc,terra1tsx0dmasjvd45k6tdywzv77d5t9k3lpzyuleavuah77pg3lwm9cq4469pm,terra1shd0wd8atmevjtryzcqzu6sxsmc4hjek43kxqsz08wxwk4nt0wvsav9004,terra1g8clplgv3ah405qjrf9yhkgur9zqlqayt8ftrvkuzsm5am7pr9ls7s26rx

    {
      "id": "terra1j9jmsplecj9ay2py27953p84nfmv7f6ce75ms5fleyhd0aecpc7q0hgmsa",
      "assets": [
        {
          "id": "ibc/517E13F14A1245D4DE8CF467ADD4DA0058974CDCC880FA6AE536DBCA1D16D84E",
          "poolAmount": 1091817.084309,
          "updatedAt": "2023-07-12T17:01:42.983Z",
          "chain": "terra",
          "createdAt": "2023-03-02T04:45:11.053Z",
          "decimals": 6,
          "icon": "https://i.ibb.co/0Bpqb3b/image.png",
          "name": "bWHALE",
          "symbol": "bWHALE",
          "verified": true,
          "entity": "White Whale",
          "twitter": "https://twitter.com/WhiteWhaleDefi",
          "website": "https://whitewhale.money/",
          "nativePrice": 1.035131150495689,
          "usdPrice": 2.826614248847115,
          "nativePriceChange1h": 0,
          "usdPriceChange1h": 0,
          "nativePriceChange24h": 0.6283964132500872,
          "usdPriceChange24h": 127.48535347804994,
          "nativePriceChange7d": 3.8443708712370266,
          "usdPriceChange7d": 16955.224528002494
        },
        {
          "id": "ibc/36A02FFC4E74DF4F64305130C3DFA1B06BEAC775648927AA44467C76A77AB8DB",
          "poolAmount": 1126808.325657,
          "updatedAt": "2023-07-12T17:01:42.983Z",
          "chain": "terra",
          "createdAt": "2023-03-02T04:45:11.053Z",
          "decimals": 6,
          "icon": "https://app.whitewhale.money/logos/whale.svg",
          "name": "Whale",
          "symbol": "WHALE",
          "totalSupply": 608686611.97936,
          "verified": true,
          "circSupplyApi": "https://apex.migaloo.zone/api/supply",
          "totalSupplyApi": "https://apex.migaloo.zone/api/supply",
          "circSupply": 204221673.879202,
          "circSupplyUpdatedAt": "2023-07-12T16:45:07.145Z",
          "totalSupplyUpdatedAt": "2023-07-12T16:45:07.145Z",
          "entity": "White Whale",
          "twitter": "https://twitter.com/WhiteWhaleDefi",
          "website": "https://whitewhale.money/",
          "nativePrice": 0.9660611600000001,
          "usdPrice": 2.7306822401137727,
          "fdv": 1662129721.1270614,
          "mcap": 557664497.9082437,
          "nativePriceChange1h": 1.149226436787042e-14,
          "usdPriceChange1h": 0,
          "nativePriceChange24h": -0.6244722520166716,
          "usdPriceChange24h": 127.48535347804994,
          "nativePriceChange7d": -3.702050326833705,
          "usdPriceChange7d": 16955.22452800249
        }
      ],
      "dex": "White Whale",
      "createdAt": "2023-02-28T01:57:55.241Z",
      "type": "xyk",
      "chain": "terra",
      "updatedAt": "2023-07-12T16:45:00.647Z",
      "poolUpdatedAt": "2023-03-01T02:19:18.161Z",
      "lpAssetId": "terra1le46uu9qjk53aktjs8dev96sl9sd2ujvcpspk75pdeg0txfvhyuswm6653",
      "defaultBaseIndex": 0,
      "liquidity": 6163101.210526438,
      "volume1h": 0,
      "volume7d": 1013614.6976343497,
      "volume24h": 7508.494822486191,
      "apr1h": 0,
      "apr24h": 0.13340364777037453,
      "apr7d": 2.57270315241831
    },

confirmed:

here it's wrong as well. https://coinhall.org/terra/terra1j9jmsplecj9ay2py27953p84nfmv7f6ce75ms5fleyhd0aecpc7q0hgmsa

not sure if the WhiteWhale frontend really needs to depended on coinhall api. but that's somethingh for another issue.

silvermind commented 1 year ago

was fixed upstream by coinhall