mirror of
https://github.com/discountry/ritmex-bot.git
synced 2026-09-11 09:18:08 +00:00
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:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user