давно крутиться идея фонда и заработка на коллективном интеллекте
собираемся все умные вместе, скидываемся по X баксиков или эфирчиков, дружно ищем прибыльные проекты, покупаем там перспективные монетки, потом на пике их продаем за эфирчики и выводим в наш криптофонд
делим между собой по такой схеме, прмиерный код
package main
import (
"fmt"
"math"
"math/rand"
"time"
)
func process_fat_accounts(accounts []float64, base float64) float64 {
ExcessSum := 0.0
for i, money := range accounts {
if money > base {
f := math.Pow(money/base, 1.3)
if money-f > base {
accounts[i] -= f
ExcessSum += f
}
}
}
return ExcessSum
}
func small_amount_limit(x float64) float64 {
if x > 10 {
x = 10
}
return x
}
func process_poor_accounts(accounts []float64, base float64, ExcessSum float64) float64 {
all_factors := 0.0
for _, money := range accounts {
if money < base {
all_factors += small_amount_limit(base / money)
}
}
amount_to_add := ExcessSum / all_factors
//fmt.Print("amount_to_add :", amount_to_add)
all_money := 0.0
//for i, money := range accounts {
for i := 0; i < len(accounts); i++ {
money := accounts[i]
if money < base {
f := small_amount_limit(base/money) * amount_to_add
accounts[i] += f
all_money += f
}
}
//fmt.Printf("all_money : %f \n", all_money)
return all_money
}
func arr_sum(accounts []float64) float64 {
base := 0.0
for _, item := range accounts {
base += item
}
return base
}
func main() {
accounts := make([]float64, 100000)
rand.Seed(time.Now().UTC().UnixNano())
for i := 0; i < len(accounts); i++ {
accounts[i] = rand.Float64() * 700
}
fmt.Println("after random init", accounts[5])
accounts[5] = 2000
base := arr_sum(accounts) / float64(len(accounts))
//multFactor := 2
fmt.Println("base :", base)
//один цикл в 8 часов, 3 цикла в день, 100 циклов в один месяц
prev := accounts[5]
for i := 1; i <= 10; i++ {
benefits := process_fat_accounts(accounts, base)
process_poor_accounts(accounts, base, benefits)
fmt.Printf("%d| баланс на 5ом счету %.2f diff %.2f \n", i, accounts[5], (accounts[5] - prev))
prev = accounts[5]
}
}