2022-05-29 14:03:17 +00:00
|
|
|
from __future__ import unicode_literals
|
|
|
|
from django.contrib.postgres.fields import ArrayField
|
|
|
|
from django.contrib.auth.models import User
|
|
|
|
from django.db import models
|
|
|
|
|
|
|
|
# Create your models here.
|
|
|
|
class Coin(models.Model):
|
|
|
|
name = models.CharField(max_length=4)
|
|
|
|
date = models.DateField()
|
|
|
|
priceusd = models.FloatField()
|
|
|
|
pricebtc = models.FloatField()
|
|
|
|
inflation = models.FloatField()
|
|
|
|
transactions = models.FloatField()
|
2022-06-13 01:28:59 +00:00
|
|
|
hashrate = models.FloatField(default="0")
|
|
|
|
stocktoflow = models.FloatField(default="0")
|
|
|
|
supply = models.FloatField(default="0")
|
2022-05-29 14:03:17 +00:00
|
|
|
fee = models.FloatField(default="0")
|
|
|
|
revenue = models.FloatField(default="0")
|
2022-06-13 01:28:59 +00:00
|
|
|
blocksize = models.FloatField(default="0")
|
|
|
|
difficulty = models.FloatField(default="0")
|
2022-05-29 14:03:17 +00:00
|
|
|
def __str__(self):
|
|
|
|
return self.priceusd
|
|
|
|
|
|
|
|
class Social(models.Model):
|
|
|
|
name = models.CharField(max_length=4)
|
|
|
|
date = models.DateField()
|
|
|
|
subscriberCount = models.IntegerField()
|
|
|
|
commentsPerHour = models.FloatField()
|
|
|
|
postsPerHour = models.FloatField()
|
|
|
|
|
|
|
|
def __str__(self):
|
|
|
|
return self.subscriberCount
|
|
|
|
|
|
|
|
class Dominance(models.Model):
|
|
|
|
name = models.CharField(max_length=4)
|
|
|
|
date = models.DateField()
|
|
|
|
dominance = models.FloatField()
|
|
|
|
|
|
|
|
def __str__(self):
|
|
|
|
return self.dominance
|
|
|
|
|
|
|
|
class Rank(models.Model):
|
|
|
|
name = models.CharField(max_length=4)
|
|
|
|
date = models.DateField()
|
|
|
|
rank = models.IntegerField()
|
|
|
|
|
|
|
|
def __str__(self):
|
2022-06-03 18:23:21 +00:00
|
|
|
return self.rank
|
|
|
|
|
|
|
|
class Sfmodel(models.Model):
|
|
|
|
date = models.DateField()
|
|
|
|
priceusd = models.FloatField()
|
2022-06-07 19:51:39 +00:00
|
|
|
pricebtc = models.FloatField()
|
2022-06-03 18:23:21 +00:00
|
|
|
color = models.FloatField()
|
|
|
|
stocktoflow = models.FloatField()
|
|
|
|
greyline = models.FloatField()
|
|
|
|
|
2022-06-05 18:36:57 +00:00
|
|
|
def __str__(self):
|
|
|
|
return self.date
|
|
|
|
|
|
|
|
class DailyData(models.Model):
|
2022-06-10 18:15:25 +00:00
|
|
|
# Date field
|
2022-06-05 18:36:57 +00:00
|
|
|
date = models.DateField()
|
2022-06-10 18:15:25 +00:00
|
|
|
|
|
|
|
# Basic information
|
|
|
|
btc_priceusd = models.FloatField()
|
2022-06-05 18:36:57 +00:00
|
|
|
xmr_priceusd = models.FloatField()
|
|
|
|
xmr_pricebtc = models.FloatField()
|
2022-06-10 18:15:25 +00:00
|
|
|
|
|
|
|
# Marketcap charts
|
|
|
|
btc_marketcap = models.FloatField()
|
|
|
|
xmr_marketcap = models.FloatField()
|
|
|
|
dash_marketcap = models.FloatField()
|
|
|
|
grin_marketcap = models.FloatField()
|
|
|
|
zcash_marketcap = models.FloatField()
|
|
|
|
|
|
|
|
# Transactions charts
|
|
|
|
xmr_transacpercentage = models.FloatField()
|
2022-06-13 01:28:59 +00:00
|
|
|
btc_transactions = models.FloatField()
|
2022-06-10 18:15:25 +00:00
|
|
|
xmr_transactions = models.FloatField()
|
2022-06-23 19:26:10 +00:00
|
|
|
zcash_transactions = models.FloatField()
|
|
|
|
dash_transactions = models.FloatField()
|
|
|
|
grin_transactions = models.FloatField()
|
2022-06-10 18:15:25 +00:00
|
|
|
btc_supply = models.IntegerField()
|
|
|
|
xmr_supply = models.IntegerField()
|
|
|
|
|
|
|
|
# Issuance charts
|
2022-06-05 18:36:57 +00:00
|
|
|
btc_inflation = models.FloatField()
|
|
|
|
xmr_inflation = models.FloatField()
|
|
|
|
dash_inflation = models.FloatField()
|
|
|
|
grin_inflation = models.FloatField()
|
|
|
|
zcash_inflation = models.FloatField()
|
2022-06-10 18:15:25 +00:00
|
|
|
xmr_metcalfebtc = models.FloatField()
|
|
|
|
xmr_metcalfeusd = models.FloatField()
|
2022-06-05 18:36:57 +00:00
|
|
|
btc_return = models.FloatField()
|
|
|
|
xmr_return = models.FloatField()
|
2022-06-10 18:15:25 +00:00
|
|
|
btc_emissionusd = models.FloatField()
|
|
|
|
btc_emissionntv = models.FloatField()
|
|
|
|
xmr_emissionusd = models.FloatField()
|
|
|
|
xmr_emissionntv = models.FloatField()
|
|
|
|
|
|
|
|
# Mining charts
|
2022-06-05 18:36:57 +00:00
|
|
|
btc_minerrevntv = models.FloatField()
|
|
|
|
xmr_minerrevntv = models.FloatField()
|
|
|
|
btc_minerrevusd = models.FloatField()
|
|
|
|
xmr_minerrevusd = models.FloatField()
|
|
|
|
btc_minerfeesntv = models.FloatField()
|
|
|
|
xmr_minerfeesntv = models.FloatField()
|
|
|
|
btc_minerfeesusd = models.FloatField()
|
|
|
|
xmr_minerfeesusd = models.FloatField()
|
|
|
|
btc_transcostntv = models.FloatField()
|
|
|
|
xmr_transcostntv = models.FloatField()
|
|
|
|
btc_transcostusd = models.FloatField()
|
|
|
|
xmr_transcostusd = models.FloatField()
|
2022-06-10 18:15:25 +00:00
|
|
|
xmr_minerrevcap = models.FloatField()
|
|
|
|
btc_minerrevcap = models.FloatField()
|
2022-06-05 18:36:57 +00:00
|
|
|
btc_commitntv = models.FloatField()
|
|
|
|
xmr_commitntv = models.FloatField()
|
|
|
|
btc_commitusd = models.FloatField()
|
|
|
|
xmr_commitusd = models.FloatField()
|
2022-06-13 01:28:59 +00:00
|
|
|
btc_blocksize = models.FloatField()
|
|
|
|
xmr_blocksize = models.FloatField()
|
|
|
|
btc_difficulty = models.FloatField()
|
|
|
|
xmr_difficulty = models.FloatField()
|
2022-06-10 18:15:25 +00:00
|
|
|
|
|
|
|
# Reddit charts
|
2022-06-08 20:23:10 +00:00
|
|
|
btc_subscriberCount = models.IntegerField()
|
|
|
|
btc_commentsPerHour = models.FloatField()
|
|
|
|
btc_postsPerHour = models.FloatField()
|
|
|
|
xmr_subscriberCount = models.IntegerField()
|
|
|
|
xmr_commentsPerHour = models.FloatField()
|
|
|
|
xmr_postsPerHour = models.FloatField()
|
|
|
|
crypto_subscriberCount = models.IntegerField()
|
|
|
|
crypto_commentsPerHour = models.FloatField()
|
|
|
|
crypto_postsPerHour = models.FloatField()
|
2022-06-05 18:36:57 +00:00
|
|
|
|
2022-08-08 19:05:59 +00:00
|
|
|
def __str__(self):
|
|
|
|
return self.date
|
|
|
|
|
|
|
|
class P2Pool(models.Model):
|
|
|
|
date = models.DateField()
|
|
|
|
hashrate = models.IntegerField()
|
|
|
|
percentage = models.FloatField()
|
|
|
|
miners = models.IntegerField()
|
|
|
|
totalhashes = models.IntegerField()
|
|
|
|
totalblocksfound = models.IntegerField()
|