diff --git a/deploy/k8s/base/unrip.yaml b/deploy/k8s/base/unrip.yaml index 4d44717..b475377 100644 --- a/deploy/k8s/base/unrip.yaml +++ b/deploy/k8s/base/unrip.yaml @@ -78,7 +78,7 @@ data: MARKET_REFERENCE_COINGECKO_URL: https://api.coingecko.com/api/v3/simple/price?ids=bitcoin&vs_currencies=eur INVENTORY_SYNC_REFRESH_MS: "15000" LIQUIDITY_REFRESH_MS: "30000" - STRATEGY_GROSS_THRESHOLD_PCT: "0.99" + STRATEGY_GROSS_THRESHOLD_PCT: "0.49" STRATEGY_INITIAL_ARMED: "false" STRATEGY_MAX_NOTIONAL_EURE: "150" STRATEGY_PRICE_MAX_AGE_MS: "30000" diff --git a/src/lib/config.mjs b/src/lib/config.mjs index d227bc9..18c607d 100644 --- a/src/lib/config.mjs +++ b/src/lib/config.mjs @@ -62,7 +62,7 @@ const DEFAULTS = { 'https://api.coingecko.com/api/v3/simple/price?ids=bitcoin&vs_currencies=eur', inventorySyncRefreshMs: 15_000, liquidityRefreshMs: 30_000, - strategyGrossThresholdPct: 0.99, + strategyGrossThresholdPct: 0.49, strategyInitialArmed: false, strategyMaxNotionalEure: 5, strategyPriceMaxAgeMs: 30_000, diff --git a/test/strategy-threshold-config.test.mjs b/test/strategy-threshold-config.test.mjs index d9cdfa2..be31d1a 100644 --- a/test/strategy-threshold-config.test.mjs +++ b/test/strategy-threshold-config.test.mjs @@ -4,21 +4,22 @@ import { readFileSync } from 'node:fs'; import { loadConfig } from '../src/lib/config.mjs'; -test('repo default strategy threshold reflects explicitly approved 0.99 percent edge', () => { +test('repo default strategy threshold reflects explicitly approved 0.49 percent edge', () => { const previous = process.env.STRATEGY_GROSS_THRESHOLD_PCT; delete process.env.STRATEGY_GROSS_THRESHOLD_PCT; try { const config = loadConfig({ envPath: '/tmp/unrip-no-such-env-file' }); - assert.equal(config.strategyGrossThresholdPct, 0.99); + assert.equal(config.strategyGrossThresholdPct, 0.49); } finally { if (previous == null) delete process.env.STRATEGY_GROSS_THRESHOLD_PCT; else process.env.STRATEGY_GROSS_THRESHOLD_PCT = previous; } }); -test('kubernetes strategy threshold deploys the approved 0.99 percent edge', () => { +test('kubernetes strategy threshold deploys the approved 0.49 percent edge', () => { const manifest = readFileSync(new URL('../deploy/k8s/base/unrip.yaml', import.meta.url), 'utf8'); - assert.match(manifest, /STRATEGY_GROSS_THRESHOLD_PCT: "0\.99"/); + assert.match(manifest, /STRATEGY_GROSS_THRESHOLD_PCT: "0\.49"/); + assert.doesNotMatch(manifest, /STRATEGY_GROSS_THRESHOLD_PCT: "0\.99"/); assert.doesNotMatch(manifest, /STRATEGY_GROSS_THRESHOLD_PCT: "1\.49"/); });