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.
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new LadderPublisher(
client,pairs,points,everyMs?,validMs?):LadderPublisher
Parameters
Section titled “Parameters”| Parameter | Type | Default value |
|---|---|---|
client |
RelayClient |
undefined |
pairs |
TokenPair[] |
undefined |
points |
(pair) => [bigint, bigint][] | null |
undefined |
everyMs? |
number |
2_000 |
validMs? |
number |
6_000 |
Returns
Section titled “Returns”LadderPublisher
Properties
Section titled “Properties”client
Section titled “client”
readonlyclient:RelayClient
readonlypairs:TokenPair[]
points
Section titled “points”
readonlypoints: (pair) => [bigint,bigint][] |null
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
pair |
TokenPair |
Returns
Section titled “Returns”[bigint, bigint][] | null
everyMs
Section titled “everyMs”
readonlyeveryMs:number=2_000
validMs
Section titled “validMs”
readonlyvalidMs:number=6_000
Methods
Section titled “Methods”start()
Section titled “start()”start():
void
Returns
Section titled “Returns”void
stop()
Section titled “stop()”stop():
void
Returns
Section titled “Returns”void
maxOutput()
Section titled “maxOutput()”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.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
pair |
TokenPair |
amountIn |
bigint |
windowMs |
number |
Returns
Section titled “Returns”bigint | null