VimŸUnDoх‰o‘з RЭSїЉ“ѓГ3Mž€>Š*G–hђпся-$;                "coin_short_name": coin.short_name.upper(),#YYYY^rTJ$_аџџџџ^ORѕѕ5_аџџџџ^ORѕ5_а
џџџџ^OUѕ	Kclass SupportMinerReport:5_а
џџџџ^OWѕ	K
class Report:5_аџџџџ^OrѕKѕK5_аџџџџ^OuѕP/            MineOSMiner.objects.select_related(5_аAџџџџ^OwѕPA            .filter(config__wallet__coin__short_name__in=["btc"])5_а	џџџџ^OzѕS                "status", "config", "config__wallet", "owner", "owner__userprofile"5_а
	џџџџ^O{ѕ
            )5_а	
3џџџџ^O|ѕN3            len(MineOSMiner.objects.select_related(5_а
$џџџџ^OѕN$            len(MineOSMiner.objects.5_а
џџџџ^O‚ѕN#            len(MineOSMiner.objects5_а
џџџџ^O‡ѕB        return len(SupportMiner.objects.filter(wallet__coin=coin))5_а
џџџџ^O‹ѕM from django.db.models import Sumfrom decimal import Decimal0from coinmine.devices.models import SupportMiner<from coinmine.balance_adjustment.models.credit import Credit,from coinmine.user.models import UserProfile.from coinmine.worker.utils import ServiceUtilsclass BTCModeReport:3    def __init__(self, accumulated_period_seconds):#        self.service = ServiceUtilsD        self.accumulated_period_seconds = accumulated_period_seconds&    def _get_miners_count(self, coin):&        return len(MineOSMiner.objects             .exclude(owner=None)B            .filter(config__wallet__coin__short_name__in=["btc"]))'    def _get_total_credits(self, coin):        return (T            Credit.objects.filter(coin=coin, support_miner__isnull=False).aggregate(/                Sum("amount_in_smallest_units").            )["amount_in_smallest_units__sum"]            or Decimal(0)        ) * coin.smallest_unit+    def _get_total_credits_usd(self, coin):=        return self._get_total_credits(coin) * coin.usd_value&    def _get_coin_per_day(self, coin):         return coin.coin_per_day%    def _get_usd_per_day(self, coin):1        return coin.coin_per_day * coin.usd_value@    def _get_tier_rates(self, coin, accumulated_period_seconds):         rate = coin.coin_per_day        result = {}0        for fee in UserProfile.USER_FEE_CHOICES:            fee_id = fee[0]            fee_rate = fee[1]3            fee_name = UserProfile.fee_name(fee_id)T            units_earned_per_second = self.service.adjusted_units_earned_per_second(2                rate, coin.smallest_unit, fee_rate
            )O            units_earned = units_earned_per_second * accumulated_period_seconds@            coin_earned = self.service.smallest_unit_to_decimal(0                units_earned, coin.smallest_unit
            )5            usd_earned = coin_earned * coin.usd_value             result[fee_name] = {%                "fee_rate": fee_rate,+                "coin_earned": coin_earned,)                "usd_earned": usd_earned,
            }        return result    def generate(self, coins):G        report = {"accounting_period": self.accumulated_period_seconds}        for coin in coins:!            report[coin.name] = {<                "miner_count": self._get_miners_count(coin),,                "usd_value": coin.usd_value,3                "coin_short_name": coin.short_name,?                "total_credits": self._get_total_credits(coin),G                "total_credits_usd": self._get_total_credits_usd(coin),=                "coin_per_day": self._get_coin_per_day(coin),;                "usd_per_day": self._get_usd_per_day(coin),3                "tier_rates": self._get_tier_rates(9                    coin, self.accumulated_period_seconds                ),
            }        return report5_а0џџџџ^O˜ѕO0from coinmine.devices.models import SupportMiner5_аџџџџ^OЄѕOfrom coinmine.5_а%џџџџ^OГѕO3from coinmine.mineosminer.models imoprt MineOSMiner5_а$џџџџ^OЗѕO4from coinmine.mineosminer.models imoport MineOSMiner5_а<џџџџ^OМѕO<                config__wallet__coin__short_name__in=["btc"]5_аџџџџ
 V
^O<	ѕ+    def _get_total_credits_usd(self, coin):=        return self._get_total_credits(coin) * coin.usd_value5_аDџџџџDEV^OL
ѕCD?                "total_credits": self._get_total_credits(coin),G                "total_credits_usd": self._get_total_credits_usd(coin),5_а%џџџџDDV^OЌѕ$&J         rate = coin.coin_per_day5_а%џџџџDDV^Oѕ%'K        ѕ%'J5_а&џџџџEEV^O;ѕ%&        smallest_units = 5_а1џџџџDDV^Oѕ
J3    def __init__(self, accumulated_period_seconds):5_а
CџџџџDDV^Oѕ
K        ѕ
J5_а)џџџџEEV^O$ѕKѕK5_аџџџџFFV^O'ѕL*        self.btc_usd_value = btc_usd_value5_аџџџџFFV^O'ѕL!        self.btc_ = btc_usd_value5_а %џџџџFFV^O,ѕL.        self.btc_smallest_unit = btc_usd_value5_а! 2џџџџFFV^O-ѕL;        self.btc_smallest_unit = btc_smallest_unitusd_value5_а "!0џџџџFFV^Owѕ/1L2                rate, coin.smallest_unit, fee_rate5_а!#"0џџџџFFV^Oxѕ/1L                 rate, , fee_rate5_а"$#4џџџџFFV^Oѕ35L0                units_earned, coin.smallest_unit5_а#%$4џџџџFFV^Oѕ35L                units_earned, 5_а$&%6'џџџџFFV^O”ѕ57L5            usd_earned = coin_earned * coin.usd_value5_а%'&6&џџџџFFV^O”
ѕ57L'            usd_earned = coin_earned * 5_а&('!џџџџFFV^O ѕ "L         return coin.coin_per_day5_а')(џџџџV^O %ѕ'    def _get_total_credits(self, coin):        return (T            Credit.objects.filter(coin=coin, support_miner__isnull=False).aggregate(/                Sum("amount_in_smallest_units").            )["amount_in_smallest_units__sum"]            or Decimal(0)        ) * coin.smallest_unit5_а(*)џџџџV^O &ѕ5_а)+*џџџџV^O -ѕ from django.db.models import Sumfrom decimal import Decimal5_а*,+џџџџV^O /ѕ<from coinmine.balance_adjustment.models.credit import Credit5_а+-,: џџџџV^PUѕ9;@=                "coin_per_day": self._get_coin_per_day(coin),5_а,.-:!џџџџV^PVѕ9;@'                "coin_per_day": (coin),5_а-0.:%џџџџV^PXѕ9;@&                "coin_per_day": coin),5_а.1/0;џџџџV^Peѕ:<@;                "usd_per_day": self._get_usd_per_day(coin),ѕ;<@5_а021;AџџџџV^Pfѕ:<@]                "usd_per_day": coin.coin_per_day * coin.usd_valueself._get_usd_per_day(coin),5_а132џџџџV^Pjѕ&    def _get_coin_per_day(self, coin):        return coin.btc_per_day%    def _get_usd_per_day(self, coin):1        return coin.coin_per_day * coin.usd_value5_а243џџџџV^Plѕ5_а354,џџџџ,:V^P lѕ+,    def generate(self, coins):G        report = {"accounting_period": self.accumulated_period_seconds}        for coin in coins:!            report[coin.name] = {<                "miner_count": self._get_miners_count(coin),,                "usd_value": coin.usd_value,3                "coin_short_name": coin.short_name,2                "coin_per_day": coin.coin_per_day,B                "usd_per_day": coin.coin_per_day * coin.usd_value,3                "tier_rates": self._get_tier_rates(9                    coin, self.accumulated_period_seconds                ),
            }        return report5_а465џџџџ,,V^P oѕ+ѕ+5_а576)џџџџ*)v)^P"(ѕ:2                "coin_per_day": coin.coin_per_day,5_а687(џџџџ*)v)^P";ѕ:B                "usd_per_day": coin.coin_per_day * coin.usd_value,5_а7982џџџџ*)v)^P"Eѕ:A                "usd_per_day": coin.btc_per_day * coin.usd_value,5_а8:92џџџџ*)v)^P"Eѕ:2                "usd_per_day": coin.btc_per_day * 5_а9<:Dџџџџ*)v)^P"Lѕ:D                "usd_per_day": coin.btc_per_day * self.btc_usd_value5_а:=;<#"џџџџ3&39v9^P& ѕ"$:@    def _get_tier_rates(self, coin, accumulated_period_seconds):5_а<>=#+џџџџ3&39v9^P&"ѕ"$:H    def _get_tier_rates(self, coin_per_day, accumulated_period_seconds):5_а=?>#Nџџџџ3&39v9^P&/ѕ:3from coinmine.mineosminer.models import MineOSMiner,from coinmine.user.models import UserProfile.from coinmine.worker.utils import ServiceUtilsclass BTCModeReport:U    def __init__(self, accumulated_period_seconds, btc_usd_value, btc_smallest_unit):#        self.service = ServiceUtilsD        self.accumulated_period_seconds = accumulated_period_seconds*        self.btc_usd_value = btc_usd_value2        self.btc_smallest_unit = btc_smallest_unit    def generate(self, coins):G        report = {"accounting_period": self.accumulated_period_seconds}        for coin in coins:!            report[coin.name] = {<                "miner_count": self._get_miners_count(coin),,                "usd_value": coin.usd_value,3                "coin_short_name": coin.short_name,1                "coin_per_day": coin.btc_per_day,E                "usd_per_day": coin.btc_per_day * self.btc_usd_value,3                "tier_rates": self._get_tier_rates(9                    coin, self.accumulated_period_seconds                ),
            }        return report&    def _get_miners_count(self, coin):        return len(;            MineOSMiner.objects.exclude(owner=None).filter(X                config__wallet__coin__short_name__in=["btc"], config__btc_mode_coin=coin
            )	        )l    def _get_tier_rates(self, coin_per_day, coin_smallest_unit, coin_usd_value, accumulated_period_seconds):        rate = coin.btc_per_day        result = {}0        for fee in UserProfile.USER_FEE_CHOICES:            fee_id = fee[0]            fee_rate = fee[1]3            fee_name = UserProfile.fee_name(fee_id)T            units_earned_per_second = self.service.adjusted_units_earned_per_second(6                rate, self.btc_smallest_unit, fee_rate
            )O            units_earned = units_earned_per_second * accumulated_period_seconds@            coin_earned = self.service.smallest_unit_to_decimal(4                units_earned, self.btc_smallest_unit
            )9            usd_earned = coin_earned * self.btc_usd_value             result[fee_name] = {%                "fee_rate": fee_rate,+                "coin_earned": coin_earned,)                "usd_earned": usd_earned,
            }        return result5_а>@?*џџџџ&9v9^P&:ѕ)*        rate = coin.btc_per_day5_а?A@2џџџџ&9v9^P&<ѕ13?6                rate, self.btc_smallest_unit, fee_rate5_а@BA2џџџџ&9v9^P&Aѕ13?>                coin_per_day, self.btc_smallest_unit, fee_rate5_аACB2џџџџ&9v9^P&Bѕ13?(                coin_per_day, , fee_rate5_аBDC6џџџџ&9v9^P&Kѕ57?4                units_earned, self.btc_smallest_unit5_аCGD6џџџџ&9v9^P&Lѕ57?                units_earned, 5_аDHEG8'џџџџ&9v9^P&Zѕ79?9            usd_earned = coin_earned * self.btc_usd_value5_аGIH8'џџџџ&9v9^P&Zѕ79?'            usd_earned = coin_earned * 5_аHJI"џџџџ"?V^P&kѕ!"    def _get_tier_rates(
        self,        coin_per_day,        coin_smallest_unit,        coin_usd_value,#        accumulated_period_seconds,    ):        result = {}0        for fee in UserProfile.USER_FEE_CHOICES:            fee_id = fee[0]            fee_rate = fee[1]3            fee_name = UserProfile.fee_name(fee_id)T            units_earned_per_second = self.service.adjusted_units_earned_per_second(:                coin_per_day, coin_smallest_unit, fee_rate
            )O            units_earned = units_earned_per_second * accumulated_period_seconds@            coin_earned = self.service.smallest_unit_to_decimal(0                units_earned, coin_smallest_unit
Vim�UnDo�]�Vԉ����ɬ	��t��(X����^j�\�!^P&g_�����^P��5�_�����^P��    �5�_�����^P��9    def _get_tier_rates(self, accumulated_period_seconds)5�_�G����^P��G    def _get_tier_rates(self, coin_per_day, accumulated_period_seconds)5�_�*����^P��H    def _get_tier_rates(self, coin_per_day, accumulated_period_seconds):5�_�!����^P���5�_�����^P��class BaseReport:@    def _get_tier_rates(self, coin, accumulated_period_seconds):%        rate = self.coin.coin_per_day        result = {}0        for fee in UserProfile.USER_FEE_CHOICES:            fee_id = fee[0]            fee_rate = fee[1]3            fee_name = UserProfile.fee_name(fee_id)T            units_earned_per_second = self.service.adjusted_units_earned_per_second(7                rate, self.coin.smallest_unit, fee_rate
            )O            units_earned = units_earned_per_second * accumulated_period_seconds@            coin_earned = self.service.smallest_unit_to_decimal(5                units_earned, self.coin.smallest_unit
            ):            usd_earned = coin_earned * self.coin.usd_value             result[fee_name] = {%                "fee_rate": fee_rate,+                "coin_earned": coin_earned,)                "usd_earned": usd_earned,
            }        return result5�_�	����^P��%        rate = self.coin.coin_per_day5�_�
	����^P��
7                rate, self.coin.smallest_unit, fee_rate5�_�	
'����^P��:            usd_earned = coin_earned * self.coin.usd_value5�_�
����^P��5                units_earned, self.coin.smallest_unit5�_�
����^P���5�_�
����^P��5�_�
����^P��,from coinmine.user.models import UserProfileclass BaseReport:@    def _get_tier_rates(self, coin, accumulated_period_seconds):         rate = coin.coin_per_day        result = {}0        for fee in UserProfile.USER_FEE_CHOICES:            fee_id = fee[0]            fee_rate = fee[1]3            fee_name = UserProfile.fee_name(fee_id)T            units_earned_per_second = self.service.adjusted_units_earned_per_second(2                rate, coin.smallest_unit, fee_rate
            )O            units_earned = units_earned_per_second * accumulated_period_seconds@            coin_earned = self.service.smallest_unit_to_decimal(0                units_earned, coin.smallest_unit
            )5            usd_earned = coin_earned * coin.usd_value             result[fee_name] = {%                "fee_rate": fee_rate,+                "coin_earned": coin_earned,)                "usd_earned": usd_earned,
            }        return result5�_�����'5v<^P&b�"�5�_�"����"9V^P&f�!"@    def _get_tier_rates(self, coin, accumulated_period_seconds):         rate = coin.coin_per_day        result = {}0        for fee in UserProfile.USER_FEE_CHOICES:            fee_id = fee[0]            fee_rate = fee[1]3            fee_name = UserProfile.fee_name(fee_id)T            units_earned_per_second = self.service.adjusted_units_earned_per_second(2                rate, coin.smallest_unit, fee_rate
            )O            units_earned = units_earned_per_second * accumulated_period_seconds@            coin_earned = self.service.smallest_unit_to_decimal(0                units_earned, coin.smallest_unit
            )5            usd_earned = coin_earned * coin.usd_value             result[fee_name] = {%                "fee_rate": fee_rate,+                "coin_earned": coin_earned,)                "usd_earned": usd_earned,
            }        return result5��