added 6 new charts, block size

This commit is contained in:
anon 2022-06-12 22:28:59 -03:00
parent 1e2a00e8c1
commit b7437249f9
10 changed files with 2107 additions and 20 deletions

View file

@ -11,11 +11,13 @@ class Coin(models.Model):
pricebtc = models.FloatField()
inflation = models.FloatField()
transactions = models.FloatField()
hashrate = models.FloatField()
stocktoflow = models.FloatField()
supply = models.FloatField()
hashrate = models.FloatField(default="0")
stocktoflow = models.FloatField(default="0")
supply = models.FloatField(default="0")
fee = models.FloatField(default="0")
revenue = models.FloatField(default="0")
blocksize = models.FloatField(default="0")
difficulty = models.FloatField(default="0")
def __str__(self):
return self.priceusd
@ -74,6 +76,7 @@ class DailyData(models.Model):
# Transactions charts
xmr_transacpercentage = models.FloatField()
btc_transactions = models.FloatField()
xmr_transactions = models.FloatField()
btc_supply = models.IntegerField()
xmr_supply = models.IntegerField()
@ -112,6 +115,10 @@ class DailyData(models.Model):
xmr_commitntv = models.FloatField()
btc_commitusd = models.FloatField()
xmr_commitusd = models.FloatField()
btc_blocksize = models.FloatField()
xmr_blocksize = models.FloatField()
btc_difficulty = models.FloatField()
xmr_difficulty = models.FloatField()
# Reddit charts
btc_subscriberCount = models.IntegerField()

View file

@ -110,7 +110,7 @@
<a class="nav-link collapsed" href="#" data-toggle="collapse" data-target="#collapsePrice"
aria-expanded="true" aria-controls="collapsePrice">
<i class="fas fa-dollar-sign"></i>
<span>Price (14)</span>
<span>Price (15)</span>
</a>
<div id="collapsePrice" class="collapse" aria-labelledby="headingPrice"
data-parent="#accordionSidebar">
@ -123,7 +123,8 @@
<a class="collapse-item" href="{% url 'monerojnet:inflationfractal' %}">Inflation-Adjusted
Fractal</a>
<a class="collapse-item" href="{% url 'monerojnet:golden' %}">Golden Ratio Multiplier</a>
<a class="collapse-item" href="{% url 'monerojnet:competitors' %}">Performance ($)</a>
<a class="collapse-item" href="{% url 'monerojnet:competitors' %}">Performance ($, Log.)</a>
<a class="collapse-item" href="{% url 'monerojnet:competitorslin' %}">Performance ($, Lin.)</a>
<a class="collapse-item" href="{% url 'monerojnet:competitorssats' %}">Performance (Sats, Log.)</a>
<a class="collapse-item" href="{% url 'monerojnet:competitorssatslin' %}">Performance (Sats, Lin.)</a>
<a class="collapse-item" href="{% url 'monerojnet:inflationreturn' %}">Return vs. Inflation</a>
@ -219,7 +220,7 @@
<a class="nav-link collapsed" href="#" data-toggle="collapse" data-target="#collapseMining"
aria-expanded="true" aria-controls="collapseMining">
<i class="fas fa-calculator"></i>
<span>Mining (10)</span>
<span>Mining (14)</span>
</a>
<div id="collapseMining" class="collapse" aria-labelledby="headingMining"
data-parent="#accordionSidebar">
@ -235,6 +236,10 @@
<a class="collapse-item" href="{% url 'monerojnet:minerrevcap' %}">Revenue / Marketcap (%)</a>
<a class="collapse-item" href="{% url 'monerojnet:commit' %}">Miner Commitment ($)</a>
<a class="collapse-item" href="{% url 'monerojnet:commitntv' %}">Miner Commitment (Ntv.)</a>
<a class="collapse-item" href="{% url 'monerojnet:blocksize' %}">Block Size (Bytes)</a>
<a class="collapse-item" href="{% url 'monerojnet:blockchainsize' %}">Blockchain Size (Bytes)</a>
<a class="collapse-item" href="{% url 'monerojnet:transactionsize' %}">Transaction Size (Bytes)</a>
<a class="collapse-item" href="{% url 'monerojnet:difficulty' %}">Mining Difficulty</a>
</div>
</div>
</li>

View file

