Add Maker Points strategy support in StandX. Introduce new configuration for Maker Points, including point bands and order management logic. Implement MakerPointsEngine for handling order placement and tracking. Update CLI and UI components to integrate Maker Points functionality, enhancing user experience and strategy options.

This commit is contained in:
discountry
2026-01-06 16:01:10 +08:00
parent 9a093459bc
commit 7aafc3b69d
11 changed files with 2032 additions and 12 deletions
+30
View File
@@ -0,0 +1,30 @@
import { describe, expect, it } from "vitest";
import { buildBpsTargets, computeDislocationBps } from "./maker-points-logic";
describe("maker points target builder", () => {
it("builds fixed bps targets per enabled band", () => {
const targets = buildBpsTargets({
band0To10: true,
band10To30: true,
band30To100: true,
});
expect(targets).toEqual([9, 29, 99]);
});
it("skips disabled bands", () => {
const targets = buildBpsTargets({
band0To10: true,
band10To30: false,
band30To100: true,
});
expect(targets).toEqual([9, 99]);
});
});
describe("maker points dislocation", () => {
it("computes max bps dislocation from mark vs bid/ask", () => {
const bps = computeDislocationBps(100, 99.97, 100.02);
expect(bps).not.toBeNull();
expect(Number(bps?.toFixed(2))).toBe(3.0);
});
});