From 0914a3c7171c0e8df29432f02eadd6f5ac3e1586 Mon Sep 17 00:00:00 2001 From: metalicn20 Date: Sat, 7 May 2022 18:00:16 +0430 Subject: [PATCH 1/3] Add IRT currency --- .../src/main/resources/data.sql | 28 +++++++++++-------- .../src/main/resources/data.sql | 4 ++- .../src/main/resources/data.sql | 3 +- .../src/main/resources/application.yml | 2 +- .../src/main/resources/data.sql | 18 ++++++------ 5 files changed, 33 insertions(+), 22 deletions(-) diff --git a/accountant/accountant-ports/accountant-persister-postgres/src/main/resources/data.sql b/accountant/accountant-ports/accountant-persister-postgres/src/main/resources/data.sql index e224ca5df..cb55f5b2a 100644 --- a/accountant/accountant-ports/accountant-persister-postgres/src/main/resources/data.sql +++ b/accountant/accountant-ports/accountant-persister-postgres/src/main/resources/data.sql @@ -1,6 +1,8 @@ INSERT INTO pair_config VALUES ('btc_usdt', 'btc', 'usdt', 0.000001, 0.01, 55000), ('eth_usdt', 'eth', 'usdt', 0.00001, 0.01, 3800), + ('btc_irt', 'btc', 'irt', 0.000001, 0.01, 55000), + ('eth_irt', 'eth', 'irt', 0.00001, 0.01, 3800), ('nln_usdt', 'nln', 'usdt', 1.0, 0.01, 0.01), ('nln_btc', 'nln', 'btc', 1.0, 0.000001, 1 / 5500000), ('nln_eth', 'nln', 'eth', 1.0, 0.000001, 1 / 550000) @@ -25,21 +27,25 @@ VALUES (1, 'btc_usdt', 'ASK', '*', 0.01, 0.01), (7, 'eth_usdt', 'ASK', '*', 0.01, 0.01), (8, 'eth_usdt', 'BID', '*', 0.01, 0.01), (9, 'nln_eth', 'ASK', '*', 0.01, 0.01), - (10, 'nln_eth', 'BID', '*', 0.01, 0.01) + (10, 'nln_eth', 'BID', '*', 0.01, 0.01), + (11, 'btc_irt', 'ASK', '*', 0.01, 0.01), + (12, 'btc_irt', 'BID', '*', 0.01, 0.01), + (13, 'eth_irt', 'ASK', '*', 0.01, 0.01), + (14, 'eth_irt', 'BID', '*', 0.01, 0.01) ON CONFLICT DO NOTHING; -- Test pair configs INSERT INTO pair_fee_config -VALUES (11, 'tbtc_tusdt', 'ASK', '*', 0.01, 0.01), - (12, 'tbtc_tusdt', 'BID', '*', 0.01, 0.01), - (13, 'nln_tusdt', 'ASK', '*', 0.01, 0.01), - (14, 'nln_tusdt', 'BID', '*', 0.01, 0.01), - (15, 'nln_tbtc', 'ASK', '*', 0.01, 0.01), - (16, 'nln_tbtc', 'BID', '*', 0.01, 0.01), - (17, 'teth_tusdt', 'ASK', '*', 0.01, 0.01), - (18, 'teth_tusdt', 'BID', '*', 0.01, 0.01), - (19, 'nln_teth', 'ASK', '*', 0.01, 0.01), - (20, 'nln_teth', 'BID', '*', 0.01, 0.01) +VALUES (15, 'tbtc_tusdt', 'ASK', '*', 0.01, 0.01), + (16, 'tbtc_tusdt', 'BID', '*', 0.01, 0.01), + (17, 'nln_tusdt', 'ASK', '*', 0.01, 0.01), + (18, 'nln_tusdt', 'BID', '*', 0.01, 0.01), + (19, 'nln_tbtc', 'ASK', '*', 0.01, 0.01), + (20, 'nln_tbtc', 'BID', '*', 0.01, 0.01), + (21, 'teth_tusdt', 'ASK', '*', 0.01, 0.01), + (22, 'teth_tusdt', 'BID', '*', 0.01, 0.01), + (23, 'nln_teth', 'ASK', '*', 0.01, 0.01), + (24, 'nln_teth', 'BID', '*', 0.01, 0.01) ON CONFLICT DO NOTHING; SELECT setval(pg_get_serial_sequence('pair_fee_config', 'id'), (SELECT MAX(id) FROM pair_fee_config)); diff --git a/api/api-ports/api-persister-postgres/src/main/resources/data.sql b/api/api-ports/api-persister-postgres/src/main/resources/data.sql index 849c97bd3..db8f35bbd 100644 --- a/api/api-ports/api-persister-postgres/src/main/resources/data.sql +++ b/api/api-ports/api-persister-postgres/src/main/resources/data.sql @@ -3,7 +3,9 @@ VALUES ('btc_usdt', 'BTCUSDT'), ('eth_usdt', 'ETHUSDT'), ('eth_btc', 'ETHBTC'), ('nln_usdt', 'NLNUSDT'), - ('nln_btc', 'NLNBTC') + ('nln_btc', 'NLNBTC'), + ('btc_irt', 'BTCIRT'), + ('eth_irt', 'ETHIRT') ON CONFLICT DO NOTHING; -- Test symbol mapper diff --git a/bc-gateway/bc-gateway-ports/bc-gateway-persister-postgres/src/main/resources/data.sql b/bc-gateway/bc-gateway-ports/bc-gateway-persister-postgres/src/main/resources/data.sql index 1f9282a7d..ec0292152 100644 --- a/bc-gateway/bc-gateway-ports/bc-gateway-persister-postgres/src/main/resources/data.sql +++ b/bc-gateway/bc-gateway-ports/bc-gateway-persister-postgres/src/main/resources/data.sql @@ -1,7 +1,8 @@ INSERT INTO currency VALUES ('BTC', 'Bitcoin'), ('ETH', 'Ethereum'), - ('USDT', 'Tether') + ('USDT', 'Tether'), + ('IRT', 'Toman') ON CONFLICT DO NOTHING; -- Test currency diff --git a/matching-engine/matching-engine-app/src/main/resources/application.yml b/matching-engine/matching-engine-app/src/main/resources/application.yml index 0b6e0d6cb..63f78b851 100644 --- a/matching-engine/matching-engine-app/src/main/resources/application.yml +++ b/matching-engine/matching-engine-app/src/main/resources/application.yml @@ -11,4 +11,4 @@ spring: host: ${REDIS_HOST:localhost} port: 6379 app: - symbols: btc_usdt,eth_usdt,eth_btc,tbtc_tusdt,teth_tusdt,teth_tbtc + symbols: btc_usdt,eth_usdt,eth_btc,tbtc_tusdt,teth_tusdt,teth_tbtc,btc_irt,eth_irt diff --git a/wallet/wallet-ports/wallet-persister-postgres/src/main/resources/data.sql b/wallet/wallet-ports/wallet-persister-postgres/src/main/resources/data.sql index b6ef6f729..ccdc1680a 100644 --- a/wallet/wallet-ports/wallet-persister-postgres/src/main/resources/data.sql +++ b/wallet/wallet-ports/wallet-persister-postgres/src/main/resources/data.sql @@ -9,7 +9,7 @@ VALUES ('btc', 'btc', 0.000001), ('eth', 'eth', 0.00001), ('usdt', 'usdt', 0.01), ('nln', 'nln', 1), - ('IRT', 'IRT', 1) + ('irt', 'irt', 1) ON CONFLICT DO NOTHING; -- Test currency @@ -23,15 +23,17 @@ INSERT INTO currency_rate(id, source_currency, dest_currency, rate) VALUES (1, 'btc', 'nln', 5500000), (2, 'usdt', 'nln', 100), (3, 'btc', 'usdt', 55000), - (4, 'eth', 'usdt', 3800) + (4, 'eth', 'usdt', 3800), + (5, 'btc', 'irt', 3800), + (6, 'eth', 'irt', 3800) ON CONFLICT DO NOTHING; -- Test currency rate INSERT INTO currency_rate(id, source_currency, dest_currency, rate) -VALUES (5, 'tbtc', 'nln', 5500000), - (6, 'tusdt', 'nln', 100), - (7, 'tbtc', 'tusdt', 55000), - (8, 'teth', 'tusdt', 3800) +VALUES (7, 'tbtc', 'nln', 5500000), + (8, 'tusdt', 'nln', 100), + (9, 'tbtc', 'tusdt', 55000), + (10, 'teth', 'tusdt', 3800) ON CONFLICT DO NOTHING; SELECT setval(pg_get_serial_sequence('currency_rate', 'id'), (SELECT MAX(id) FROM currency_rate)); @@ -45,8 +47,8 @@ VALUES (1, 1, 'main', 'btc', 10), (6, 1, 'exchange', 'nln', 0), (7, 1, 'main', 'eth', 10000), (8, 1, 'exchange', 'eth', 0), - (9, 1, 'main', 'IRT', 100000000), - (10, 1, 'exchange', 'IRT', 0) + (9, 1, 'main', 'irt', 100000000), + (10, 1, 'exchange', 'irt', 0) ON CONFLICT DO NOTHING; -- Test wallet From 5f6097c6a8840859ef454f52347d9917fc9431a0 Mon Sep 17 00:00:00 2001 From: metalicn20 Date: Sat, 7 May 2022 18:46:41 +0430 Subject: [PATCH 2/3] Fix docker-compose.yml build contexts --- docker-compose.yml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/docker-compose.yml b/docker-compose.yml index 3648fe5fa..a1aa78c83 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -94,6 +94,7 @@ services: - kafka-3 vault: image: ghcr.io/opexdev/vault-opex + build: docker-images/vault volumes: - vault-data:/vault/file environment: @@ -143,6 +144,7 @@ services: condition: on-failure postgres-accountant: image: ghcr.io/opexdev/postgres-opex + build: docker-images/postgres environment: - POSTGRES_USER=${DB_USER:-opex} - POSTGRES_PASSWORD=${DB_PASS:-hiopex} @@ -155,6 +157,7 @@ services: - default postgres-eventlog: image: ghcr.io/opexdev/postgres-opex + build: docker-images/postgres environment: - POSTGRES_USER=${DB_USER:-opex} - POSTGRES_PASSWORD=${DB_PASS:-hiopex} @@ -167,6 +170,7 @@ services: - default postgres-auth: image: ghcr.io/opexdev/postgres-opex + build: docker-images/postgres environment: - POSTGRES_USER=${DB_USER:-opex} - POSTGRES_PASSWORD=${DB_PASS:-hiopex} @@ -182,6 +186,7 @@ services: condition: on-failure postgres-wallet: image: ghcr.io/opexdev/postgres-opex + build: docker-images/postgres environment: - POSTGRES_USER=${DB_USER:-opex} - POSTGRES_PASSWORD=${DB_PASS:-hiopex} @@ -197,6 +202,7 @@ services: condition: on-failure postgres-api: image: ghcr.io/opexdev/postgres-opex + build: docker-images/postgres environment: - POSTGRES_USER=${DB_USER:-opex} - POSTGRES_PASSWORD=${DB_PASS:-hiopex} @@ -212,6 +218,7 @@ services: condition: on-failure postgres-bc-gateway: image: ghcr.io/opexdev/postgres-opex + build: docker-images/postgres environment: - POSTGRES_USER=${DB_USER:-opex} - POSTGRES_PASSWORD=${DB_PASS:-hiopex} @@ -227,6 +234,7 @@ services: condition: on-failure postgres-referral: image: ghcr.io/opexdev/postgres-opex + build: docker-images/postgres environment: - POSTGRES_USER=${DB_USER:-opex} - POSTGRES_PASSWORD=${DB_PASS:-hiopex} @@ -240,6 +248,7 @@ services: condition: on-failure accountant: image: ghcr.io/opexdev/accountant + build: accountant/accountant-app environment: - JAVA_OPTS=-Xmx256m -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5005 - SPRING_PROFILES_ACTIVE=scheduled @@ -261,6 +270,7 @@ services: - postgres-accountant eventlog: image: ghcr.io/opexdev/eventlog + build: eventlog/eventlog-app environment: - JAVA_OPTS=-Xmx256m - KAFKA_IP_PORT=kafka-1:29092,kafka-2:29092,kafka-3:29092 @@ -279,6 +289,7 @@ services: - postgres-eventlog matching-engine: image: ghcr.io/opexdev/matching-engine + build: matching-engine/matching-engine-app environment: - JAVA_OPTS=-Xmx256m -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5005 - KAFKA_IP_PORT=kafka-1:29092,kafka-2:29092,kafka-3:29092 @@ -292,6 +303,7 @@ services: - redis matching-gateway: image: ghcr.io/opexdev/matching-gateway + build: bc-gateway/bc-gateway-app environment: - JAVA_OPTS=-Xmx256m -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5005 - KAFKA_IP_PORT=kafka-1:29092,kafka-2:29092,kafka-3:29092 @@ -307,6 +319,7 @@ services: - matching-engine auth: image: ghcr.io/opexdev/auth + build: user-management/keycloak-gateway environment: - JAVA_OPTS=-Xmx256m -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5005 - KAFKA_IP_PORT=kafka-1:29092,kafka-2:29092,kafka-3:29092 @@ -334,6 +347,7 @@ services: condition: on-failure wallet: image: ghcr.io/opexdev/wallet + build: wallet/wallet-app environment: - JAVA_OPTS=-Xmx256m -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5005 - KAFKA_IP_PORT=kafka-1:29092,kafka-2:29092,kafka-3:29092 @@ -357,6 +371,7 @@ services: condition: on-failure api: image: ghcr.io/opexdev/api + build: api/api-app environment: - JAVA_OPTS=-Xmx256m -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5005 - KAFKA_IP_PORT=kafka-1:29092,kafka-2:29092,kafka-3:29092 @@ -385,6 +400,7 @@ services: condition: on-failure websocket: image: ghcr.io/opexdev/websocket + build: websocket/websocket-app environment: - JAVA_OPTS=-Xmx256m -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5005 - KAFKA_IP_PORT=kafka-1:29092,kafka-2:29092,kafka-3:29092 @@ -407,6 +423,7 @@ services: condition: on-failure bc-gateway: image: ghcr.io/opexdev/bc-gateway + build: bc-gateway/bc-gateway-app environment: - JAVA_OPTS=-Xmx256m -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5005 - SPRING_PROFILES_DEFAULT=scheduled @@ -432,6 +449,7 @@ services: condition: on-failure storage: image: ghcr.io/opexdev/storage + build: storage/storage-app environment: - JAVA_OPTS=-Xmx256m -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5005 - CONSUL_HOST=consul @@ -449,6 +467,7 @@ services: condition: on-failure referral: image: ghcr.io/opexdev/referral + build: referral/referral-app environment: - JAVA_OPTS=-Xmx256m -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=1044 - CONSUL_HOST=consul @@ -471,6 +490,7 @@ services: condition: on-failure captcha: image: ghcr.io/opexdev/captcha + build: captcha/captcha-app environment: - JAVA_OPTS=-Xmx256m -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=1044 - CONSUL_HOST=consul @@ -482,6 +502,7 @@ services: condition: on-failure admin: image: ghcr.io/opexdev/admin + build: admin/admin-app environment: - JAVA_OPTS=-Xmx256m -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5005 - KAFKA_IP_PORT=kafka-1:29092,kafka-2:29092,kafka-3:29092 From 7bf48f00ba610057e8b64367a8d294e8e3fcd2d0 Mon Sep 17 00:00:00 2001 From: metalicn20 Date: Sat, 7 May 2022 19:20:21 +0430 Subject: [PATCH 3/3] Add BSC, BUSD currency --- .../src/main/resources/data.sql | 31 ++++++++++------- .../src/main/resources/data.sql | 5 ++- .../src/main/resources/data.sql | 26 +++++++-------- .../src/main/resources/application.yml | 2 +- .../src/main/resources/data.sql | 33 ++++++++++++------- 5 files changed, 59 insertions(+), 38 deletions(-) diff --git a/accountant/accountant-ports/accountant-persister-postgres/src/main/resources/data.sql b/accountant/accountant-ports/accountant-persister-postgres/src/main/resources/data.sql index cb55f5b2a..ef46b666b 100644 --- a/accountant/accountant-ports/accountant-persister-postgres/src/main/resources/data.sql +++ b/accountant/accountant-ports/accountant-persister-postgres/src/main/resources/data.sql @@ -3,6 +3,9 @@ VALUES ('btc_usdt', 'btc', 'usdt', 0.000001, 0.01, 55000), ('eth_usdt', 'eth', 'usdt', 0.00001, 0.01, 3800), ('btc_irt', 'btc', 'irt', 0.000001, 0.01, 55000), ('eth_irt', 'eth', 'irt', 0.00001, 0.01, 3800), + ('bsc_irt', 'bsc', 'irt', 0.00001, 0.01, 3800), + ('bsc_usdt', 'bsc', 'usdt', 0.00001, 0.01, 3800), + ('busd_irt', 'busd', 'irt', 0.00001, 0.01, 3800), ('nln_usdt', 'nln', 'usdt', 1.0, 0.01, 0.01), ('nln_btc', 'nln', 'btc', 1.0, 0.000001, 1 / 5500000), ('nln_eth', 'nln', 'eth', 1.0, 0.000001, 1 / 550000) @@ -31,21 +34,27 @@ VALUES (1, 'btc_usdt', 'ASK', '*', 0.01, 0.01), (11, 'btc_irt', 'ASK', '*', 0.01, 0.01), (12, 'btc_irt', 'BID', '*', 0.01, 0.01), (13, 'eth_irt', 'ASK', '*', 0.01, 0.01), - (14, 'eth_irt', 'BID', '*', 0.01, 0.01) + (14, 'eth_irt', 'BID', '*', 0.01, 0.01), + (15, 'bsc_irt', 'ASK', '*', 0.01, 0.01), + (16, 'bsc_irt', 'BID', '*', 0.01, 0.01), + (17, 'bsc_usdt', 'ASK', '*', 0.01, 0.01), + (18, 'bsc_usdt', 'BID', '*', 0.01, 0.01), + (19, 'busd_irt', 'ASK', '*', 0.01, 0.01), + (20, 'busd_irt', 'BID', '*', 0.01, 0.01) ON CONFLICT DO NOTHING; -- Test pair configs INSERT INTO pair_fee_config -VALUES (15, 'tbtc_tusdt', 'ASK', '*', 0.01, 0.01), - (16, 'tbtc_tusdt', 'BID', '*', 0.01, 0.01), - (17, 'nln_tusdt', 'ASK', '*', 0.01, 0.01), - (18, 'nln_tusdt', 'BID', '*', 0.01, 0.01), - (19, 'nln_tbtc', 'ASK', '*', 0.01, 0.01), - (20, 'nln_tbtc', 'BID', '*', 0.01, 0.01), - (21, 'teth_tusdt', 'ASK', '*', 0.01, 0.01), - (22, 'teth_tusdt', 'BID', '*', 0.01, 0.01), - (23, 'nln_teth', 'ASK', '*', 0.01, 0.01), - (24, 'nln_teth', 'BID', '*', 0.01, 0.01) +VALUES (21, 'tbtc_tusdt', 'ASK', '*', 0.01, 0.01), + (22, 'tbtc_tusdt', 'BID', '*', 0.01, 0.01), + (23, 'nln_tusdt', 'ASK', '*', 0.01, 0.01), + (24, 'nln_tusdt', 'BID', '*', 0.01, 0.01), + (25, 'nln_tbtc', 'ASK', '*', 0.01, 0.01), + (26, 'nln_tbtc', 'BID', '*', 0.01, 0.01), + (27, 'teth_tusdt', 'ASK', '*', 0.01, 0.01), + (28, 'teth_tusdt', 'BID', '*', 0.01, 0.01), + (29, 'nln_teth', 'ASK', '*', 0.01, 0.01), + (30, 'nln_teth', 'BID', '*', 0.01, 0.01) ON CONFLICT DO NOTHING; SELECT setval(pg_get_serial_sequence('pair_fee_config', 'id'), (SELECT MAX(id) FROM pair_fee_config)); diff --git a/api/api-ports/api-persister-postgres/src/main/resources/data.sql b/api/api-ports/api-persister-postgres/src/main/resources/data.sql index db8f35bbd..a61eeec72 100644 --- a/api/api-ports/api-persister-postgres/src/main/resources/data.sql +++ b/api/api-ports/api-persister-postgres/src/main/resources/data.sql @@ -1,11 +1,14 @@ INSERT INTO symbol_maps(symbol, value) VALUES ('btc_usdt', 'BTCUSDT'), ('eth_usdt', 'ETHUSDT'), + ('bsc_usdt', 'BSCUSDT'), ('eth_btc', 'ETHBTC'), ('nln_usdt', 'NLNUSDT'), ('nln_btc', 'NLNBTC'), ('btc_irt', 'BTCIRT'), - ('eth_irt', 'ETHIRT') + ('eth_irt', 'ETHIRT'), + ('bsc_irt', 'BSCIRT'), + ('busd_irt', 'BUSDIRT') ON CONFLICT DO NOTHING; -- Test symbol mapper diff --git a/bc-gateway/bc-gateway-ports/bc-gateway-persister-postgres/src/main/resources/data.sql b/bc-gateway/bc-gateway-ports/bc-gateway-persister-postgres/src/main/resources/data.sql index ec0292152..00447840d 100644 --- a/bc-gateway/bc-gateway-ports/bc-gateway-persister-postgres/src/main/resources/data.sql +++ b/bc-gateway/bc-gateway-ports/bc-gateway-persister-postgres/src/main/resources/data.sql @@ -2,7 +2,9 @@ INSERT INTO currency VALUES ('BTC', 'Bitcoin'), ('ETH', 'Ethereum'), ('USDT', 'Tether'), - ('IRT', 'Toman') + ('IRT', 'Toman'), + ('BSC', 'Binance Smart Chain'), + ('BUSD', 'Binance USD') ON CONFLICT DO NOTHING; -- Test currency @@ -21,8 +23,7 @@ ON CONFLICT DO NOTHING; -- Test chains INSERT INTO chains VALUES ('test-bitcoin'), - ('test-ethereum'), - ('test-bsc') + ('test-ethereum') ON CONFLICT DO NOTHING; INSERT INTO address_types(id, address_type, address_regex) @@ -42,8 +43,7 @@ ON CONFLICT DO NOTHING; -- Test chain address types INSERT INTO chain_address_types(chain_name, addr_type_id) VALUES ('test-bitcoin', 3), - ('test-ethereum', 2), - ('test-bsc', 2) + ('test-ethereum', 2) ON CONFLICT DO NOTHING; INSERT INTO currency_implementations(id, @@ -58,7 +58,9 @@ INSERT INTO currency_implementations(id, decimal) VALUES (1, 'BTC', 'bitcoin', false, null, null, true, 0.0001, 0.0001, 0), (2, 'ETH', 'ethereum', false, null, null, true, 0.00001, 0.000001, 18), - (3, 'USDT', 'ethereum', true, '0xdac17f958d2ee523a2206206994597c13d831ec7', 'USDT', true, 0.01, 0.01, 6) + (3, 'USDT', 'ethereum', true, '0xdac17f958d2ee523a2206206994597c13d831ec7', 'USDT', true, 0.01, 0.01, 6), + (4, 'BSC', 'bsc', false, null, null, true, 0.0001, 0.0001, 0), + (5, 'BUSD', 'bsc', true, '0xe9e7cea3dedca5984780bafc599bd69add087d56', 'BUSD', true, 0.01, 0.01, 6) ON CONFLICT DO NOTHING; -- Test currency implementation @@ -72,9 +74,9 @@ INSERT INTO currency_implementations(id, withdraw_fee, withdraw_min, decimal) -VALUES (4, 'TBTC', 'test-bitcoin', false, null, null, true, 0.0001, 0.0001, 0), - (5, 'TETH', 'test-ethereum', false, null, null, true, 0.00001, 0.000001, 18), - (6, 'TUSDT', 'test-ethereum', true, '0x110a13fc3efe6a245b50102d2d79b3e76125ae83', 'TUSDT', true, 0.01, 0.01, 6) +VALUES (6, 'TBTC', 'test-bitcoin', false, null, null, true, 0.0001, 0.0001, 0), + (7, 'TETH', 'test-ethereum', false, null, null, true, 0.00001, 0.000001, 18), + (8, 'TUSDT', 'test-ethereum', true, '0x110a13fc3efe6a245b50102d2d79b3e76125ae83', 'TUSDT', true, 0.01, 0.01, 6) ON CONFLICT DO NOTHING; SELECT setval(pg_get_serial_sequence('currency_implementations', 'id'), (SELECT MAX(id) FROM currency_implementations)); @@ -88,8 +90,7 @@ ON CONFLICT DO NOTHING; -- Test chain endpoints INSERT INTO chain_endpoints(id, chain_name, endpoint_url) VALUES (4, 'test-bitcoin', 'lb://chain-scan-gateway/test-bitcoin/transfers'), - (5, 'test-ethereum', 'lb://chain-scan-gateway/test-eth/transfers'), - (6, 'test-bsc', 'lb://chain-scan-gateway/test-bsc/transfers') + (5, 'test-ethereum', 'lb://chain-scan-gateway/test-eth/transfers') ON CONFLICT DO NOTHING; SELECT setval(pg_get_serial_sequence('chain_endpoints', 'id'), (SELECT MAX(id) FROM chain_endpoints)); @@ -103,8 +104,7 @@ ON CONFLICT DO NOTHING; -- Test chain scan schedules INSERT INTO chain_sync_schedules VALUES ('test-bitcoin', CURRENT_DATE, 600, 60), - ('test-ethereum', CURRENT_DATE, 90, 60), - ('test-bsc', CURRENT_DATE, 90, 60) + ('test-ethereum', CURRENT_DATE, 90, 60) ON CONFLICT DO NOTHING; INSERT INTO wallet_sync_schedules diff --git a/matching-engine/matching-engine-app/src/main/resources/application.yml b/matching-engine/matching-engine-app/src/main/resources/application.yml index 63f78b851..6b5926b40 100644 --- a/matching-engine/matching-engine-app/src/main/resources/application.yml +++ b/matching-engine/matching-engine-app/src/main/resources/application.yml @@ -11,4 +11,4 @@ spring: host: ${REDIS_HOST:localhost} port: 6379 app: - symbols: btc_usdt,eth_usdt,eth_btc,tbtc_tusdt,teth_tusdt,teth_tbtc,btc_irt,eth_irt + symbols: btc_usdt,eth_usdt,eth_btc,tbtc_tusdt,teth_tusdt,teth_tbtc,btc_irt,eth_irt,bsc_irt,bsc_usdt,busd_irt diff --git a/wallet/wallet-ports/wallet-persister-postgres/src/main/resources/data.sql b/wallet/wallet-ports/wallet-persister-postgres/src/main/resources/data.sql index ccdc1680a..1bf220201 100644 --- a/wallet/wallet-ports/wallet-persister-postgres/src/main/resources/data.sql +++ b/wallet/wallet-ports/wallet-persister-postgres/src/main/resources/data.sql @@ -8,6 +8,8 @@ INSERT INTO currency(name, symbol, precision) VALUES ('btc', 'btc', 0.000001), ('eth', 'eth', 0.00001), ('usdt', 'usdt', 0.01), + ('bsc', 'bsc', 0.01), + ('busd', 'busd', 0.01), ('nln', 'nln', 1), ('irt', 'irt', 1) ON CONFLICT DO NOTHING; @@ -25,15 +27,18 @@ VALUES (1, 'btc', 'nln', 5500000), (3, 'btc', 'usdt', 55000), (4, 'eth', 'usdt', 3800), (5, 'btc', 'irt', 3800), - (6, 'eth', 'irt', 3800) + (6, 'eth', 'irt', 3800), + (7, 'bsc', 'irt', 3800), + (8, 'bsc', 'usdt', 3800), + (9, 'busd', 'usdt', 3800) ON CONFLICT DO NOTHING; -- Test currency rate INSERT INTO currency_rate(id, source_currency, dest_currency, rate) -VALUES (7, 'tbtc', 'nln', 5500000), - (8, 'tusdt', 'nln', 100), - (9, 'tbtc', 'tusdt', 55000), - (10, 'teth', 'tusdt', 3800) +VALUES (10, 'tbtc', 'nln', 5500000), + (11, 'tusdt', 'nln', 100), + (12, 'tbtc', 'tusdt', 55000), + (13, 'teth', 'tusdt', 3800) ON CONFLICT DO NOTHING; SELECT setval(pg_get_serial_sequence('currency_rate', 'id'), (SELECT MAX(id) FROM currency_rate)); @@ -48,17 +53,21 @@ VALUES (1, 1, 'main', 'btc', 10), (7, 1, 'main', 'eth', 10000), (8, 1, 'exchange', 'eth', 0), (9, 1, 'main', 'irt', 100000000), - (10, 1, 'exchange', 'irt', 0) + (10, 1, 'exchange', 'irt', 0), + (11, 1, 'main', 'bsc', 100000000), + (12, 1, 'exchange', 'bsc', 0), + (13, 1, 'main', 'busd', 100000000), + (14, 1, 'exchange', 'busd', 0) ON CONFLICT DO NOTHING; -- Test wallet INSERT INTO wallet(id, owner, wallet_type, currency, balance) -VALUES (11, 1, 'main', 'tbtc', 10), - (12, 1, 'exchange', 'tbtc', 0), - (13, 1, 'main', 'tusdt', 550000), - (14, 1, 'exchange', 'tusdt', 0), - (17, 1, 'main', 'teth', 10000), - (18, 1, 'exchange', 'teth', 0) +VALUES (15, 1, 'main', 'tbtc', 10), + (16, 1, 'exchange', 'tbtc', 0), + (17, 1, 'main', 'tusdt', 550000), + (18, 1, 'exchange', 'tusdt', 0), + (19, 1, 'main', 'teth', 10000), + (20, 1, 'exchange', 'teth', 0) ON CONFLICT DO NOTHING; SELECT setval(pg_get_serial_sequence('wallet', 'id'), (SELECT MAX(id) FROM wallet));