@ -0,0 +1,342 @@
{% extends 'monerojnet/base.html' %}
{% block content %}
<!-- Content Wrapper -->
<div id="content-wrapper" style="background-color:rgb(48, 44, 41)">
<!-- Main Content -->
<div id="content">
<!-- Begin Page Content -->
<div class="container-fluid"><br>
<div class="row">
<div class="col-xl-12 col-lg-12">
<div class="card" id="graph1">
<div
class="card-header py-3 d-flex flex-row align-items-center justify-content-between text-white">
<h6 class="m-0 text-light">Total Blockchain Size for Monero and Bitcoin (Bytes)</h6>
<div class="dropdown no-arrow">
<a class="dropdown-toggle" href="#" role="button"
onclick="$('#graph1').toggleClass('fullscreen');window.dispatchEvent(new Event('resize'));">
<i class="fas fa-arrows-alt fa-sm fa-fw text-gray-400"></i>
</a>
</div>
</div>
<div class="card-body pb-0 pt-0 pl-0 pr-0" style="height: 100px;">
<div id="graph" style="height: 100%; width:100%;"></div>
</div>
</div>
<br>
</div>
</div>
<!-- Content Row -->
<div class="row">
<!-- Earnings (Monthly) Card Example -->
<div class="col-xl-6 col-md-6 mb-4">
<div class="card border-left-new h-100 py-2">
<div class="card-body">
<div class="row no-gutters align-items-center">
<div class="col mr-2">
<div class="text-xs font-weight-bold text-info text-uppercase mb-1">
Current Monero Blockchain Size</div>
<div class="h5 mb-0 font-weight-bold text-gray-800">{{ now_xmr }}</div>
</div>
<div class="col-auto">
<i class="fab fa-monero fa-2x text-gray-300"></i>
</div>
</div>
</div>
</div>
</div>
<!-- Earnings (Monthly) Card Example -->
<div class="col-xl-6 col-md-6 mb-4">
<div class="card border-left-new h-100 py-2">
<div class="card-body">
<div class="row no-gutters align-items-center">
<div class="col mr-2">
<div class="text-xs font-weight-bold text-info text-uppercase mb-1">
Current Bitcoin Blockchain Size</div>
<div class="h5 mb-0 font-weight-bold text-gray-800">{{ now_btc }}</div>
</div>
<div class="col-auto">
<i class="fab fa-bitcoin fa-2x text-gray-300"></i>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- Content Row -->
<div class="row">
<div class="col-xl-11 col-md-6 mb-4">
<div class="alert alert-dark" role="alert">
Not financial advice.
For information about the chart, click the button >
</div>
</div>
<div class="col-xl-1">
<button type="button" class="btn btn-dark btn-block" data-toggle="modal" href="#"
data-target="#id_Modal">
<div class="col-auto">
<i class="fa fa-info-circle fa-2x "></i>
</div>
</button>
</div>
</div>
</div>
<!-- /.container-fluid -->
</div>
<!-- End of Main Content -->
</div>
<!-- End of Content Wrapper -->
<!-- Modal -->
<div class="modal fade" id="id_Modal" tabindex="-1" role="dialog" aria-labelledby="Modal" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="Modal">Help about the chart</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Cancelar">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
This chart shows the average space in disc that the whole blockchain of Bitcoin and Monero ocupy. <br>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
<!-- Fim do Modal -->
<!-- Page level plugins -->
<script>
var data3 = {
type: "scatter",
mode: "lines",
name: 'Bitcoin Blockchain Size',
x: {{ dates|safe }},
y: {{ btc_blocksize|safe }},
line: {
color: '#ffd311'
,width: 2
}
};
var data3_mobile = {
type: "scatter",
mode: "lines",
name: 'Bitcoin Blockchain Size',
x: {{ dates|safe }},
y: {{ btc_blocksize|safe }},
line: {
color: '#ffd311'
,width: 2
}
};
var data2 = {
type: "scatter",
mode: "lines",
name: 'Monero Blockchain Size',
x: {{ dates|safe }},
y: {{ xmr_blocksize|safe }},
line: {
color: '#dd1d1d'
,width: 2
}
};
var data2_mobile = {
type: "scatter",
mode: "lines",
name: 'Monero Blockchain Size',
x: {{ dates|safe }},
y: {{ xmr_blocksize|safe }},
line: {
color: '#dd1d1d'
,width: 2
}
};
var data = [data3, data2];
var data_mobile = [data3_mobile, data2_mobile];
var layout = {
plot_bgcolor:"#252221",
paper_bgcolor:"#252221",
annotations: [
{
xref: 'paper',
yref: 'paper',
x: 1,
xanchor: 'auto',
y: 0.6,
yanchor: 'auto',
text: 'Moneroj<br>https://www.moneroj.net',
showarrow: false,
borderwidth: 1,
bordercolor: '#5f5f5f',
bgcolor: '#333333',
borderpad: 5,
align: 'center',
font: {
color: "white",
size: 12
}
}],
separators: ",.",
legend: {
x: 1,
y: 0.95,
bgcolor: '#333333',
bordercolor: '#5f5f5f',
borderwidth: 1,
font: {
color: 'white',
size: 12
},
traceorder: 'normal',
xanchor: 'auto',
yanchor: 'auto'
},
hoverlabel: {
namelength: -1
},
yaxis: {
type: "log",
title: {
text: 'Transaction Size (Bytes)',
font: {
size: 20,
color: 'white'
}
},
tickformat :",.0f"
,nticks: 10
,tickfont: {
color: "#ffffff"
,size: 12
}
,gridcolor: "#333333"
},
xaxis: {
hoverformat: "%Y-%m-%d",
showgrid: true,
type: 'date',
nticks: 10
,tickfont: {
color: "#dddddd"
,size: 13
}
,gridcolor: "#333333"
,range: ['2009-01-01', '2026-01-01']
,zeroline: true
},
margin: {
l: 120,
r: 60,
b: 35,
t: 10,
pad: 4
}
};
var layout_mobile = {
plot_bgcolor:"black",
paper_bgcolor:"black",
separators: ",.",
hoverlabel: {
namelength: -1
},
legend: {
x: 0.98,
y: 0.05,
bgcolor: '#000000',
bordercolor: '#5f5f5f',
borderwidth: 1,
font: {
color: 'white',
size: 5
},
traceorder: 'normal',
xanchor: 'auto',
yanchor: 'auto'
},
showlegend: false,
yaxis: {
type: "log",
tickformat :",.0f"
,nticks: 10
,tickfont: {
color: "#ffffff"
,size: 7
}
,gridcolor: "#444444"
},
xaxis: {
hoverformat: "%Y",
showgrid: true,
type: 'date',
nticks: 10
,tickfont: {
color: "#dddddd"
,size: 7
}
,gridcolor: "#444444"
,range: ['2009-01-01', '2026-01-01']
,zeroline: true
},
margin: {
l: 40,
r: 0,
b: 35,
t: 10,
pad: 0
}
};
function findBootstrapEnvironment() {
let envs = ['xs', 'sm', 'md', 'lg', 'xl'];
let el = document.createElement('div');
document.body.appendChild(el);
let curEnv = envs.shift();
for (let env of envs.reverse()) {
el.classList.add(`d-${env}-none`);
if (window.getComputedStyle(el).display === 'none') {
curEnv = env;
break;
}
}
document.body.removeChild(el);
return curEnv;
}
env_size = findBootstrapEnvironment();
if (env_size == "xs") {
document.getElementById("graph1").style.height="350px";
Plotly.newPlot('graph', data_mobile, layout_mobile, {responsive: true, modeBarButtonsToRemove: ['toImage', 'hoverCompareCartesian', 'hoverClosest2d', 'toggleSpikelines', 'lasso2d', 'select2d', 'hoverClosestCartesian'], displaylogo: false});
}
else {
document.getElementById("graph1").style.height="700px";
Plotly.newPlot('graph', data, layout, {responsive: true, modeBarButtonsToRemove: ['toImage', 'hoverCompareCartesian', 'hoverClosest2d', 'toggleSpikelines', 'lasso2d', 'select2d', 'hoverClosestCartesian'], displaylogo: false});
}
</script>
{% endblock %}

View file

