Refactor Maker Points logic by removing dislocation calculations and related UI elements. Update MakerPointsEngine to utilize new price fetching methods and streamline order synchronization. Adjust translations and tests accordingly to reflect these changes.

This commit is contained in:
discountry
2026-01-06 16:18:54 +08:00
parent 7aafc3b69d
commit 33b5407245
5 changed files with 11 additions and 132 deletions
-21
View File
@@ -11,24 +11,3 @@ export function buildBpsTargets(config: MakerPointsBandConfig): number[] {
if (config.band30To100) targets.push(99);
return targets.sort((a, b) => a - b);
}
export function computeDislocationBps(
markPrice: number | null | undefined,
bestBid: number | null | undefined,
bestAsk: number | null | undefined
): number | null {
const mark = Number(markPrice);
if (!Number.isFinite(mark) || mark <= 0) return null;
const distances: number[] = [];
const bid = Number(bestBid);
const ask = Number(bestAsk);
if (Number.isFinite(bid)) {
distances.push(Math.abs(mark - bid) / mark * 10000);
}
if (Number.isFinite(ask)) {
distances.push(Math.abs(ask - mark) / mark * 10000);
}
if (!distances.length) return null;
const max = Math.max(...distances);
return Number.isFinite(max) ? max : null;
}