diff --git a/_businesses/staking.html b/_businesses/staking.html index 95926e0..489abf2 100644 --- a/_businesses/staking.html +++ b/_businesses/staking.html @@ -91,34 +91,17 @@

Calculator

diff --git a/_config.yml b/_config.yml index a7059e9..25a6eb3 100644 --- a/_config.yml +++ b/_config.yml @@ -181,6 +181,12 @@ defaults: values: layout: "resource" category: "resource" + - + scope: + type: "posts" + values: + layout: "post" + category: "post" #liquid: diff --git a/_layouts/network.html b/_layouts/network.html index a70fff5..533d846 100644 --- a/_layouts/network.html +++ b/_layouts/network.html @@ -31,14 +31,52 @@

Market

Main Coin Symbol {{ page.network_symbol | upcase }} + + + Network Symbol + {{ page.network_symbol }} + + + Network Title + {{ page.network_title }} + + + Network Fee + {{ page.network_fee }} + - Market Cap - {{ page.market_cap | formatprice }} + Network Inflation + {{ page.network_inflation }} + + + + + + P2P Wallets + + + + + + Slashing Policies + + + + +
diff --git a/_networks/solana.html b/_networks/solana.html index 3b1af0e..1ef1250 100644 --- a/_networks/solana.html +++ b/_networks/solana.html @@ -2,38 +2,44 @@ title: "Solana" icon: "/assets/images/networks-logo/solana.svg" -market_cap: 11476031214 -network_symbol: "SOL" -network_title: "Solana" -network_fee: 1.0 -network_epoch: 5.0 -network_inflation: 8.0 - -site_main: "https://solana.com/" -site_docs: "https://docs.solana.com/" -site_git: "https://github.com/solana-labs" -site_explorer: "https://explorer.solana.com/" - -token: "SOL" -token_price: 32.12 - -stake_min: 1 -stake_apr: 7.1 -stake_reward_frequency: '2-3 day' -stake_effectiveness_rating: 0 -stake_unbonding_period: 21.0 - -slashing_uptime: true -slashing_duble_signe: true - -node_start_value: 0 -node_hardware: 32CPU_256GRAM_2TS_CUDA -node_reward_constant: 0 -node_reward_percentage: 7.0 - -staked_value: 0.0 - -p2p_staked_value: 4537698.0 -p2p_wallet: 'FKsC411dik9ktS6xPADxs4Fk2SCENvAiuccQHLAPndvk' +network: + symbol: "SOL" + fee: 1.0 + epoch: 5.0 + inflation: 8.0 + token: + name: "SOL" + price: 32.12 + +sites: + - name: "Main" + url: "https://solana.com/" + - name: "Documentation" + url: "https://docs.solana.com/" + - name: "Source" + url: "https://github.com/solana-labs" + - name: "explorer" + url: "https://explorer.solana.com/" + +staking: + min: 1 + apr: 7.1 + +validator: + cost: 1 + staked: 0 + hardware: 32CPU_256GRAM_2TS_CUDA + reward: + constant: 0 + percentage: 7.0 + slashing: + - 'Uptime' + - 'Duble signe' + +competitors: + p2p: + staked: 4537698.0 + wallets: + - 'FKsC411dik9ktS6xPADxs4Fk2SCENvAiuccQHLAPndvk' --- diff --git a/_posts/2021-08-30-welcome-to-jekyll.html b/_posts/2021-08-30-welcome.md similarity index 75% rename from _posts/2021-08-30-welcome-to-jekyll.html rename to _posts/2021-08-30-welcome.md index 10f26bd..de566ba 100644 --- a/_posts/2021-08-30-welcome-to-jekyll.html +++ b/_posts/2021-08-30-welcome.md @@ -1,6 +1,6 @@ --- -layout: post -title: "Welcome to Jekyll!" +title: "How to add a new post" +description: " This project is based on Jekyll (static site builder) and hosted on GitHub. In this post I`ll show you how to impove the project" categories: jekyll update --- @@ -10,8 +10,9 @@ a web server and auto-regenerates your site when a file is updated. Jekyll requires blog post files to be named according to the following format: - +``` `YEAR-MONTH-DAY-title.MARKUP` +``` Where `YEAR` is a four-digit number, `MONTH` and `DAY` are both two-digit numbers, and `MARKUP` is the file extension representing the format used in the @@ -28,7 +29,9 @@ #=> prints 'Hi, Tom' to STDOUT. {% endhighlight %} -Check out the [Jekyll docs][jekyll-docs] for more info on how to get the most out of Jekyll. File all bugs/feature requests at [Jekyll’s GitHub repo][jekyll-gh]. If you have questions, you can ask them on [Jekyll Talk][jekyll-talk]. +Check out the [Jekyll docs][jekyll-docs] for more info on how to get the most out of +Jekyll. File all bugs/feature requests at [Jekyll’s GitHub repo][jekyll-gh]. If you +have questions, you can ask them on [Jekyll Talk][jekyll-talk]. [jekyll-docs]: https://jekyllrb.com/docs/home [jekyll-gh]: https://github.com/jekyll/jekyll diff --git a/_posts/2022-01-01-Test-Page.html b/_posts/2022-01-01-Test-Page.html deleted file mode 100644 index 5aa5414..0000000 --- a/_posts/2022-01-01-Test-Page.html +++ /dev/null @@ -1,7 +0,0 @@ ---- -layout: post -title: "Test page" -categories: Test ---- - -