@ -0,0 +1,343 @@
{% extends 'monerojnet/base.html' %}
{% block content %}
<!-- Content Wrapper -->
<div id="content-wrapper" style="background-color:rgb(48, 44, 41)">
<!-- Main Content -->
<div id="content">
<!-- Begin Page Content -->
<div class="container-fluid"><br>
<div class="row">
<div class="col-xl-12 col-lg-12">
<div class="card" id="graph1">
<div
class="card-header py-3 d-flex flex-row align-items-center justify-content-between text-white">
<h6 class="m-0 text-light">Average Block Size for both Monero and Bitcoin (Bytes)</h6>
<div class="dropdown no-arrow">
<a class="dropdown-toggle" href="#" role="button"
onclick="$('#graph1').toggleClass('fullscreen');window.dispatchEvent(new Event('resize'));">
<i class="fas fa-arrows-alt fa-sm fa-fw text-gray-400"></i>
</a>
</div>
</div>
<div class="card-body pb-0 pt-0 pl-0 pr-0" style="height: 100px;">
<div id="graph" style="height: 100%; width:100%;"></div>
</div>
</div>
<br>
</div>
</div>
<!-- Content Row -->
<div class="row">
<!-- Earnings (Monthly) Card Example -->
<div class="col-xl-6 col-md-6 mb-4">
<div class="card border-left-new h-100 py-2">
<div class="card-body">
<div class="row no-gutters align-items-center">
<div class="col mr-2">
<div class="text-xs font-weight-bold text-info text-uppercase mb-1">
Current Monero Average Block Size</div>
<div class="h5 mb-0 font-weight-bold text-gray-800">{{ now_xmr }}</div>
</div>
<div class="col-auto">
<i class="fab fa-monero fa-2x text-gray-300"></i>
</div>
</div>
</div>
</div>
</div>
<!-- Earnings (Monthly) Card Example -->
<div class="col-xl-6 col-md-6 mb-4">
<div class="card border-left-new h-100 py-2">
<div class="card-body">
<div class="row no-gutters align-items-center">
<div class="col mr-2">
<div class="text-xs font-weight-bold text-info text-uppercase mb-1">
Current Bitcoin Average Block Size</div>
<div class="h5 mb-0 font-weight-bold text-gray-800">{{ now_btc }}</div>
</div>
<div class="col-auto">
<i class="fab fa-bitcoin fa-2x text-gray-300"></i>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- Content Row -->
<div class="row">
<div class="col-xl-11 col-md-6 mb-4">
<div class="alert alert-dark" role="alert">
Not financial advice.
For information about the chart, click the button >
</div>
</div>
<div class="col-xl-1">
<button type="button" class="btn btn-dark btn-block" data-toggle="modal" href="#"
data-target="#id_Modal">
<div class="col-auto">
<i class="fa fa-info-circle fa-2x "></i>
</div>
</button>
</div>
</div>
</div>
<!-- /.container-fluid -->
</div>
<!-- End of Main Content -->
</div>
<!-- End of Content Wrapper -->
<!-- Modal -->
<div class="modal fade" id="id_Modal" tabindex="-1" role="dialog" aria-labelledby="Modal" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="Modal">Help about the chart</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Cancelar">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
This chart shows the average space in disc that each block ocupies daily for both Bitcoin and Monero. To obtain the total disc space used daily,
you have to multiply by the number of blocks each day. <br>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
<!-- Fim do Modal -->
<!-- Page level plugins -->
<script>
var data3 = {
type: "scatter",
mode: "lines",
name: 'Bitcoin Block Size',
x: {{ dates|safe }},
y: {{ btc_blocksize|safe }},
line: {
color: '#ffd311'
,width: 2
}
};
var data3_mobile = {
type: "scatter",
mode: "lines",
name: 'Bitcoin Block Size',
x: {{ dates|safe }},
y: {{ btc_blocksize|safe }},
line: {
color: '#ffd311'
,width: 2
}
};
var data2 = {
type: "scatter",
mode: "lines",
name: 'Monero Block Size',
x: {{ dates|safe }},
y: {{ xmr_blocksize|safe }},
line: {
color: '#dd1d1d'
,width: 2
}
};
var data2_mobile = {
type: "scatter",
mode: "lines",
name: 'Monero Block Size',
x: {{ dates|safe }},
y: {{ xmr_blocksize|safe }},
line: {
color: '#dd1d1d'
,width: 2
}
};
var data = [data3, data2];
var data_mobile = [data3_mobile, data2_mobile];
var layout = {
plot_bgcolor:"#252221",
paper_bgcolor:"#252221",
annotations: [
{
xref: 'paper',
yref: 'paper',
x: 1,
xanchor: 'auto',
y: 0.6,
yanchor: 'auto',
text: 'Moneroj<br>https://www.moneroj.net',
showarrow: false,
borderwidth: 1,
bordercolor: '#5f5f5f',
bgcolor: '#333333',
borderpad: 5,
align: 'center',
font: {
color: "white",
size: 12
}
}],
separators: ",.",
legend: {
x: 1,
y: 0.95,
bgcolor: '#333333',
bordercolor: '#5f5f5f',
borderwidth: 1,
font: {
color: 'white',
size: 12
},
traceorder: 'normal',
xanchor: 'auto',
yanchor: 'auto'
},
hoverlabel: {
namelength: -1
},
yaxis: {
type: "log",
title: {
text: 'Average Block Size (Bytes)',
font: {
size: 20,
color: 'white'
}
},
tickformat :",.2f"
,nticks: 10
,tickfont: {
color: "#ffffff"
,size: 12
}
,gridcolor: "#333333"
},
xaxis: {
hoverformat: "%Y-%m-%d",
showgrid: true,
type: 'date',
nticks: 10
,tickfont: {
color: "#dddddd"
,size: 13
}
,gridcolor: "#333333"
,range: ['2009-01-01', '2026-01-01']
,zeroline: true
},
margin: {
l: 120,
r: 60,
b: 35,
t: 10,
pad: 4
}
};
var layout_mobile = {
plot_bgcolor:"black",
paper_bgcolor:"black",
separators: ",.",
hoverlabel: {
namelength: -1
},
legend: {
x: 0.98,
y: 0.05,
bgcolor: '#000000',
bordercolor: '#5f5f5f',
borderwidth: 1,
font: {
color: 'white',
size: 5
},
traceorder: 'normal',
xanchor: 'auto',
yanchor: 'auto'
},
showlegend: false,
yaxis: {
type: "log",
tickformat :",.2f"
,nticks: 10
,tickfont: {
color: "#ffffff"
,size: 7
}
,gridcolor: "#444444"
},
xaxis: {
hoverformat: "%Y",
showgrid: true,
type: 'date',
nticks: 10
,tickfont: {
color: "#dddddd"
,size: 7
}
,gridcolor: "#444444"
,range: ['2009-01-01', '2026-01-01']
,zeroline: true
},
margin: {
l: 40,
r: 0,
b: 35,
t: 10,
pad: 0
}
};
function findBootstrapEnvironment() {
let envs = ['xs', 'sm', 'md', 'lg', 'xl'];
let el = document.createElement('div');
document.body.appendChild(el);
let curEnv = envs.shift();
for (let env of envs.reverse()) {
el.classList.add(`d-${env}-none`);
if (window.getComputedStyle(el).display === 'none') {
curEnv = env;
break;
}
}
document.body.removeChild(el);
return curEnv;
}
env_size = findBootstrapEnvironment();
if (env_size == "xs") {
document.getElementById("graph1").style.height="350px";
Plotly.newPlot('graph', data_mobile, layout_mobile, {responsive: true, modeBarButtonsToRemove: ['toImage', 'hoverCompareCartesian', 'hoverClosest2d', 'toggleSpikelines', 'lasso2d', 'select2d', 'hoverClosestCartesian'], displaylogo: false});
}
else {
document.getElementById("graph1").style.height="700px";
Plotly.newPlot('graph', data, layout, {responsive: true, modeBarButtonsToRemove: ['toImage', 'hoverCompareCartesian', 'hoverClosest2d', 'toggleSpikelines', 'lasso2d', 'select2d', 'hoverClosestCartesian'], displaylogo: false});
}
</script>
{% endblock %}

View file

@ -14,7 +14,7 @@
<div class="card" id="graph1">
<div
class="card-header py-3 d-flex flex-row align-items-center justify-content-between text-white">
<h6 class="m-0 text-light">Competitor Performance</h6>
<h6 class="m-0 text-light">Competitor Performance (Log Scale)</h6>
<div class="dropdown no-arrow">
<a class="dropdown-toggle" href="#" role="button"
onclick="$('#graph1').toggleClass('fullscreen');window.dispatchEvent(new Event('resize'));">
@ -30,7 +30,6 @@
</div>
</div>
<!-- Content Row -->
<div class="row">

View file

