diff --git a/conf/finaldata/dexorder-finaldata.toml b/conf/finaldata/dexorder-finaldata.toml index 18f5c34..be0d742 100644 --- a/conf/finaldata/dexorder-finaldata.toml +++ b/conf/finaldata/dexorder-finaldata.toml @@ -1,4 +1,3 @@ -metadata='metadata.json' # mounted from a ConfigMap in the k8s yaml rpc_url = '${rpc_urls.finaldata}' ws_url = '' redis_url = '' diff --git a/src/dexorder/final_ohlc.py b/src/dexorder/final_ohlc.py index 4efa1f2..f83aa33 100644 --- a/src/dexorder/final_ohlc.py +++ b/src/dexorder/final_ohlc.py @@ -144,7 +144,7 @@ class OHLCFile: @staticmethod def row_bytes(row): - return (','.join(str(c) for c in row)+'\n').encode('ascii') + return (','.join([str(row[0])] + [f'{c:f}' for c in row[1:]])+'\n').encode('ascii') def flush(self): # first we write the "final" rows which means rows that have been closed and will get no more data. @@ -157,9 +157,11 @@ class OHLCFile: # write the current row if self._cur is not None: data = OHLCFile.row_bytes(self._cur) + start_of_current_row = self.file.tell() self.file.write(data) # rewind our file cursor to the beginning of the current row - self.file.seek(len(data), os.SEEK_END) + self.file.seek(start_of_current_row) + log.debug(f'flushing {self.filename}') self.file.flush() def _load(self, earliest_change): diff --git a/src/dexorder/pools.py b/src/dexorder/pools.py index 7339c96..f2c9c21 100644 --- a/src/dexorder/pools.py +++ b/src/dexorder/pools.py @@ -44,8 +44,11 @@ async def load_pool(address: str) -> OldPoolDict: v3 = UniswapV3Pool(address) t0, t1 = await asyncio.gather(v3.token0(), v3.token1()) token0, token1 = await asyncio.gather(get_token(t0), get_token(t1)) - if (token0 is not None and token1 is not None - and (token0['approved'] and token1['approved'] or is_generating_metadata())): + # This is an old conditional that checks for token approval before handling the data. The backend currently + # handles all pools and token regardless of approval. + # if (token0 is not None and token1 is not None + # and (token0['approved'] and token1['approved'] or is_generating_metadata())): + if token0 is not None and token1 is not None: fee = await v3.fee() if uniswapV3_pool_address(t0, t1, fee) == address: # VALIDATE don't just trust that it's a Uniswap pool decimals = token0['decimals'] - token1['decimals']