fix: keep Surplus seller active after proof
This commit is contained in:
@@ -155,7 +155,7 @@ SURPLUS_UNDERCUT_BPS=10
|
||||
SURPLUS_MAX_CANDIDATE_ORDER_BOOKS=10
|
||||
SURPLUS_REPRICE_INTERVAL_MS=300000
|
||||
SURPLUS_REQUEST_TIMEOUT_MS=120000
|
||||
SURPLUS_STOP_AFTER_SETTLED_REQUESTS=1
|
||||
# Leave empty until a live earnings record establishes the terminal status.
|
||||
SURPLUS_SETTLED_STATUSES=
|
||||
# 0 keeps selling. 1 pauses after the first trade or one offer-cap of spend.
|
||||
SURPLUS_STOP_AFTER_SETTLED_REQUESTS=0
|
||||
SURPLUS_SETTLED_STATUSES=confirmed
|
||||
SURPLUS_STATE_PATH=/var/lib/surplus-manager/state.json
|
||||
|
||||
@@ -120,9 +120,9 @@ export function loadSurplusManagerConfig(
|
||||
300_000,
|
||||
),
|
||||
stopAfterTrades: boundedInteger(
|
||||
env.SURPLUS_STOP_AFTER_SETTLED_REQUESTS ?? "1",
|
||||
env.SURPLUS_STOP_AFTER_SETTLED_REQUESTS ?? "0",
|
||||
"SURPLUS_STOP_AFTER_SETTLED_REQUESTS",
|
||||
1,
|
||||
0,
|
||||
1,
|
||||
),
|
||||
settledStatuses: statusList(
|
||||
|
||||
@@ -453,7 +453,7 @@ export class SurplusSellerController {
|
||||
? baselineAllowance - allowance.remainingUsdNanos
|
||||
: 0n;
|
||||
const spendCap = parseUsdDecimal(this.config.perOfferCapUsd, "ceil");
|
||||
if (providerSpend >= spendCap) {
|
||||
if (this.config.stopAfterTrades > 0 && providerSpend >= spendCap) {
|
||||
const stopping: SurplusControllerState = {
|
||||
version: 1,
|
||||
phase: "stopping",
|
||||
@@ -476,6 +476,7 @@ export class SurplusSellerController {
|
||||
const book = await this.client.getOrderBook(currentState.intent.model);
|
||||
const ownBookOffer = book.offers.find((offer) => offer.id === currentState.offerId);
|
||||
if (
|
||||
this.config.stopAfterTrades > 0 &&
|
||||
ownBookOffer &&
|
||||
ownBookOffer.trades24h >=
|
||||
currentState.highestTrades24h + this.config.stopAfterTrades
|
||||
|
||||
Reference in New Issue
Block a user