@ -0,0 +1,427 @@
{% extends 'monerojnet/base.html' %}
{% block content %}
<!-- Content Wrapper -->
<div id="content-wrapper" style="background-color:rgb(48, 44, 41)">
<!-- Main Content -->
<div id="content">
<!-- Begin Page Content -->
<div class="container-fluid"><br>
<div class="row">
<div class="col-xl-12 col-lg-12">
<div class="card" id="graph1">
<div
class="card-header py-3 d-flex flex-row align-items-center justify-content-between text-white">
<h6 class="m-0 text-light">Competitor Performance (Linear Scale)</h6>
<div class="dropdown no-arrow">
<a class="dropdown-toggle" href="#" role="button"
onclick="$('#graph1').toggleClass('fullscreen');window.dispatchEvent(new Event('resize'));">
<i class="fas fa-arrows-alt fa-sm fa-fw text-gray-400"></i>
</a>
</div>
</div>
<div class="card-body pb-0 pt-0 pl-0 pr-0" style="height: 100px;">
<div id="graph" style="height: 100%; width:100%;"></div>
</div>
</div>
<br>
</div>
</div>
<!-- Content Row -->
<div class="row">
<!-- Earnings (Monthly) Card Example -->
<div class="col-xl-3 col-md-6 mb-4">
<div class="card border-left-new h-100 py-2">
<div class="card-body">
<div class="row no-gutters align-items-center">
<div class="col mr-2">
<div class="text-xs font-weight-bold text-info text-uppercase mb-1">
Monero's Return on Capital</div>
<div class="h5 mb-0 font-weight-bold text-gray-800">{{ now_xmr }}</div>
</div>
<div class="col-auto">
<i class="fab fa-monero fa-2x text-gray-300"></i>
</div>
</div>
</div>
</div>
</div>
<!-- Earnings (Monthly) Card Example -->
<div class="col-xl-3 col-md-6 mb-4">
<div class="card border-left-new h-100 py-2">
<div class="card-body">
<div class="row no-gutters align-items-center">
<div class="col mr-2">
<div class="text-xs font-weight-bold text-info text-uppercase mb-1">
Dash's Return on Capital</div>
<div class="h5 mb-0 font-weight-bold text-gray-800">{{ now_dash }}</div>
</div>
<div class="col-auto">
<i class="fa fa-bomb fa-2x text-gray-300"></i>
</div>
</div>
</div>
</div>
</div>
<!-- Earnings (Monthly) Card Example -->
<div class="col-xl-3 col-md-6 mb-4">
<div class="card border-left-new h-100 py-2">
<div class="card-body">
<div class="row no-gutters align-items-center">
<div class="col mr-2">
<div class="text-xs font-weight-bold text-info text-uppercase mb-1">
Grin's Return on Capital</div>
<div class="h5 mb-0 font-weight-bold text-gray-800">{{ now_grin }}</div>
</div>
<div class="col-auto">
<i class="fa fa-bomb fa-2x text-gray-300"></i>
</div>
</div>
</div>
</div>
</div>
<!-- Earnings (Monthly) Card Example -->
<div class="col-xl-3 col-md-6 mb-4">
<div class="card border-left-new h-100 py-2">
<div class="card-body">
<div class="row no-gutters align-items-center">
<div class="col mr-2">
<div class="text-xs font-weight-bold text-info text-uppercase mb-1">
Zcash's Return on Capital</div>
<div class="h5 mb-0 font-weight-bold text-gray-800">{{ now_zcash }}</div>
</div>
<div class="col-auto">
<i class="fa fa-bomb fa-2x text-gray-300"></i>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- Content Row -->
<div class="row">
<div class="col-xl-11 col-md-6 mb-4">
<div class="alert alert-dark" role="alert">
Not financial advice.
For information about the chart, click the button >
</div>
</div>
<div class="col-xl-1">
<button type="button" class="btn btn-dark btn-block" data-toggle="modal" href="#"
data-target="#id_Modal">
<div class="col-auto">
<i class="fa fa-info-circle fa-2x "></i>
</div>
</button>
</div>
</div>
</div>
<!-- /.container-fluid -->
</div>
<!-- End of Main Content -->
</div>
<!-- End of Content Wrapper -->
<!-- Modal -->
<div class="modal fade" id="id_Modal" tabindex="-1" role="dialog" aria-labelledby="Modal" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="Modal">Help about the chart</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Cancelar">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
This chart shows the comparison between Monero's most important competitors. It shows their return as a
multiplication of the price on their respective first top.
This chart shows clearly that the coin with the lowest inflation is the one that protects most the
purchasing power of its holders. In this case, since Monero's Inflation
is way lower than its competitors, it takes the cake as the best coin (or, in other words, the one that
made people most for their money).<br>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
<!-- Fim do Modal -->
<!-- Page level plugins -->
<script>
var data3 = {
type: "scatter",
mode: "lines",
name: 'Dash Return On Capital',
x: {{ dates|safe }},
y: {{ dash|safe }},
line: {
color: '#2f21f7'
,width: 2
}
};
var data3_mobile = {
type: "scatter",
mode: "lines",
name: 'Dash Return On Capital',
x: {{ dates|safe }},
y: {{ dash|safe }},
line: {
color: '#2f21f7'
,width: 2
}
};
var data1 = {
type: "scatter",
mode: "lines",
name: 'Grin Return On Capital',
x: {{ dates|safe }},
y: {{ grin|safe }},
line: {
color: '#dcdf30'
,width: 2
}
};
var data1_mobile = {
type: "scatter",
mode: "lines",
name: 'Grin Return On Capital',
x: {{ dates|safe }},
y: {{ grin|safe }},
line: {
color: '#dcdf30'
,width: 2
}
};
var data4 = {
type: "scatter",
mode: "lines",
name: 'Zcash Return On Capital',
x: {{ dates|safe }},
y: {{ zcash|safe }},
line: {
color: '#ffb6a0'
,width: 2
}
};
var data4_mobile = {
type: "scatter",
mode: "lines",
name: 'Zcash Return On Capital',
x: {{ dates|safe }},
y: {{ zcash|safe }},
line: {
color: '#ffb6a0'
,width: 2
}
};
var data2 = {
type: "scatter",
mode: "lines",
name: 'Monero Return On Capital',
x: {{ dates|safe }},
y: {{ xmr|safe }},
line: {
color: '#dd1d1d'
,width: 2
}
};
var data2_mobile = {
type: "scatter",
mode: "lines",
name: 'Monero Return On Capital',
x: {{ dates|safe }},
y: {{ xmr|safe }},
line: {
color: '#dd1d1d'
,width: 2
}
};
var data = [data3, data2, data1, data4];
var data_mobile = [data3_mobile, data2_mobile, data1_mobile, data4_mobile];
var layout = {
plot_bgcolor:"#252221",
paper_bgcolor:"#252221",
annotations: [
{
xref: 'paper',
yref: 'paper',
x: 0.02,
xanchor: 'auto',
y: 0.50,
yanchor: 'auto',
text: 'Moneroj<br>https://www.moneroj.net',
showarrow: false,
borderwidth: 1,
bordercolor: '#5f5f5f',
bgcolor: '#333333',
borderpad: 5,
align: 'center',
font: {
color: "white",
size: 12
}
}],
separators: ",.",
legend: {
x: 0.02,
y: 0.98,
bgcolor: '#333333',
bordercolor: '#5f5f5f',
borderwidth: 1,
font: {
color: 'white',
size: 12
},
traceorder: 'normal',
xanchor: 'auto',
yanchor: 'auto'
},
hoverlabel: {
namelength: -1
},
yaxis: {
type: "linear",
title: {
text: 'Multiple from first top',
font: {
size: 20,
color: 'white'
}
},
tickformat :",.2f"
,nticks: 10
,tickfont: {
color: "#ffffff"
,size: 12
}
,gridcolor: "#333333"
},
xaxis: {
hoverformat: ",.0f",
showgrid: true,
type: 'number',
nticks: 10
,tickfont: {
color: "#dddddd"
,size: 13
}
,gridcolor: "#333333"
,range: ['1', '3200']
,zeroline: true
},
margin: {
l: 120,
r: 60,
b: 35,
t: 10,
pad: 4
}
};
var layout_mobile = {
plot_bgcolor:"black",
paper_bgcolor:"black",
separators: ",.",
hoverlabel: {
namelength: -1
},
legend: {
x: 0.02,
y: 0.98,
bgcolor: '#000000',
bordercolor: '#5f5f5f',
borderwidth: 1,
font: {
color: 'white',
size: 5
},
traceorder: 'normal',
xanchor: 'auto',
yanchor: 'auto'
},
showlegend: false,
yaxis: {
type: "linear",
tickformat :",.0f"
,nticks: 10
,tickfont: {
color: "#ffffff"
,size: 7
}
,gridcolor: "#444444"
},
xaxis: {
hoverformat: ",.0f",
showgrid: true,
type: 'number',
nticks: 10
,tickfont: {
color: "#dddddd"
,size: 7
}
,gridcolor: "#444444"
,range: ['1', '3200']
,zeroline: true
},
margin: {
l: 40,
r: 0,
b: 35,
t: 10,
pad: 0
}
};
function findBootstrapEnvironment() {
let envs = ['xs', 'sm', 'md', 'lg', 'xl'];
let el = document.createElement('div');
document.body.appendChild(el);
let curEnv = envs.shift();
for (let env of envs.reverse()) {
el.classList.add(`d-${env}-none`);
if (window.getComputedStyle(el).display === 'none') {
curEnv = env;
break;
}
}
document.body.removeChild(el);
return curEnv;
}
env_size = findBootstrapEnvironment();
if (env_size == "xs") {
document.getElementById("graph1").style.height="350px";
Plotly.newPlot('graph', data_mobile, layout_mobile, {responsive: true, modeBarButtonsToRemove: ['toImage', 'hoverCompareCartesian', 'hoverClosest2d', 'toggleSpikelines', 'lasso2d', 'select2d', 'hoverClosestCartesian'], displaylogo: false});
}
else {
document.getElementById("graph1").style.height="700px";
Plotly.newPlot('graph', data, layout, {responsive: true, modeBarButtonsToRemove: ['toImage', 'hoverCompareCartesian', 'hoverClosest2d', 'toggleSpikelines', 'lasso2d', 'select2d', 'hoverClosestCartesian'], displaylogo: false});
}
</script>
{% endblock %}

View file

