fix: need to divide by block time (blocks in a month)
This commit is contained in:
parent
20a273a0dd
commit
6edf872664
|
@ -25,6 +25,7 @@ import (
|
||||||
var _ cron.CronableService = (*PriceTracker)(nil)
|
var _ cron.CronableService = (*PriceTracker)(nil)
|
||||||
|
|
||||||
const usdSymbol = "usd"
|
const usdSymbol = "usd"
|
||||||
|
const blocksPerMonth = 30 * 144
|
||||||
|
|
||||||
type PriceTracker struct {
|
type PriceTracker struct {
|
||||||
config *config.Manager
|
config *config.Manager
|
||||||
|
@ -152,6 +153,7 @@ SELECT AVG(rate) as average_rate FROM (
|
||||||
maxStoragePrice := p.config.Config().Core.Storage.Sia.MaxStoragePrice
|
maxStoragePrice := p.config.Config().Core.Storage.Sia.MaxStoragePrice
|
||||||
maxStoragePrice = maxStoragePrice / redundancy.Redundancy()
|
maxStoragePrice = maxStoragePrice / redundancy.Redundancy()
|
||||||
maxStoragePrice = maxStoragePrice / units.TiB
|
maxStoragePrice = maxStoragePrice / units.TiB
|
||||||
|
maxStoragePrice = maxStoragePrice / blocksPerMonth
|
||||||
maxStoragePrice = maxStoragePrice / averageRate
|
maxStoragePrice = maxStoragePrice / averageRate
|
||||||
|
|
||||||
p.logger.Debug("Setting max storage price", zap.Float64("maxStoragePrice", maxStoragePrice))
|
p.logger.Debug("Setting max storage price", zap.Float64("maxStoragePrice", maxStoragePrice))
|
||||||
|
|
Loading…
Reference in New Issue