Skip to content

LadderPublisher

The ladder side of the ladder-and-job protocol: every everyMs push a full ladder per pair, computed by points(pair) as (solver receives, solver pays out) before fees.

new LadderPublisher(client, pairs, points, everyMs?, validMs?): LadderPublisher

Parameter Type Default value
client RelayClient undefined
pairs TokenPair[] undefined
points (pair) => [bigint, bigint][] | null undefined
everyMs? number 2_000
validMs? number 6_000

LadderPublisher

readonly client: RelayClient


readonly pairs: TokenPair[]


readonly points: (pair) => [bigint, bigint][] | null

Parameter Type
pair TokenPair

[bigint, bigint][] | null


readonly everyMs: number = 2_000


readonly validMs: number = 6_000

start(): void

void


stop(): void

void


maxOutput(pair, amountIn, windowMs): bigint | null

The most any of our ladders for pair that were live within the last windowMs pays out for amountIn (null when none covers it): the bound a dispatched job is held to, since the relay quoted the user from one of them.

Parameter Type
pair TokenPair
amountIn bigint
windowMs number

bigint | null