@ -0,0 +1,342 @@
{% extends 'monerojnet/base.html' %}
{% block content %}
<!-- Content Wrapper -->
<div id="content-wrapper" style="background-color:rgb(48, 44, 41)">
<!-- Main Content -->
<div id="content">
<!-- Begin Page Content -->
<div class="container-fluid"><br>
<div class="row">
<div class="col-xl-12 col-lg-12">
<div class="card" id="graph1">
<div
class="card-header py-3 d-flex flex-row align-items-center justify-content-between text-white">
<h6 class="m-0 text-light">Mining Difficulty</h6>
<div class="dropdown no-arrow">
<a class="dropdown-toggle" href="#" role="button"
onclick="$('#graph1').toggleClass('fullscreen');window.dispatchEvent(new Event('resize'));">
<i class="fas fa-arrows-alt fa-sm fa-fw text-gray-400"></i>
</a>
</div>
</div>
<div class="card-body pb-0 pt-0 pl-0 pr-0" style="height: 100px;">
<div id="graph" style="height: 100%; width:100%;"></div>
</div>
</div>
<br>
</div>
</div>
<!-- Content Row -->
<div class="row">
<!-- Earnings (Monthly) Card Example -->
<div class="col-xl-6 col-md-6 mb-4">
<div class="card border-left-new h-100 py-2">
<div class="card-body">
<div class="row no-gutters align-items-center">
<div class="col mr-2">
<div class="text-xs font-weight-bold text-info text-uppercase mb-1">
Monero Mining Difficulty</div>
<div class="h5 mb-0 font-weight-bold text-gray-800">{{ now_xmr }}</div>
</div>
<div class="col-auto">
<i class="fab fa-monero fa-2x text-gray-300"></i>
</div>
</div>
</div>
</div>
</div>
<!-- Earnings (Monthly) Card Example -->
<div class="col-xl-6 col-md-6 mb-4">
<div class="card border-left-new h-100 py-2">
<div class="card-body">
<div class="row no-gutters align-items-center">
<div class="col mr-2">
<div class="text-xs font-weight-bold text-info text-uppercase mb-1">
Bitcoin Mining Difficulty</div>
<div class="h5 mb-0 font-weight-bold text-gray-800">{{ now_btc }}</div>
</div>
<div class="col-auto">
<i class="fab fa-bitcoin fa-2x text-gray-300"></i>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- Content Row -->
<div class="row">
<div class="col-xl-11 col-md-6 mb-4">
<div class="alert alert-dark" role="alert">
Not financial advice.
For information about the chart, click the button >
</div>
</div>
<div class="col-xl-1">
<button type="button" class="btn btn-dark btn-block" data-toggle="modal" href="#"
data-target="#id_Modal">
<div class="col-auto">
<i class="fa fa-info-circle fa-2x "></i>
</div>
</button>
</div>
</div>
</div>
<!-- /.container-fluid -->
</div>
<!-- End of Main Content -->
</div>
<!-- End of Content Wrapper -->
<!-- Modal -->
<div class="modal fade" id="id_Modal" tabindex="-1" role="dialog" aria-labelledby="Modal" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="Modal">Help about the chart</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Cancelar">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
This chart shows the current mining difficulty for both Monero and Bitcoin. They are not directly comparable.<br>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
<!-- Fim do Modal -->
<!-- Page level plugins -->
<script>
var data3 = {
type: "scatter",
mode: "lines",
name: 'Bitcoin Mining Difficulty',
x: {{ dates|safe }},
y: {{ btc_difficulty|safe }},
line: {
color: '#ffd311'
,width: 2
}
};
var data3_mobile = {
type: "scatter",
mode: "lines",
name: 'Bitcoin Mining Difficulty',
x: {{ dates|safe }},
y: {{ btc_difficulty|safe }},
line: {
color: '#ffd311'
,width: 2
}
};
var data2 = {
type: "scatter",
mode: "lines",
name: 'Monero Mining Difficulty',
x: {{ dates|safe }},
y: {{ xmr_difficulty|safe }},
line: {
color: '#dd1d1d'
,width: 2
}
};
var data2_mobile = {
type: "scatter",
mode: "lines",
name: 'Monero Mining Difficulty',
x: {{ dates|safe }},
y: {{ xmr_difficulty|safe }},
line: {
color: '#dd1d1d'
,width: 2
}
};
var data = [data3, data2];
var data_mobile = [data3_mobile, data2_mobile];
var layout = {
plot_bgcolor:"#252221",
paper_bgcolor:"#252221",
annotations: [
{
xref: 'paper',
yref: 'paper',
x: 1,
xanchor: 'auto',
y: 0.6,
yanchor: 'auto',
text: 'Moneroj<br>https://www.moneroj.net',
showarrow: false,
borderwidth: 1,
bordercolor: '#5f5f5f',
bgcolor: '#333333',
borderpad: 5,
align: 'center',
font: {
color: "white",
size: 12
}
}],
separators: ",.",
legend: {
x: 1,
y: 0.95,
bgcolor: '#333333',
bordercolor: '#5f5f5f',
borderwidth: 1,
font: {
color: 'white',
size: 12
},
traceorder: 'normal',
xanchor: 'auto',
yanchor: 'auto'
},
hoverlabel: {
namelength: -1
},
yaxis: {
type: "log",
title: {
text: 'Mining Difficulty',
font: {
size: 20,
color: 'white'
}
},
tickformat :",.0f"
,nticks: 10
,tickfont: {
color: "#ffffff"
,size: 12
}
,gridcolor: "#333333"
},
xaxis: {
hoverformat: "%Y-%m-%d",
showgrid: true,
type: 'date',
nticks: 10
,tickfont: {
color: "#dddddd"
,size: 13
}
,gridcolor: "#333333"
,range: ['2009-01-01', '2026-01-01']
,zeroline: true
},
margin: {
l: 120,
r: 60,
b: 35,
t: 10,
pad: 4
}
};
var layout_mobile = {
plot_bgcolor:"black",
paper_bgcolor:"black",
separators: ",.",
hoverlabel: {
namelength: -1
},
legend: {
x: 0.98,
y: 0.05,
bgcolor: '#000000',
bordercolor: '#5f5f5f',
borderwidth: 1,
font: {
color: 'white',
size: 5
},
traceorder: 'normal',
xanchor: 'auto',
yanchor: 'auto'
},
showlegend: false,
yaxis: {
type: "log",
tickformat :",.0f"
,nticks: 10
,tickfont: {
color: "#ffffff"
,size: 7
}
,gridcolor: "#444444"
},
xaxis: {
hoverformat: "%Y",
showgrid: true,
type: 'date',
nticks: 10
,tickfont: {
color: "#dddddd"
,size: 7
}
,gridcolor: "#444444"
,range: ['2009-01-01', '2026-01-01']
,zeroline: true
},
margin: {
l: 40,
r: 0,
b: 35,
t: 10,
pad: 0
}
};
function findBootstrapEnvironment() {
let envs = ['xs', 'sm', 'md', 'lg', 'xl'];
let el = document.createElement('div');
document.body.appendChild(el);
let curEnv = envs.shift();
for (let env of envs.reverse()) {
el.classList.add(`d-${env}-none`);
if (window.getComputedStyle(el).display === 'none') {
curEnv = env;
break;
}
}
document.body.removeChild(el);
return curEnv;
}
env_size = findBootstrapEnvironment();
if (env_size == "xs") {
document.getElementById("graph1").style.height="350px";
Plotly.newPlot('graph', data_mobile, layout_mobile, {responsive: true, modeBarButtonsToRemove: ['toImage', 'hoverCompareCartesian', 'hoverClosest2d', 'toggleSpikelines', 'lasso2d', 'select2d', 'hoverClosestCartesian'], displaylogo: false});
}
else {
document.getElementById("graph1").style.height="700px";
Plotly.newPlot('graph', data, layout, {responsive: true, modeBarButtonsToRemove: ['toImage', 'hoverCompareCartesian', 'hoverClosest2d', 'toggleSpikelines', 'lasso2d', 'select2d', 'hoverClosestCartesian'], displaylogo: false});
}
</script>
{% endblock %}

