(d=None)
| 84 | |
| 85 | |
| 86 | def get_exchange_rate_btc_to_usd(d=None): |
| 87 | from history.models import Price |
| 88 | if d is None: |
| 89 | d = datetime.datetime.now() |
| 90 | |
| 91 | exchange_pair = 'USDT_BTC' |
| 92 | latest_price = Price.objects.filter(symbol=exchange_pair, created_on__lt=d).order_by('-created_on').first() |
| 93 | return latest_price.price |
| 94 | |
| 95 | |
| 96 | def get_cost_basis(total_amount, symbol): |
no outgoing calls
no test coverage detected