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
评论列表
文章目录