@sly-rentals/core 1.1.2 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api.json +12242 -9231
- package/dist/cjs/calculator/ContestTimeline.js +396 -0
- package/dist/cjs/calculator/ContestTimeline.js.map +1 -0
- package/dist/cjs/calculator/MinBidChart.js +419 -0
- package/dist/cjs/calculator/MinBidChart.js.map +1 -0
- package/dist/cjs/calculator/dom.js +39 -0
- package/dist/cjs/calculator/dom.js.map +1 -0
- package/dist/cjs/calculator/emitter.js +36 -0
- package/dist/cjs/calculator/emitter.js.map +1 -0
- package/dist/cjs/calculator/index.js +20 -0
- package/dist/cjs/calculator/index.js.map +1 -0
- package/dist/cjs/cost/constants.js +54 -5
- package/dist/cjs/cost/constants.js.map +1 -1
- package/dist/cjs/cost/estimate.js +7 -4
- package/dist/cjs/cost/estimate.js.map +1 -1
- package/dist/cjs/cost/estimate.test.js +16 -4
- package/dist/cjs/cost/estimate.test.js.map +1 -1
- package/dist/cjs/cost/index.js +32 -17
- package/dist/cjs/cost/index.js.map +1 -1
- package/dist/cjs/cost/sizes.js +20 -3
- package/dist/cjs/cost/sizes.js.map +1 -1
- package/dist/cjs/instructions/acceptRental.js +39 -53
- package/dist/cjs/instructions/acceptRental.js.map +1 -1
- package/dist/cjs/instructions/closeContract.js +18 -50
- package/dist/cjs/instructions/closeContract.js.map +1 -1
- package/dist/cjs/instructions/closeRental.js +19 -15
- package/dist/cjs/instructions/closeRental.js.map +1 -1
- package/dist/cjs/instructions/createContract.js +2 -4
- package/dist/cjs/instructions/createContract.js.map +1 -1
- package/dist/cjs/instructions/createContractThread.js +1 -2
- package/dist/cjs/instructions/createContractThread.js.map +1 -1
- package/dist/cjs/instructions/index.js +65 -42
- package/dist/cjs/instructions/index.js.map +1 -1
- package/dist/cjs/instructions/reserveRental.js +34 -46
- package/dist/cjs/instructions/reserveRental.js.map +1 -1
- package/dist/cjs/kit/index.js +5 -27
- package/dist/cjs/kit/index.js.map +1 -1
- package/dist/cjs/legacy/index.js +6 -3
- package/dist/cjs/legacy/index.js.map +1 -1
- package/dist/cjs/package.json +1 -1
- package/dist/cjs/react/ContestTimeline.js +59 -0
- package/dist/cjs/react/ContestTimeline.js.map +1 -0
- package/dist/cjs/react/MinBidChart.js +34 -0
- package/dist/cjs/react/MinBidChart.js.map +1 -0
- package/dist/cjs/react/index.js +18 -0
- package/dist/cjs/react/index.js.map +1 -0
- package/dist/cjs/utils/bidMath.js +6 -115
- package/dist/cjs/utils/bidMath.js.map +1 -1
- package/dist/cjs/utils/contestChain.js +199 -0
- package/dist/cjs/utils/contestChain.js.map +1 -0
- package/dist/cjs/utils/contractSnapshot.js +207 -0
- package/dist/cjs/utils/contractSnapshot.js.map +1 -0
- package/dist/cjs/utils/contractSnapshot.test.js +247 -0
- package/dist/cjs/utils/contractSnapshot.test.js.map +1 -0
- package/dist/cjs/utils/index.js +8 -3
- package/dist/cjs/utils/index.js.map +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/calculator/ContestTimeline.js +392 -0
- package/dist/esm/calculator/ContestTimeline.js.map +1 -0
- package/dist/esm/calculator/MinBidChart.js +412 -0
- package/dist/esm/calculator/MinBidChart.js.map +1 -0
- package/dist/esm/calculator/dom.js +35 -0
- package/dist/esm/calculator/dom.js.map +1 -0
- package/dist/esm/calculator/emitter.js +32 -0
- package/dist/esm/calculator/emitter.js.map +1 -0
- package/dist/esm/calculator/index.js +13 -0
- package/dist/esm/calculator/index.js.map +1 -0
- package/dist/esm/cost/constants.js +52 -4
- package/dist/esm/cost/constants.js.map +1 -1
- package/dist/esm/cost/estimate.js +9 -6
- package/dist/esm/cost/estimate.js.map +1 -1
- package/dist/esm/cost/estimate.test.js +18 -6
- package/dist/esm/cost/estimate.test.js.map +1 -1
- package/dist/esm/cost/index.js +13 -3
- package/dist/esm/cost/index.js.map +1 -1
- package/dist/esm/cost/sizes.js +19 -2
- package/dist/esm/cost/sizes.js.map +1 -1
- package/dist/esm/instructions/acceptRental.js +40 -54
- package/dist/esm/instructions/acceptRental.js.map +1 -1
- package/dist/esm/instructions/closeContract.js +16 -15
- package/dist/esm/instructions/closeContract.js.map +1 -1
- package/dist/esm/instructions/closeRental.js +20 -16
- package/dist/esm/instructions/closeRental.js.map +1 -1
- package/dist/esm/instructions/createContract.js +2 -4
- package/dist/esm/instructions/createContract.js.map +1 -1
- package/dist/esm/instructions/createContractThread.js +2 -3
- package/dist/esm/instructions/createContractThread.js.map +1 -1
- package/dist/esm/instructions/index.js +36 -28
- package/dist/esm/instructions/index.js.map +1 -1
- package/dist/esm/instructions/reserveRental.js +34 -46
- package/dist/esm/instructions/reserveRental.js.map +1 -1
- package/dist/esm/kit/index.js +4 -4
- package/dist/esm/kit/index.js.map +1 -1
- package/dist/esm/legacy/index.js +5 -2
- package/dist/esm/legacy/index.js.map +1 -1
- package/dist/esm/package.json +1 -1
- package/dist/esm/react/ContestTimeline.js +56 -0
- package/dist/esm/react/ContestTimeline.js.map +1 -0
- package/dist/esm/react/MinBidChart.js +30 -0
- package/dist/esm/react/MinBidChart.js.map +1 -0
- package/dist/esm/react/index.js +12 -0
- package/dist/esm/react/index.js.map +1 -0
- package/dist/esm/utils/bidMath.js +6 -114
- package/dist/esm/utils/bidMath.js.map +1 -1
- package/dist/esm/utils/contestChain.js +191 -0
- package/dist/esm/utils/contestChain.js.map +1 -0
- package/dist/esm/utils/contractSnapshot.js +201 -0
- package/dist/esm/utils/contractSnapshot.js.map +1 -0
- package/dist/esm/utils/contractSnapshot.test.js +245 -0
- package/dist/esm/utils/contractSnapshot.test.js.map +1 -0
- package/dist/esm/utils/index.js +4 -2
- package/dist/esm/utils/index.js.map +1 -1
- package/dist/esm/version.js +1 -1
- package/dist/types/calculator/ContestTimeline.d.ts +69 -0
- package/dist/types/calculator/ContestTimeline.d.ts.map +1 -0
- package/dist/types/calculator/MinBidChart.d.ts +73 -0
- package/dist/types/calculator/MinBidChart.d.ts.map +1 -0
- package/dist/types/calculator/dom.d.ts +16 -0
- package/dist/types/calculator/dom.d.ts.map +1 -0
- package/dist/types/calculator/emitter.d.ts +13 -0
- package/dist/types/calculator/emitter.d.ts.map +1 -0
- package/dist/types/calculator/index.d.ts +13 -0
- package/dist/types/calculator/index.d.ts.map +1 -0
- package/dist/types/cost/constants.d.ts +49 -4
- package/dist/types/cost/constants.d.ts.map +1 -1
- package/dist/types/cost/estimate.d.ts +12 -1
- package/dist/types/cost/estimate.d.ts.map +1 -1
- package/dist/types/cost/index.d.ts +13 -3
- package/dist/types/cost/index.d.ts.map +1 -1
- package/dist/types/cost/sizes.d.ts +19 -2
- package/dist/types/cost/sizes.d.ts.map +1 -1
- package/dist/types/instructions/acceptRental.d.ts +8 -0
- package/dist/types/instructions/acceptRental.d.ts.map +1 -1
- package/dist/types/instructions/closeContract.d.ts +9 -0
- package/dist/types/instructions/closeContract.d.ts.map +1 -1
- package/dist/types/instructions/closeRental.d.ts +8 -0
- package/dist/types/instructions/closeRental.d.ts.map +1 -1
- package/dist/types/instructions/createContract.d.ts.map +1 -1
- package/dist/types/instructions/index.d.ts +36 -28
- package/dist/types/instructions/index.d.ts.map +1 -1
- package/dist/types/instructions/reserveRental.d.ts +8 -0
- package/dist/types/instructions/reserveRental.d.ts.map +1 -1
- package/dist/types/kit/index.d.ts +0 -2
- package/dist/types/kit/index.d.ts.map +1 -1
- package/dist/types/legacy/index.d.ts +1 -2
- package/dist/types/legacy/index.d.ts.map +1 -1
- package/dist/types/react/ContestTimeline.d.ts +17 -0
- package/dist/types/react/ContestTimeline.d.ts.map +1 -0
- package/dist/types/react/MinBidChart.d.ts +12 -0
- package/dist/types/react/MinBidChart.d.ts.map +1 -0
- package/dist/types/react/index.d.ts +12 -0
- package/dist/types/react/index.d.ts.map +1 -0
- package/dist/types/utils/bidMath.d.ts +6 -44
- package/dist/types/utils/bidMath.d.ts.map +1 -1
- package/dist/types/utils/contestChain.d.ts +118 -0
- package/dist/types/utils/contestChain.d.ts.map +1 -0
- package/dist/types/utils/contractSnapshot.d.ts +123 -0
- package/dist/types/utils/contractSnapshot.d.ts.map +1 -0
- package/dist/types/utils/contractSnapshot.test.d.ts +2 -0
- package/dist/types/utils/contractSnapshot.test.d.ts.map +1 -0
- package/dist/types/utils/index.d.ts +2 -1
- package/dist/types/utils/index.d.ts.map +1 -1
- package/dist/types/version.d.ts +1 -1
- package/package.json +15 -1
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ContestTimeline = ContestTimeline;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
/**
|
|
6
|
+
* @purpose Thin React wrapper around the vanilla `ContestTimeline` class.
|
|
7
|
+
* Owns container ref + lifecycle; converts emitter events back into the
|
|
8
|
+
* React-style callback props (`onKnobsChange` etc.).
|
|
9
|
+
*
|
|
10
|
+
* Logic lives in `@sly-rentals/core/calculator`.
|
|
11
|
+
*/
|
|
12
|
+
const react_1 = require("react");
|
|
13
|
+
const calculator_1 = require("../calculator");
|
|
14
|
+
function ContestTimeline(props) {
|
|
15
|
+
const hostRef = (0, react_1.useRef)(null);
|
|
16
|
+
const instRef = (0, react_1.useRef)(null);
|
|
17
|
+
const handlersRef = (0, react_1.useRef)({
|
|
18
|
+
onKnobsChange: props.onKnobsChange,
|
|
19
|
+
onPresetChange: props.onPresetChange,
|
|
20
|
+
onCalcDefenderAtDayChange: props.onCalcDefenderAtDayChange,
|
|
21
|
+
});
|
|
22
|
+
handlersRef.current.onKnobsChange = props.onKnobsChange;
|
|
23
|
+
handlersRef.current.onPresetChange = props.onPresetChange;
|
|
24
|
+
handlersRef.current.onCalcDefenderAtDayChange = props.onCalcDefenderAtDayChange;
|
|
25
|
+
(0, react_1.useLayoutEffect)(() => {
|
|
26
|
+
if (!hostRef.current)
|
|
27
|
+
return;
|
|
28
|
+
const inst = new calculator_1.ContestTimeline(hostRef.current, propsToVanilla(props));
|
|
29
|
+
instRef.current = inst;
|
|
30
|
+
const offKnobs = inst.on('knobsChange', next => handlersRef.current.onKnobsChange(next));
|
|
31
|
+
const offPreset = inst.on('presetChange', next => handlersRef.current.onPresetChange(next));
|
|
32
|
+
const offCalc = inst.on('calcDefenderAtDayChange', at => handlersRef.current.onCalcDefenderAtDayChange(at));
|
|
33
|
+
return () => {
|
|
34
|
+
offKnobs();
|
|
35
|
+
offPreset();
|
|
36
|
+
offCalc();
|
|
37
|
+
inst.destroy();
|
|
38
|
+
instRef.current = null;
|
|
39
|
+
};
|
|
40
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
41
|
+
}, []);
|
|
42
|
+
(0, react_1.useEffect)(() => {
|
|
43
|
+
instRef.current?.update(propsToVanilla(props));
|
|
44
|
+
}, [props]);
|
|
45
|
+
return (0, jsx_runtime_1.jsx)("div", { ref: hostRef });
|
|
46
|
+
}
|
|
47
|
+
function propsToVanilla(p) {
|
|
48
|
+
return {
|
|
49
|
+
activeDays: p.activeDays,
|
|
50
|
+
nowDay: p.nowDay,
|
|
51
|
+
challengeCur: p.challengeCur,
|
|
52
|
+
knobs: p.knobs,
|
|
53
|
+
chain: p.chain,
|
|
54
|
+
preset: p.preset,
|
|
55
|
+
chainDefenderExists: p.chainDefenderExists,
|
|
56
|
+
classNames: p.classNames,
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
//# sourceMappingURL=ContestTimeline.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ContestTimeline.js","sourceRoot":"","sources":["../../../src/react/ContestTimeline.tsx"],"names":[],"mappings":";;AAwBA,0CAoCC;;AA5DD;;;;;;GAMG;AAEH,iCAA2D;AAC3D,8CAIuB;AAWvB,SAAgB,eAAe,CAAC,KAA2B;IACzD,MAAM,OAAO,GAAG,IAAA,cAAM,EAAiB,IAAI,CAAC,CAAC;IAC7C,MAAM,OAAO,GAAG,IAAA,cAAM,EAAgC,IAAI,CAA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QACzB,CAAC,CAAC;QACF,uDAAuD;IACzD,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,IAAA,iBAAS,EAAC,GAAG,EAAE;QACb,OAAO,CAAC,OAAO,EAAE,MAAM,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC,CAAC;IACjD,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC;IAEZ,OAAO,gCAAK,GAAG,EAAE,OAAO,GAAI,CAAC;AAC/B,CAAC;AAED,SAAS,cAAc,CAAC,CAAuB;IAC7C,OAAO;QACL,UAAU,EAAE,CAAC,CAAC,UAAU;QACxB,MAAM,EAAE,CAAC,CAAC,MAAM;QAChB,YAAY,EAAE,CAAC,CAAC,YAAY;QAC5B,KAAK,EAAE,CAAC,CAAC,KAAK;QACd,KAAK,EAAE,CAAC,CAAC,KAAK;QACd,MAAM,EAAE,CAAC,CAAC,MAAM;QAChB,mBAAmB,EAAE,CAAC,CAAC,mBAAmB;QAC1C,UAAU,EAAE,CAAC,CAAC,UAAU;KACzB,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DEFAULT_MIN_BID_CHART_THEME = void 0;
|
|
4
|
+
exports.MinBidChart = MinBidChart;
|
|
5
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
|
+
/**
|
|
7
|
+
* @purpose Thin React wrapper around the vanilla `MinBidChart` class.
|
|
8
|
+
* Owns container ref + lifecycle; forwards prop changes via `.update()`.
|
|
9
|
+
*
|
|
10
|
+
* Visual + math logic lives in `@sly-rentals/core/calculator` so non-React
|
|
11
|
+
* consumers can use the same code without paying for React.
|
|
12
|
+
*/
|
|
13
|
+
const react_1 = require("react");
|
|
14
|
+
const calculator_1 = require("../calculator");
|
|
15
|
+
Object.defineProperty(exports, "DEFAULT_MIN_BID_CHART_THEME", { enumerable: true, get: function () { return calculator_1.DEFAULT_MIN_BID_CHART_THEME; } });
|
|
16
|
+
function MinBidChart(props) {
|
|
17
|
+
const hostRef = (0, react_1.useRef)(null);
|
|
18
|
+
const instRef = (0, react_1.useRef)(null);
|
|
19
|
+
(0, react_1.useLayoutEffect)(() => {
|
|
20
|
+
if (!hostRef.current)
|
|
21
|
+
return;
|
|
22
|
+
instRef.current = new calculator_1.MinBidChart(hostRef.current, props);
|
|
23
|
+
return () => {
|
|
24
|
+
instRef.current?.destroy();
|
|
25
|
+
instRef.current = null;
|
|
26
|
+
};
|
|
27
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
28
|
+
}, []);
|
|
29
|
+
(0, react_1.useEffect)(() => {
|
|
30
|
+
instRef.current?.update(props);
|
|
31
|
+
}, [props]);
|
|
32
|
+
return (0, jsx_runtime_1.jsx)("div", { ref: hostRef });
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=MinBidChart.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MinBidChart.js","sourceRoot":"","sources":["../../../src/react/MinBidChart.tsx"],"names":[],"mappings":";;;AAoBA,kCAmBC;;AAvCD;;;;;;GAMG;AAEH,iCAA2D;AAC3D,8CAMuB;AAEd,4GANP,wCAA2B,OAMO;AAGpC,SAAgB,WAAW,CAAC,KAAuB;IACjD,MAAM,OAAO,GAAG,IAAA,cAAM,EAAiB,IAAI,CAAC,CAAC;IAC7C,MAAM,OAAO,GAAG,IAAA,cAAM,EAA4B,IAAI,CAAC,CAAC;IAExD,IAAA,uBAAe,EAAC,GAAG,EAAE;QACnB,IAAI,CAAC,OAAO,CAAC,OAAO;YAAE,OAAO;QAC7B,OAAO,CAAC,OAAO,GAAG,IAAI,wBAAkB,CAAC,OAAO,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;QACjE,OAAO,GAAG,EAAE;YACV,OAAO,CAAC,OAAO,EAAE,OAAO,EAAE,CAAC;YAC3B,OAAO,CAAC,OAAO,GAAG,IAAI,CAAC;QACzB,CAAC,CAAC;QACF,uDAAuD;IACzD,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,IAAA,iBAAS,EAAC,GAAG,EAAE;QACb,OAAO,CAAC,OAAO,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC;IACjC,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC;IAEZ,OAAO,gCAAK,GAAG,EAAE,OAAO,GAAI,CAAC;AAC/B,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @purpose React component entry point for the SRSLY reservation
|
|
4
|
+
* calculator. Sits behind the `@sly-rentals/core/react` subpath export
|
|
5
|
+
* so non-React consumers don't pay the import cost.
|
|
6
|
+
*
|
|
7
|
+
* Pair with `@sly-rentals/core/react/styles.css` for the default
|
|
8
|
+
* SRSLY-themed look, or pass `classNames` / `theme` props for custom
|
|
9
|
+
* styling.
|
|
10
|
+
*/
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.ContestTimeline = exports.DEFAULT_MIN_BID_CHART_THEME = exports.MinBidChart = void 0;
|
|
13
|
+
var MinBidChart_1 = require("./MinBidChart");
|
|
14
|
+
Object.defineProperty(exports, "MinBidChart", { enumerable: true, get: function () { return MinBidChart_1.MinBidChart; } });
|
|
15
|
+
Object.defineProperty(exports, "DEFAULT_MIN_BID_CHART_THEME", { enumerable: true, get: function () { return MinBidChart_1.DEFAULT_MIN_BID_CHART_THEME; } });
|
|
16
|
+
var ContestTimeline_1 = require("./ContestTimeline");
|
|
17
|
+
Object.defineProperty(exports, "ContestTimeline", { enumerable: true, get: function () { return ContestTimeline_1.ContestTimeline; } });
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/react/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;GAQG;;;AAEH,6CAMuB;AALrB,0GAAA,WAAW,OAAA;AACX,0HAAA,2BAA2B,OAAA;AAM7B,qDAI2B;AAHzB,kHAAA,eAAe,OAAA"}
|
|
@@ -1,23 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/**
|
|
3
|
-
* @purpose Reservation bid math
|
|
3
|
+
* @purpose Reservation bid math (pure formula + type)
|
|
4
4
|
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
5
|
+
* Mirror of the on-chain `ConfigState::bid_min_stardust` formula so UIs
|
|
6
|
+
* can preview the contest minimum-bid floor without hitting an RPC for
|
|
7
|
+
* every keystroke. Fetch-aware helpers (`getMinimumBid`,
|
|
8
|
+
* `computeMinimumBidFromSnapshot`) live in `./contractSnapshot` — they
|
|
9
|
+
* call into the pure formula here.
|
|
10
10
|
*/
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.computeMinimumBid = computeMinimumBid;
|
|
13
|
-
exports.getMinimumBid = getMinimumBid;
|
|
14
|
-
const config_1 = require("../accounts/config");
|
|
15
|
-
const contract_1 = require("../accounts/contract");
|
|
16
|
-
const rental_1 = require("../accounts/rental");
|
|
17
|
-
const srsly_1 = require("../pda/srsly");
|
|
18
|
-
const config_2 = require("./config");
|
|
19
|
-
const rpc_1 = require("./rpc");
|
|
20
|
-
const SYSTEM_PROGRAM_ID = '11111111111111111111111111111111';
|
|
21
13
|
/**
|
|
22
14
|
* Pure math: contest minimum-bid floor in stardust.
|
|
23
15
|
*
|
|
@@ -46,105 +38,4 @@ function computeMinimumBid(args) {
|
|
|
46
38
|
const base = args.rateStardust > defenderBid ? args.rateStardust : defenderBid;
|
|
47
39
|
return (base * effBps) / 10000n;
|
|
48
40
|
}
|
|
49
|
-
/**
|
|
50
|
-
* High-level helper: compute the contest minimum bid for a contract right
|
|
51
|
-
* now (or at `now + delaySeconds`).
|
|
52
|
-
*
|
|
53
|
-
* Fetches `ConfigState`, `ContractState`, and the active/queued `RentalState`
|
|
54
|
-
* accounts, derives `closeness` from the active rental window, and returns
|
|
55
|
-
* the floor a challenger must clear plus enough context to render a UI.
|
|
56
|
-
*
|
|
57
|
-
* @example
|
|
58
|
-
* ```ts
|
|
59
|
-
* const floor = await getMinimumBid({ contractAddress: 'Abc...' });
|
|
60
|
-
* console.log('Bid at least', floor.minBidStardust, 'stardust');
|
|
61
|
-
*
|
|
62
|
-
* // Preview the floor 4 hours from now (snipe-window pricing):
|
|
63
|
-
* const later = await getMinimumBid({
|
|
64
|
-
* contractAddress: 'Abc...',
|
|
65
|
-
* delaySeconds: 4 * 60 * 60,
|
|
66
|
-
* });
|
|
67
|
-
* ```
|
|
68
|
-
*
|
|
69
|
-
* If the contract has no active rental yet, closeness = 0 and the floor
|
|
70
|
-
* collapses to the rate-bump floor (`rate × captureRate`).
|
|
71
|
-
*/
|
|
72
|
-
async function getMinimumBid(args) {
|
|
73
|
-
const rpcUrl = args.rpcUrl ?? (0, config_2.getRpcUrl)();
|
|
74
|
-
const rpc = (0, rpc_1.createRpc)(rpcUrl);
|
|
75
|
-
const cfgPromise = (0, config_1.fetchConfig)(rpcUrl);
|
|
76
|
-
const contractPromise = (0, contract_1.fetchContract)(args.contractAddress, rpcUrl);
|
|
77
|
-
const [cfg, contract] = await Promise.all([cfgPromise, contractPromise]);
|
|
78
|
-
const cfgData = cfg.data;
|
|
79
|
-
const contractData = contract.data;
|
|
80
|
-
const rateStardust = BigInt(contractData.rate);
|
|
81
|
-
const atlasPerPoint = args.atlasPerPoint ?? BigInt(cfgData.atlasPerPoint);
|
|
82
|
-
const stardustPerAtlas = BigInt(cfgData.stardustToAtlas);
|
|
83
|
-
const activeAddr = await (0, srsly_1.deriveActiveRental)(contract.address);
|
|
84
|
-
const queuedAddr = await (0, srsly_1.deriveQueuedRental)(contract.address);
|
|
85
|
-
// Active rental — only meaningful if the contract field points at it.
|
|
86
|
-
let activeStart = null;
|
|
87
|
-
let activeEnd = null;
|
|
88
|
-
if (contractData.activeRental && contractData.activeRental.toString() !== SYSTEM_PROGRAM_ID) {
|
|
89
|
-
try {
|
|
90
|
-
const active = await (0, rental_1.fetchRental)(activeAddr, rpcUrl);
|
|
91
|
-
const a = active.data;
|
|
92
|
-
activeStart = Number(a.startTime);
|
|
93
|
-
activeEnd = Number(a.endTime);
|
|
94
|
-
}
|
|
95
|
-
catch {
|
|
96
|
-
// Account missing despite contract pointer — treat as no active rental.
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
// Queued rental — defender bid lives here if a reservation exists.
|
|
100
|
-
let defenderBidStardust = 0n;
|
|
101
|
-
if (contractData.queuedRental && contractData.queuedRental.toString() !== SYSTEM_PROGRAM_ID) {
|
|
102
|
-
try {
|
|
103
|
-
const queued = await (0, rental_1.fetchRental)(queuedAddr, rpcUrl);
|
|
104
|
-
const q = queued.data;
|
|
105
|
-
const bidAtlas = BigInt(q.bidAtlas);
|
|
106
|
-
const bidPoints = BigInt(q.bidPoints);
|
|
107
|
-
// Points are 8-decimal dust; converting to stardust requires the same
|
|
108
|
-
// 8-decimal precision: stardust = points_dust * atlasPerPoint *
|
|
109
|
-
// stardustPerAtlas / 1e8. With both at 1e8 precision this collapses
|
|
110
|
-
// to points_dust * atlasPerPoint.
|
|
111
|
-
const pointsAsStardust = bidPoints > 0n ? (bidPoints * atlasPerPoint * stardustPerAtlas) / 100000000n : 0n;
|
|
112
|
-
defenderBidStardust = bidAtlas + pointsAsStardust;
|
|
113
|
-
}
|
|
114
|
-
catch {
|
|
115
|
-
// Missing queued account — leave defenderBidStardust = 0.
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
const evaluatedAtSeconds = args.nowSeconds !== undefined
|
|
119
|
-
? Math.floor(args.nowSeconds)
|
|
120
|
-
: Math.floor(Date.now() / 1000) + Math.max(0, args.delaySeconds ?? 0);
|
|
121
|
-
let closeness = 0;
|
|
122
|
-
if (activeStart !== null && activeEnd !== null && activeEnd > activeStart) {
|
|
123
|
-
const span = activeEnd - activeStart;
|
|
124
|
-
const elapsed = evaluatedAtSeconds - activeStart;
|
|
125
|
-
closeness = Math.max(0, Math.min(1, elapsed / span));
|
|
126
|
-
}
|
|
127
|
-
const minBidStardust = computeMinimumBid({
|
|
128
|
-
rateStardust,
|
|
129
|
-
defenderBidStardust,
|
|
130
|
-
contestedMultiplierMaxBps: cfgData.contestedMultiplierMaxBps,
|
|
131
|
-
captureRateBps: BigInt(cfgData.captureRateBps),
|
|
132
|
-
closenessFraction: closeness,
|
|
133
|
-
});
|
|
134
|
-
const baseStardust = rateStardust > defenderBidStardust ? rateStardust : defenderBidStardust;
|
|
135
|
-
const rampMultiplier = baseStardust > 0n ? Number(minBidStardust) / Number(baseStardust) : 1;
|
|
136
|
-
// RPC reference kept to match the codebase pattern even when unused;
|
|
137
|
-
// future refinements (e.g. fetching chain time) can plug in here.
|
|
138
|
-
void rpc;
|
|
139
|
-
return {
|
|
140
|
-
minBidStardust,
|
|
141
|
-
defenderBidStardust,
|
|
142
|
-
rateStardust,
|
|
143
|
-
closenessFraction: closeness,
|
|
144
|
-
rampMultiplier,
|
|
145
|
-
evaluatedAtSeconds,
|
|
146
|
-
activeEndSeconds: activeEnd,
|
|
147
|
-
activeStartSeconds: activeStart,
|
|
148
|
-
};
|
|
149
|
-
}
|
|
150
41
|
//# sourceMappingURL=bidMath.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bidMath.js","sourceRoot":"","sources":["../../../src/utils/bidMath.ts"],"names":[],"mappings":";AAAA;;;;;;;;GAQG;;
|
|
1
|
+
{"version":3,"file":"bidMath.js","sourceRoot":"","sources":["../../../src/utils/bidMath.ts"],"names":[],"mappings":";AAAA;;;;;;;;GAQG;;AAiBH,8CAkBC;AAjCD;;;;;;;;;;;;;;GAcG;AACH,SAAgB,iBAAiB,CAAC,IAMjC;IACC,MAAM,SAAS,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,iBAAiB,CAAC,CAAC,CAAC;IACnE,MAAM,YAAY,GAAG,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,SAAS,GAAG,MAAM,CAAC,CAAC,CAAC;IAC5D,MAAM,MAAM,GAAG,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,IAAI,CAAC,yBAAyB,CAAC,CAAC,CAAC;IACrE,MAAM,QAAQ,GAAG,MAAM,GAAG,IAAI,CAAC;IAC/B,kEAAkE;IAClE,MAAM,SAAS,GAAG,MAAO,GAAG,CAAC,QAAQ,GAAG,YAAY,CAAC,GAAG,IAAI,CAAC;IAC7D,MAAM,MAAM,GAAG,IAAI,CAAC,cAAc,GAAG,MAAO,CAAC,CAAC,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC,MAAO,CAAC;IAC7E,MAAM,MAAM,GAAG,SAAS,GAAG,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC;IACvD,MAAM,WAAW,GAAG,IAAI,CAAC,mBAAmB,IAAI,EAAE,CAAC;IACnD,MAAM,IAAI,GAAG,IAAI,CAAC,YAAY,GAAG,WAAW,CAAC,CAAC,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,WAAW,CAAC;IAC/E,OAAO,CAAC,IAAI,GAAG,MAAM,CAAC,GAAG,MAAO,CAAC;AACnC,CAAC"}
|
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @purpose Pure-math chain-of-contests simulator.
|
|
4
|
+
*
|
|
5
|
+
* Walks a sequence of reservation events (calc defender + user-added
|
|
6
|
+
* takeovers) and produces per-row floor / bonus / owner-take values
|
|
7
|
+
* plus the segment breakdown UIs use to render piecewise curves.
|
|
8
|
+
*
|
|
9
|
+
* No React, no IO, no RPC. Feeds a calculator/visualization layer
|
|
10
|
+
* (`@sly-rentals/core/react/calculator`) but is callable standalone
|
|
11
|
+
* from any environment.
|
|
12
|
+
*/
|
|
13
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
+
exports.nextKnobId = void 0;
|
|
15
|
+
exports.stardustToDisplay = stardustToDisplay;
|
|
16
|
+
exports.computeContestChain = computeContestChain;
|
|
17
|
+
exports.distributeEven = distributeEven;
|
|
18
|
+
exports.distributeSnipeHeavy = distributeSnipeHeavy;
|
|
19
|
+
const bidMath_1 = require("./bidMath");
|
|
20
|
+
function clamp(n, lo, hi) {
|
|
21
|
+
return Math.max(lo, Math.min(hi, n));
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Convert a stardust value into the caller's display currency.
|
|
25
|
+
*
|
|
26
|
+
* ATLAS: stardust / stardustPerAtlas.
|
|
27
|
+
* POINTS: stardust / (stardustPerAtlas × atlasPerPoint), with a
|
|
28
|
+
* min-capture floor since the on-chain threshold rejects sub-floor bids.
|
|
29
|
+
*/
|
|
30
|
+
function stardustToDisplay(stardust, cur, stardustPerAtlas, atlasPerPoint, minCaptureThresholdPoints) {
|
|
31
|
+
const atlas = Number(stardust) / stardustPerAtlas;
|
|
32
|
+
if (cur === 'ATLAS')
|
|
33
|
+
return atlas;
|
|
34
|
+
return Math.max(atlas / atlasPerPoint, minCaptureThresholdPoints);
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Walk a chain of contest events and produce per-contest math + segment
|
|
38
|
+
* breakdown.
|
|
39
|
+
*
|
|
40
|
+
* The chain begins with an optional calc defender row (the simulator's
|
|
41
|
+
* "your bid" entry). Subsequent takeover knobs are computed via
|
|
42
|
+
* `computeMinimumBid` against the previous row's bid.
|
|
43
|
+
*
|
|
44
|
+
* v1 assumes same-currency ATLAS knockoffs; tier-upgrade compensation
|
|
45
|
+
* is not modeled.
|
|
46
|
+
*/
|
|
47
|
+
function computeContestChain(args) {
|
|
48
|
+
const { cfg, rateStardust, activeDays, userDefender, takeoverKnobs, displayCur, stardustPerAtlas, atlasPerPoint, minCaptureThresholdPoints, contestedThreshold, contestedCountStart, } = args;
|
|
49
|
+
const safeSpan = Math.max(0.0001, activeDays);
|
|
50
|
+
const sorted = [...takeoverKnobs].sort((a, b) => a.atDay - b.atDay);
|
|
51
|
+
const rows = [];
|
|
52
|
+
const segments = [];
|
|
53
|
+
const toDisplay = (s) => stardustToDisplay(s, displayCur, stardustPerAtlas, atlasPerPoint, minCaptureThresholdPoints);
|
|
54
|
+
const callMinBid = (closeness, defenderBidStardust) => (0, bidMath_1.computeMinimumBid)({
|
|
55
|
+
rateStardust,
|
|
56
|
+
defenderBidStardust,
|
|
57
|
+
contestedMultiplierMaxBps: cfg.contestedMultiplierMaxBps,
|
|
58
|
+
captureRateBps: cfg.captureRateBps,
|
|
59
|
+
closenessFraction: closeness,
|
|
60
|
+
});
|
|
61
|
+
const tmp = [];
|
|
62
|
+
if (userDefender) {
|
|
63
|
+
tmp.push({
|
|
64
|
+
id: '__calc',
|
|
65
|
+
atDay: userDefender.atDay,
|
|
66
|
+
bidStardust: userDefender.bidStardust,
|
|
67
|
+
bidDisplay: toDisplay(userDefender.bidStardust),
|
|
68
|
+
defenderBidStardust: 0n,
|
|
69
|
+
defenderAtDay: 0,
|
|
70
|
+
source: 'calc',
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
const firstEventAt = tmp[0]?.atDay ?? 0;
|
|
74
|
+
if (firstEventAt > 0) {
|
|
75
|
+
segments.push({
|
|
76
|
+
startDay: 0,
|
|
77
|
+
endDay: firstEventAt,
|
|
78
|
+
defenderBidStardust: 0n,
|
|
79
|
+
hasDefender: false,
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
let cursorBid = userDefender?.bidStardust ?? 0n;
|
|
83
|
+
let cursorAt = userDefender?.atDay ?? 0;
|
|
84
|
+
for (const k of sorted) {
|
|
85
|
+
segments.push({
|
|
86
|
+
startDay: cursorAt,
|
|
87
|
+
endDay: k.atDay,
|
|
88
|
+
defenderBidStardust: cursorBid,
|
|
89
|
+
hasDefender: true,
|
|
90
|
+
});
|
|
91
|
+
const closeness = clamp(k.atDay / safeSpan, 0, 1);
|
|
92
|
+
const floor = callMinBid(closeness, cursorBid);
|
|
93
|
+
tmp.push({
|
|
94
|
+
id: k.id,
|
|
95
|
+
atDay: k.atDay,
|
|
96
|
+
bidStardust: floor,
|
|
97
|
+
bidDisplay: toDisplay(floor),
|
|
98
|
+
defenderBidStardust: cursorBid,
|
|
99
|
+
defenderAtDay: cursorAt,
|
|
100
|
+
source: 'knob',
|
|
101
|
+
});
|
|
102
|
+
cursorBid = floor;
|
|
103
|
+
cursorAt = k.atDay;
|
|
104
|
+
}
|
|
105
|
+
if (tmp.length > 0) {
|
|
106
|
+
segments.push({
|
|
107
|
+
startDay: cursorAt,
|
|
108
|
+
endDay: activeDays,
|
|
109
|
+
defenderBidStardust: cursorBid,
|
|
110
|
+
hasDefender: true,
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
// Bonus multiplier — config knob, scales the same-cur knockoff bonus.
|
|
114
|
+
// 100 bps = 1× = no-op (current on-chain formula).
|
|
115
|
+
// TODO(bonus_multiplier_bps): drop the `?? 100` fallback once the
|
|
116
|
+
// on-chain field is guaranteed present.
|
|
117
|
+
const bonusMult = (cfg.bonusMultiplierBps ?? 100) / 100;
|
|
118
|
+
const bonusByIdx = tmp.map((_, i) => {
|
|
119
|
+
const next = tmp[i + 1];
|
|
120
|
+
if (!next)
|
|
121
|
+
return 0;
|
|
122
|
+
const closeness = clamp((next.atDay - tmp[i].atDay) / safeSpan, 0, 1);
|
|
123
|
+
const raw = Math.max(0, (next.bidDisplay - tmp[i].bidDisplay) * closeness * bonusMult);
|
|
124
|
+
// Match on-chain `b.min(bid_atlas)` — bonus capped at challenger's bid.
|
|
125
|
+
return Math.min(next.bidDisplay, raw);
|
|
126
|
+
});
|
|
127
|
+
// Owner-take is realized only by the LAST contester in the chain — every
|
|
128
|
+
// earlier contester gets their bid back as refund when outbid, plus a
|
|
129
|
+
// bonus from the next challenger's bid. Net contract escrow at end of
|
|
130
|
+
// chain = bid_last − Σ bonuses paid across the chain (the deficit on
|
|
131
|
+
// each refund is covered by the next challenger's bid). Intermediate
|
|
132
|
+
// rows therefore contribute 0 to owner take.
|
|
133
|
+
const totalBonusForOwner = bonusByIdx.reduce((acc, b) => acc + b, 0);
|
|
134
|
+
const lastIdx = tmp.length - 1;
|
|
135
|
+
let contestedCount = contestedCountStart;
|
|
136
|
+
let bumpFlagged = false;
|
|
137
|
+
for (let i = 0; i < tmp.length; i++) {
|
|
138
|
+
const t = tmp[i];
|
|
139
|
+
const bonusEarned = bonusByIdx[i];
|
|
140
|
+
const ownerTake = i === lastIdx ? Math.max(0, t.bidDisplay - totalBonusForOwner) : 0;
|
|
141
|
+
contestedCount = contestedCount + 1;
|
|
142
|
+
const isInitial = i === 0;
|
|
143
|
+
const triggersRateBump = !bumpFlagged && contestedThreshold > 0 && contestedCount >= contestedThreshold && !isInitial;
|
|
144
|
+
if (triggersRateBump)
|
|
145
|
+
bumpFlagged = true;
|
|
146
|
+
rows.push({
|
|
147
|
+
id: t.id,
|
|
148
|
+
idx: i + 1,
|
|
149
|
+
atDay: t.atDay,
|
|
150
|
+
floorStardust: t.bidStardust,
|
|
151
|
+
floorDisplay: t.bidDisplay,
|
|
152
|
+
bonusDisplay: bonusEarned,
|
|
153
|
+
ownerTakeDisplay: ownerTake,
|
|
154
|
+
defenderBidStardust: t.defenderBidStardust,
|
|
155
|
+
defenderAtDay: t.defenderAtDay,
|
|
156
|
+
source: t.source,
|
|
157
|
+
isInitial,
|
|
158
|
+
contestedCountAfter: contestedCount,
|
|
159
|
+
triggersRateBump,
|
|
160
|
+
});
|
|
161
|
+
}
|
|
162
|
+
const baselineAtlas = (Number(rateStardust) / stardustPerAtlas) * activeDays;
|
|
163
|
+
const baselineDisplay = displayCur === 'ATLAS'
|
|
164
|
+
? baselineAtlas
|
|
165
|
+
: Math.max(baselineAtlas / atlasPerPoint, minCaptureThresholdPoints);
|
|
166
|
+
const totalOwnerDisplay = rows.reduce((acc, r) => acc + r.ownerTakeDisplay, 0);
|
|
167
|
+
const totalBonusDisplay = rows.reduce((acc, r) => acc + r.bonusDisplay, 0);
|
|
168
|
+
const multiplier = baselineDisplay > 0 ? totalOwnerDisplay / baselineDisplay : 0;
|
|
169
|
+
return {
|
|
170
|
+
segments,
|
|
171
|
+
rows,
|
|
172
|
+
totalOwnerDisplay,
|
|
173
|
+
totalBonusDisplay,
|
|
174
|
+
baselineDisplay,
|
|
175
|
+
multiplier,
|
|
176
|
+
};
|
|
177
|
+
}
|
|
178
|
+
/** Even spacing across [from, to] excluding endpoints. */
|
|
179
|
+
function distributeEven(count, from, to) {
|
|
180
|
+
if (count <= 0 || to <= from)
|
|
181
|
+
return [];
|
|
182
|
+
const step = (to - from) / (count + 1);
|
|
183
|
+
return Array.from({ length: count }, (_, i) => from + step * (i + 1));
|
|
184
|
+
}
|
|
185
|
+
/** Quadratic bias toward `to` — clusters knobs near the snipe window. */
|
|
186
|
+
function distributeSnipeHeavy(count, from, to) {
|
|
187
|
+
if (count <= 0 || to <= from)
|
|
188
|
+
return [];
|
|
189
|
+
const span = to - from;
|
|
190
|
+
return Array.from({ length: count }, (_, i) => {
|
|
191
|
+
const t = (i + 1) / (count + 1);
|
|
192
|
+
const skewed = 1 - Math.pow(1 - t, 2);
|
|
193
|
+
return from + span * skewed;
|
|
194
|
+
});
|
|
195
|
+
}
|
|
196
|
+
let knobCounter = 0;
|
|
197
|
+
const nextKnobId = () => `k${++knobCounter}`;
|
|
198
|
+
exports.nextKnobId = nextKnobId;
|
|
199
|
+
//# sourceMappingURL=contestChain.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contestChain.js","sourceRoot":"","sources":["../../../src/utils/contestChain.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;GAUG;;;AAiFH,8CAUC;AAaD,kDA8LC;AAGD,wCAIC;AAGD,oDAQC;AAtTD,uCAA8C;AAoE9C,SAAS,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