<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Fredo Corleone on Medium]]></title>
        <description><![CDATA[Stories by Fredo Corleone on Medium]]></description>
        <link>https://medium.com/@freddycorly?source=rss-7a417881c5c4------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*maDX0ib8p65EVtRMFwGeAw.jpeg</url>
            <title>Stories by Fredo Corleone on Medium</title>
            <link>https://medium.com/@freddycorly?source=rss-7a417881c5c4------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 23 Nov 2026 14:03:01 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@freddycorly/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[How I repainted Bootstrap v5]]></title>
            <link>https://freddycorly.medium.com/how-i-repainted-bootstrap-v5-4d936502218e?source=rss-7a417881c5c4------2</link>
            <guid isPermaLink="false">https://medium.com/p/4d936502218e</guid>
            <category><![CDATA[bootstrap-5]]></category>
            <category><![CDATA[runtime]]></category>
            <category><![CDATA[responsive]]></category>
            <category><![CDATA[css]]></category>
            <dc:creator><![CDATA[Fredo Corleone]]></dc:creator>
            <pubDate>Thu, 09 Mar 2023 00:48:21 GMT</pubDate>
            <atom:updated>2023-03-09T00:51:37.781Z</atom:updated>
            <content:encoded><![CDATA[<p>These days I’m scaffolding a lightweight Angular app at work and I wanted to have the possibility to easily customize colors of Bootstrap via CSS variables.</p><p>This idea is not new and was implemented for the v4 of Boostrap by Herman Starikov and he detailed the process in his <a href="https://medium.com/@Hermanhasawish/how-i-repainted-bootstrap-without-sass-d789f41aa74b">How I repainted Bootstrap without SASS 👨🏼‍🎨</a>.<br>I’m just trying to improve upon that and to do so for Boostrap v5.</p><p>But first: why CSS variables? Well… Because you can change the styles at runtime, and it’s easier to customize without the need of recompiling.</p><p>As a first step I extracted all the colors and put them on screen to get a rough idea of how colors are distributed.<br>On the y axis there’s the hue and on the x axis there’s the lightness.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/798/1*-_MzoHgVVl255TRwC3aBjA.png" /><figcaption>Bootstrap v5 color distribution straight from the code with regex</figcaption></figure><p>In the image above you can see that colors are all not spaced evenly therefore they are not consistent. To fix this in his article Herman proposed a more consistent palette, that I took and modified removing all unused colors.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/563/1*TDEOGqh6C0rHqFLVZ91dxw.png" /><figcaption>This is more or less the resulting palette after my modifications</figcaption></figure><p>Then as the last step I devised an algorithm to replace each single color of the Boostrap CSS to the variable name of the closest matching color of my new palette and… BOOM!</p><p>Now I can change my CSS variables and see those styles applying throughout the entire application, and not only that, I can also reconfigure variables locally and change the appearance of each component independently thanks to the Angular style encapsulation.</p><p>To see all that in action navigate to my GitHub and try to re-assign variables.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fcodepen.io%2Feternalsunshineofspotlessmind%2Fembed%2Fpreview%2FbGxYGRE%3Fdefault-tabs%3Dcss%252Cresult%26height%3D600%26host%3Dhttps%253A%252F%252Fcodepen.io%26slug-hash%3DbGxYGRE&amp;display_name=CodePen&amp;url=https%3A%2F%2Fcodepen.io%2Feternalsunshineofspotlessmind%2Fpen%2FbGxYGRE&amp;image=https%3A%2F%2Fshots.codepen.io%2Feternalsunshineofspotlessmind%2Fpen%2FbGxYGRE-512.jpg%3Fversion%3D1678322084&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=codepen" width="800" height="600" frameborder="0" scrolling="no"><a href="https://medium.com/media/5d20673a708e4f5db3097cbe02ff7dbf/href">https://medium.com/media/5d20673a708e4f5db3097cbe02ff7dbf/href</a></iframe><p>It works surprisingly well, isn’t it? I think this is gorgeous and I will start applying it to every project.</p><p>Thanks for your attention, if you liked it please share and clap it!<br>Have a good day :)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4d936502218e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Make Dialogs Using the Angular Router with Named Router Outlets]]></title>
            <link>https://freddycorly.medium.com/make-dialogs-using-the-angular-router-with-named-router-outlets-55343752040a?source=rss-7a417881c5c4------2</link>
            <guid isPermaLink="false">https://medium.com/p/55343752040a</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[components]]></category>
            <category><![CDATA[angular]]></category>
            <category><![CDATA[modal-dialogs]]></category>
            <category><![CDATA[router]]></category>
            <dc:creator><![CDATA[Fredo Corleone]]></dc:creator>
            <pubDate>Mon, 14 Nov 2022 23:35:34 GMT</pubDate>
            <atom:updated>2022-11-14T23:40:22.534Z</atom:updated>
            <content:encoded><![CDATA[<p>Hi guys, today I’m going to show you how you can use Angular Named Router Outlets feature to achieve the Dialog Pattern very easily.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/743/1*w6kRSTm3fFjKx041gVsxVg.png" /><figcaption>The dialog we are going to make today! :D</figcaption></figure><p>Dialogs are very widespread, despite being such an unfrienldy encounter: we all came across annoying popups that ask for confirmation about some cookie related stuff while surfing on the Internet.<br>But not all dialogs are made equal, some dialogs, simply take a moment to gather information from the user when some action need to take precedence over all the rest.</p><p>Dialogs can usually be avoided when you design your app freely without projectual constraints, yet when you work as a consultant, as I do, requirements are such that you are required to use dialogs.</p><h3>Our Objective</h3><p>What we want is to be able to <strong>open a dialog</strong> and <strong>wait for the user</strong> to take action, read the result of said user action and <strong>close the dialog</strong>.</p><p>In particular we want to implement the <strong>Are You Sure Dialog</strong> with a <strong>title</strong>, a <strong>message </strong>and a couple of buttons, one to <strong>dismiss </strong>and one to <strong>confirm</strong>.</p><p>To do that we want to use the Angular router, and configure the router in such a way that we can <strong>open the dialog without disturbing the primary outlet</strong>, for that we need Named Router Outlet.</p><p>The repository with the source code for this can be found at <a href="https://github.com/4skinSkywalker/dialogs-with-router">https://github.com/4skinSkywalker/dialogs-with-router</a></p><p>The demo can be found at <a href="https://4skinskywalker.github.io/dialogs-with-router/">https://4skinskywalker.github.io/dialogs-with-router/</a></p><h3>Configuring the Router</h3><p>We will make use of a feature called <strong>Named Router Outlet that let you have separate navigations in the same view</strong>, for instance you can have a primary navigation for your sidebar and a separate secondary navigation for your main content, and controls them indipendently!</p><p>In our case we will use Named Router Outlet to open the modal without disturbing the primary navigation of our application.</p><p>In order to use an auxilary router outlet we define a new router-outlet element and use its “name” property as follows:</p><pre>&lt;router-outlet name=&quot;auxiliary&quot;&gt;&lt;/router-outlet&gt;</pre><p>We can put the above where we want, I put it in my AppComponent.<br>In case you are wondering <strong>“auxilary” is just a name of choice</strong>, feel free to choose what you prefer, but remember what you’ve used as we need it later.</p><p>After that, we must configure the router via route array in our routing module, as follows:</p><pre>const routes: Routes = [<br>  {<br>    path: &#39;dialog-are-you-sure&#39;,<br>    component: DialogAreYouSureComponent,<br>    outlet: &#39;auxiliary&#39;<br>  }<br>];</pre><p>The above array describes the path to open our dialogs, <strong>the outlet property is used to tell the router to put the dialog in the router-outlet with the name “auxilary”</strong> that we defined before.</p><p>To open the dialog we will use the following code:</p><pre>this.router.navigate to [&#39;&#39;, { outlets: { auxiliary: [ &#39;dialog-are-you-sure&#39; ] } }];</pre><p>To close the dialog we simply pass <em>null </em>as “auxilary” value, like so:</p><pre>this.router.navigate([{ outlets: { auxiliary: null } }]);</pre><p>Go to <a href="#5cea">Creating DialogService to Open/Close Dialogs</a> to see where and in which context these two lines of code are used.</p><h3>Our Super Basic Folder Structure</h3><p>We create a folder named dialogs, which will hold all our dialog components (these are regular Angular components):</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/337/1*kVRZf-2ZuHN3T1mZsQkLjg.png" /><figcaption>Folder structure for our dialogs</figcaption></figure><p>You’ll have to create DialogService which will be at the root of the dialog folder, and each dialog component will have its dedicated folder.</p><h3>Creating the Base Dialog</h3><p>We start with the dialog-base component which is the scaffold for all our dialogs:</p><pre>&lt;div class=&quot;card-wrap&quot; (click)=&quot;dismiss($event)&quot;&gt;<br>    &lt;div class=&quot;card&quot;&gt;<br>        &lt;div class=&quot;card-header&quot;&gt;<br>            &lt;ng-content select=&quot;[header]&quot;&gt;&lt;/ng-content&gt;<br>        &lt;/div&gt;<br>        &lt;div class=&quot;card-body&quot;&gt;<br>            &lt;ng-content select=&quot;[body]&quot;&gt;&lt;/ng-content&gt;<br>        &lt;/div&gt;<br>        &lt;div class=&quot;card-footer&quot;&gt;<br>            &lt;ng-content select=&quot;[footer]&quot;&gt;&lt;/ng-content&gt;<br>        &lt;/div&gt;<br>    &lt;/div&gt;<br>&lt;/div&gt;</pre><p>The above component uses Content Projection to make so that consumers (which are other dialogs) can inject custom markup.</p><p>Let’s define some CSS and make so that card-wrap takes all the page with a mild blackish appearance (sort of a backdrop) and the card is positioned in the middle of the screen with well defined areas such as header, body and footer:</p><pre>.card-wrap {<br>    background-color: #0002;<br>    display: grid;<br>    height: 100vh;<br>    left: 0;<br>    place-items: center;<br>    position: fixed;<br>    top: 0;<br>    width: 100vw;<br>}<br><br>.card {<br>    background-color: #fff;<br>    border-radius: 0.5rem;<br>    box-shadow: 0 0 8px 4px #0002;<br>    width: clamp(25ch, 50%, 50ch);<br>}<br><br>.card-header {<br>    border-top-left-radius: 0.5rem;<br>    border-top-right-radius: 0.5rem;<br>    border-bottom: 1px solid #eee;<br>    padding: 0.5rem;<br>}<br><br>.card-body {<br>    padding: 0.5rem;<br>    max-height: 400px;<br>    overflow-y: auto;<br>}<br><br>.card-footer {<br>    border-bottom-left-radius: 0.5rem;<br>    border-bottom-right-radius: 0.5rem;<br>    border-top: 1px solid #eee;<br>    padding: 0.5rem;<br>}</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/654/1*_5QVXJ_s9uUSpbpPIiDe2g.png" /><figcaption>Doesn’t look too great without content…</figcaption></figure><h3>Creating Are You Sure Dialog with Content Projection</h3><p>Now, we can make use of Content Projection to reuse dialog-base and make our dialog-are-you-sure component:</p><pre>&lt;app-dialog-base&gt;<br>    &lt;ng-container header&gt;Are You Sure?&lt;/ng-container&gt;<br>    &lt;ng-container body&gt;Are You Sure dialog is working&lt;/ng-container&gt;<br>    &lt;ng-container footer&gt;1234&lt;/ng-container&gt;<br>&lt;/app-dialog-base&gt;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/456/1*MyHBCuJEt50IZQhaDvYfvg.png" /><figcaption>What a wonderful sight, Content Projection is awesome! :D</figcaption></figure><p>For now let’s move on, we will add functionalities and pass some data to our Are You Sure Dialog later…</p><h3>Creating DialogService to Open/Close Dialogs</h3><p>Now that we are set up with our component we need to make DialogService, which will be injected in dialog consumers to open/close dialogs.</p><p><strong>I want my dialogs to take input data and return a promise of data</strong>, so that the consumer can await until either the dialog is dismissed or closed with data.</p><p>Let’s create a new DialogService and put some juicy code in it:</p><pre>export class DialogService {<br><br>  data: any;<br><br>  private resolve: Function | undefined;<br>  private reject: Function | undefined;<br><br>  constructor(<br>    private router: Router<br>  ) { }<br><br>  open(dialogPath: string, data: any) {<br>    this.data = data;<br>    this.router.navigate([&#39;&#39;, { outlets: { auxiliary: [ dialogPath ] } }]);<br>    return new Promise((resolve, reject) =&gt; {<br>      this.resolve = resolve;<br>      this.reject = reject;<br>    })<br>  }<br><br>  close(data: any) {<br>    if (!this.resolve) return;<br>    this.router.navigate([{ outlets: { auxiliary: null } }]);<br>    this.resolve(data);<br>  }<br><br>  dismiss(error = &#39;Modal dismissed.&#39;) {<br>    if (!this.reject) return;<br>    this.router.navigate([{ outlets: { auxiliary: null } }]);<br>    this.reject(error);<br>  }<br>}</pre><p>This is the very engine of the machine.</p><p>We have a public property that holds the input data for our dialog, it’s set at the time the consumer calls the open method.</p><p>There are two private properties: resolve and reject.<br>Resolve and reject are extracted from the new Promise returned by the open method call, resolve is used to return output data to the consumer that’s awaiting the promise while reject is used to dismiss the dialog with an error.</p><p>The three methods are self descripting, they are used to open, close and dismiss.<br>As already mentioned the whole dialog instance is handled with a promise.</p><h3>Upgrading our Are You Sure Dialog</h3><p>We come back to the Are You Sure Dialog, passing data and adding functionalities to it.</p><p>We want to be able to be able to pass a title and a message, and either dismiss or close the dialog.</p><p>To pass data and give functionalities to Are You Sure we need to inject DialogService in it:</p><pre>export class DialogAreYouSureComponent {<br><br>  constructor(<br>    public ds: DialogService<br>  ) { }<br><br>  confirm() {<br>    this.ds.close(true);<br>  }<br><br>}</pre><p>We created a confirm method that delegates to the close method of DialogService passing the boolean value <em>true </em>to it.</p><p>DialogService is publicly availiable so that the template can access its property data and the method dismiss.<br>Inside the template we can show data via interpolation:</p><pre>&lt;app-dialog-base *ngIf=&quot;ds.data&quot;&gt;<br>    &lt;ng-container header&gt;{{ ds.data.title }}&lt;/ng-container&gt;<br>    &lt;ng-container body&gt;{{ ds.data.message }}&lt;/ng-container&gt;<br>    &lt;ng-container footer&gt;<br>        &lt;div class=&quot;footer-buttons&quot;&gt;<br>            &lt;button (click)=&quot;ds.dismiss()&quot;&gt;Dismiss&lt;/button&gt;<br>            &lt;button (click)=&quot;confirm()&quot;&gt;Confirm&lt;/button&gt;<br>        &lt;/div&gt;<br>    &lt;/ng-container&gt;<br>&lt;/app-dialog-base&gt;</pre><h3>Consuming Are You Sure Dialog</h3><p>Now that everything is set up let’s open our first dialog!</p><p>Inside the template of the consumer create a button and bind a function to open the dialog to the click event:</p><pre>&lt;button (click)=&quot;openDialogAreYouSure()&quot;&gt;Open Dialog Are You Sure&lt;/button&gt;</pre><p>Inside the component of the consumer let’s make a function to open Are You Sure Dialog with a title and a message:</p><pre>export class AppComponent {<br><br>  constructor(<br>    private ds: DialogService<br>  ) { }<br><br>  async openDialogAreYouSure() {<br>    try {<br>      const result = await this.ds.open(&#39;dialog-are-you-sure&#39;, {<br>        title: &#39;Confirmation dialog&#39;,<br>        message: &#39;Are you sure you want to continue?&#39;<br>      });<br>      console.log(result);<br>    }<br>    catch (err) {<br>      console.error(err);<br>    }<br>  }<br><br>}</pre><p>As you can see we marked openDialogAreYouSure with the keyword <em>async</em>, so that we can <em>await </em>the Promise returned by DialogService.<br>We use <em>try/catch</em> to log into the console whether the user has confirmed or dismissed the dialog.</p><h3>The End</h3><p>Thank you a lot for reading this Medium article, I really hope you liked it!<br>If you have any question feel free to post it here or send an issue on GitHub.</p><p>The repository with the source code for this can be found at <a href="https://github.com/4skinSkywalker/dialogs-with-router">https://github.com/4skinSkywalker/dialogs-with-router</a></p><p>The demo can be found at <a href="https://4skinskywalker.github.io/dialogs-with-router/">https://4skinskywalker.github.io/dialogs-with-router/</a></p><p><em>Fredo Corleone</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=55343752040a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Fr3d0's Volume Profile Visible Range (VPVR)]]></title>
            <link>https://freddycorly.medium.com/poors-man-vpvr-ee50593a19bd?source=rss-7a417881c5c4------2</link>
            <guid isPermaLink="false">https://medium.com/p/ee50593a19bd</guid>
            <category><![CDATA[tradingview]]></category>
            <category><![CDATA[bitcoin]]></category>
            <category><![CDATA[technical-analysis]]></category>
            <category><![CDATA[vpvr]]></category>
            <category><![CDATA[pine-script]]></category>
            <dc:creator><![CDATA[Fredo Corleone]]></dc:creator>
            <pubDate>Sat, 30 Oct 2021 19:46:11 GMT</pubDate>
            <atom:updated>2021-10-31T22:53:06.537Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eIHA5a4wmiqTipkFiLBfHg.png" /><figcaption>A screenshot showing the indicator this post is about.</figcaption></figure><p>Hi guys,<br>today I’m gonna show you my implementation of the Volume Profile Visible Range indicator, in short VPVR.</p><p>The VPVR is an advanced charting indicator available on a TradingView Pro used to display trading activity over a specified period and plots histograms on the chart which reveals dominant and significant price levels based on volume.</p><p>In essence gives an indication of Supply or demand at a certain price.</p><p><strong>Key properties of the VPVR indicator:</strong><br>- Number of bars (period)<br>- Number of histograms (resolution)<br>- Point of Control</p><h3>High level overview</h3><p>Volume Profile is basically volume by price. The volume profile takes each price point and tells us how many transactions occurred at these levels. The longer the histogram the more the transactions that happened.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/794/1*Wt6c_tppT6AyY5QAhIBjOw.png" /><figcaption>An image of the indicator with some explanation.</figcaption></figure><h4>High Volume Node</h4><p>In short HVN is the point in the volume profile where there is more volume than average.</p><p>An HVN forms when theprice spends a great deal of time at a certain level and can therefore be seen as areas of consolidation.</p><h4>Point of Control</h4><p>In short PoC is the highest HVN in the volume profile.</p><h4>Low Volume Node</h4><p>In short LVN is the point in the volume profile where there is less volume than average.</p><p>These areas are historical areas where price burst through the price range and there was little market interest, they are also referred as the “Unfair Market Price” so price tends to spend very little time in these areas.</p><h4>Value Area</h4><p>In short VA is where 70% of the volume is located in the volume profile.</p><p>What is interesting about the value area is that it will act as resistance in a bearish market and as support in a bullish market.</p><h4>Clearance Area</h4><p>In short CA is which there are only LVN, if price enters this area expect it to move through pretty quickly.</p><h3>Low level implementation</h3><p>At the core of VPVR there’s a concept called “bucketization”.</p><p><strong>Question:</strong> what is bucketization?</p><p><strong>Answer:</strong> bucketization consists of identifying metrics with high predictive power and combine them appropriately.</p><p>I think this is a problem of bucketization because what the VPVR does is to take a price range, divide it into buckets and fill them up with the volume that was produced in each bucket’s range over the given period.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/843/1*Y_cHWPQkdg4oZ6efqsyFtg.png" /><figcaption>An example of what volume will fill what bucket.</figcaption></figure><p>The more we divide our price range the finer the resolution, but also the less significant each bucket will become.</p><p><strong>The steps are:</strong><br>1. Get the price range with min and max over the give period;<br>2. Divide the range into buckets;<br>3. Loop over each candle of the given period and proportionally assign volume to one or more bucket.</p><p><strong>Question:</strong> how to assign volume to buckets?</p><p><strong>Answer:</strong> we need to calculate the right amount to add to each bucket for each candle. If 20% of a candle lies on a bucket then that bucket needs to have 20% of the volume of that candle, the rest 80% belongs to other buckets.</p><p>To get the percentage of a candle on a given bucket we have to find the price range of the candle contained within the bucket, then divide that amount by the entire length of the candle.</p><h4>How to bucketize</h4><p>Let’s examine the 5 cases that may arise:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/547/1*aHcmnCC24cI147typdiwHA.png" /></figure><p>In this first case the candle is above our bucket so our formula should return a good 0.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/597/1*_Lrp0f8-_EgRqZQYjMpOxQ.png" /></figure><p>In the second case the candle is partially contained in the bucket, in the top part of the latter. This means a certain percentage of volume will be added to the bucket.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/579/1*U9j_WT46Pf7Mqt0pPyLBYA.png" /></figure><p>In this third case the candle fills the bucket range entirely, this is also a case in which a percentage of the volume will be added to the bucket.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/596/1*4D_nZkcbqkp-_eWo8VIdTw.png" /></figure><p>The fourth case is that in which a part of the candle is contained in the bucket from the bottom of its range. Yet another case in which part of the volume is contained in the bucket.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/561/1*p0ZWw_3iuDFCMEVJnjTWew.png" /></figure><p>This fifth and last case is redundant, as the first the candle is out of range and our calculation should return a 0.</p><p><strong>Question:</strong> what are the formulas of A, B, C and Target respectively?</p><p><strong>Answer:</strong><br>- A = Max(candle_high, bucket_top) - Min(candle_low, bucket_bottom);<br>- B = Max(candle_high, bucket_top) - Min(candle_high, bucket_top);<br>- C = Max(candle_low, bucket_bottom) - Min(candle_low, bucket_bottom);<br>- Target = A - B - C.</p><p>Now that we now how to calculate the price range belonging to each bucket we need to calculate a percentage of volume to fill the bucket with.</p><p>The formula is trivially simple:<br>Volume * Target / (candle_high - candle_low).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/774/1*ewC3iVS8w6KfjFvCgBpUJg.png" /></figure><p><strong>Question:</strong> can we distinguish between buy volume and sell volume? If so, how?</p><p><strong>Answer:</strong> yes we can and the following paragraph will teach you how.</p><p>Put it simply we can use the difference between the extremes of a candle (low and high) and its close price to get the buy and sell volumes.<br>The formulas for that are:<br>- Buy volume = Volume * (close - low) / (high - low);<br>- Sell volume = Volume * (high - close) / (high - low).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/440/1*HcL-7RvhqzWv07mYLRYcWA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/404/1*QUdEoLa5Fhcy05sQa4GYDw.png" /></figure><p>I know this is rather simplicistic but it makes sense.</p><h3>Closing thoughts</h3><p>This post is a working progress and I’m going to give more details if necessary.</p><p>A working draft implementing what’s above can be found at: <a href="https://gist.github.com/4skinSkywalker/d5e42f46851decf69054e0d0287ab6f5">https://gist.github.com/4skinSkywalker/d5e42f46851decf69054e0d0287ab6f5</a>.</p><p>If you are going to take piece from my gist don’t forget to give me credit!</p><p>I hope you liked this article as much as I liked writing it! ❤</p><p>P.S.: Now my indicator is publicly available and can be found at: <a href="https://it.tradingview.com/script/Sdowdtp7/">https://www.tradingview.com/script/oBu2dpeL-Fr3d0-s-Volume-Profile-Visible-Range/</a>.</p><p>Thanks,<br>Fredo Corleone</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ee50593a19bd" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Create your Reef chain account]]></title>
            <link>https://freddycorly.medium.com/create-your-reef-chain-account-6b06ad323c6?source=rss-7a417881c5c4------2</link>
            <guid isPermaLink="false">https://medium.com/p/6b06ad323c6</guid>
            <category><![CDATA[polkadot]]></category>
            <category><![CDATA[reef-finance]]></category>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[evm]]></category>
            <category><![CDATA[ethereum]]></category>
            <dc:creator><![CDATA[Fredo Corleone]]></dc:creator>
            <pubDate>Thu, 14 Oct 2021 12:41:23 GMT</pubDate>
            <atom:updated>2021-10-14T12:41:23.662Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/742/1*DCyYy_3FX52aitGg5-d0wQ.png" /></figure><p>In order to interact with dapps on the Reef chain you need to do two thing:<br>- Generate a Polkadot address;<br>- Get some Reef tokens;<br>- Bind your Polkadot address to an EVM address.</p><h3>Generate a Polkadot account</h3><p>If you already have a Polkadot account skip to the next part.</p><p>The easiest wat to generate a Polkadot address is via Polkadot{.js} browser extension. Download and install it from the official website at <a href="https://polkadot.js.org/extension/">https://polkadot.js.org/extension/</a>.</p><h4>Step 1</h4><p>Click on the plus icon in the top-right corner.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/561/1*fjiY5xDYcJaA-7W-1aE8Ew.png" /></figure><h4>Step 2</h4><p>Click on “Create new account”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/561/1*0AKncRVNDZUIbnXft7iczg.png" /></figure><h4>Step 3</h4><p>Save your mnemonic seed on paper (it’s advisable not to store it in your computer nor in the cloud).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/561/1*nCIYjgJDYgEzt-p7j_TFBQ.png" /></figure><h4>Step 4</h4><p>Be sure it can work on any chain by “Allow use on any chain” under NETWORK selector.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/561/1*PQBH4NPh_8AW4rD_2a3Jkg.png" /></figure><p>You should now see your newly created Polkadot address.</p><h3>Get some Reef test tokens</h3><p>To pair a Polkadot address with an EVM address a transaction, with a specific contract by Reef Finance, is required. Therefore you need some Reef tokens.</p><p>Let’s say that for this example you would like to connect to the testnet of Reef.<br>To get 1000 REEF testnet tokens simply type !drip &lt;YOUR_ADDRESS&gt; in <a href="https://app.element.io/#/room/#reef:matrix.org">Reef matrix chat</a>.</p><h3>Bind your Polkadot address to an EVM address</h3><p>It’s now time to pair your new Polkadot address with an EVM address.<br>This step is needed in order to interact with dapps hosted in the Reef chain ecosystem.</p><p>To complete the binding process head over to <a href="https://evm.reefscan.com/#/evmAccount">https://evm.reefscan.com/#/evmAccount</a>, and follow the steps below:</p><h4>Step 1</h4><p>Once you’ve landed on <a href="https://evm.reefscan.com/#/evmAccount">https://evm.reefscan.com/#/evmAccount</a> you’ll be presented with the screen here below.</p><p>The first thing you have to do is to make sure to select “Testnet” from the selector in the bottom-left corner:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/988/1*Me1Kb0kydja6WSj6zvpiLw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/987/1*dnMyH0twtHJQoLYam5mYFQ.png" /></figure><h4>Step 2</h4><p>Click on “Bind” and you’ll be presented with a Polkadot{.js} dialog that asks for your password to sign the transaction.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/987/1*umNlPYqiVYoKAzwtfmjyEg.png" /></figure><p>Sign the transaction above and you’re done!<br>My compliments, now you are part of the Reef chain family.</p><h3>Conclusion</h3><p>Finally we are ready to enjoy the extreme speed and efficiency of Reef chain!</p><p>I hope this was easy an not that painful.<br>Cheers ❤</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6b06ad323c6" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[My light JS implementation of RxJS subjects]]></title>
            <link>https://freddycorly.medium.com/my-light-js-implementation-of-rxjs-subjects-1a747dcf1839?source=rss-7a417881c5c4------2</link>
            <guid isPermaLink="false">https://medium.com/p/1a747dcf1839</guid>
            <category><![CDATA[rxjs]]></category>
            <category><![CDATA[data-structures]]></category>
            <category><![CDATA[js]]></category>
            <category><![CDATA[async]]></category>
            <dc:creator><![CDATA[Fredo Corleone]]></dc:creator>
            <pubDate>Sun, 10 Oct 2021 19:01:06 GMT</pubDate>
            <atom:updated>2021-10-10T19:01:06.717Z</atom:updated>
            <content:encoded><![CDATA[<p>Working on different apps I’ve found that subjects from RxJS proved to be a good way to handle communication between components and deal with asynchronicity in general.</p><h3>What is a subject?</h3><p>A subject is an object that delivers messages to one or more consumers at once.<br>This is the concept is called <strong>multicasting</strong>.</p><h3>What I wanted to achieve</h3><p>I wanted to provide an essential implementation of the following subjects from RxJS:</p><ol><li><strong>Subject</strong>, doens’t have an initial value and doesn’t cache any value</li><li><strong>BehaviorSubject</strong>, requires an initial value and emits its current value to new consumers</li><li><strong>ReplaySubject</strong>, emits a specified quantity of last emitted values in first-in-first-out fashion to new consumers</li></ol><p>I’ve never required to complete or error out a subject, therefore I won’t implement completion and erroring.</p><p><strong>The API is compatible with that of RxJS subjects, I could drop-in replace them and use them with the “| async” in Angular.</strong></p><h3>A much better naming</h3><p>I always thought subjects in RxJS are poorly named. Therefore I decided, for my light JS implementation, to rename them:</p><ol><li><strong>Subject </strong>becomes <strong>ObsEmitter</strong>, because the concept is similar to an EventEmitter</li><li><strong>BehaviorSubject </strong>becomes <strong>ObsCacher</strong>, because it acts as a cache that consumers can read the latest value when they need it</li><li><strong>ReplaySubject </strong>becomes <strong>ObsReplayer</strong>, this is pretty similar</li></ol><p>I decided to throw away the Subject word and replace it with Obs: Obs stands for <strong>Obs</strong>ervable and the noun right after should convey the fact it’s also an Observ<strong>er</strong>.</p><h3>The API</h3><p>The standard API is pretty simple:<br>- <strong>getValue()</strong> is used to get the latest value in <strong>ObsCacher</strong><br>- <strong>getValues()</strong> is used to get the latest values in <strong>ObsReplayer</strong><br>- <strong>next()</strong> is used to broadcast a new value<br>- <strong>subscribe()</strong> is used to add new consumers<br>- <strong>unsubscribe()</strong> is used to remove a consumer</p><p>One think to be aware is that <strong>unsubscribe()</strong> is not a method of the object itself, it’s the return value of the <strong>subscribe()</strong> call:</p><pre>let emitter$ = new ObsEmitter();<br><br>let subscription = emitter$<br>  .subscribe(val =&gt;<br>    console.log(val)<br>  );</pre><pre>subscription.unsubscribe();</pre><h3>Differences between my interpretation and RxJS one</h3><h4>ObsCacher (BehaviorSubject)</h4><p>You can initialize it empty and the default value will be undefined, in RxJS you have to give it a value.</p><h4>ObsReplayer (ReplaySubject)</h4><p>The difference is that it provides .getValues() that returns an array of values, in RxJS there’s no such method.</p><h3>ObsEmitter implementation</h3><p>The concept is similar to an EventEmitter that keeps a registry of multiple listeners. When an event happens, e.g. new value arrives, it notifies those listeners.</p><pre>function ObsEmitter() {<br>    this.consumers = {};<br>}</pre><pre>ObsEmitter.prototype.next = function (value) {<br>    for (let key in this.consumers)<br>        this.consumers[key](value);<br>};</pre><pre>ObsEmitter.prototype.subscribe = function (callback) {</pre><pre>    // This is necessary for &quot;| async&quot; in Angular<br>    if (&quot;next&quot; in callback)<br>        callback = callback.next;</pre><pre>    // This is a kind of unique id<br>    let namespace = Math.random().toString(36).slice(2);</pre><pre>    this.consumers[namespace] = callback;</pre><pre>    return {<br>        unsubscribe: () =&gt; delete this.consumers[namespace]<br>    };<br>};</pre><p>It’s very simple, on next method call it iterates over all consumers calling them with the value as argument.</p><h3>ObsCacher implementation</h3><p>It acts as a cache that subscribers can read the latest value when they need it.</p><pre>function ObsCacher(value = undefined) {<br>    this.value = value;<br>    this.consumers = {};<br>}</pre><pre>ObsCacher.prototype.next = function (value) {<br>    this.value = value;<br>    for (let key in this.consumers)<br>        this.consumers[key](value);<br>};</pre><pre>ObsCacher.prototype.getValue = function () {<br>    return this.value;<br>};</pre><pre>ObsCacher.prototype.subscribe = function (callback) {</pre><pre>    // This is necessary for &quot;| async&quot; in Angular<br>    if (&quot;next&quot; in callback)<br>        callback = callback.next;</pre><pre>    callback(this.value);</pre><pre>    // This is a kind of unique id<br>    let namespace = Math.random().toString(36).slice(2);</pre><pre>    this.consumers[namespace] = callback;</pre><pre>    return {<br>        unsubscribe: () =&gt; delete this.consumers[namespace]<br>    };<br>};</pre><p>Pretty similar to that of ObsEmitter but it has an additional field to hold the last value and a method to retrieve it.</p><h3>ObsReplayer implementation</h3><p>You can specify how many values you want to store in the buffer (bufferSize) and the amount of time to hold a value in the buffer before removing it from it (windowTime). Both configurations may exist simultaneously.</p><p>For this one I needed a DoublyLinkedList in order to manage the removal of elements in an efficient way.</p><pre>function ObsReplayer(bufferSize, expireTime) {<br>    this.bufferSize = bufferSize || Number.MAX_SAFE_INTEGER;<br>    this.expireTime = expireTime || Number.MAX_SAFE_INTEGER;<br>    this.values = new DoublyLinkedList();<br>    this.consumers = {};<br>}</pre><pre>ObsReplayer.prototype.next = function (value) {<br>    this.values.push({<br>        timestamp: (new Date()).getTime(),<br>        value<br>    });<br>    for (let key in this.consumers)<br>        this.consumers[key](<br>            this.getValues()<br>        );<br>};</pre><pre>ObsReplayer.prototype.getValues = function () {<br>    let collected = [];<br>    let count = this.bufferSize;<br>    this.values.traverseReverse((node) =&gt; {<br>        if (!count) {<br>            this.values.remove(node);<br>            return;<br>        }<br>        let dt = (new Date()).getTime() - node.data.timestamp;<br>        if (dt &gt; this.expireTime) {<br>            this.values.remove(node);<br>            return;<br>        }<br>        collected.push(node.data.value);<br>        count--;<br>    });<br>    return collected.reverse();<br>};</pre><pre>ObsReplayer.prototype.subscribe = function (callback) {</pre><pre>    // This is necessary for &quot;| async&quot; in Angular<br>    if (&quot;next&quot; in callback) callback = callback.next;</pre><pre>    // Run it with last values<br>    callback(this.getValues());</pre><pre>    // This is a kind of unique id<br>    let namespace = Math.random().toString(36).slice(2);</pre><pre>    this.consumers[namespace] = callback;</pre><pre>    return {<br>        unsubscribe: () =&gt; delete this.consumers[namespace]<br>    };<br>};</pre><p>When next method is called it adds the data along with a timestamp and pack both under a node to be pushed inside the DoublyLinkedList.</p><p>The method getValues() is the responsible for the filtering, it loops through nodes in reverse cronological order end remove all those that are too far back. Those that survived this first filter then have to pass an additional filter by time. If they don’t, then they get removed. Else they get added to a collected array and returned to the consumer.</p><h3>Conclusion</h3><p>If you want to fiddle with the code head over to my GitHub repo:</p><p><a href="https://github.com/4skinSkywalker/AsyncUtils">https://github.com/4skinSkywalker/AsyncUtils</a></p><p>Or go to the corresponding NPM package:</p><p><a href="https://www.npmjs.com/package/bada55asyncutils">https://www.npmjs.com/package/bada55asyncutils</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1a747dcf1839" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A better JS INTERVAL that evaluates ASYNC function SEQUENTIALLY, it’s pausable/resumable and can be…]]></title>
            <link>https://freddycorly.medium.com/a-better-js-interval-that-evaluates-async-function-sequentially-its-pausable-resumable-and-can-be-394902b1fcb6?source=rss-7a417881c5c4------2</link>
            <guid isPermaLink="false">https://medium.com/p/394902b1fcb6</guid>
            <category><![CDATA[promises]]></category>
            <category><![CDATA[async]]></category>
            <category><![CDATA[sequential]]></category>
            <category><![CDATA[setinterval]]></category>
            <category><![CDATA[js]]></category>
            <dc:creator><![CDATA[Fredo Corleone]]></dc:creator>
            <pubDate>Sun, 10 Oct 2021 12:52:33 GMT</pubDate>
            <atom:updated>2021-10-10T12:59:13.005Z</atom:updated>
            <content:encoded><![CDATA[<h3>A better JS INTERVAL that evaluates ASYNC function SEQUENTIALLY, it’s pausable/resumable and can be forced to run</h3><p>When you need to fetch data periodically from a server you usually use setInterval(), pass it a job and a delay and this will keep calling your job at a constant rate given by the delay.</p><p>This is acceptable for most applications since the delay from your server to the client will be smaller than the rate give by your delay.<br>BUT… It does NOT a good job when you have slow connection or you are trying to fetch data sequentially.</p><p>You have to know that setInterval() doesn’t wait for your async job to be completed, it runs blindly.<br>Therefore in case or slow connectivity you can end up accumulating old responses that might (depending on what you do in your code) override newer and fresher data.</p><p>I decided to give this problem a shot and I came up with a cool neat constructor that it’s like the setInterval() but evaluates your async jobs sequentially (won’t call again unless the previous has finished) and it’s also startable/stoppable and forced to execute!</p><p>As usual I wrote down a bullet list how want I wanted:</p><pre>A SmartInterval that creates an interval that has the following features:<br>- Can be paused/stopped<br>- Can be forced to execute<br>- Evaluates sequentially (no other call is made before the current call is evaluated)</pre><h3>Code example</h3><p>Here you can see how simple the API of this SmartInterval is:</p><pre>let SmartInterval = require(&quot;smartinterval&quot;);</pre><pre>let dataFetcher = new SmartInterval(<br>  async () =&gt; {<br>    await getSomeData();<br>    await getSomeOtherData();<br>  }<br>  , 3000<br>);</pre><pre>dataFetcher.start();</pre><pre>dataFetcher.forceExecution();</pre><pre>dataFetcher.stop();</pre><h3>How it’s made: the constructor</h3><p>The constructor accepts 2 arguments exactly as setInterval() does, the first is the async job you want to run on a give time basis, the second is the minimum amount of milliseconds between each job call.</p><pre>function SmartInterval(asyncFn, delayMs) {<br>  this.asyncFn = asyncFn;<br>  this.delayMs = delayMs;</pre><pre>  this.running = false;<br>}</pre><h3>The cycle</h3><p>The cycle is the main method behind the magic of all this.<br>It awaits the job call.<br>Await for a certain delay.<br>Rinse and repeat.</p><pre>SmartInterval.prototype.cycle = async function (forced) {<br>  await this.asyncFn();<br>  await this.delay(this.delayMs);<br>  if (!forced &amp;&amp; this.running) this.cycle();<br>};</pre><h3>The delay</h3><p>The delay is a promise that resolves after a give time.<br>Being it a promise is awaitable by default, therefore you can pause at it for the give amount of milliseconds.<br>It’s the ingenous lil trick behind the minimum delay between calls described above.</p><pre>// This function is just an arbitrary delay to be used with async/await pattern<br>SmartInterval.prototype.delay = function (ms) {<br>  return new Promise(res =&gt;<br>    setTimeout(() =&gt; res(1), ms)<br>  );<br>};</pre><h3>How to start</h3><p>If already running, then it does nothing. Else if calls the cycle() method and changes the internal state of the interval.</p><pre>SmartInterval.prototype.start = function () {<br>  if (this.running) return;<br>  this.running = true;<br>  this.cycle();<br>};</pre><h3>How to stop</h3><p>It changes the internal state of the interval so that the cycle() method isn’t called anymore (therefore stopping the vicious cycle).</p><pre>SmartInterval.prototype.stop = function () {<br>  if (this.running) this.running = false;<br>};</pre><h3>How to force a cycle</h3><p>To force the execution it’s as simple as calling the cycle() method manually.<br>It’s passing an argument to make an exception so that the call doesn’t spawn another long-lasting loop inside the cycle.</p><pre>SmartInterval.prototype.forceExecution = function () {<br>  if (this.running) this.cycle(true);<br>};</pre><h3>Conclusion</h3><p>You can find this on GitHub:</p><p><a href="https://github.com/4skinSkywalker/SmartInterval">https://github.com/4skinSkywalker/SmartInterval</a></p><p>And as an NPM package:</p><p><a href="https://www.npmjs.com/package/smartinterval">https://www.npmjs.com/package/smartinterval</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=394902b1fcb6" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A better JS prompt]]></title>
            <link>https://freddycorly.medium.com/a-better-js-prompt-838df93dce96?source=rss-7a417881c5c4------2</link>
            <guid isPermaLink="false">https://medium.com/p/838df93dce96</guid>
            <category><![CDATA[dialog]]></category>
            <category><![CDATA[prompt]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[ux]]></category>
            <category><![CDATA[modal]]></category>
            <dc:creator><![CDATA[Fredo Corleone]]></dc:creator>
            <pubDate>Sun, 10 Oct 2021 12:23:20 GMT</pubDate>
            <atom:updated>2021-10-10T12:23:20.845Z</atom:updated>
            <content:encoded><![CDATA[<p>Everybody knows how ugly the built-in browser prompt is.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/421/1*vPbU5n74vGDtev3JFCTjSQ.png" /><figcaption>The state of the art of browser prompt</figcaption></figure><p>We need to do better. We need multiple inputs, more type of them, we need validation, we need the prompt to be awaitable and we need a way to style the look and feel of it!</p><p>With this in mind I decided to create a better JS prompt that provides the flexibility to do much much more and works with native input elements and HTML validation.</p><p>I won’t bother you with all the lil details now. Just look the result!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/846/1*KRbKeiLgpmnDPrO15FiVVA.png" /><figcaption>My interpretation of how a prompt should look like</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/720/1*lPfIvdUNoG-BTpa61_9BPg.gif" /><figcaption>A GIF showing how it works</figcaption></figure><p>The API of my prompt is very simple:</p><pre>let prompt = await new SmartPrompt({<br>  figureColor: &quot;#bada55&quot;, // The green-ish color<br>  groundColor: &quot;#fafae9&quot;, // A shade of white</pre><pre>  title: &quot;This is a title&quot;,<br>  prescription: &quot;This is the text under the title&quot;,<br>  postscription: &quot;This is the text at the bottom befor the buttons&quot;,</pre><pre>  template: `&lt;div style=&quot;display: grid; grid-gap: 1rem;&quot;&gt;<br>  &lt;input name=&quot;myNumber&quot; type=&quot;number&quot; min=&quot;0&quot; max=&quot;10&quot; placeholder=&quot;Age&quot;&gt;<br>  &lt;input name=&quot;myText&quot; type=&quot;text&quot; minlength=&quot;3&quot; maxlength=&quot;10&quot; placeholder=&quot;Username&quot; required=&quot;true&quot;&gt;<br>  &lt;div&gt;<br>    &lt;input name=&quot;myCheck&quot; type=&quot;checkbox&quot; required=&quot;true&quot;<br>    &lt;label&gt;Check&lt;/label&gt;<br>  &lt;/div&gt;<br>  &lt;!-- ...other HTML inputs... --&gt;<br>&lt;/div&gt;`<br>});</pre><p>I started by imagining what I wanted and wrote that down:</p><pre>I want to be able to provide the developer with simplest API possible to gather inputs from the user, with beatiful prompts.</pre><pre>The promp is able to:<br>- Be awaited (async/await style)<br>- Be discarded (with outside click or cancel button click)<br>- Provide any complex template containing inputs<br>- Spit an error if the template is not valid HTML<br>- Have validation for inputs (with a lil animation)<br>- Have overflow scroll if there is too much content<br>- Two buttons, one to confirm and on to dismiss</pre><p>With the above points constantly in mind I started thinking about how I could provide the most flexibility, and the answer was to accept any kind of markup from the consumer.</p><h3>How does it work internally?</h3><p>I won’t spend too much time into details, I just want to provide you with an idea on how I did the essential things.</p><p>The constructor takes the option object provided to the it and extracts it’s properties and provide some fallbacks, also checks if the template provided is valid HTML:</p><pre>this.figureColor = opts.figureColor || &quot;#111&quot;;<br>this.groundColor = opts.groundColor || &quot;#fffff1&quot;;<br>this.textColor = opts.textColor || &quot;#111&quot;;</pre><pre>this.title = opts.title || &quot;&quot;;<br>this.prescription = opts.prescription || &quot;&quot;;<br>this.postscription = opts.postscription || &quot;&quot;;</pre><pre>this.template = opts.template;<br>if (!this.template) {<br>  throw new Error(&quot;You must provide a valid template.&quot;);<br>}</pre><pre>if (!this.isValidTemplate(this.template)) {<br>  throw new Error(`{{ error message here }}`);<br>}</pre><p>To check the validity of a template you create it by injecting HTML with .innerHTML = and then read it back and check the result against your original template:</p><pre>let doc = document.createElement(&quot;DIV&quot;);<br>doc.innerHTML = template;<br>if (doc.innerHTML !== template) { // Look strange, huh? Hehe<br>  return false;<br>}</pre><p>This works because the browser is adapting the HTML to make it fit if there are missing closing tags or malformed attributes.</p><p>Last the constructor returns a promise, because if you remember I wanted the prompt to be awaited:</p><pre>// Return a promise and extract resolve and reject<br>return new Promise((res, rej) =&gt; {</pre><pre>  // Open the modal<br>  let el = document.createElement(&quot;DIV&quot;);<br>  el.innerHTML = this.getBoilerPlate();</pre><pre>  // Setup so that clicking outside dismisses the dialog<br>  el.firstElementChild.addEventListener(&quot;click&quot;, (e) =&gt; {<br>    if (e.target.classList[0] === (&quot;modal-wrapper&quot; + this.uuid)) {<br>      this.cancel();<br>    }<br>  });</pre><pre>  document.body.appendChild(el.firstElementChild);<br>  this.fade(1);</pre><pre>  window[&quot;prompt&quot; + this.uuid] = this; // &quot;this&quot; is SmartPrompt</pre><pre>  this.resolve = res;<br>  this.reject = rej;<br>});</pre><p>I needed to extract the resolve() and reject() from the promise because I want to trigger them outside the promise.<br>When the user clicks “Submit” he/she triggers this.submit() (same goes for “Cancel”):</p><pre>SmartPrompt.prototype.submit = function () {<br>  if (this.getForm().checkValidity()) {<br>    this.resolve(this.parseResult());<br>    this.removeModal();<br>  } else {<br>    // Do a shake animation to signal invalidity<br>  }<br>};</pre><pre>SmartPrompt.prototype.cancel = function () {<br>  this.removeModal();<br>  this.reject(&quot;Aborted by the user.&quot;);<br>};</pre><p>As you can see from the above snippet the magic of validation happens when I call the .checkValidity() on the form element.</p><p>To get the form values and make them into an object I use the FormData constructor:</p><pre>SmartPrompt.prototype.parseResult = function () {<br>  let formData = new FormData(this.getForm());<br>  return [...formData.entries()]<br>    .reduce((result, tuple) =&gt;<br>      (result[tuple[0]] = tuple[1], result)<br>      , {}<br>    );<br>};</pre><pre>// &lt;input type=&quot;text&quot; name=&quot;myName&quot;&gt;<br>// will become<br>// { myName: &quot;whatever was inputted&quot; }</pre><p>In order to encapsulate the prompt markup and style I use a UUID:</p><pre>this.uuid = Math.random().toString(36).slice(2);</pre><p>The shell of the prompt and its styles are marked with the above UUID. I defined all the boilerplate associated with the prompt in a function that uses interpolation to generate the markup the way it has to be:</p><pre>&lt;div class=&quot;modal-wrapper${this.uuid}&quot;&gt;...&lt;/div&gt;<br>...<br>&lt;style&gt;<br>.modal-wrapper${this.uuid} {<br>  position: fixed;<br>  top: 0;<br>  z-index: 999999;<br>  ...<br>}<br>...<br>&lt;/style&gt;</pre><h3>Conclusion</h3><p>You can play with this prompt, to be precise the first draft of it, in Codepen:</p><p><a href="https://codepen.io/eternalsunshineofspotlessmind/full/WNOVdyQ">https://codepen.io/eternalsunshineofspotlessmind/full/WNOVdyQ</a></p><p>I made it into a GitHub repository:</p><p><a href="https://github.com/4skinSkywalker/SmartPrompt">https://github.com/4skinSkywalker/SmartPrompt</a></p><p>And a NPM package:</p><p><a href="https://www.npmjs.com/package/smartprompt">https://www.npmjs.com/package/smartprompt</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=838df93dce96" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ethbox: Ethereum’s first escrow community]]></title>
            <link>https://freddycorly.medium.com/ethbox-ethereums-first-escrow-community-2bbabdd1e0b1?source=rss-7a417881c5c4------2</link>
            <guid isPermaLink="false">https://medium.com/p/2bbabdd1e0b1</guid>
            <category><![CDATA[bitcoin]]></category>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[moonshots]]></category>
            <category><![CDATA[ethereum]]></category>
            <category><![CDATA[cryptocurrency]]></category>
            <dc:creator><![CDATA[Fredo Corleone]]></dc:creator>
            <pubDate>Thu, 01 Apr 2021 12:05:09 GMT</pubDate>
            <atom:updated>2021-04-11T09:40:27.425Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mKJWUNTYieni-TaKN01bjA.png" /></figure><h3>What Is ethbox?</h3><p>ethbox is a platform providing a smart contract-based digital escrow service, to ensure that transferring funds between two or more parties takes place without any chance of failure.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*90RWkkcrN_hFOuzQHvXCYQ.png" /></figure><h3>Why Is Even useful?</h3><p>Accidentally sending funds to a mistyped or mistaken recipient address has already been the cause for hundreds of millions, if not billions, of financial damage.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/567/1*8X-shEyqfKInluuCgHTahw.png" /><figcaption>Up to 18% of all bitcoins got lost due to wrong transaction address or losing the wallet passphrase.</figcaption></figure><p>Currently, ethbox’s main functionality is to secure peer-to-peer cryptocurrency transactions in the Ethereum network, supporting the transfer of ETH and ERC-20 tokens. In the future, the platform will expand to blockchain ecosystems other than Ethereum.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/291/1*oiP4zifbZEfGjsXFNm63gQ.png" /></figure><p>Since smart contracts are transparent and ethbox needs to verify passphrases before executing code, ethbox does not store the passphrases in plain text. The platform generate hash values for the passphrases, which are then used to verify the validity of passphrases entered by recipients. Coupling MetaMask with hashing passphrases provides two layers of security that create a robust and practically unbreakable system to conduct blockchain transactions.</p><h3>Over the Counter Trading</h3><p>ethbox gives users additional functionalities within the Ethereum network by allowing to trade ETH and ERC-20 tokens peer-to-peer and trustlessly. Using the smart contract’s features, over-the-counter (OTC) trading is vastly simplified, as the transfer of funds can only be completed when all terms are satisfied.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*e-ovr3cGeVqnxbj4JEV1aA.png" /></figure><p>This feature shields traders from projects and other traders with malicious, fraudulent intentions.</p><p><em>This feature would be very interesting if in the future it could be possible to trade let’s say an ERC-20 as USDT for and ERC-721 as a rare NFT.</em></p><h3>Anonimity</h3><p>ethbox sets itself apart by concealing blockchain transactions, making the sender and receiver untraceable. This provides users with much-desired anonymity together with transactions that are guaranteed to be flawless and worry-free.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/356/1*wYP3WcYV1BbDyOKi-J6lsg.png" /></figure><p>The approach is similar to that of a mixer (for example Tornado or Blank): <em>all funds get mixed together making it impossible to link a sender to a recepient.</em></p><h3>Token Utility and Tokenomics</h3><p>ethbox’s token, EBOX, is a deflationary utility and governance token. EBOX is deflated through buy-back and burning part of the generated fee. Those who hold EBOX will have access to exclusive services on ethbox, and subsidized fees for common services.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/717/1*FNtmLflVLei-fXqqt8gWlg.png" /></figure><p>EBOX holders with more than 5000 tokens automatically participate to the staking program (read below).</p><p>EBOX holders will actively participate in the development of ethbox and decision making for upcoming project milestones.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/728/1*nQd3UHtXpj58euBfpBsMOA.png" /></figure><h3>Staking Rewards</h3><p>The <strong>share rate</strong> is used for calculating each user’s individual share among the entirety of EBOX tokens that are being given away as staking rewards.</p><p>Users holding <strong>5,000 EBOX</strong> or above are assigned a <strong>base share rate</strong> of <strong>x1</strong>. Users holding <strong>50,000 EBOX</strong> or above are assigned a <strong>base share rate</strong> of <strong>x2</strong>. <em>Users with less than 5,000 EBOX do not participate in the staking reward.</em></p><p>Staking period (from one payday to the next) is one month, during which the minimum of 5,000 EBOX / 50,000 EBOX needs to be held at all times.</p><p>18% of the total EBOX supply (65,000,000) have been allocated for staking, which makes for a total of 11,700,000 over a period of 4 years, equaling <strong>243,750 EBOX being given away as staking rewards each month</strong>.</p><p>These monthly 243,750 EBOX are split among all participating users proportionally to the amount of EBOX tokens being held, multiplied with the user’s respective share rate.</p><p>There are additional bonuses for LP providers, more info can be found at the following link: <a href="https://ethbox.medium.com/introducing-ebox-staking-rewards-4c65c07fc89d">Introducing Staking Rewards</a>.</p><h3>Upcoming Features</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/326/1*E7Bz4APOJiFBmqRgnLwsmw.png" /><figcaption>Extract from ethbox’s <a href="https://ethbox.org/ethbox%20Whitepaper.pdf">WhitePaper</a></figcaption></figure><h3>Channels and Resources</h3><ul><li><a href="https://www.ethbox.org/">Website</a></li><li><a href="https://www.ethbox.org/testnet/">Open Beta on Rinkeby Testnet</a></li><li><a href="https://www.t.me/ethbox_official">Telegram Community Chat</a></li><li><a href="https://www.t.me/ethboxANN">Telegram Announcements</a></li><li><a href="https://www.t.me/ethbox_testnet">Telegram Testnet Assistence</a></li><li><a href="https://twitter.com/ethbox_official">Twitter</a></li><li><a href="https://www.reddit.com/user/ethbox">Reddit</a></li><li><a href="https://www.facebook.com/Ethbox-163318048851696">Facebook</a></li><li><a href="https://www.github.com/ethbox-official">GitHub</a></li><li><a href="https://www.ethbox.org/ethbox%20Whitepaper.pdf">WhitePaper</a></li><li><a href="https://ethbox.org/ethbox%20Lightpaper.pdf">LightPaper</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2bbabdd1e0b1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[CRYPTO THAT WILL MOON IN 2021]]></title>
            <link>https://freddycorly.medium.com/crypto-that-will-moon-in-2021-3e2630ae09d2?source=rss-7a417881c5c4------2</link>
            <guid isPermaLink="false">https://medium.com/p/3e2630ae09d2</guid>
            <category><![CDATA[cryptocurrency]]></category>
            <category><![CDATA[crypto]]></category>
            <category><![CDATA[ethereum]]></category>
            <category><![CDATA[bitcoin]]></category>
            <category><![CDATA[cryptocurrency-investment]]></category>
            <dc:creator><![CDATA[Fredo Corleone]]></dc:creator>
            <pubDate>Wed, 10 Feb 2021 11:39:56 GMT</pubDate>
            <atom:updated>2021-08-08T17:38:32.466Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DtvH-OUnnjWCFJLJTPM-xg.jpeg" /><figcaption>Picture of a cryptocurrency going to the moon</figcaption></figure><p>Hi guys,</p><p>with this post I want to compress days of research so that you don’t have to waste time by choosing long-term and undervalued projects.</p><p>You wouldn’t believe how many hours of reading I’ve spent to come up with this list of projects.</p><p>I have “skin in the game” in each of the following coins, but don’t worry because I’m plancton and can’t dump on you.</p><p>I’ll try to be as clear, using laymen terms, and as concise (no more than 3 points for projects) so that the reading won’t hurt your brain.</p><p>The ordering is alphabetic to be fair towards the projects I’ve picked.</p><p>P.S.: This post took hours. If there’s something wrong just tell me and I’ll fix it. Enjoy!</p><p><strong>Cartesi</strong> (CTSI #452 on CoinGecko 24M market cap)<br>- It’s a layer-2 solution running in Linux that helps layer-1 blockchains to scale.<br>- They will release a Software Developer Kit and Optimistic Rollups (which are used to improve speed by quite a lot) soon.<br>- CTSI token has utility: block rewards, staking and arbitration.</p><p><strong>Celer Network</strong> (CELR #266 on CoinGecko 68M market cap)<br>- It’s a layer-2 solution that enables fast and low cost transactions.<br>- It has a working an Software Developer Kit and an app called CelerX that showcases the speed they can achieve.<br>- CELR token has utility: liquidity, staking and paying the service.</p><p><strong>CertiK</strong> (CTK #288 on CoinGecko 58M market cap)<br>- It’s a Delegated Proof-of-Stake blockchain built with the Cosmos Developer Kit.<br>- It’s main product is the Security Oracle which is basically a piece of code you can call to check if a smart contract you is safe or not, think of it as an anti-scam oracle.<br>- CTK token has both utility and governance: gas, staking, rewards, collateral and voting.</p><p><strong>ethbox </strong>(EBOX #2747 on CoinMarketCap 3M fully diluted market cap)<br>- Used to send, receive and trade tokens with reversibility and privacy.<br>- Integrated with Ethereum, Binance Smart Chain and Polygon.<br>- EBOX token has both utility and governance: staking rewads and service payment.</p><p><strong>Chromia</strong> (CHR #462 on CoinGecko 23M market cap)<br>- It aims to solve the scalability problem of current blockchains with a unique approach: by forming a network of relational databases (nodes).<br>- It works similar to sharding (a technique used for parallel computing) and leverage existing Proof-of-Work blockchains to improve it’s security (Chromia’s transactions gets bundled and inserted into BitCoin or Ethereum).<br>- CHR token has utility: rewards and paying.</p><p><strong>Contentos</strong> (COS #348 on CoinGecko 39M market cap)<br>- It aims to protect author’s rights by building a decentralized digital content comminity capable of distributing and rewarding contents.<br>- Provides smart contracts for automated monetization, copyright verification and storage of digital content right into the Contentos blockchain. Every interaction of a user within the eco-system is recorded and provides a credit status therefore incentivizing positive interactions.<br>- COS token has utility and governance: gas, transactions and voting.</p><p><strong>COTI</strong> (COTI #262 on CoinGecko 69M market cap)<br>- It’s a graph blockchain that combines Proof-of-Trust and Proof-of-Stake to achieve highspeed and low costs.<br>- It enables other blockchains to use its trust score system to identify malicious actors, it also has a payment solution for merchants that works via web and POS.<br>- COTI has utility: transactions and rewards.</p><p><strong>Cover Protocol</strong> (COVER #347 on CoinGecko 41M market cap)<br>- It’s a risk coverage marketplace for Ethereum projects. In basic terms is insurance for DeFi, it works by people holding CLAIM or NOCLAIM tokens to cover themselves from possible losses resulting by project failures.<br>- It withstood and hack and has learnt the hard lesson.<br>- COVER is a governance token used to vote for proposals and validate/invalidate claims.</p><p><strong>Cudos</strong> (CUDOS #642 on CoinGecko 10M market cap)<br>- It aims to offer monetization for sellers’ hardware idle time and competitive computing power prices for buyers.<br>- It partnered with AMD and has pretty high profile advisors such as the Director of Blockchain for AMD and the former CEO of Sony Entertainment Europe.<br>- CUDOS is the utility token for the platform.</p><p><strong>DIA</strong> (DIA #268 on CoinGecko 67M market cap)<br>- It’s an open-source price oracle for DeFi applications. A price oracle is a piece of code that can be used to get reliable data for financial applications.<br>- Its data feeds are open-source and verifiable by everyone.<br>- DIA is both governance and utility token: voting, staking and payments.</p><p><strong>DUSK Network</strong> (DUSK #380 on CoinGecko 35M market cap)<br>- It’s a blockchain that enables privacy-preserving transactions and smart contracts execution.<br>- It could bring a privacy-friendly DeFi in which interactions with smart contracts are kept secret.<br>- DUSK is the utility token used for transactions.</p><p><strong>EasyFi</strong> (EASY #445 on CoinGecko 26M market cap)<br>- DeFi lending protocol that enables under-collateralized lending, it achieve this with TrustScore which is a mechanism to analyze borrower’s activities on various platforms to determine the collateralization ratio required.<br>- It uses Proof-of-Stake and Plasma to be high speed and low cost.<br>- EAST has both governance and utility: voting, rewards and staking.</p><p><strong>Frontier</strong> (FRONT #454 on CoinGecko 24M market cap)<br>- It’s a DeFi aggregation platform that makes super easy and comfortable to use the most established DeFi services on the following chains: Ethereum, BSC, Band, Kava, Harmony and Cosmos.<br>- The financial services you can find in the app are: staking, swapping, liquidity provision, borrowing/lending and more!<br>- FRONT is both utility and governance token: voting, liquidity provision and staking.</p><p><strong>Injective Protocol</strong> (INJ #130 on CoinGecko 207M market cap)<br>- It’s a decentralized exchange that lets users trade digital and pegged-in-value copies of almost anything (crypto, fiat, stocks…).<br>- It’s built on layer-2 therefore it’s fast and cheap. It’s a Robinhood (trading app) killer. It’s close to its mainnet.<br>- INJ token is both utility and governance: voting, rewards and collateral backing.</p><p><strong>Measurable Data Token</strong> (MDT #398 on CoinGecko 32M market cap)<br>- It’s a secure and anonymous marketplace for data exchange.<br>- It also provides consumers insights to businesses with Artificial Intelligence.<br>- MDT is the utility token to pay for data and is used for rewards.</p><p><strong>Opacity</strong> (OPCT #754 on CoinGecko 7M market cap)<br>- It’s a cloud storage powered by OPCT token.<br>- It’s based on zero-knowledge principle, this means they can’t track your uploads/downloads.<br>- OPCT it’s the utility token for payments and rewards.</p><p><strong>Origin Protocol</strong> (OGN #207 on CoinGecko 101M market cap)<br>- It aims to be the future of decentralized e-commerce to make it easy for people to commerce without paying commissions.<br>- The focus is to build an open and free market in which participants have stakes in the network.<br>- OGN is a utility token to pay for the service and affiliate/advertise the platform.</p><p><strong>Orion Protocol</strong> (ORN #225 on CoinGecko 91M market cap)<br>- It’s a trading terminal that executes trades across different exchanges both centralized and decentralized.<br>- It has a portfolio management app and app store (algo trading bots), and also other products for exchanges.<br>- ORN is a utility token used for broker staking, rewards and discounts.</p><p><strong>Prometeus</strong> (PROM #403 on CoinGecko 32M market cap)<br>- It’s a layer-2 project built on Binance Smart Chain and Arweave that aims to provide anonymous data store and exchange.<br>- It’s basically a way in which people can monetize data beyond jurisdiction.<br>- PROM is a utility token used for staking and payments.</p><p><strong>Prosper</strong> (PROS #647 on CoinGecko 10M market cap)<br>- It’s an prediction/hedging platform built on Ethereum and Binance Smart Chain.<br>- Think of it as a betting platform in which you choose between BULL and BEAR scenarios (over a given period) and you can win/lose money.<br>- PROS is both utility and governance token: rewards, liquidity provision, insurance system and fee discounts.</p><p><strong>STP Network</strong> (STPT #458 on CoinGecko 24M market cap)<br>- It will enable synthetics assets to be issued on Polkadot.<br>- It aims to reduce collateralization needed and be able to work cross-chain.<br>- STPT is the governance token used for protocol decisions.</p><p><strong>TrueFi</strong> (TRU #287 on CoinGecko 61M market cap)<br>- It aims to enable uncollateralized lending by letting TRU stakers to accept/refuse the requests submitted by borrowers, TRU stakers are subjected to upside/downside based on if the loan ends up repaid.<br>- Borrowers sign a loan agreement and will face legal action in case they don’t return the principal and interest.<br>- TRU is the governance token used to make decisions.</p><p><strong>Wing Finance</strong> (WING #411 on CoinGecko 31M market cap)<br>- It’s a lending platform that has two types of lending a) collateralized lending and b) credit-based lending.<br>- Credit-based lending uses an OScore (ONTology Score) to reduce collateralization.<br>- WING is used for voting, discounts and insurance contracts.</p><p>Thanks for you attention,<br>Fredo Corleone</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3e2630ae09d2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[DeFi of Thrones — Betting on the Blockchain]]></title>
            <link>https://freddycorly.medium.com/defi-of-thrones-betting-on-the-blockchain-5ab64b3ff93d?source=rss-7a417881c5c4------2</link>
            <guid isPermaLink="false">https://medium.com/p/5ab64b3ff93d</guid>
            <category><![CDATA[cryptocurrency-investment]]></category>
            <category><![CDATA[chain-link]]></category>
            <category><![CDATA[aave]]></category>
            <category><![CDATA[defi]]></category>
            <category><![CDATA[cryptocurrency]]></category>
            <dc:creator><![CDATA[Fredo Corleone]]></dc:creator>
            <pubDate>Mon, 14 Dec 2020 13:22:40 GMT</pubDate>
            <atom:updated>2020-12-14T13:22:40.399Z</atom:updated>
            <content:encoded><![CDATA[<h3>DeFi of Thrones — Betting on the Blockchain</h3><p>Today I want to introduce you a DeFi (Decentralized Finance) project that I think it’s quite interesting: <strong>DeFi of Thrones</strong> (<a href="https://defiofthrones.io/">https://defiofthrones.io/</a>).</p><p>The concept is <strong>extremely simple </strong>and I’m going to explain it to you in few simple words.</p><h3>THE GAME</h3><p>Every week there are <strong>two DeFi projects</strong> (called houses) <strong>in opposition</strong> (in a war).<br>This week’s war is LINK vs AAVE.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/660/1*SKrg5IEr4DtVnz7SV1P6pQ.png" /><figcaption>Custom designs from the dApp at <a href="https://defiofthrones.io/">defiofthrones.io</a></figcaption></figure><p>The goal of the game is to <strong>pick and bet on the project/house</strong> you think will perform best, in terms of price appreciation, over the duration of the war.</p><p>The duration of the <strong>war is 7 days</strong>, but you have only <strong>4 days to pick</strong> your choice.</p><p>The house that wins the war is the one which has a higher price appreciation over the entire duration of the war (7 days).</p><p>To bet on the house of your choice you have to buy tickets using <strong>DOTX token</strong> (on <a href="https://app.uniswap.org/#/swap?outputCurrency=0xFAb5a05C933f1A2463E334E011992E897D56eF0a">Uniswap</a>). Each tickets costs 10 DOTX.</p><p>You can <strong>switch house within the 4 days</strong> remaining to buy tickets but it will <strong>cost you 1% of your purchased tickets</strong>.</p><p>If your house wins the war, then <strong>you win a share of the tickets</strong> of the losing house. The amount of tickets you can win is visible in the app under “Your potential reward”.</p><h3>DOTX DISTRIBUTION</h3><p><strong>Max. supply</strong>: 6,000,000<br><strong>Circ. supply</strong>: 3,900,000<br><strong>Deflationary</strong>: 5% of the DoTx tokens from the losing house are permanently burnt after each war.</p><p><strong>17%<br></strong>1 million DoTx + 150 ETH provided on Uniswap</p><p><strong>31%<br></strong>1.9 millions DoTx sold on the public sale at $0.045 per token, with ETH pegged at $425</p><p><strong>17%<br></strong>1 million DoTx allocated to swap the DOT v1</p><p><strong>12%</strong><br>700,000 DoTx allocated to the team locked in <a href="https://etherscan.io/address/0x0404c78f23babd3f62f69a077faa2406d7ee2027">time contract</a>. At the 7th month 50% of the team tokens will be distributed and every following month, 5.5% of the tokens will be unlocked</p><p><strong>23%</strong><br>1.4 millions DoTx allocated to marketing locked in a <a href="https://etherscan.io/address/0xb31cd4191e00d56294b407045fe20084e8ad28d7">vesting contract</a> with linear release over 2 years.</p><h3>THE APPLICATION</h3><p>The dApp (Decentralized Application) is app and running at <a href="https://defiofthrones.io/app/war">https://defiofthrones.io/app/war</a>.</p><p>In the main screen you have a lot of useful information to consider in order to make the best choice possible:</p><ol><li>Houses price graphs;</li></ol><p>2. A timer that shows when the war will end;</p><p>3. Two cards for the houses with ticker, opening price, current price (with trend indicator), a description, total users, total tickets, total value, DOTX to burn and DOTX to vault;</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/723/1*_-7XQhUOlbwuL5166tNBYQ.png" /></figure><p>4. Your tickets, your joined house, total tickets, a button to buy tickets, a button to switch house and the time remaining to buy tickets;</p><p>5. Your share of the reward;</p><p>6. Your potential reward, tickets bought, potential reward and total value;</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/362/1*_ORWhgt8Sq92ni-NUjBxVQ.png" /></figure><p>7. Houses performance (%);</p><p>8. Last transactions with a link to Etherscan.</p><p>There are plenty other functionalities such as chat, leaderboard, accounts… and a lot more to be developed in the near future (check <a href="https://trello.com/b/q99vJg24/defi-of-thrones-project">future developments</a>)!</p><h3>OTHER CONSIDERATIONS</h3><p>The <strong>market cap is extremely low</strong> (365,027 USD 14/12/2020 13:47) with a lot of room for growth.</p><p>It has <strong>Chainlink integration</strong> to retrieve real market data of opening and closing prices.</p><p>The <strong>team is extremely professional</strong> and transparent (check their <a href="https://github.com/DefiOfThrones/DOTTokenContract">GitHub</a> and <a href="https://trello.com/b/q99vJg24/defi-of-thrones-project">TODO</a>).</p><p>The <strong>community is healthy</strong> without toxic individuals.</p><p>The application is <strong>released </strong>and working and new features are being built continuosly (<a href="https://defiofthrones.medium.com/defi-of-thrones-first-war-platform-onboarding-428ef5e2b4d4">https://defiofthrones.medium.com/defi-of-thrones-first-war-platform-onboarding-428ef5e2b4d4</a>).</p><p>Contracts are <strong>audited</strong> (<a href="https://defiofthrones.medium.com/defi-of-thrones-audit-overview-80adc56465d4">https://defiofthrones.medium.com/defi-of-thrones-audit-overview-80adc56465d4</a>).</p><p>The project is <strong>resilient </strong>and has already resisted a DDoS (<a href="https://defiofthrones.medium.com/ddos-attack-against-defi-of-thrones-website-6409bbe389f6">https://defiofthrones.medium.com/ddos-attack-against-defi-of-thrones-website-6409bbe389f6</a>).</p><h3>USEFUL LINKS</h3><p><strong>Site</strong>: <a href="https://defiofthrones.io/">https://defiofthrones.io/</a></p><p><strong>Start the app</strong>: <a href="https://defiofthrones.io/app/">https://defiofthrones.io/app/</a></p><p><strong>Contract</strong>: <a href="https://etherscan.io/address/0xFAb5a05C933f1A2463E334E011992E897D56eF0a">https://etherscan.io/address/0xFAb5a05C933f1A2463E334E011992E897D56eF0a</a></p><p><strong>Buy on Uniswap</strong>: <a href="https://app.uniswap.org/#/swap?outputCurrency=0xFAb5a05C933f1A2463E334E011992E897D56eF0a">https://app.uniswap.org/#/swap?outputCurrency=0xFAb5a05C933f1A2463E334E011992E897D56eF0a</a></p><p><strong>Twitter</strong>: <a href="https://twitter.com/DefiOfThrones">https://twitter.com/DefiOfThrones</a></p><p><strong>Medium</strong>: <a href="https://medium.com/@defiofthrones">https://medium.com/@defiofthrones</a></p><p><strong>GitHub</strong>: <a href="https://github.com/DefiOfThrones/DOTTokenContract">https://github.com/DefiOfThrones/DOTTokenContract</a></p><p><strong>Telegram</strong>: <a href="https://t.me/DeFiOfThronesOfficial">https://t.me/DeFiOfThronesOfficial</a></p><p><strong>Discord</strong>: <a href="https://discord.com/invite/FhTt85c">https://discord.com/invite/FhTt85c</a></p><p><strong>Project TODO</strong>: <a href="https://trello.com/b/q99vJg24/defi-of-thrones-project">https://trello.com/b/q99vJg24/defi-of-thrones-project</a></p><h3>DISCLAIMER</h3><p>I’m not affiliated to this project, but I have a small bag of DOTX.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5ab64b3ff93d" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>