-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7f65ab2
commit af70046
Showing
4 changed files
with
192 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,6 +20,8 @@ | |
<script defer src="https://unpkg.com/[email protected]/dist/js/tabulator.min.js"></script> | ||
<script defer src="https://unpkg.com/[email protected]/build/global/luxon.min.js"></script> | ||
|
||
<script src="https://d3js.org/d3.v6.js"></script> | ||
|
||
<!-- MISC --> | ||
<link rel="stylesheet" href="/css/misc.css" /> | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,7 @@ import { utils as ethersUtils, providers, Contract, constants, BigNumber } from | |
import { Contract as MCContract, Provider as MCProvider } from "https://esm.sh/[email protected]"; | ||
import { MINIPOOL_STATUS_MAP, formatters, transformerFns, unfuckEthersObj } from "/js/utils.js"; | ||
import { minipoolsTransformer } from "/js/transformers.js"; | ||
import { DateTime } from "https://esm.sh/[email protected]"; | ||
|
||
// Hard-code reward cycle amounts | ||
// Note we show the rewards for the *next* cycle amount | ||
|
@@ -274,6 +275,43 @@ class GoGoPool { | |
return this.minipoolsData; | ||
} | ||
|
||
launchCapacityData() { | ||
const ignoreNodes = { | ||
"NodeID-2wWroHMggzJvKh6t3tdPtJTTP9DNmdc4K": true, | ||
"NodeID-LUhB7mVaTMnkYLQsqf2RV2PUerJfsq2wW": true, | ||
"NodeID-LXpULpbU1A4AobEzCSBy6wYLEbogwsMK1": true, | ||
"NodeID-GpDhyVHYVaL8qXFB2a1QPBsXyUMZjiXLF": true, | ||
}; | ||
const now = DateTime.now().startOf("day") / 1000; | ||
let stakingMPs = this.minipoolsData.filter( | ||
(mp) => | ||
!ignoreNodes[mp.nodeID] && mp.status === "Staking" && mp.endTime > now && mp.endTime < now + 60 * 60 * 24 * 7 | ||
); | ||
stakingMPs = stakingMPs.map((mp) => { | ||
return { | ||
date: DateTime.fromSeconds(mp.endTime), | ||
value: 1, | ||
}; | ||
}); | ||
|
||
// Add an element for each mp we could launch right now | ||
const amtAvail = parseFloat( | ||
this.dashboardAsTabulatorData().filter( | ||
(obj) => obj.contract === "TokenggAVAX" && obj.title === "amountAvailableForStaking" | ||
)[0].value | ||
); | ||
const mpAvail = Math.floor(amtAvail / 1000); | ||
// console.log(mpAvail); | ||
for (let i = 0; i < mpAvail; i++) { | ||
stakingMPs.push({ | ||
date: DateTime.fromSeconds(now), | ||
value: 1, | ||
}); | ||
} | ||
// console.log(stakingMPs); | ||
return stakingMPs; | ||
} | ||
|
||
async fetchStakers({ status } = { status: Object.keys(MINIPOOL_STATUS_MAP) }) { | ||
await this.until((_) => this.isLoaded); | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters