simulated.py 文件源码

python
阅读 20 收藏 0 点赞 0 评论 0

项目:contracts 作者: DAB-Foundation 项目源码 文件源码
def to_discredit(self, sct):
        """
        used only after the activation of CDT contract
        convert SCT to DCT
        :param sct: amount of SCT to be converted
        :return: dct
        """
        # used only after the activation of CDT contract
        if not self.is_cdt_active:
            return
        # convert SCT to DCT minus 0.05 fee
        dct = sct * 0.95
        # calculate the cash price of CDT
        self.CDTP = self.CDTB / (self.CDTS * self.CDT_CRR)
        # log CDT contract according to switch
        if self.log == self.log_cdt or self.log == self.log_dpt_cdt:
            print('discredit:', sct, 'SCT','=>', dct, 'DCT')
        return dct
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号