Skip to content

Commit

Permalink
Add/pool och orai (#180)
Browse files Browse the repository at this point in the history
* update: add pool OCH/ORAI for oraidex-sync

* fix: fixed failed testcase
  • Loading branch information
trungbach authored Feb 22, 2024
1 parent 163d3cf commit 39d9021
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 6 deletions.
2 changes: 1 addition & 1 deletion packages/oraidex-server/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ registerListener(CACHE_KEY.TICKER_ORDER_BOOK, getOrderbookSummary);
// wait 30s to setup all init info before
setTimeout(() => {
updateInterval();
}, 30000);
}, 10000);

const app = express();
app.use(cors());
Expand Down
13 changes: 12 additions & 1 deletion packages/oraidex-sync/src/pairs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,13 @@ import {
usdtCw20Address
} from "./constants";
import { PairMapping } from "./types";
import { WETH_CONTRACT, BTC_CONTRACT, pairLpTokens, NEUTARO_ORAICHAIN_DENOM } from "@oraichain/oraidex-common";
import {
WETH_CONTRACT,
BTC_CONTRACT,
pairLpTokens,
NEUTARO_ORAICHAIN_DENOM,
OCH_CONTRACT
} from "@oraichain/oraidex-common";

// the orders are important! Do not change the order of the asset_infos.
export const pairs: PairMapping[] = [
Expand Down Expand Up @@ -113,6 +119,11 @@ export const pairs: PairMapping[] = [
asset_infos: [{ native_token: { denom: NEUTARO_ORAICHAIN_DENOM } }, { token: { contract_addr: usdcCw20Address } }],
lp_token: pairLpTokens.NTMPI_USDC,
symbols: ["NTMPI", "USDC"]
},
{
asset_infos: [{ token: { contract_addr: OCH_CONTRACT } }, { native_token: { denom: ORAI } }],
lp_token: pairLpTokens.OCH_ORAI,
symbols: ["OCH", "ORAI"]
}
];

Expand Down
13 changes: 12 additions & 1 deletion packages/oraidex-sync/tests/helper.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,13 @@ import * as poolHelper from "../src/pool-helper";
import * as helper from "../src/helper";
import * as parse from "../src/parse";
import { SwapOperation } from "@oraichain/oraidex-contracts-sdk/build/OraiswapRouter.types";
import { BTC_CONTRACT, NEUTARO_ORAICHAIN_DENOM, WETH_CONTRACT, pairLpTokens } from "@oraichain/oraidex-common";
import {
BTC_CONTRACT,
NEUTARO_ORAICHAIN_DENOM,
WETH_CONTRACT,
pairLpTokens,
OCH_CONTRACT
} from "@oraichain/oraidex-common";

describe("test-helper", () => {
let duckDb: DuckDb;
Expand Down Expand Up @@ -250,6 +256,11 @@ describe("test-helper", () => {
],
lp_token: pairLpTokens.NTMPI_USDC,
symbols: ["NTMPI", "USDC"]
},
{
asset_infos: [{ token: { contract_addr: OCH_CONTRACT } }, { native_token: { denom: ORAI } }],
lp_token: pairLpTokens.OCH_ORAI,
symbols: ["OCH", "ORAI"]
}
]);
});
Expand Down
6 changes: 3 additions & 3 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3364,9 +3364,9 @@
integrity sha512-INpHnhL970OCkR7I71Kssb2aLl2l4Y/x8W6FlyRO0KmC8GHjxc/hlNB1t44BiI7lkOYmcWMRQoC8dwParsp1RQ==

"@oraichain/oraidex-common@latest":
version "1.0.67"
resolved "https://registry.yarnpkg.com/@oraichain/oraidex-common/-/oraidex-common-1.0.67.tgz#b16221be2b70ecb118e76462306dd643b16fdc71"
integrity sha512-4Jj4gPZJeRSm9z3PAk8+Q8lUZ8miFPAodqooct5MaqgtJloblpJkDr0/BGZYg2783nUcd7U7Ku95vsSMUhlewg==
version "1.0.70"
resolved "https://registry.yarnpkg.com/@oraichain/oraidex-common/-/oraidex-common-1.0.70.tgz#ec68f38b43b25affcec684183bc6514e86520aa1"
integrity sha512-DZY5M/4JGwhEZJULHE+rfoET7dAw8FpnS/M3404xZ/GV1q9t6935M0qSzNiy2yk4PHJaWq+DxN8hPAYiiSTe9Q==
dependencies:
"@cosmjs/amino" "^0.31.0"
"@cosmjs/cosmwasm-stargate" "^0.31.0"
Expand Down

0 comments on commit 39d9021

Please sign in to comment.