From 8f9f70392417ec18268e63e7a4f5b747c1f41913 Mon Sep 17 00:00:00 2001 From: Danswar <48102227+Danswar@users.noreply.github.com> Date: Thu, 5 Mar 2026 10:13:42 -0300 Subject: [PATCH 1/2] feat: add JUSD/USDT hummingbot container group configuration (#3362) Add deploy and parameter support for hb-jusd-usdt in dev and prd so the new bot can be selected and deployed with the existing container group flow. --- .../bicep/container-groups/README.md | 2 + .../bicep/container-groups/deploy.sh | 3 +- .../parameters/dev-hb-jusd-usdt.json | 42 +++++++++++++++++++ .../parameters/prd-hb-jusd-usdt.json | 42 +++++++++++++++++++ 4 files changed, 88 insertions(+), 1 deletion(-) create mode 100644 infrastructure/bicep/container-groups/parameters/dev-hb-jusd-usdt.json create mode 100644 infrastructure/bicep/container-groups/parameters/prd-hb-jusd-usdt.json diff --git a/infrastructure/bicep/container-groups/README.md b/infrastructure/bicep/container-groups/README.md index 11c498676c..06c910fd4d 100644 --- a/infrastructure/bicep/container-groups/README.md +++ b/infrastructure/bicep/container-groups/README.md @@ -11,6 +11,7 @@ Container Instances are: - hb-deuro-usdt: Hummingbot (dEURO/USDT) +- hb-jusd-usdt: Hummingbot (JUSD/BTC) - hb-deps-usdt: Hummingbot (dEPS/USDT) - rk: RangeKeeper Liquidity Bot @@ -30,6 +31,7 @@ There is an entrypoint script in the container to setup the individual environme Connect to the running container: - az container exec --resource-group rg-dfx-api-dev --name ci-dfx-hb-deuro-usdt-dev --exec-command /bin/bash +- az container exec --resource-group rg-dfx-api-dev --name ci-dfx-hb-jusd-usdt-dev --exec-command /bin/bash - az container exec --resource-group rg-dfx-api-dev --name ci-dfx-hb-deps-usdt-dev --exec-command /bin/bash Start the Hummingbot within the container: diff --git a/infrastructure/bicep/container-groups/deploy.sh b/infrastructure/bicep/container-groups/deploy.sh index e811415cca..c64a9d3485 100755 --- a/infrastructure/bicep/container-groups/deploy.sh +++ b/infrastructure/bicep/container-groups/deploy.sh @@ -9,9 +9,10 @@ API_NAME="api" environmentOptions=("loc" "dev" "prd") # "hb-deuro-usdt": Hummingbot (dEURO/USDT) +# "hb-jusd-usdt": Hummingbot (JuiceDollar/USDT) # "hb-deps-usdt": Hummingbot (dEPS/USDT) # "rk": RangeKeeper Liquidity Bot -instanceNameOptions=("hb-deuro-usdt" "hb-deps-usdt" "rk") +instanceNameOptions=("hb-deuro-usdt" "hb-jusd-usdt" "hb-deps-usdt" "rk") # --- ARGUMENTS --- # DOCKER_USERNAME= diff --git a/infrastructure/bicep/container-groups/parameters/dev-hb-jusd-usdt.json b/infrastructure/bicep/container-groups/parameters/dev-hb-jusd-usdt.json new file mode 100644 index 0000000000..517b7bae9a --- /dev/null +++ b/infrastructure/bicep/container-groups/parameters/dev-hb-jusd-usdt.json @@ -0,0 +1,42 @@ +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "fileShareQuota": { + "value": 100 + }, + "containerImage": { + "value": "dfxswiss/hummingbot:beta" + }, + "containerVolumeMounts": { + "value": [ + { + "name": "volume", + "mountPath": "/mnt/hummingbot", + "readOnly": false + } + ] + }, + "containerCPU": { + "value": 0.5 + }, + "containerMemory": { + "value": 1 + }, + "containerEnv": { + "value": [ + { + "name": "BOT_DIR", + "value": "jusd-usdt-dev" + }, + { + "name": "STRATEGY_FILE", + "value": "jusd-usdt-conf_pure_mm.yml" + } + ] + }, + "containerCommand": { + "value": [] + } + } +} \ No newline at end of file diff --git a/infrastructure/bicep/container-groups/parameters/prd-hb-jusd-usdt.json b/infrastructure/bicep/container-groups/parameters/prd-hb-jusd-usdt.json new file mode 100644 index 0000000000..1f821087e7 --- /dev/null +++ b/infrastructure/bicep/container-groups/parameters/prd-hb-jusd-usdt.json @@ -0,0 +1,42 @@ +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "fileShareQuota": { + "value": 100 + }, + "containerImage": { + "value": "dfxswiss/hummingbot:latest" + }, + "containerVolumeMounts": { + "value": [ + { + "name": "volume", + "mountPath": "/mnt/hummingbot", + "readOnly": false + } + ] + }, + "containerCPU": { + "value": 0.5 + }, + "containerMemory": { + "value": 1 + }, + "containerEnv": { + "value": [ + { + "name": "BOT_DIR", + "value": "jusd-usdt" + }, + { + "name": "STRATEGY_FILE", + "value": "jusd-usdt-conf_pure_mm.yml" + } + ] + }, + "containerCommand": { + "value": [] + } + } +} \ No newline at end of file From df0fae303a5574e9b0184820e13f4ceae30b4da3 Mon Sep 17 00:00:00 2001 From: TaprootFreak <142087526+TaprootFreak@users.noreply.github.com> Date: Thu, 5 Mar 2026 14:14:33 +0100 Subject: [PATCH 2/2] fix: recalibrate financeLogPairIds toScrypt CHF (#3351) --- ...72500000000-RecalibrateScryptChfPairIds.js | 73 +++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 migration/1772500000000-RecalibrateScryptChfPairIds.js diff --git a/migration/1772500000000-RecalibrateScryptChfPairIds.js b/migration/1772500000000-RecalibrateScryptChfPairIds.js new file mode 100644 index 0000000000..71961044a4 --- /dev/null +++ b/migration/1772500000000-RecalibrateScryptChfPairIds.js @@ -0,0 +1,73 @@ +/** + * @typedef {import('typeorm').MigrationInterface} MigrationInterface + * @typedef {import('typeorm').QueryRunner} QueryRunner + */ + +/** + * Recalibrate financeLogPairIds for toScrypt CHF. + * + * BankTx 190079 (19.02, 40k CHF) has no matching ExchangeTx deposit at Scrypt + * because it was manually added, shifting the 1:1 mapping. In unfiltered mode + * there are 23 senders (40k each) vs 22 receivers (40k each) → +40'000 CHF + * phantom pending on Yapeal/CHF (Asset 404). + * + * Fix: Set both IDs so the unfiltered window starts balanced + * (Sender = 1'370'000 CHF, Receiver = 1'370'000 CHF → toScrypt = 0). + * + * @class + * @implements {MigrationInterface} + */ +module.exports = class RecalibrateScryptChfPairIds1772500000000 { + name = 'RecalibrateScryptChfPairIds1772500000000'; + + /** + * @param {QueryRunner} queryRunner + */ + async up(queryRunner) { + console.log('=== Recalibrate financeLogPairIds toScrypt CHF ===\n'); + + const rows = await queryRunner.query(`SELECT id, value FROM dbo.setting WHERE [key] = 'financeLogPairIds'`); + + if (rows.length === 0) { + console.log('ERROR: financeLogPairIds setting not found. Aborting.'); + return; + } + + const setting = rows[0]; + const pairIds = JSON.parse(setting.value); + + console.log('Current toScrypt.chf:', JSON.stringify(pairIds.toScrypt.chf)); + + pairIds.toScrypt.chf.bankTxId = 190080; + pairIds.toScrypt.chf.exchangeTxId = 123646; + + console.log('New toScrypt.chf:', JSON.stringify(pairIds.toScrypt.chf)); + + const newValue = JSON.stringify(pairIds); + + await queryRunner.query(`UPDATE dbo.setting SET value = '${newValue}' WHERE id = ${setting.id}`); + + // Verify + const verify = await queryRunner.query(`SELECT value FROM dbo.setting WHERE id = ${setting.id}`); + const verified = JSON.parse(verify[0].value); + console.log('\nVerified toScrypt.chf:', JSON.stringify(verified.toScrypt.chf)); + console.log('\n=== Migration Complete ==='); + } + + /** + * @param {QueryRunner} queryRunner + */ + async down(queryRunner) { + const rows = await queryRunner.query(`SELECT id, value FROM dbo.setting WHERE [key] = 'financeLogPairIds'`); + + if (rows.length === 0) return; + + const setting = rows[0]; + const pairIds = JSON.parse(setting.value); + + pairIds.toScrypt.chf.bankTxId = 186482; + pairIds.toScrypt.chf.exchangeTxId = 116514; + + await queryRunner.query(`UPDATE dbo.setting SET value = '${JSON.stringify(pairIds)}' WHERE id = ${setting.id}`); + } +};