Test Page

diff --git a/_posts/2022-10-13-how_to_add_network.md b/_posts/2022-10-13-how_to_add_network.md new file mode 100644 index 0000000..ca45c42 --- /dev/null +++ b/_posts/2022-10-13-how_to_add_network.md @@ -0,0 +1,116 @@ +--- +title: 'How to add a network' +description: 'To add a new network, you can create an a new descriptive file, then the them makes all required pages.' +--- + +This project contains PoS networks. + +To add a new network, just create a new file (the same name with network) in the +networks collection folder (_network). + +You have to descripe it fully. + +## General information + +First of all define general informations such as title, icon and descriptions: + +- title: the title of the network +- description: a short descritpion of the network +- icon: full path of a graphic file from assets folder + +You may add more based on Jekyll theme. + +## References and sites + +There must be list of sites where the network is supported. + +here is an example: + +```yaml +sites: + - name: "Main" + url: "https://solana.com/" + - name: "Documentation" + url: "https://docs.solana.com/" + - name: "Source" + url: "https://github.com/solana-labs" + - name: "explorer" + url: "https://explorer.solana.com/" +``` + +The site section is array of sites (a paire of name and url). + +## Network information + +The network part contains general information about the network it self, such as +fee and epoch; + +Here is an example + +```yaml +network: + symbol: "SOL" + fee: 1.0 + epoch: 5.0 + inflation: 8.0 + token: + name: "SOL" + price: 32.12 +``` + +- sympol: the short name of the network +- fee: Common fee of transactions based on the main token +- epoch: The length of the network epoch in the unit of days +- inflation: the inflation rate (percentage) of the coin in a year +- token: description of the main token +- token.name: The name of the main token +- token.price: the price of the main token in USDT + +## Staking + +Suppos you are about to stake on the network, this part show how the +network is in staking. for example APR and minimum staking value. + +here is an example: + + +```yaml +staking: + min: 1 + apr: 7.1 +``` + +## To be a validator + +To become a validator, you must pay and do lots of things, this part +show you the critical points of views: + +Here is an example: + +```yaml +validator: + cost: 1 + staked: 0 + hardware: 32CPU_256GRAM_2TS_CUDA + reward: + constant: 0 + percentage: 7.0 + slashing: + - 'Uptime' + - 'Duble signe' +``` + +## Competitors + +There are many staking company you may want to know about. + +Here is list of competitors: + +```yaml +competitors: + p2p: + staked: 4537698.0 + wallets: + - 'FKsC411dik9ktS6xPADxs4Fk2SCENvAiuccQHLAPndvk' +``` + diff --git a/assets/js/calculator-staking.js b/assets/js/calculator-staking.js index 10f2fa1..2a081bd 100644 --- a/assets/js/calculator-staking.js +++ b/assets/js/calculator-staking.js @@ -5,10 +5,69 @@ const { useState } = owl.hooks; + const rolesDb = JSON.parse(document.getElementById('roles-data').textContent); + const networkDb = JSON.parse(document.getElementById('networks-data').textContent); + const resourcesDb = JSON.parse(document.getElementById('resources-data').textContent); + + function computeNetworkRevenueInMounth(network) { + let coinValue = 0; + coinValue += (30 * network.validator.reward.constant / network.network.epoch) * network.network.token.price; + coinValue += (network.competitors.p2p.staked * network.staking.apr * network.validator.reward.percentage) / (12.0 * 100 * 100); + coinValue += network.validator.staked * (network.staking.apr - network.network.inflation) / 12.0; + return coinValue; + } + + function computeSetupCostInUSDT(network) { + return 150 + (network.validator.staked + network.network.fee) * network.network.token.price; + } + + function computeMaintainCostInUSDT(networks) { + let costMaintain = 0; + let n = networks.length; + // Add network resource price + networks.forEach(network => + costMaintain += getResource(network).cost + ); + + // SPO cost + let spo = getRole("SPO"); + costMaintain += Math.ceil(n / spo.throughput) * spo.cost; + + // IT cost + let it = getRole("IT"); + costMaintain += Math.ceil(n / it.throughput) * it.cost; + + // CTO cost + let cto = getRole("CTO"); + costMaintain += cto.cost; + + // CEO cost + let ceo = getRole("CEO"); + costMaintain += ceo.cost; + + return costMaintain; + } + + + function getResource(network) { + let list = resourcesDb.filter(resource => resource.name === network.validator.hardware); + if (list.length) { + return list[0] + } + console.warn("Resource with name " + network.validator.hardware + " not found"); + } + + function getRole(abbreviation) { + let list = rolesDb.filter(role => role.abbreviation === abbreviation); + if (list.length) { + return list[0] + } + console.warn("Role with name " + abbreviation + " not found"); + } // ------------------------------------------------------------------------- // NetworkTable // ------------------------------------------------------------------------- - const ResourceTable_TEMPLATE = xml /* xml */` + const ResourceTable_TEMPLATE = xml /* xml */`