View file

@ -0,0 +1,343 @@
{% extends 'monerojnet/base.html' %}
{% block content %}
<!-- Content Wrapper -->
<div id="content-wrapper" style="background-color:rgb(48, 44, 41)">
<!-- Main Content -->
<div id="content">
<!-- Begin Page Content -->
<div class="container-fluid"><br>
<div class="row">
<div class="col-xl-12 col-lg-12">
<div class="card" id="graph1">
<div
class="card-header py-3 d-flex flex-row align-items-center justify-content-between text-white">
<h6 class="m-0 text-light">Average Transaction Size for both Monero and Bitcoin (Bytes)</h6>
<div class="dropdown no-arrow">
<a class="dropdown-toggle" href="#" role="button"
onclick="$('#graph1').toggleClass('fullscreen');window.dispatchEvent(new Event('resize'));">
<i class="fas fa-arrows-alt fa-sm fa-fw text-gray-400"></i>
</a>
</div>
</div>
<div class="card-body pb-0 pt-0 pl-0 pr-0" style="height: 100px;">
<div id="graph" style="height: 100%; width:100%;"></div>
</div>
</div>
<br>
</div>
</div>
<!-- Content Row -->
<div class="row">
<!-- Earnings (Monthly) Card Example -->
<div class="col-xl-6 col-md-6 mb-4">
<div class="card border-left-new h-100 py-2">
<div class="card-body">
<div class="row no-gutters align-items-center">
<div class="col mr-2">
<div class="text-xs font-weight-bold text-info text-uppercase mb-1">
Current Monero Average Transaction Size</div>
<div class="h5 mb-0 font-weight-bold text-gray-800">{{ now_xmr }}</div>
</div>
<div class="col-auto">
<i class="fab fa-monero fa-2x text-gray-300"></i>
</div>
</div>
</div>
</div>
</div>
<!-- Earnings (Monthly) Card Example -->
<div class="col-xl-6 col-md-6 mb-4">
<div class="card border-left-new h-100 py-2">
<div class="card-body">
<div class="row no-gutters align-items-center">
<div class="col mr-2">
<div class="text-xs font-weight-bold text-info text-uppercase mb-1">
Current Bitcoin Average Transaction Size</div>
<div class="h5 mb-0 font-weight-bold text-gray-800">{{ now_btc }}</div>
</div>
<div class="col-auto">
<i class="fab fa-bitcoin fa-2x text-gray-300"></i>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- Content Row -->
<div class="row">
<div class="col-xl-11 col-md-6 mb-4">
<div class="alert alert-dark" role="alert">
Not financial advice.
For information about the chart, click the button >
</div>
</div>
<div class="col-xl-1">
<button type="button" class="btn btn-dark btn-block" data-toggle="modal" href="#"
data-target="#id_Modal">
<div class="col-auto">
<i class="fa fa-info-circle fa-2x "></i>
</div>
</button>
</div>
</div>
</div>
<!-- /.container-fluid -->
</div>
<!-- End of Main Content -->
</div>
<!-- End of Content Wrapper -->
<!-- Modal -->
<div class="modal fade" id="id_Modal" tabindex="-1" role="dialog" aria-labelledby="Modal" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="Modal">Help about the chart</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Cancelar">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
This chart shows the average space in disc that transaction ocupies on average for both Bitcoin and Monero. To obtain the total disc space used daily,
you have to multiply this number by the daily transaction count. <br>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
<!-- Fim do Modal -->
<!-- Page level plugins -->
<script>
var data3 = {
type: "scatter",
mode: "lines",
name: 'Bitcoin Transaction Size',
x: {{ dates|safe }},
y: {{ btc_blocksize|safe }},
line: {
color: '#ffd311'
,width: 2
}
};
var data3_mobile = {
type: "scatter",
mode: "lines",
name: 'Bitcoin Transaction Size',
x: {{ dates|safe }},
y: {{ btc_blocksize|safe }},
line: {
color: '#ffd311'
,width: 2
}
};
var data2 = {
type: "scatter",
mode: "lines",
name: 'Monero Transaction Size',
x: {{ dates|safe }},
y: {{ xmr_blocksize|safe }},
line: {
color: '#dd1d1d'
,width: 2
}
};
var data2_mobile = {
type: "scatter",
mode: "lines",
name: 'Monero Transaction Size',
x: {{ dates|safe }},
y: {{ xmr_blocksize|safe }},
line: {
color: '#dd1d1d'
,width: 2
}
};
var data = [data3, data2];
var data_mobile = [data3_mobile, data2_mobile];
var layout = {
plot_bgcolor:"#252221",
paper_bgcolor:"#252221",
annotations: [
{
xref: 'paper',
yref: 'paper',
x: 1,
xanchor: 'auto',
y: 0.6,
yanchor: 'auto',
text: 'Moneroj<br>https://www.moneroj.net',
showarrow: false,
borderwidth: 1,
bordercolor: '#5f5f5f',
bgcolor: '#333333',
borderpad: 5,
align: 'center',
font: {
color: "white",
size: 12
}
}],
separators: ",.",
legend: {
x: 1,
y: 0.95,
bgcolor: '#333333',
bordercolor: '#5f5f5f',
borderwidth: 1,
font: {
color: 'white',
size: 12
},
traceorder: 'normal',
xanchor: 'auto',
yanchor: 'auto'
},
hoverlabel: {
namelength: -1
},
yaxis: {
type: "log",
title: {
text: 'Transaction Size (Bytes)',
font: {
size: 20,
color: 'white'
}
},
tickformat :",.2f"
,nticks: 10
,tickfont: {
color: "#ffffff"
,size: 12
}
,gridcolor: "#333333"
},
xaxis: {
hoverformat: "%Y-%m-%d",
showgrid: true,
type: 'date',
nticks: 10
,tickfont: {
color: "#dddddd"
,size: 13
}
,gridcolor: "#333333"
,range: ['2009-01-01', '2026-01-01']
,zeroline: true
},
margin: {
l: 120,
r: 60,
b: 35,
t: 10,
pad: 4
}
};
var layout_mobile = {
plot_bgcolor:"black",
paper_bgcolor:"black",
separators: ",.",
hoverlabel: {
namelength: -1
},
legend: {
x: 0.98,
y: 0.05,
bgcolor: '#000000',
bordercolor: '#5f5f5f',
borderwidth: 1,
font: {
color: 'white',
size: 5
},
traceorder: 'normal',
xanchor: 'auto',
yanchor: 'auto'
},
showlegend: false,
yaxis: {
type: "log",
tickformat :",.2f"
,nticks: 10
,tickfont: {
color: "#ffffff"
,size: 7
}
,gridcolor: "#444444"
},
xaxis: {
hoverformat: "%Y",
showgrid: true,
type: 'date',
nticks: 10
,tickfont: {
color: "#dddddd"
,size: 7
}
,gridcolor: "#444444"
,range: ['2009-01-01', '2026-01-01']
,zeroline: true
},
margin: {
l: 40,
r: 0,
b: 35,
t: 10,
pad: 0
}
};
function findBootstrapEnvironment() {
let envs = ['xs', 'sm', 'md', 'lg', 'xl'];
let el = document.createElement('div');
document.body.appendChild(el);
let curEnv = envs.shift();
for (let env of envs.reverse()) {
el.classList.add(`d-${env}-none`);
if (window.getComputedStyle(el).display === 'none') {
curEnv = env;
break;
}
}
document.body.removeChild(el);
return curEnv;
}
env_size = findBootstrapEnvironment();
if (env_size == "xs") {
document.getElementById("graph1").style.height="350px";
Plotly.newPlot('graph', data_mobile, layout_mobile, {responsive: true, modeBarButtonsToRemove: ['toImage', 'hoverCompareCartesian', 'hoverClosest2d', 'toggleSpikelines', 'lasso2d', 'select2d', 'hoverClosestCartesian'], displaylogo: false});
}
else {
document.getElementById("graph1").style.height="700px";
Plotly.newPlot('graph', data, layout, {responsive: true, modeBarButtonsToRemove: ['toImage', 'hoverCompareCartesian', 'hoverClosest2d', 'toggleSpikelines', 'lasso2d', 'select2d', 'hoverClosestCartesian'], displaylogo: false});
}
</script>
{% endblock %}

