-
Notifications
You must be signed in to change notification settings - Fork 1
/
features.html
39 lines (36 loc) · 45.2 KB
/
features.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<!doctype html>
<html lang="en" dir="ltr" class="docs-wrapper docs-doc-page docs-version-current plugin-docs plugin-id-default docs-doc-id-features">
<head>
<meta charset="UTF-8">
<meta name="generator" content="Docusaurus v2.2.0">
<title data-rh="true">📖 Features | Hashgreen</title><meta data-rh="true" name="viewport" content="width=device-width,initial-scale=1"><meta data-rh="true" name="twitter:card" content="summary_large_image"><meta data-rh="true" property="og:url" content="https://docs.hash.green/features"><meta data-rh="true" name="docusaurus_locale" content="en"><meta data-rh="true" name="docsearch:language" content="en"><meta data-rh="true" name="docusaurus_version" content="current"><meta data-rh="true" name="docusaurus_tag" content="docs-default-current"><meta data-rh="true" name="docsearch:version" content="current"><meta data-rh="true" name="docsearch:docusaurus_tag" content="docs-default-current"><meta data-rh="true" property="og:title" content="📖 Features | Hashgreen"><meta data-rh="true" name="description" content="Highlight"><meta data-rh="true" property="og:description" content="Highlight"><link data-rh="true" rel="icon" href="/img/favicon.ico"><link data-rh="true" rel="canonical" href="https://docs.hash.green/features"><link data-rh="true" rel="alternate" href="https://docs.hash.green/features" hreflang="en"><link data-rh="true" rel="alternate" href="https://docs.hash.green/zh-Hant/features" hreflang="zh-Hant"><link data-rh="true" rel="alternate" href="https://docs.hash.green/features" hreflang="x-default"><link rel="alternate" type="application/rss+xml" href="/blog/rss.xml" title="Hashgreen RSS Feed">
<link rel="alternate" type="application/atom+xml" href="/blog/atom.xml" title="Hashgreen Atom Feed">
<link rel="preconnect" href="https://www.google-analytics.com">
<script>window.ga=window.ga||function(){(ga.q=ga.q||[]).push(arguments)},ga.l=+new Date,ga("create","UA-215712055-3","auto"),ga("set","anonymizeIp",!0),ga("send","pageview")</script>
<script async src="https://www.google-analytics.com/analytics.js"></script>
<link rel="preconnect" href="https://www.google-analytics.com">
<link rel="preconnect" href="https://www.googletagmanager.com">
<script async src="https://www.googletagmanager.com/gtag/js?id=G-E9PMCRRH75"></script>
<script>function gtag(){dataLayer.push(arguments)}window.dataLayer=window.dataLayer||[],gtag("js",new Date),gtag("config","G-E9PMCRRH75",{})</script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/katex.min.css" integrity="sha384-odtC+0UGzzFL/6PNoE8rX/SPcQDXBJ+uRepguP4QkPCm2LBxH3FA3y+fKSiJ+AmM" crossorigin="anonymous"><link rel="stylesheet" href="/assets/css/styles.f37a726d.css">
<link rel="preload" href="/assets/js/runtime~main.ab13e0ea.js" as="script">
<link rel="preload" href="/assets/js/main.d4b44e97.js" as="script">
</head>
<body class="navigation-with-keyboard">
<script>!function(){function t(t){document.documentElement.setAttribute("data-theme",t)}var e=function(){var t=null;try{t=localStorage.getItem("theme")}catch(t){}return t}();t(null!==e?e:"light")}()</script><div id="__docusaurus">
<div role="region" aria-label="Skip to main content"><a class="skipToContent_fXgn" href="#docusaurus_skipToContent_fallback">Skip to main content</a></div><nav class="navbar navbar--fixed-top"><div class="navbar__inner"><div class="navbar__items"><button aria-label="Toggle navigation bar" aria-expanded="false" class="navbar__toggle clean-btn" type="button"><svg width="30" height="30" viewBox="0 0 30 30" aria-hidden="true"><path stroke="currentColor" stroke-linecap="round" stroke-miterlimit="10" stroke-width="2" d="M4 7h22M4 15h22M4 23h22"></path></svg></button><a class="navbar__brand" href="/"><div class="navbar__logo"><img src="/img/hashgreen-green.svg" alt="Hashgreen" class="themedImage_ToTc themedImage--light_HNdA"><img src="/img/hashgreen-green.svg" alt="Hashgreen" class="themedImage_ToTc themedImage--dark_i4oU"></div></a><a aria-current="page" class="navbar__item navbar__link navbar__link--active" href="/">Docs</a><a class="navbar__item navbar__link" href="/blog">Blog</a><a href="https://hash.green/" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link">HashgreenSwap<svg width="13.5" height="13.5" aria-hidden="true" viewBox="0 0 24 24" class="iconExternalLink_nPIU"><path fill="currentColor" d="M21 13v10h-21v-19h12v2h-10v15h17v-8h2zm3-12h-10.988l4.035 4-6.977 7.07 2.828 2.828 6.977-7.07 4.125 4.172v-11z"></path></svg></a></div><div class="navbar__items navbar__items--right"><div class="navbar__item dropdown dropdown--hoverable dropdown--right"><a href="#" aria-haspopup="true" aria-expanded="false" role="button" class="navbar__link"><svg viewBox="0 0 24 24" width="20" height="20" aria-hidden="true" class="iconLanguage_nlXk"><path fill="currentColor" d="M12.87 15.07l-2.54-2.51.03-.03c1.74-1.94 2.98-4.17 3.71-6.53H17V4h-7V2H8v2H1v1.99h11.17C11.5 7.92 10.44 9.75 9 11.35 8.07 10.32 7.3 9.19 6.69 8h-2c.73 1.63 1.73 3.17 2.98 4.56l-5.09 5.02L4 19l5-5 3.11 3.11.76-2.04zM18.5 10h-2L12 22h2l1.12-3h4.75L21 22h2l-4.5-12zm-2.62 7l1.62-4.33L19.12 17h-3.24z"></path></svg>English</a><ul class="dropdown__menu"><li><a href="/features" target="_self" rel="noopener noreferrer" class="dropdown__link dropdown__link--active" lang="en">English</a></li><li><a href="/zh-Hant/features" target="_self" rel="noopener noreferrer" class="dropdown__link" lang="zh-Hant">繁體中文</a></li></ul></div><div class="toggle_vylO colorModeToggle_DEke"><button class="clean-btn toggleButton_gllP toggleButtonDisabled_aARS" type="button" disabled="" title="Switch between dark and light mode (currently light mode)" aria-label="Switch between dark and light mode (currently light mode)" aria-live="polite"><svg viewBox="0 0 24 24" width="24" height="24" class="lightToggleIcon_pyhR"><path fill="currentColor" d="M12,9c1.65,0,3,1.35,3,3s-1.35,3-3,3s-3-1.35-3-3S10.35,9,12,9 M12,7c-2.76,0-5,2.24-5,5s2.24,5,5,5s5-2.24,5-5 S14.76,7,12,7L12,7z M2,13l2,0c0.55,0,1-0.45,1-1s-0.45-1-1-1l-2,0c-0.55,0-1,0.45-1,1S1.45,13,2,13z M20,13l2,0c0.55,0,1-0.45,1-1 s-0.45-1-1-1l-2,0c-0.55,0-1,0.45-1,1S19.45,13,20,13z M11,2v2c0,0.55,0.45,1,1,1s1-0.45,1-1V2c0-0.55-0.45-1-1-1S11,1.45,11,2z M11,20v2c0,0.55,0.45,1,1,1s1-0.45,1-1v-2c0-0.55-0.45-1-1-1C11.45,19,11,19.45,11,20z M5.99,4.58c-0.39-0.39-1.03-0.39-1.41,0 c-0.39,0.39-0.39,1.03,0,1.41l1.06,1.06c0.39,0.39,1.03,0.39,1.41,0s0.39-1.03,0-1.41L5.99,4.58z M18.36,16.95 c-0.39-0.39-1.03-0.39-1.41,0c-0.39,0.39-0.39,1.03,0,1.41l1.06,1.06c0.39,0.39,1.03,0.39,1.41,0c0.39-0.39,0.39-1.03,0-1.41 L18.36,16.95z M19.42,5.99c0.39-0.39,0.39-1.03,0-1.41c-0.39-0.39-1.03-0.39-1.41,0l-1.06,1.06c-0.39,0.39-0.39,1.03,0,1.41 s1.03,0.39,1.41,0L19.42,5.99z M7.05,18.36c0.39-0.39,0.39-1.03,0-1.41c-0.39-0.39-1.03-0.39-1.41,0l-1.06,1.06 c-0.39,0.39-0.39,1.03,0,1.41s1.03,0.39,1.41,0L7.05,18.36z"></path></svg><svg viewBox="0 0 24 24" width="24" height="24" class="darkToggleIcon_wfgR"><path fill="currentColor" d="M9.37,5.51C9.19,6.15,9.1,6.82,9.1,7.5c0,4.08,3.32,7.4,7.4,7.4c0.68,0,1.35-0.09,1.99-0.27C17.45,17.19,14.93,19,12,19 c-3.86,0-7-3.14-7-7C5,9.07,6.81,6.55,9.37,5.51z M12,3c-4.97,0-9,4.03-9,9s4.03,9,9,9s9-4.03,9-9c0-0.46-0.04-0.92-0.1-1.36 c-0.98,1.37-2.58,2.26-4.4,2.26c-2.98,0-5.4-2.42-5.4-5.4c0-1.81,0.89-3.42,2.26-4.4C12.92,3.04,12.46,3,12,3L12,3z"></path></svg></button></div><div class="searchBox_ZlJk"></div></div></div><div role="presentation" class="navbar-sidebar__backdrop"></div></nav><div id="docusaurus_skipToContent_fallback" class="main-wrapper mainWrapper_z2l0 docsWrapper_BCFX"><button aria-label="Scroll back to top" class="clean-btn theme-back-to-top-button backToTopButton_sjWU" type="button"></button><div class="docPage__5DB"><aside class="theme-doc-sidebar-container docSidebarContainer_b6E3"><div class="sidebar_njMd"><nav class="menu thin-scrollbar menu_SIkG"><ul class="theme-doc-sidebar-menu menu__list"><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-1 menu__list-item"><a class="menu__link" href="/">🌏 Overview</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-1 menu__list-item"><a class="menu__link" href="/roadmap">🛣️ Roadmap</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-1 menu__list-item"><a class="menu__link" href="/community">👥 Community</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-1 menu__list-item"><a class="menu__link" href="/partners">🤝 Partners</a></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--active" href="/category/products">Products</a></div><ul style="display:block;overflow:visible;height:auto" class="menu__list"><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/get-started">▶ Get Started</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/how-to-trade-on-hashgreenswap">🏫 How to Trade on HashgreenSwap</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/how-to-test-hashgreenswap-on-testnet">🧪 How to Test HashgreenSwap on Testnet</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link menu__link--active" aria-current="page" tabindex="0" href="/features">📖 Features</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/exchange">💱 Exchange</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/liquidity-pool">🏊 Liquidity Pool</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/yield-farming">🌾 Yield Farming</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/hashgreen-dao">🗳️ HashgreenDAO</a></li></ul></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-1 menu__list-item"><a class="menu__link" href="/tokenomics">💰 Tokenomics</a></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist menu__link--sublist-caret" aria-expanded="false" href="/category/hashgreen-dex">Legacy Products</a></div></li></ul></nav></div></aside><main class="docMainContainer_gTbr"><div class="container padding-top--md padding-bottom--lg"><div class="row"><div class="col docItemCol_VOVn"><div class="docItemContainer_Djhp"><article><nav class="theme-doc-breadcrumbs breadcrumbsContainer_Z_bl" aria-label="Breadcrumbs"><ul class="breadcrumbs" itemscope="" itemtype="https://schema.org/BreadcrumbList"><li class="breadcrumbs__item"><a aria-label="Home page" class="breadcrumbs__link" href="/"><svg viewBox="0 0 24 24" class="breadcrumbHomeIcon_OVgt"><path d="M10 19v-5h4v5c0 .55.45 1 1 1h3c.55 0 1-.45 1-1v-7h1.7c.46 0 .68-.57.33-.87L12.67 3.6c-.38-.34-.96-.34-1.34 0l-8.36 7.53c-.34.3-.13.87.33.87H5v7c0 .55.45 1 1 1h3c.55 0 1-.45 1-1z" fill="currentColor"></path></svg></a></li><li itemscope="" itemprop="itemListElement" itemtype="https://schema.org/ListItem" class="breadcrumbs__item"><a class="breadcrumbs__link" itemprop="item" href="/category/products"><span itemprop="name">Products</span></a><meta itemprop="position" content="1"></li><li itemscope="" itemprop="itemListElement" itemtype="https://schema.org/ListItem" class="breadcrumbs__item breadcrumbs__item--active"><span class="breadcrumbs__link" itemprop="name">📖 Features</span><meta itemprop="position" content="2"></li></ul></nav><div class="tocCollapsible_ETCw theme-doc-toc-mobile tocMobile_ITEo"><button type="button" class="clean-btn tocCollapsibleButton_TO0P">On this page</button></div><div class="theme-doc-markdown markdown"><header><h1>📖 Features</h1></header><img loading="lazy" src="/img/pyke-whitepaper-features-banner.jpg" class="img_ev3q"><h2 class="anchor anchorWithStickyNavbar_LWe7" id="highlight">Highlight<a class="hash-link" href="#highlight" title="Direct link to heading"></a></h2><h3 class="anchor anchorWithStickyNavbar_LWe7" id="offer">Offer<a class="hash-link" href="#offer" title="Direct link to heading"></a></h3><p>HashgreenSwap (HGSwap) uses offers at its core. Whether it’s liquidity addition, liquidity removal, or token swaps, users can look up current prices of the pool and submit a corresponding offer to match the HGSwap’s pools. For example, one can create an offer swapping 1.000 XCH for 35.000 USDS, and the HGSwap dApp can combine it with the pool funds, creating a transaction (”spend bundle” for chialisp people) to be submitted to the blockchain.</p><p>This experience is different from current peer-to-peer (p2p) trading in that you do not need a counter-party to take your offer, as the HGSwap will always take your offer as long as your offering prices are at or around the market price. All transactions can settle within a block (less than a minute in real time) provided sufficient fees are included in the offer.</p><h2 class="anchor anchorWithStickyNavbar_LWe7" id="key-features">Key Features<a class="hash-link" href="#key-features" title="Direct link to heading"></a></h2><h3 class="anchor anchorWithStickyNavbar_LWe7" id="zap">Zap<a class="hash-link" href="#zap" title="Direct link to heading"></a></h3><p>“Zap” is the ability to add unequal funds to the pool. In Uniswap, you will have to add equal values in two tokens (e.g., 1 ETH and 1800 USDC) to deposit liquidity. HGSwap is built factoring in unequal fund addition, which allows several parties to provide liquidity so much more easily. As a XCH holder, you can directly add them to the XCH-USDS pool without having to convert half of them into USDS first; as a project developer, you can simply put in PROJ token into a PROJ-XCH pool to provide liquidity.</p><p>Simply put, it is a huge time and effort saver for the users to have the ability to “zap” into a liquidity pool, and you would not end up with annoying tiny amount of scrap tokens on either end.</p><h3 class="anchor anchorWithStickyNavbar_LWe7" id="marketplace-aggregation">Marketplace Aggregation<a class="hash-link" href="#marketplace-aggregation" title="Direct link to heading"></a></h3><p>One of the core feature of offers is the ability to aggregate. There are plenty of marketplaces that currently hold an amazing repository of offer files, and these marketplaces can become big players against HGSwap by aggregating multiple offers into one and trading against it.</p><p>One thing to note is, many current offers on the market have prices far away from market prices, and generally they wouldn’t be able to be traded against HGSwap. Only offers with prices close to the market price have a chance to be included in the marketplace aggregation, thus making it possible for these marketplaces be profitable.</p><h3 class="anchor anchorWithStickyNavbar_LWe7" id="permissioning">Permissioning<a class="hash-link" href="#permissioning" title="Direct link to heading"></a></h3><p>Chia is a coin-set model blockchain, and hence lack of permissioning can lead to denial-of-service attacks against any protocols. Concretely, a bad actor can consistently interact with HGSwap in each and every block while not performing any trade, thus blocking any actual users from using the service.</p><p>While it is true that the bad actor has to pay specific fees to continue to block the HGSwap, compared to the TVL (total value locked) of the pool it might be financially feasible and reasonable. This is a potentially weakness (not a security weakness though) of this version, and we aim to work with the community to continue to resolve the issue.</p><h3 class="anchor anchorWithStickyNavbar_LWe7" id="airdrop-to-pool">Airdrop to pool<a class="hash-link" href="#airdrop-to-pool" title="Direct link to heading"></a></h3><p>You can airdrop your tokens or assets to a pool! While usually there is a 0.3% associated with the liquidity pools in terms of swapping, you can opt to donate everything into the pool and make it an airdrop! This will be a very useful inceptive tool for project developers as they can run campaigns to urge users to add liquidity into PROJ-XCH pools.</p><h2 class="anchor anchorWithStickyNavbar_LWe7" id="money-matters">Money Matters<a class="hash-link" href="#money-matters" title="Direct link to heading"></a></h2><h3 class="anchor anchorWithStickyNavbar_LWe7" id="fair-pricing">Fair Pricing<a class="hash-link" href="#fair-pricing" title="Direct link to heading"></a></h3><p>We don’t like to brag about ourselves, but we have employed advanced calculus to make detailed mathematical equations about the tokens and liquidity token payouts. The equations looks somewhat similar to the Uniswap’s <span class="math math-inline"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msqrt><mrow><mi>A</mi><mo>×</mo><mi>B</mi></mrow></msqrt><mo>=</mo><mi>V</mi></mrow><annotation encoding="application/x-tex">\sqrt{A \times B} = V</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1.04em;vertical-align:-0.155em"></span><span class="mord sqrt"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.885em"><span class="svg-align" style="top:-3em"><span class="pstrut" style="height:3em"></span><span class="mord" style="padding-left:0.833em"><span class="mord mathnormal">A</span><span class="mspace" style="margin-right:0.2222em"></span><span class="mbin">×</span><span class="mspace" style="margin-right:0.2222em"></span><span class="mord mathnormal" style="margin-right:0.05017em">B</span></span></span><span style="top:-2.845em"><span class="pstrut" style="height:3em"></span><span class="hide-tail" style="min-width:0.853em;height:1.08em"><svg xmlns="http://www.w3.org/2000/svg" width="400em" height="1.08em" viewBox="0 0 400000 1080" preserveAspectRatio="xMinYMin slice"><path d="M95,702
c-2.7,0,-7.17,-2.7,-13.5,-8c-5.8,-5.3,-9.5,-10,-9.5,-14
c0,-2,0.3,-3.3,1,-4c1.3,-2.7,23.83,-20.7,67.5,-54
c44.2,-33.3,65.8,-50.3,66.5,-51c1.3,-1.3,3,-2,5,-2c4.7,0,8.7,3.3,12,10
s173,378,173,378c0.7,0,35.3,-71,104,-213c68.7,-142,137.5,-285,206.5,-429
c69,-144,104.5,-217.7,106.5,-221
l0 -0
c5.3,-9.3,12,-14,20,-14
H400000v40H845.2724
s-225.272,467,-225.272,467s-235,486,-235,486c-2.7,4.7,-9,7,-19,7
c-6,0,-10,-1,-12,-3s-194,-422,-194,-422s-65,47,-65,47z
M834 80h400000v40h-400000z"></path></svg></span></span></span><span class="vlist-s"></span></span><span class="vlist-r"><span class="vlist" style="height:0.155em"><span></span></span></span></span></span><span class="mspace" style="margin-right:0.2778em"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em"></span></span><span class="base"><span class="strut" style="height:0.6833em"></span><span class="mord mathnormal" style="margin-right:0.22222em">V</span></span></span></span></span>, but has bells and whistles to ensure the fees are collected fairly in scenerios like “zapping” and when multiple offers are aggregated together. It looks somewhat like this:</p><div class="math math-display"><span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mrow><mo fence="true">(</mo><mfrac><mn>1</mn><mn>2</mn></mfrac><mi>log</mi><mo></mo><mfrac><msup><mi>A</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msup><mi>A</mi></mfrac><mo>+</mo><mfrac><mn>1</mn><mn>2</mn></mfrac><mi>log</mi><mo></mo><mfrac><msup><mi>B</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msup><mi>B</mi></mfrac><mo fence="true">)</mo></mrow><mo>−</mo><mfrac><mn>1</mn><mn>2</mn></mfrac><mi>ϕ</mi><mrow><mo fence="true">∣</mo><mfrac><mn>1</mn><mn>2</mn></mfrac><mi>log</mi><mo></mo><mfrac><msup><mi>A</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msup><mi>A</mi></mfrac><mo>−</mo><mfrac><mn>1</mn><mn>2</mn></mfrac><mi>log</mi><mo></mo><mfrac><msup><mi>B</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msup><mi>B</mi></mfrac><mo fence="true">∣</mo></mrow><mo>≥</mo><mi>log</mi><mo></mo><mfrac><msup><mi>V</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msup><mi>V</mi></mfrac></mrow><annotation encoding="application/x-tex">\left( \frac{1}{2} \log \frac{A'}{A} + \frac{1}{2} \log \frac{B'}{B} \right) - \frac{1}{2} \phi \left| \frac{1}{2} \log \frac{A'}{A} - \frac{1}{2} \log \frac{B'}{B} \right| \ge \log \frac{V'}{V}</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:2.4em;vertical-align:-0.95em"></span><span class="minner"><span class="mopen delimcenter" style="top:0em"><span class="delimsizing size3">(</span></span><span class="mord"><span class="mopen nulldelimiter"></span><span class="mfrac"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:1.3214em"><span style="top:-2.314em"><span class="pstrut" style="height:3em"></span><span class="mord"><span class="mord">2</span></span></span><span style="top:-3.23em"><span class="pstrut" style="height:3em"></span><span class="frac-line" style="border-bottom-width:0.04em"></span></span><span style="top:-3.677em"><span class="pstrut" style="height:3em"></span><span class="mord"><span class="mord">1</span></span></span></span><span class="vlist-s"></span></span><span class="vlist-r"><span class="vlist" style="height:0.686em"><span></span></span></span></span></span><span class="mclose nulldelimiter"></span></span><span class="mspace" style="margin-right:0.1667em"></span><span class="mop">lo<span style="margin-right:0.01389em">g</span></span><span class="mspace" style="margin-right:0.1667em"></span><span class="mord"><span class="mopen nulldelimiter"></span><span class="mfrac"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:1.4289em"><span style="top:-2.314em"><span class="pstrut" style="height:3em"></span><span class="mord"><span class="mord mathnormal">A</span></span></span><span style="top:-3.23em"><span class="pstrut" style="height:3em"></span><span class="frac-line" style="border-bottom-width:0.04em"></span></span><span style="top:-3.677em"><span class="pstrut" style="height:3em"></span><span class="mord"><span class="mord"><span class="mord mathnormal">A</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.7519em"><span style="top:-3.063em;margin-right:0.05em"><span class="pstrut" style="height:2.7em"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mtight">′</span></span></span></span></span></span></span></span></span></span></span></span><span class="vlist-s"></span></span><span class="vlist-r"><span class="vlist" style="height:0.686em"><span></span></span></span></span></span><span class="mclose nulldelimiter"></span></span><span class="mspace" style="margin-right:0.2222em"></span><span class="mbin">+</span><span class="mspace" style="margin-right:0.2222em"></span><span class="mord"><span class="mopen nulldelimiter"></span><span class="mfrac"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:1.3214em"><span style="top:-2.314em"><span class="pstrut" style="height:3em"></span><span class="mord"><span class="mord">2</span></span></span><span style="top:-3.23em"><span class="pstrut" style="height:3em"></span><span class="frac-line" style="border-bottom-width:0.04em"></span></span><span style="top:-3.677em"><span class="pstrut" style="height:3em"></span><span class="mord"><span class="mord">1</span></span></span></span><span class="vlist-s"></span></span><span class="vlist-r"><span class="vlist" style="height:0.686em"><span></span></span></span></span></span><span class="mclose nulldelimiter"></span></span><span class="mspace" style="margin-right:0.1667em"></span><span class="mop">lo<span style="margin-right:0.01389em">g</span></span><span class="mspace" style="margin-right:0.1667em"></span><span class="mord"><span class="mopen nulldelimiter"></span><span class="mfrac"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:1.4289em"><span style="top:-2.314em"><span class="pstrut" style="height:3em"></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.05017em">B</span></span></span><span style="top:-3.23em"><span class="pstrut" style="height:3em"></span><span class="frac-line" style="border-bottom-width:0.04em"></span></span><span style="top:-3.677em"><span class="pstrut" style="height:3em"></span><span class="mord"><span class="mord"><span class="mord mathnormal" style="margin-right:0.05017em">B</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.7519em"><span style="top:-3.063em;margin-right:0.05em"><span class="pstrut" style="height:2.7em"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mtight">′</span></span></span></span></span></span></span></span></span></span></span></span><span class="vlist-s"></span></span><span class="vlist-r"><span class="vlist" style="height:0.686em"><span></span></span></span></span></span><span class="mclose nulldelimiter"></span></span><span class="mclose delimcenter" style="top:0em"><span class="delimsizing size3">)</span></span></span><span class="mspace" style="margin-right:0.2222em"></span><span class="mbin">−</span><span class="mspace" style="margin-right:0.2222em"></span></span><span class="base"><span class="strut" style="height:2.412em;vertical-align:-0.95em"></span><span class="mord"><span class="mopen nulldelimiter"></span><span class="mfrac"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:1.3214em"><span style="top:-2.314em"><span class="pstrut" style="height:3em"></span><span class="mord"><span class="mord">2</span></span></span><span style="top:-3.23em"><span class="pstrut" style="height:3em"></span><span class="frac-line" style="border-bottom-width:0.04em"></span></span><span style="top:-3.677em"><span class="pstrut" style="height:3em"></span><span class="mord"><span class="mord">1</span></span></span></span><span class="vlist-s"></span></span><span class="vlist-r"><span class="vlist" style="height:0.686em"><span></span></span></span></span></span><span class="mclose nulldelimiter"></span></span><span class="mord mathnormal">ϕ</span><span class="mspace" style="margin-right:0.1667em"></span><span class="minner"><span class="mopen"><span class="delimsizing mult"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:1.462em"><span style="top:-2.266em"><span class="pstrut" style="height:3.216em"></span><span class="delimsizinginner delim-size1"><span>∣</span></span></span><span style="top:-2.864em"><span class="pstrut" style="height:3.216em"></span><span style="height:1.216em;width:0.3333em"><svg xmlns="http://www.w3.org/2000/svg" width="0.3333em" height="1.216em" style="width:0.3333em" viewBox="0 0 333.33000000000004 1216" preserveAspectRatio="xMinYMin"><path d="M145 0 H188 V1216 H145z M145 0 H188 V1216 H145z"></path></svg></span></span><span style="top:-4.072em"><span class="pstrut" style="height:3.216em"></span><span class="delimsizinginner delim-size1"><span>∣</span></span></span></span><span class="vlist-s"></span></span><span class="vlist-r"><span class="vlist" style="height:0.95em"><span></span></span></span></span></span></span><span class="mord"><span class="mopen nulldelimiter"></span><span class="mfrac"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:1.3214em"><span style="top:-2.314em"><span class="pstrut" style="height:3em"></span><span class="mord"><span class="mord">2</span></span></span><span style="top:-3.23em"><span class="pstrut" style="height:3em"></span><span class="frac-line" style="border-bottom-width:0.04em"></span></span><span style="top:-3.677em"><span class="pstrut" style="height:3em"></span><span class="mord"><span class="mord">1</span></span></span></span><span class="vlist-s"></span></span><span class="vlist-r"><span class="vlist" style="height:0.686em"><span></span></span></span></span></span><span class="mclose nulldelimiter"></span></span><span class="mspace" style="margin-right:0.1667em"></span><span class="mop">lo<span style="margin-right:0.01389em">g</span></span><span class="mspace" style="margin-right:0.1667em"></span><span class="mord"><span class="mopen nulldelimiter"></span><span class="mfrac"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:1.4289em"><span style="top:-2.314em"><span class="pstrut" style="height:3em"></span><span class="mord"><span class="mord mathnormal">A</span></span></span><span style="top:-3.23em"><span class="pstrut" style="height:3em"></span><span class="frac-line" style="border-bottom-width:0.04em"></span></span><span style="top:-3.677em"><span class="pstrut" style="height:3em"></span><span class="mord"><span class="mord"><span class="mord mathnormal">A</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.7519em"><span style="top:-3.063em;margin-right:0.05em"><span class="pstrut" style="height:2.7em"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mtight">′</span></span></span></span></span></span></span></span></span></span></span></span><span class="vlist-s"></span></span><span class="vlist-r"><span class="vlist" style="height:0.686em"><span></span></span></span></span></span><span class="mclose nulldelimiter"></span></span><span class="mspace" style="margin-right:0.2222em"></span><span class="mbin">−</span><span class="mspace" style="margin-right:0.2222em"></span><span class="mord"><span class="mopen nulldelimiter"></span><span class="mfrac"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:1.3214em"><span style="top:-2.314em"><span class="pstrut" style="height:3em"></span><span class="mord"><span class="mord">2</span></span></span><span style="top:-3.23em"><span class="pstrut" style="height:3em"></span><span class="frac-line" style="border-bottom-width:0.04em"></span></span><span style="top:-3.677em"><span class="pstrut" style="height:3em"></span><span class="mord"><span class="mord">1</span></span></span></span><span class="vlist-s"></span></span><span class="vlist-r"><span class="vlist" style="height:0.686em"><span></span></span></span></span></span><span class="mclose nulldelimiter"></span></span><span class="mspace" style="margin-right:0.1667em"></span><span class="mop">lo<span style="margin-right:0.01389em">g</span></span><span class="mspace" style="margin-right:0.1667em"></span><span class="mord"><span class="mopen nulldelimiter"></span><span class="mfrac"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:1.4289em"><span style="top:-2.314em"><span class="pstrut" style="height:3em"></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.05017em">B</span></span></span><span style="top:-3.23em"><span class="pstrut" style="height:3em"></span><span class="frac-line" style="border-bottom-width:0.04em"></span></span><span style="top:-3.677em"><span class="pstrut" style="height:3em"></span><span class="mord"><span class="mord"><span class="mord mathnormal" style="margin-right:0.05017em">B</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.7519em"><span style="top:-3.063em;margin-right:0.05em"><span class="pstrut" style="height:2.7em"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mtight">′</span></span></span></span></span></span></span></span></span></span></span></span><span class="vlist-s"></span></span><span class="vlist-r"><span class="vlist" style="height:0.686em"><span></span></span></span></span></span><span class="mclose nulldelimiter"></span></span><span class="mclose"><span class="delimsizing mult"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:1.462em"><span style="top:-2.266em"><span class="pstrut" style="height:3.216em"></span><span class="delimsizinginner delim-size1"><span>∣</span></span></span><span style="top:-2.864em"><span class="pstrut" style="height:3.216em"></span><span style="height:1.216em;width:0.3333em"><svg xmlns="http://www.w3.org/2000/svg" width="0.3333em" height="1.216em" style="width:0.3333em" viewBox="0 0 333.33000000000004 1216" preserveAspectRatio="xMinYMin"><path d="M145 0 H188 V1216 H145z M145 0 H188 V1216 H145z"></path></svg></span></span><span style="top:-4.072em"><span class="pstrut" style="height:3.216em"></span><span class="delimsizinginner delim-size1"><span>∣</span></span></span></span><span class="vlist-s"></span></span><span class="vlist-r"><span class="vlist" style="height:0.95em"><span></span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.2778em"></span><span class="mrel">≥</span><span class="mspace" style="margin-right:0.2778em"></span></span><span class="base"><span class="strut" style="height:2.1149em;vertical-align:-0.686em"></span><span class="mop">lo<span style="margin-right:0.01389em">g</span></span><span class="mspace" style="margin-right:0.1667em"></span><span class="mord"><span class="mopen nulldelimiter"></span><span class="mfrac"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:1.4289em"><span style="top:-2.314em"><span class="pstrut" style="height:3em"></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.22222em">V</span></span></span><span style="top:-3.23em"><span class="pstrut" style="height:3em"></span><span class="frac-line" style="border-bottom-width:0.04em"></span></span><span style="top:-3.677em"><span class="pstrut" style="height:3em"></span><span class="mord"><span class="mord"><span class="mord mathnormal" style="margin-right:0.22222em">V</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.7519em"><span style="top:-3.063em;margin-right:0.05em"><span class="pstrut" style="height:2.7em"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mtight">′</span></span></span></span></span></span></span></span></span></span></span></span><span class="vlist-s"></span></span><span class="vlist-r"><span class="vlist" style="height:0.686em"><span></span></span></span></span></span><span class="mclose nulldelimiter"></span></span></span></span></span></span></div><p>Don’t worry if you can’t understand, because you don’t have to. You can trust that the offers you are making will guarantee you can receiving at least the assets you are committing in the offer files, and leave the rest of the complicated maths to HGSwap.</p><h3 class="anchor anchorWithStickyNavbar_LWe7" id="fee">Fee<a class="hash-link" href="#fee" title="Direct link to heading"></a></h3><p>We charge a 0.90% fee (like in Uniswap V1). 0.3% will go to the liquidity providers and 0.6% will go to HG token holders (a.k.a. protocol owners, or DAO participants). It is interesting to note that in cases like “zapping” where only half of the assets are effectively swapped, we cut your fee rate in half (because you are a great liquidity provider and we love you!).</p><p>The details of how protocol fees are distributed and utilized will be announced later, but it will likely be used to buy back $HG tokens from the market.</p><h2 class="anchor anchorWithStickyNavbar_LWe7" id="future-works">Future Works<a class="hash-link" href="#future-works" title="Direct link to heading"></a></h2><p>The description of future works below might a little bit developer-facing and some Chia understanding is very required to continue.</p><h3 class="anchor anchorWithStickyNavbar_LWe7" id="native-singleton-aggregation">Native Singleton Aggregation<a class="hash-link" href="#native-singleton-aggregation" title="Direct link to heading"></a></h3><p>It has been a very hot topic whether “singleton aggregation” is coming to the Chia Blockchain or not. Basically, with this feature on the consensus level, multiple users can interact with the same singleton (or, NFT) in the same block without a contention problem (i.e., only one of the users can successfully interact with the coin but the others will fail to perform so). Hence the aforementioned problems in the permissioning section will be largely alleviated, and the bad actors can no longer single-handedly block other users’ transactions against HGSwap.</p><h3 class="anchor anchorWithStickyNavbar_LWe7" id="end-user-aggregation">End User Aggregation<a class="hash-link" href="#end-user-aggregation" title="Direct link to heading"></a></h3><p>Before the official singleton aggregation lands, it is feasible for the HGSwap dApp to look for pending transactions in the mempool, which other users have submitted for the intention of trading against HGSwap, and to build on top of the resulting singletons by <a href="https://docs.chia.net/mempool#replace-by-fee" target="_blank" rel="noopener noreferrer">replacing the original transaction</a>.</p><p>The effect is, that subsequent users who are interested in interacting with HGSwap can “ride on the same coin”, which prevents users from fighting over the same coin; yet this requires the dApp to employ a strong backend service to achieve so as it needs to constantly listen to the mempool and provide the latest singleton information.</p><p>This approach will always be inferior to the native singleton aggregation as described above, but is a solution that any developer can accomplish.</p><h2 class="anchor anchorWithStickyNavbar_LWe7" id="technicals">Technicals<a class="hash-link" href="#technicals" title="Direct link to heading"></a></h2><h3 class="anchor anchorWithStickyNavbar_LWe7" id="hashgreenswap-smart-contracts">HashgreenSwap Smart Contracts<a class="hash-link" href="#hashgreenswap-smart-contracts" title="Direct link to heading"></a></h3><p><a href="https://github.com/hashgreen/hashgreenswap-contract" target="_blank" rel="noopener noreferrer">The HashgreenSwap smart contracts</a> are the implementation of <a href="http://hash.green/" target="_blank" rel="noopener noreferrer">HashgreenSwap</a>, an automated market maker (AMM) in <a href="http://chialisp.com/" target="_blank" rel="noopener noreferrer">chialisp</a> language on the <a href="https://www.chia.net/" target="_blank" rel="noopener noreferrer">Chia blockchain</a>. If you would like to verify the smart contract, please visit the GitHub repository <a href="https://github.com/hashgreen/hashgreenswap-contract" target="_blank" rel="noopener noreferrer">here</a>.</p><h3 class="anchor anchorWithStickyNavbar_LWe7" id="cypher">Cypher<a class="hash-link" href="#cypher" title="Direct link to heading"></a></h3><p>The HashgreenSwap is built using an open-source chialisp library called <a href="https://github.com/hashgreen/cypher-chialisp" target="_blank" rel="noopener noreferrer">Cypher</a>. It is a library aiming at packing the most commonly used functionalities and alleviating common security issues for chialisp smart coin developers. It is extensively tested and hence increases the security promise we offer.</p></div></article><nav class="pagination-nav docusaurus-mt-lg" aria-label="Docs pages navigation"><a class="pagination-nav__link pagination-nav__link--prev" href="/how-to-test-hashgreenswap-on-testnet"><div class="pagination-nav__sublabel">Previous</div><div class="pagination-nav__label">🧪 How to Test HashgreenSwap on Testnet</div></a><a class="pagination-nav__link pagination-nav__link--next" href="/exchange"><div class="pagination-nav__sublabel">Next</div><div class="pagination-nav__label">💱 Exchange</div></a></nav></div></div><div class="col col--3"><div class="tableOfContents_bqdL thin-scrollbar theme-doc-toc-desktop"><ul class="table-of-contents table-of-contents__left-border"><li><a href="#highlight" class="table-of-contents__link toc-highlight">Highlight</a><ul><li><a href="#offer" class="table-of-contents__link toc-highlight">Offer</a></li></ul></li><li><a href="#key-features" class="table-of-contents__link toc-highlight">Key Features</a><ul><li><a href="#zap" class="table-of-contents__link toc-highlight">Zap</a></li><li><a href="#marketplace-aggregation" class="table-of-contents__link toc-highlight">Marketplace Aggregation</a></li><li><a href="#permissioning" class="table-of-contents__link toc-highlight">Permissioning</a></li><li><a href="#airdrop-to-pool" class="table-of-contents__link toc-highlight">Airdrop to pool</a></li></ul></li><li><a href="#money-matters" class="table-of-contents__link toc-highlight">Money Matters</a><ul><li><a href="#fair-pricing" class="table-of-contents__link toc-highlight">Fair Pricing</a></li><li><a href="#fee" class="table-of-contents__link toc-highlight">Fee</a></li></ul></li><li><a href="#future-works" class="table-of-contents__link toc-highlight">Future Works</a><ul><li><a href="#native-singleton-aggregation" class="table-of-contents__link toc-highlight">Native Singleton Aggregation</a></li><li><a href="#end-user-aggregation" class="table-of-contents__link toc-highlight">End User Aggregation</a></li></ul></li><li><a href="#technicals" class="table-of-contents__link toc-highlight">Technicals</a><ul><li><a href="#hashgreenswap-smart-contracts" class="table-of-contents__link toc-highlight">HashgreenSwap Smart Contracts</a></li><li><a href="#cypher" class="table-of-contents__link toc-highlight">Cypher</a></li></ul></li></ul></div></div></div></div></main></div></div><footer class="footer"><div class="container container-fluid"><div class="row footer__links"><div class="col footer__col"><div class="footer__title">Community</div><ul class="footer__items clean-list"><li class="footer__item"><a href="https://www.linkedin.com/company/hashgreen-labs" target="_blank" rel="noopener noreferrer" class="footer__link-item">LinkedIn<svg width="13.5" height="13.5" aria-hidden="true" viewBox="0 0 24 24" class="iconExternalLink_nPIU"><path fill="currentColor" d="M21 13v10h-21v-19h12v2h-10v15h17v-8h2zm3-12h-10.988l4.035 4-6.977 7.07 2.828 2.828 6.977-7.07 4.125 4.172v-11z"></path></svg></a></li><li class="footer__item"><a href="https://discord.gg/4RbcEHGaTg" target="_blank" rel="noopener noreferrer" class="footer__link-item">Discord<svg width="13.5" height="13.5" aria-hidden="true" viewBox="0 0 24 24" class="iconExternalLink_nPIU"><path fill="currentColor" d="M21 13v10h-21v-19h12v2h-10v15h17v-8h2zm3-12h-10.988l4.035 4-6.977 7.07 2.828 2.828 6.977-7.07 4.125 4.172v-11z"></path></svg></a></li><li class="footer__item"><a href="https://twitter.com/HashgreenLabs/" target="_blank" rel="noopener noreferrer" class="footer__link-item">Twitter<svg width="13.5" height="13.5" aria-hidden="true" viewBox="0 0 24 24" class="iconExternalLink_nPIU"><path fill="currentColor" d="M21 13v10h-21v-19h12v2h-10v15h17v-8h2zm3-12h-10.988l4.035 4-6.977 7.07 2.828 2.828 6.977-7.07 4.125 4.172v-11z"></path></svg></a></li></ul></div><div class="col footer__col"><div class="footer__title">About</div><ul class="footer__items clean-list"><li class="footer__item"><a href="https://www.hashgreen.net/" target="_blank" rel="noopener noreferrer" class="footer__link-item">Team<svg width="13.5" height="13.5" aria-hidden="true" viewBox="0 0 24 24" class="iconExternalLink_nPIU"><path fill="currentColor" d="M21 13v10h-21v-19h12v2h-10v15h17v-8h2zm3-12h-10.988l4.035 4-6.977 7.07 2.828 2.828 6.977-7.07 4.125 4.172v-11z"></path></svg></a></li><li class="footer__item"><a href="#" class="footer__link-item">Updates</a></li></ul></div><div class="col footer__col"><div class="footer__title">Contact</div><ul class="footer__items clean-list"><li class="footer__item"><a href="mailto:[email protected]" target="_blank" rel="noopener noreferrer" class="footer__link-item">Contact Us<svg width="13.5" height="13.5" aria-hidden="true" viewBox="0 0 24 24" class="iconExternalLink_nPIU"><path fill="currentColor" d="M21 13v10h-21v-19h12v2h-10v15h17v-8h2zm3-12h-10.988l4.035 4-6.977 7.07 2.828 2.828 6.977-7.07 4.125 4.172v-11z"></path></svg></a></li><li class="footer__item"><a href="mailto:[email protected]" target="_blank" rel="noopener noreferrer" class="footer__link-item">Token Listing<svg width="13.5" height="13.5" aria-hidden="true" viewBox="0 0 24 24" class="iconExternalLink_nPIU"><path fill="currentColor" d="M21 13v10h-21v-19h12v2h-10v15h17v-8h2zm3-12h-10.988l4.035 4-6.977 7.07 2.828 2.828 6.977-7.07 4.125 4.172v-11z"></path></svg></a></li><li class="footer__item"><a href="mailto:[email protected]" target="_blank" rel="noopener noreferrer" class="footer__link-item">Join Us<svg width="13.5" height="13.5" aria-hidden="true" viewBox="0 0 24 24" class="iconExternalLink_nPIU"><path fill="currentColor" d="M21 13v10h-21v-19h12v2h-10v15h17v-8h2zm3-12h-10.988l4.035 4-6.977 7.07 2.828 2.828 6.977-7.07 4.125 4.172v-11z"></path></svg></a></li></ul></div></div><div class="footer__bottom text--center"><div class="footer__copyright">Hashgreen © 2022. All rights reserved.</div></div></div></footer></div>
<script src="/assets/js/runtime~main.ab13e0ea.js"></script>
<script src="/assets/js/main.d4b44e97.js"></script>
</body>
</html>