Resources and Hardwares

@@ -43,7 +102,7 @@ class ResourceTable extends Component { static template = ResourceTable_TEMPLATE; } - + // ------------------------------------------------------------------------- // NetworkTable // ------------------------------------------------------------------------- @@ -51,17 +110,25 @@ - - - - + + + `; class NetworkTableRow extends Component { static template = NetworkTableRow_TEMPLATE; + static props = ['network']; + state = useState({ + computedRevenue: 0, + setupCost: 0 + }); + + constructor(parent, props) { + super(parent, props); + this.state.computedRevenue = computeNetworkRevenueInMounth(props.network); + this.state.setupCost = computeSetupCostInUSDT(props.network); + } deleteNetwork() { alert(this.props.network.title) @@ -79,13 +146,14 @@ Title - Cost/Month (USDT) - Actions + Token Price + Setup Cost + Revenue (USDT/Month) - + @@ -166,13 +234,8 @@ constructor() { super() - var costSetup = 0; - this.env.networksDb.forEach(network => { - if(network.id) { - // Constant cost - costSetup += 150 + (network.nodeStartValue + network.networkFee) * network.tokenPrice; - } - }); + let costSetup = 0; + this.env.networksDb.forEach(network => costSetup += computeSetupCostInUSDT(network)); this.state.costSetup = costSetup; } } @@ -204,56 +267,16 @@ class MaintainCost extends Component { static template = MaintainCost_TEMPLATE; + static props = ['networks']; state = useState({ costMaintain: 0 }); - constructor() { - super() - var costMaintain = 0; - var n = this.env.networksDb.length -1; - // Add network resource price - this.env.networksDb.forEach(network => { - if(network.id) { - // Constant cost - costMaintain += this.getResource(network).cost; - } - }); - - // SPO cost - var spo = this.getRole("SPO"); - costMaintain += Math.ceil(n / spo.throughput) * spo.cost; - - // IT cost - var it = this.getRole("IT"); - costMaintain += Math.ceil(n / it.throughput) * it.cost; - - // CTO cost - var cto = this.getRole("CTO"); - costMaintain += cto.cost; - - // CEO cost - var ceo = this.getRole("CEO"); - costMaintain += ceo.cost; - - this.state.costMaintain = costMaintain; - } - - getResource (network) { - var list = this.env.resourcesDb.filter(resource => resource.name === network.nodeHardware ); - if(list.length) { - return list[0] - } - console.warn("Resource with name " + network.nodeHardware + " not found"); - } - - getRole(abbreviation){ - var list = this.env.rolesDb.filter(role => role.abbreviation === abbreviation); - if(list.length) { - return list[0] - } - console.warn("Role with name " + abbreviation + " not found"); + constructor(parent, props) { + super(parent, props); + this.state.costMaintain = computeMaintainCostInUSDT(props.networks); } + } @@ -296,22 +319,14 @@ constructor() { super() - var revenueStaking = 0; - this.env.networksDb.forEach(network => { - if(network.id) { - // Constant revenue - var coinValue = 0; - coinValue += (30 * network.rewardConstant / network.epoch) * network.tokenPrice; - coinValue += (network.p2pStaked * network.apr * network.rewardPercentage) / (12.0*100*100); - coinValue += network.nodeStartValue * (network.apr - network.inflation) / 12.0; - revenueStaking = revenueStaking + coinValue * network.tokenPrice; - } - }); + let revenueStaking = 0; + this.env.networksDb.forEach(network => + revenueStaking += computeNetworkRevenueInMounth(network) * network.network.token.price + ); this.state.revenueStaking = revenueStaking; } } - // ------------------------------------------------------------------------- // App Component // ------------------------------------------------------------------------- @@ -353,9 +368,9 @@ // Setup code function setup() { App.env.localStorage = window.localStorage; - App.env.rolesDb = JSON.parse(document.getElementById('roles-data').textContent); - App.env.networksDb = JSON.parse(document.getElementById('networks-data').textContent); - App.env.resourcesDb = JSON.parse(document.getElementById('resources-data').textContent); + App.env.rolesDb = rolesDb; + App.env.networksDb = networkDb; + App.env.resourcesDb = resourcesDb; const app = new App(); app.mount(document.getElementById('calculatorBody')); } diff --git a/networks.html b/networks.html index 7f45fab..d0cabcc 100644 --- a/networks.html +++ b/networks.html @@ -17,11 +17,7 @@
{{ network.title }}
-

${{ network.market_cap | formatprice }}

-

Market Cap

-
-
-

{{ network.stake_apr }}%

+

{{ network.staking.apr }}%

APR

diff --git a/posts.html b/posts.html new file mode 100644 index 0000000..60b8815 --- /dev/null +++ b/posts.html @@ -0,0 +1,27 @@ +--- +layout: page +title: Posts +permalink: /posts/ +--- + + +
+ {% for post in site.posts %} +
+
+
+ {{ post.title }} +
+ {{post.date}} +

{{ post.description }} +

+ Read More +
+
+
+ {% endfor %} +
+ +