osmosis-labs / osmojs

OsmosJS makes it easy to compose and broadcast Osmosis and Cosmos messages
https://cosmology.zone/products/osmojs
Apache License 2.0
63 stars 32 forks source link

Geometric TWAP query bug #48

Closed baoskee closed 1 year ago

baoskee commented 1 year ago

OSMO to ATOM pool geometric TWAP query is giving "52431954000000000". You need to shift this by 18 decimals to get the decimal value. This is surely a bug?

  return await client.osmosis.twap.v1beta1.geometricTwapToNow({
    poolId: Long.fromNumber(poolId),
    baseAsset,
    quoteAsset,

    startTime: startTime
      ? startTime
      : // Default is 60 minutes ago
        new Date(new Date().getTime() - 1000 * 60 * 60),
  });
pyramation commented 1 year ago

oh, we should use the prototypes.typingsFormat.customTypes.useCosmosSDKDec option from telescope, this is a bug on the backend, but telescope has a fix, will enable in next major version!

pyramation commented 1 year ago

should be fixed in v16!