Enhance MakerPoints configuration and logic

- Added new configuration options for band-specific order amounts in `config.ts`.
- Implemented conditional logic in `MakerPointsEngine` to utilize the new band amounts based on the Binance depth cancel setting.
- Refactored order amount handling to improve clarity and maintainability.
This commit is contained in:
discountry
2026-01-18 01:49:36 +08:00
parent a34d06f9b4
commit 9629c22496
2 changed files with 26 additions and 5 deletions
+11 -4
View File
@@ -467,8 +467,8 @@ export class MakerPointsEngine {
const binanceSnapshot = this.binanceDepth.getSnapshot();
const rawSkipBuy = Boolean(binanceSnapshot?.skipBuySide);
const rawSkipSell = Boolean(binanceSnapshot?.skipSellSide);
const rawSkipBuy = this.config.enableBinanceDepthCancel && Boolean(binanceSnapshot?.skipBuySide);
const rawSkipSell = this.config.enableBinanceDepthCancel && Boolean(binanceSnapshot?.skipSellSide);
const skipBuy = closeOnly ? false : rawSkipBuy;
const skipSell = closeOnly ? false : rawSkipSell;
const prevSkipBuy = this.lastSkipBuy;
@@ -542,8 +542,6 @@ export class MakerPointsEngine {
skipSell: boolean;
}): DesiredOrder[] {
const { bid1, ask1, skipBuy, skipSell } = params;
const amount = Number(this.config.perOrderAmount);
if (!Number.isFinite(amount) || amount <= 0) return [];
const targets = buildBpsTargets({
band0To10: this.config.enableBand0To10,
@@ -556,7 +554,16 @@ export class MakerPointsEngine {
const priceDecimals = this.getPriceDecimals();
const desired: DesiredOrder[] = [];
const getAmountForBps = (bps: number): number => {
if (bps <= 10) return Number(this.config.band0To10Amount);
if (bps <= 30) return Number(this.config.band10To30Amount);
return Number(this.config.band30To100Amount);
};
for (const bps of targets) {
const amount = getAmountForBps(bps);
if (!Number.isFinite(amount) || amount <= 0) continue;
if (!skipBuy) {
const price = bid1 * (1 - bps / 10000);
if (Number.isFinite(price) && price > 0) {