Skip to content

Commit

Permalink
Merge pull request #10 from oraichain/hotfix/zero-price-ohlcv
Browse files Browse the repository at this point in the history
Hotfix/zero price ohlcv
  • Loading branch information
trungbach authored Aug 9, 2023
2 parents a8e6b3a + 612486b commit 79c38da
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/oraidex-server/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@oraichain/oraidex-server",
"version": "1.0.4",
"version": "1.0.5",
"main": "dist/index.js",
"bin": "dist/index.js",
"license": "MIT",
Expand Down
3 changes: 2 additions & 1 deletion packages/oraidex-sync/src/db.ts
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,8 @@ export class DuckDb {
}

async insertOhlcv(ohlcv: Ohlcv[]) {
await this.insertBulkData(ohlcv, "swap_ohlcv");
const filtedOhlcv = ohlcv.filter((item) => item.open != 0 && item.close != 0 && item.low != 0 && item.high != 0);
await this.insertBulkData(filtedOhlcv, "swap_ohlcv");
}

async getOhlcvCandles(query: GetCandlesQuery): Promise<Ohlcv[]> {
Expand Down

0 comments on commit 79c38da

Please sign in to comment.