All checks were successful
deploy / deploy (push) Successful in 31s
Proof: Strategy gross edge threshold is lowered to the user-approved 0.49 percent in repo defaults and Kubernetes deploy config; targeted threshold tests, dashboard build, and full npm test pass. Assumptions: User explicitly approved lowering below the previous 0.99 percent threshold for the active BTC/EURe NEAR Intents pair; max notional and funds exposure are unchanged. Still fake: Venue-native terminal fill events, fee attribution, realized per-trade PnL, and full inventory-skew strategy controls remain incomplete.
25 lines
1.1 KiB
JavaScript
25 lines
1.1 KiB
JavaScript
import test from 'node:test';
|
|
import assert from 'node:assert/strict';
|
|
import { readFileSync } from 'node:fs';
|
|
|
|
import { loadConfig } from '../src/lib/config.mjs';
|
|
|
|
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.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.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\.49"/);
|
|
assert.doesNotMatch(manifest, /STRATEGY_GROSS_THRESHOLD_PCT: "0\.99"/);
|
|
assert.doesNotMatch(manifest, /STRATEGY_GROSS_THRESHOLD_PCT: "1\.49"/);
|
|
});
|