Skip to content
This repository has been archived by the owner. It is now read-only.

Calculation for estimated storage is incorrect #775

mtlynch opened this issue Mar 22, 2018 · 2 comments


None yet
3 participants
Copy link

commented Mar 22, 2018

Sia-UI estimates the storage capacity based on the allowance:


The calculation is here:

const estimate = new BigNumber(SiaAPI.siacoinsToHastings(action.funds)).dividedBy(response.storageterabytemonth).times(1e12)
yield put(actions.setStorageEstimate('~' + readableFilesize(estimate.toPrecision(1))))

This calculation is essentially:

[allowance] / [storage_per_tb_per_month]

This is incorrect as it neglects upload cost and contract fees. It also misuses the storage price as the price per TB per contract period when it is actually the price per TB per month. The actual calculation requires Sia-UI to solve for tb_count in this equation:

allowance = (storage_per_tb_per_month * tb_count * months_per_contract) +
  (upload_per_tb * tb_count) +

This comment has been minimized.

Copy link

commented Jun 30, 2018

don't know how this slipped through for so many months, this is an easy fix. @eddiewang


This comment has been minimized.

Copy link

commented Jul 2, 2018

Thanks for the equation @mtlynch - i went ahead and implemented that into PR #800. Feel free to give it a glance to see if it makes sense. From my testing, the numbers look right.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.