View file

@ -14,6 +14,7 @@ urlpatterns = [
path('fractal/', views.fractal, name='fractal'),
path('golden/', views.golden, name='golden'),
path('competitors/', views.competitors, name='competitors'),
path('competitorslin/', views.competitorslin, name='competitorslin'),
path('competitorssats/', views.competitorssats, name='competitorssats'),
path('competitorssatslin/', views.competitorssatslin, name='competitorssatslin'),
path('translin/', views.translin, name='translin'),
@ -74,6 +75,10 @@ urlpatterns = [
path('privacymarketcap/', views.privacymarketcap, name='privacymarketcap'),
path('privacydominance/', views.privacydominance, name='privacydominance'),
path('monerodominance/', views.monerodominance, name='monerodominance'),
path('blocksize/', views.blocksize, name='blocksize'),
path('transactionsize/', views.transactionsize, name='transactionsize'),
path('blockchainsize/', views.blockchainsize, name='blockchainsize'),
path('difficulty/', views.difficulty, name='difficulty'),
# URLs to useful functions on monerojnet/views.py
# Only admins can use these

View file

@ -38,6 +38,18 @@ api = PushshiftAPI()
def get_history(request, symbol, start_time=None, end_time=None):
update = True
count = 0
priceusd = 0
inflation = 0
pricebtc = 0
stocktoflow = 0
supply = 0
fee = 0
revenue = 0
hashrate = 0
transactions = 0
blocksize = 0
difficulty = 0
with open("settings.json") as file:
data = json.load(file)
file.close()
@ -64,38 +76,58 @@ def get_history(request, symbol, start_time=None, end_time=None):
coin.date = day
try:
coin.priceusd = float(item['PriceUSD'])
priceusd = coin.priceusd
except:
coin.priceusd = 0
coin.priceusd = priceusd
try:
coin.pricebtc = float(item['PriceBTC'])
pricebtc = coin.pricebtc
except:
coin.pricebtc = 0
coin.pricebtc = pricebtc
try:
coin.inflation = float(item['IssContPctAnn'])
coin.stocktoflow = (100/coin.inflation)**1.65
inflation = coin.inflation
stocktoflow = coin.stocktoflow
except:
coin.inflation = 0
coin.stocktoflow = 0
coin.inflation = inflation
coin.stocktoflow = stocktoflow
try:
coin.supply = float(item['SplyCur'])
supply = coin.supply
except:
coin.supply = 0
coin.supply = supply
try:
coin.fee = float(item['FeeTotNtv'])
fee = coin.fee
except:
coin.fee = 0
coin.fee = fee
try:
coin.revenue = float(item['RevNtv'])
revenue = coin.revenue
except:
coin.revenue = 0
coin.revenue = revenue
try:
coin.hashrate = float(item['HashRate'])
hashrate = coin.hashrate
except:
coin.hashrate = 0
coin.hashrate = hashrate
try:
coin.transactions = float(item['TxCnt'])
transactions = coin.transactions
except:
coin.transactions = 0
coin.transactions = transactions
try:
coin.blocksize = float(item['BlkSizeMeanByte'])
blocksize = coin.blocksize
except:
coin.blocksize = blocksize
try:
coin.difficulty = float(item['DiffLast'])
difficulty = coin.difficulty
except:
coin.difficulty = difficulty
coin.save()
count += 1
print(str(symbol) + ' ' + str(coin.date))
@ -351,6 +383,18 @@ def populate_database(request):
data = DailyData()
data.date = datetime.datetime.strftime(coin_btc.date, '%Y-%m-%d')
if coin_btc.blocksize > 0:
data.btc_blocksize = coin_btc.blocksize
data.btc_transactions = coin_btc.transactions
else:
data.btc_blocksize = 0
data.btc_transactions = 0
if coin_btc.difficulty > 0:
data.btc_difficulty = coin_btc.difficulty
else:
data.btc_difficulty = 0
if coin_btc.transactions == 0:
data.btc_transcostusd = 0
data.btc_transcostntv = 0
@ -418,6 +462,17 @@ def populate_database(request):
coins_xmr = Coin.objects.filter(name='xmr').filter(date=coin_btc.date)
if coins_xmr:
for coin_xmr in coins_xmr:
if coin_xmr.blocksize > 0:
data.xmr_blocksize = coin_xmr.blocksize
else:
data.xmr_blocksize = 0
if coin_xmr.difficulty > 0:
data.xmr_difficulty = coin_xmr.difficulty
else:
data.xmr_difficulty = 0
if coin_xmr.priceusd < 0.001:
data.xmr_pricebtc = 0
data.xmr_priceusd = 0
@ -522,6 +577,8 @@ def populate_database(request):
data.xmr_marketcap = 0
data.xmr_minerrevcap = 0
data.xmr_transactions = 0
data.xmr_blocksize = 0
data.xmr_difficulty = 0
coins_dash = Coin.objects.filter(name='dash').filter(date=coin_btc.date)
if coins_dash:
@ -562,6 +619,8 @@ def populate_database(request):
data.xmr_transacpercentage = 0
data.xmr_minerrevcap = 0
data.xmr_transactions = 0
data.xmr_blocksize = 0
data.xmr_difficulty = 0
if count_aux > 2800:
coins_zcash = Coin.objects.filter(name='zec').filter(date=coin_btc.date)
@ -943,7 +1002,7 @@ def update_database(date_from=None, date_to=None):
data.pricebtc = coin_xmr.pricebtc
if data.priceusd == 0:
data.priceusd = coin_xmr.priceusd
if data.stocktoflow == 0:
if data.stocktoflow == 0 and coin_xmr.supply > 0:
supply = int(coin_xmr.supply)*10**12
reward = (2**64 -1 - supply) >> 19
if reward < 0.6*(10**12):
@ -1083,8 +1142,8 @@ def update_database(date_from=None, date_to=None):
try:
data.btc_commitntv = coin_btc.hashrate/(coin_btc.revenue)
data.xmr_commitntv = coin_xmr.hashrate/(coin_xmr.revenue)
data.btc_commitusd = coin_btc.priceusd*coin_btc.hashrate/(coin_btc.revenue)
data.xmr_commitusd = coin_xmr.priceusd*coin_xmr.hashrate/(coin_xmr.revenue)
data.btc_commitusd = coin_btc.hashrate/(coin_btc.revenue*coin_btc.priceusd)
data.xmr_commitusd = coin_xmr.hashrate/(coin_xmr.revenue*coin_xmr.priceusd)
except:
pass
# Reddit charts
@ -2084,6 +2143,83 @@ def competitors(request):
'now_dash': now_dash, 'now_grin': now_grin, 'now_zcash': now_zcash, 'dates': dates}
return render(request, 'monerojnet/competitors.html', context)
def competitorslin(request):
dt = datetime.datetime.now(timezone.utc).timestamp()
dates = []
xmr = []
dash = []
grin = []
zcash = []
count = 0
now_xmr = 0
now_dash = 0
now_grin = 0
now_zcash = 0
count = 0
coins_xmr = Coin.objects.order_by('date').filter(name='xmr')
for coin_xmr in coins_xmr:
if coin_xmr.priceusd:
if count > 30:
xmr.append(coin_xmr.priceusd/5.01)
now_xmr = coin_xmr.priceusd/5.01
dates.append(count)
count += 1
elif count <= 63:
continue
else:
xmr.append('')
count = 0
coins_dash = Coin.objects.order_by('date').filter(name='dash')
for coin_dash in coins_dash:
count += 1
if coin_dash.priceusd and count > 130:
dash.append(coin_dash.priceusd/14.7)
now_dash = coin_dash.priceusd/14.7
elif count <= 130:
continue
else:
dash.append('')
dates.append(count)
count = 0
coins_grin = Coin.objects.order_by('date').filter(name='grin')
for coin_grin in coins_grin:
count += 1
if coin_grin.priceusd and count > 155:
grin.append(coin_grin.priceusd/6.37)
now_grin = coin_grin.priceusd/6.37
elif count <= 155:
continue
else:
grin.append('')
dates.append(count)
count = 0
coins_zcash = Coin.objects.order_by('date').filter(name='zec')
for coin_zcash in coins_zcash:
count += 1
if coin_zcash.priceusd and count > 434:
zcash.append(coin_zcash.priceusd/750)
now_zcash = coin_zcash.priceusd/750
elif count <= 434:
continue
else:
zcash.append('')
dates.append(count)
now_dash = locale.format('%.2f', now_dash, grouping=True)
now_grin = locale.format('%.2f', now_grin, grouping=True)
now_zcash = locale.format('%.2f', now_zcash, grouping=True)
now_xmr = locale.format('%.2f', now_xmr, grouping=True)
dt = 'competitorslin.html ' + locale.format('%.2f', datetime.datetime.now(timezone.utc).timestamp() - dt, grouping=True)+' seconds'
print(dt)
context = {'xmr': xmr, 'dash': dash, 'grin': grin, 'zcash': zcash, 'now_xmr': now_xmr,
'now_dash': now_dash, 'now_grin': now_grin, 'now_zcash': now_zcash, 'dates': dates}
return render(request, 'monerojnet/competitorslin.html', context)
def marketcap(request):
dt = datetime.datetime.now(timezone.utc).timestamp()
data = DailyData.objects.order_by('date')
@ -2841,6 +2977,144 @@ def inflation(request):
context = {'inflationxmr': inflationxmr, 'inflationbtc': inflationbtc, 'finflationxmr': finflationxmr, 'finflationbtc': finflationbtc, 'now_xmr': now_xmr, 'now_btc': now_btc, 'dates': dates}
return render(request, 'monerojnet/inflation.html', context)
def blocksize(request):
dt = datetime.datetime.now(timezone.utc).timestamp()
data = DailyData.objects.order_by('date')
xmr_blocksize = []
btc_blocksize = []
dates = []
now_xmr = 0
now_btc = 0
for item in data:
dates.append(datetime.datetime.strftime(item.date, '%Y-%m-%d'))
if item.btc_blocksize > 0.001:
btc_blocksize.append(item.btc_blocksize/1024)
now_btc = item.btc_blocksize
else:
btc_blocksize.append('')
if item.xmr_blocksize > 0.001:
xmr_blocksize.append(item.xmr_blocksize/1024)
now_xmr = item.xmr_blocksize
else:
xmr_blocksize.append('')
now_btc = locale.format('%.2f', now_btc, grouping=True) + ' bytes'
now_xmr = locale.format('%.2f', now_xmr, grouping=True) + ' bytes'
dt = 'blocksize.html ' + locale.format('%.2f', datetime.datetime.now(timezone.utc).timestamp() - dt, grouping=True)+' seconds'
print(dt)
context = {'xmr_blocksize': xmr_blocksize, 'btc_blocksize': btc_blocksize, 'now_xmr': now_xmr, 'now_btc': now_btc, 'dates': dates}
return render(request, 'monerojnet/blocksize.html', context)
def transactionsize(request):
dt = datetime.datetime.now(timezone.utc).timestamp()
data = DailyData.objects.order_by('date')
xmr_blocksize = []
btc_blocksize = []
dates = []
now_xmr = 0
now_btc = 0
for item in data:
dates.append(datetime.datetime.strftime(item.date, '%Y-%m-%d'))
if item.btc_blocksize > 0.001 and item.btc_transactions > 0:
now_btc = 144*item.btc_blocksize/(1024*item.btc_transactions)
btc_blocksize.append(144*item.btc_blocksize/(1024*item.btc_transactions))
else:
btc_blocksize.append('')
if item.xmr_blocksize > 0.001 and item.xmr_transactions > 0:
now_xmr = 720*item.xmr_blocksize/(1024*item.xmr_transactions)
xmr_blocksize.append(720*item.xmr_blocksize/(1024*item.xmr_transactions))
else:
xmr_blocksize.append('')
now_btc = locale.format('%.2f', now_btc, grouping=True) + ' bytes'
now_xmr = locale.format('%.2f', now_xmr, grouping=True) + ' bytes'
dt = 'transactionsize.html ' + locale.format('%.2f', datetime.datetime.now(timezone.utc).timestamp() - dt, grouping=True)+' seconds'
print(dt)
context = {'xmr_blocksize': xmr_blocksize, 'btc_blocksize': btc_blocksize, 'now_xmr': now_xmr, 'now_btc': now_btc, 'dates': dates}
return render(request, 'monerojnet/transactionsize.html', context)
def difficulty(request):
dt = datetime.datetime.now(timezone.utc).timestamp()
data = DailyData.objects.order_by('date')
xmr_difficulty = []
btc_difficulty = []
dates = []
now_xmr = 0
now_btc = 0
for item in data:
dates.append(datetime.datetime.strftime(item.date, '%Y-%m-%d'))
if item.btc_difficulty > 0.001:
now_btc = item.btc_difficulty
btc_difficulty.append(now_btc)
else:
btc_difficulty.append('')
if item.xmr_difficulty > 0.001:
now_xmr = item.xmr_difficulty
xmr_difficulty.append(now_xmr)
else:
xmr_difficulty.append('')
now_btc = locale.format('%.0f', now_btc, grouping=True)
now_xmr = locale.format('%.0f', now_xmr, grouping=True)
dt = 'difficulty.html ' + locale.format('%.2f', datetime.datetime.now(timezone.utc).timestamp() - dt, grouping=True)+' seconds'
print(dt)
context = {'xmr_difficulty': xmr_difficulty, 'btc_difficulty': btc_difficulty, 'now_xmr': now_xmr, 'now_btc': now_btc, 'dates': dates}
return render(request, 'monerojnet/difficulty.html', context)
def blockchainsize(request):
dt = datetime.datetime.now(timezone.utc).timestamp()
data = DailyData.objects.order_by('date')
xmr_blocksize = []
btc_blocksize = []
dates = []
now_xmr = 0
now_btc = 0
for item in data:
dates.append(datetime.datetime.strftime(item.date, '%Y-%m-%d'))
if item.btc_blocksize > 0.001 and item.btc_transactions > 0:
now_btc += 144*item.btc_blocksize/1024
if now_btc < 200:
btc_blocksize.append('')
else:
btc_blocksize.append(now_btc)
else:
btc_blocksize.append('')
if item.xmr_blocksize > 0.001 and item.xmr_transactions > 0:
now_xmr += 720*item.xmr_blocksize/1024
if now_btc < 200:
xmr_blocksize.append('')
else:
xmr_blocksize.append(now_xmr)
else:
xmr_blocksize.append('')
now_btc = locale.format('%.2f', now_btc/(1024*1024), grouping=True) + ' Gb'
now_xmr = locale.format('%.2f', now_xmr/(1024*1024), grouping=True) + ' Gb'
dt = 'blockchainsize.html ' + locale.format('%.2f', datetime.datetime.now(timezone.utc).timestamp() - dt, grouping=True)+' seconds'
print(dt)
context = {'xmr_blocksize': xmr_blocksize, 'btc_blocksize': btc_blocksize, 'now_xmr': now_xmr, 'now_btc': now_btc, 'dates': dates}
return render(request, 'monerojnet/blockchainsize.html', context)
def compinflation(request):
dt = datetime.datetime.now(timezone.utc).timestamp()
data = DailyData.objects.order_by('date')