Skip to content

Commit

Permalink
fix: correct estimated reward
Browse files Browse the repository at this point in the history
  • Loading branch information
alex-sandrk committed Feb 7, 2024
1 parent 307e071 commit 1ad1fd4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "lumerin-wallet-desktop",
"version": "1.2.51",
"version": "1.2.52",
"engines": {
"node": ">=14"
},
Expand Down
11 changes: 9 additions & 2 deletions src/components/contracts/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,15 @@ export const formatPrice = (price, symbol) => {
};

export const formatBtcPerTh = networkDifficulty => {
const networkHashrate = (networkDifficulty * Math.pow(2, 32)) / 600;
const profitPerTh = (1000000000000 / networkHashrate) * (8 * 144);
const networkHashrate =
(networkDifficulty * Math.pow(2, 32)) / 600 / Math.pow(10, 12);

const miningHours = 24;
const blockReward = 6.25;
const hashrate = 1; // TH/s
const blocksExpected = 1 / 0.1667; // 1 block every 10 minutes
const profitPerTh =
(hashrate / networkHashrate) * (blockReward * miningHours * blocksExpected);

const fixedValue = Number(profitPerTh).toFixed(8);
return fixedValue;
Expand Down

0 comments on commit 1ad1fd4

Please sign in to comment.