<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>ppumang's dev blog - ppumang's dev blog</title>
    <description>blockchain, web, machine learning</description>
    <link>https://ppumang.github.io/</link>
    <atom:link href="https://ppumang.github.io/feed.xml" rel="self" type="application/rss+xml"/>
    <pubDate>Tue, 12 Mar 2024 12:26:05 +0000</pubDate>
    <lastBuildDate>Tue, 12 Mar 2024 12:26:05 +0000</lastBuildDate>
    <generator>Jekyll v3.9.5</generator>
    
      <item>
        <title>ppumang's dev blog - What is mev Boost?</title>
        <description>
</description>
        <pubDate>Sat, 26 Nov 2022 00:00:00 +0000</pubDate>
        <link>https://ppumang.github.io/What-is-mev-boost/</link>
        <guid isPermaLink="true">https://ppumang.github.io/What-is-mev-boost/</guid>
        
        
      </item>
    
      <item>
        <title>ppumang's dev blog - What is flashbot?</title>
        <description>&lt;p&gt;pbs - proposer build seperation&lt;/p&gt;
</description>
        <pubDate>Sat, 26 Nov 2022 00:00:00 +0000</pubDate>
        <link>https://ppumang.github.io/What-is-flashbot/</link>
        <guid isPermaLink="true">https://ppumang.github.io/What-is-flashbot/</guid>
        
        
      </item>
    
      <item>
        <title>ppumang's dev blog - How will ethereum change after pos?</title>
        <description>
</description>
        <pubDate>Thu, 17 Nov 2022 00:00:00 +0000</pubDate>
        <link>https://ppumang.github.io/ethereum/How-will-Ethereum-change-after-POS/</link>
        <guid isPermaLink="true">https://ppumang.github.io/ethereum/How-will-Ethereum-change-after-POS/</guid>
        
        
        <category>ethereum</category>
        
      </item>
    
      <item>
        <title>ppumang's dev blog - Before startup (paul graham)</title>
        <description>&lt;blockquote&gt;
  &lt;p&gt;Before startup&lt;/p&gt;
&lt;/blockquote&gt;

&lt;ul&gt;
  &lt;li&gt;
    &lt;p&gt;In your college life, there are a lot more thing you can do besides startup. Like traveling around the world with little money, with your backpack. Do you really have to start a startup right now??&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;The one thing that matters is a good product.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Start from a side project.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Learn a lot before starting a startup&lt;/p&gt;
  &lt;/li&gt;
&lt;/ul&gt;
</description>
        <pubDate>Sun, 13 Nov 2022 00:00:00 +0000</pubDate>
        <link>https://ppumang.github.io/how%20to%20start%20a%20startup/Before-startup-(paul-graham)/</link>
        <guid isPermaLink="true">https://ppumang.github.io/how%20to%20start%20a%20startup/Before-startup-(paul-graham)/</guid>
        
        
        <category>how to start a startup</category>
        
      </item>
    
      <item>
        <title>ppumang's dev blog - Decimal point to binary scale</title>
        <description>&lt;p&gt;In binary scale, multiplying 2 is equal to moving every numbers to left by 1.&lt;/p&gt;

\[0.625 = 0.xyz_2 \\
    1.250 = x.yz_2 \rightarrow x = 1 \\
    0.25 = 0.yz_2 \\
    0.5 = y.z_2 \rightarrow y=0 \\
    0.5 = 0.z_2 \\
    1 = z_2 \rightarrow z = 1 \\
    \therefore x=1, y=0, z=1\]
</description>
        <pubDate>Fri, 04 Nov 2022 00:00:00 +0000</pubDate>
        <link>https://ppumang.github.io/cs/decimal-point-to-binary-scale/</link>
        <guid isPermaLink="true">https://ppumang.github.io/cs/decimal-point-to-binary-scale/</guid>
        
        
        <category>cs</category>
        
      </item>
    
      <item>
        <title>ppumang's dev blog - Inverse problem model</title>
        <description>&lt;p&gt;In &lt;em&gt;Inverse Problem&lt;/em&gt;, we wish to recover a signal \(X_{true}\) given measurements \(Y\).&lt;/p&gt;

\[\mathcal{A}[X_{true}] + \epsilon = Y\]

&lt;p&gt;The goal of inverse problem is to find \(\mathcal{A^{-1}}\).&lt;/p&gt;

&lt;p&gt;Most denoising models are based on deep learning.&lt;/p&gt;

&lt;p&gt;We use neural network to approximate
\(f_\theta \approx \mathcal{A^{-1}}\)&lt;/p&gt;
</description>
        <pubDate>Thu, 03 Nov 2022 00:00:00 +0000</pubDate>
        <link>https://ppumang.github.io/deep%20learning/inverse-problem-model/</link>
        <guid isPermaLink="true">https://ppumang.github.io/deep%20learning/inverse-problem-model/</guid>
        
        
        <category>deep learning</category>
        
      </item>
    
      <item>
        <title>ppumang's dev blog - What is uniswap v3</title>
        <description>&lt;blockquote&gt;
  &lt;p&gt;What distinguishes Uniswap v3 from v2 is “concentrated liquidity”&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;In Uniswap v2, price was determined by the whole liquidity pool. So, same ratio \(X1 \times X2 = C\) was used in every price interval.&lt;/p&gt;

&lt;p&gt;In Uniswap v3, liquidity providers can provide liquidity in a specific price interval. This means that the AMM algorithm behaves differently in every price sections.&lt;/p&gt;

&lt;p&gt;This gives Uniswap v3 to be able to provide relatively high liquidity compared to the original mechanism.&lt;/p&gt;

&lt;p&gt;For example, in the case of stable coins, price will probably be in $0.99 ~ $1.01. So, people will concentrate their assets in mid price to earn more transaction fees.&lt;/p&gt;
</description>
        <pubDate>Sat, 29 Oct 2022 00:00:00 +0000</pubDate>
        <link>https://ppumang.github.io/defi/What-is-Uniswap-v3/</link>
        <guid isPermaLink="true">https://ppumang.github.io/defi/What-is-Uniswap-v3/</guid>
        
        
        <category>defi</category>
        
      </item>
    
      <item>
        <title>ppumang's dev blog - Options, futures, and other derivatives   categories</title>
        <description>&lt;blockquote&gt;
  &lt;p&gt;Chapter 1. Introduction&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Exchange-traded markets&lt;br /&gt;
Over-the-counter markets&lt;br /&gt;
Forward contracts&lt;br /&gt;
Futures contracts&lt;br /&gt;
Options&lt;br /&gt;
Types of traders:&lt;br /&gt;
 &lt;em&gt;Hedgers&lt;/em&gt;&lt;br /&gt;
 &lt;em&gt;Speculators&lt;/em&gt;&lt;br /&gt;
 &lt;em&gt;Arbitrageurs&lt;/em&gt;&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;Chapter 2. Mechanics of futures markets&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Specification of a futures contract&lt;br /&gt;
Convergence of futures price to spot price&lt;br /&gt;
The operation of margin accounts&lt;br /&gt;
OTC markets&lt;br /&gt;
Market quotes&lt;br /&gt;
Delivery&lt;br /&gt;
Types of traders and types of orders&lt;br /&gt;
Regulation&lt;br /&gt;
Accounting and tax&lt;br /&gt;
Forward vs futures contracts&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;Chapter 3. Hedging strategies using futures&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Basic principles&lt;br /&gt;
Arguments for and against hedging&lt;br /&gt;
Basis risk&lt;br /&gt;
Cross hedging&lt;br /&gt;
Stock index futures&lt;br /&gt;
Stack and roll&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;Chapter 4. Interest rates&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Types of rates&lt;br /&gt;
Measuring interest rates&lt;br /&gt;
Zero rates&lt;br /&gt;
Bond pricing&lt;br /&gt;
Determining Treasury zero rates&lt;br /&gt;
Forward rates&lt;br /&gt;
Forward rates agreements&lt;br /&gt;
Duration&lt;br /&gt;
Convexity&lt;br /&gt;
Theories of the term structure of interest rates&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;Chapter 5. Determination of forward and futures prices&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Investment assets vs consumption assets&lt;br /&gt;
Short selling&lt;br /&gt;
Assumptions and notation&lt;br /&gt;
Forward price for an investment asset&lt;br /&gt;
Known income&lt;br /&gt;
Known yield&lt;br /&gt;
Valuing forward contracts&lt;br /&gt;
Are forward prices and futures prices equal?&lt;br /&gt;
Futures prices of stock indices&lt;br /&gt;
Forward and futures contracts on currencies&lt;br /&gt;
Futures on commodities&lt;br /&gt;
The cost of carry&lt;br /&gt;
Delivery options&lt;br /&gt;
Futures prices and expected future spot prices&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;Chapter 6. Interest rate futures&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Day count and quotation conventions&lt;br /&gt;
Treasuty bond futures&lt;br /&gt;
Eurodollar futures&lt;br /&gt;
Duration-based hedging strategies using futures&lt;br /&gt;
Hedging portfolios of assets and liabilities&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;Chapter 7. Swaps&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Mechanics of interest rate swaps&lt;br /&gt;
Day count issues&lt;br /&gt;
Confirmations&lt;br /&gt;
The comparative-advantage argument&lt;br /&gt;
The nature of swap rates&lt;br /&gt;
Determining the LIBOR/swap zero rates&lt;br /&gt;
Valuation of interest rate swaps&lt;br /&gt;
Term structure effects&lt;br /&gt;
Fixed-for-fixed currency swaps&lt;br /&gt;
Valuation of fixed-for-fixed currency swaps&lt;br /&gt;
Other currency swaps&lt;br /&gt;
Credit risk&lt;br /&gt;
Other types of swaps&lt;/p&gt;
</description>
        <pubDate>Tue, 25 Oct 2022 00:00:00 +0000</pubDate>
        <link>https://ppumang.github.io/finance/Options,-Futures,-and-other-derivatives-categories/</link>
        <guid isPermaLink="true">https://ppumang.github.io/finance/Options,-Futures,-and-other-derivatives-categories/</guid>
        
        
        <category>finance</category>
        
      </item>
    
      <item>
        <title>ppumang's dev blog - Blockchain investing</title>
        <description>&lt;blockquote&gt;
  &lt;p&gt;How to invest in blockchain&lt;/p&gt;
&lt;/blockquote&gt;

&lt;ul&gt;
  &lt;li&gt;Find things early when they still are just whitepapers.&lt;/li&gt;
  &lt;li&gt;Meet the team&lt;/li&gt;
  &lt;li&gt;You should also adjust your positions and manage risks&lt;/li&gt;
  &lt;li&gt;Look for novel concepts ( Haven’t been tried before? A novel game theoretical concept? New consensus algorithm? )&lt;/li&gt;
  &lt;li&gt;Review code&lt;/li&gt;
  &lt;li&gt;Protocol, Infrastructural layer&lt;/li&gt;
&lt;/ul&gt;
</description>
        <pubDate>Sun, 23 Oct 2022 00:00:00 +0000</pubDate>
        <link>https://ppumang.github.io/finance/blockchain-investing/</link>
        <guid isPermaLink="true">https://ppumang.github.io/finance/blockchain-investing/</guid>
        
        
        <category>finance</category>
        
      </item>
    
      <item>
        <title>ppumang's dev blog - Sok: dex with amm protocols</title>
        <description>&lt;blockquote&gt;
  &lt;p&gt;Summary of &lt;a href=&quot;../../assets/papers/sok-amm.pdf&quot;&gt;SoK: DEX with AMM Protocols&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;SoK: systematization of knowledge&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;AMM&lt;/strong&gt;&lt;br /&gt;
Pros: Provides liquidity and encourage swapping assets &lt;br /&gt;
Cons: Slippage will easily occur. vulnerable to impermanent loss(divergence loss). Also has security issue&lt;/p&gt;

&lt;p&gt;A lot of models were proposed to solve this issue, but there were mostly just the same. &lt;br /&gt;
The purpose of this paper is SoK of AMM-based DEX&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Actors&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Liquidity Providers&lt;/li&gt;
  &lt;li&gt;Traders&lt;/li&gt;
  &lt;li&gt;Protocol Foundation&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Assets&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Risk assets
    &lt;ul&gt;
      &lt;li&gt;Illiquidity, type of assets the DEX is designed for&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;Base assets
    &lt;ul&gt;
      &lt;li&gt;In some protocols, risk assets have to be designated with base assets&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;Pool shares
    &lt;ul&gt;
      &lt;li&gt;Liquidity shares, LP shares. Represents ownership in the portfolio of the assets within a pool&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;Protocol tokens
    &lt;ul&gt;
      &lt;li&gt;Governance token.&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Dynamics&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Invariant properties
    &lt;ul&gt;
      &lt;li&gt;conservation function. ex) CPMM&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;Mechanisms
    &lt;ul&gt;
      &lt;li&gt;asset swapping &amp;amp; liquidity provision/withdrawls&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Economy&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Rewards
    &lt;ul&gt;
      &lt;li&gt;Liquidity reward - Receive trading fees&lt;/li&gt;
      &lt;li&gt;Staking reward - Rewards from staking pool shares or other tokens as part of an initial incentive program from a certain token protocol&lt;/li&gt;
      &lt;li&gt;Governance right - rights to vote for proposals&lt;/li&gt;
      &lt;li&gt;Security reward - bounty programs, auditing, etc.&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;Explicit cost
    &lt;ul&gt;
      &lt;li&gt;Liquidity withdrawal penalty&lt;/li&gt;
      &lt;li&gt;Swap fee&lt;/li&gt;
      &lt;li&gt;Gas fee&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;Implicit cost
    &lt;ul&gt;
      &lt;li&gt;Slippage&lt;/li&gt;
      &lt;li&gt;Divergence loss(Impermenant loss)&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;img src=&quot;../../assets/images/defi-on-blockchain.png&quot; /&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;State space representation&lt;/strong&gt;&lt;br /&gt;
&lt;img src=&quot;../../assets/images/liquidity-provision-and-withdrawal.png&quot; /&gt;
&lt;img src=&quot;../../assets/images/token-exchange.png&quot; /&gt;&lt;/p&gt;

&lt;p&gt;state \(\chi\)&lt;br /&gt;
\(\chi = ({\{r_k\}_{k=1,...,n}, \{p_k\}_{k=1,...,n}, C, \Omega})\)&lt;/p&gt;

&lt;p&gt;\(r_k = quantity\ of\ token\ k\)&lt;br /&gt;
\(p_k = current\ spot\ price\ of\ token\ k\)&lt;br /&gt;
\(C = conservation\ function\ invariants\)&lt;br /&gt;
\(\Omega = collection\ of\ protocol\ hyperparameters\)&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;General rules of AMM-based DEX&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Price stays constant for pure liquidity provision and withdrawals&lt;/li&gt;
  &lt;li&gt;Invariants of AMM pool stays constant for pure swapping
\((\{r_k\}, \{p_k\}, \mathcal{C}, \Omega) \xrightarrow{liquidity\ change} (\{r_k\}, \{p_k\}, \mathcal{C}', \Omega)\)&lt;br /&gt;
\((\{r_k\}, \{p_k\}, \mathcal{C}, \Omega) \xrightarrow{swap} (\{r_k'\}, \{p_k'\}, \mathcal{C}, \Omega)\)&lt;/li&gt;
&lt;/ol&gt;

&lt;ul&gt;
  &lt;li&gt;Cisproportionate addition or removal can be viewed as combination of proportionate reserve change plus asset swap&lt;/li&gt;
  &lt;li&gt;Swap fees causes \(\mathcal{C}\) to change. It can be divided into swap and provision&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Generalized formulas&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Conservation function (bonding curve)&lt;br /&gt;
\(\mathcal{C} = C(\{r_k\})\)&lt;br /&gt;
conservation function for each token \((r_i - r_o)\) must be concave, nonnegative, nondecreasing&lt;br /&gt;
\(Z(\{r_k\};\mathcal{C}) = C(\{r_k\}) - \mathcal{C} = 0\)&lt;br /&gt;
here, \(\mathcal{C}\) is determined by initial liquidity provision.&lt;br /&gt;
For example, if AMM formula is \(XY = k\), then \(Z = XY - k,\ C(\{r_k\}) = XY,\ \mathcal{C} = k\)&lt;/li&gt;
  &lt;li&gt;Spot exchange rate&lt;br /&gt;
\(_iE_o(\{r_k\}; \mathcal{C}) = \dfrac{\partial Z(\{r_k\};\mathcal{C})/r_o}{\partial Z(\{r_k\};\mathcal{C})/r_i}\)&lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Swap amount
input \(x_i\), output \(x_o\)&lt;br /&gt;
&lt;em&gt;a) Update reserve quantities&lt;/em&gt;&lt;br /&gt;
 \(r_i':=R_i(x_i;r_i) = r_i + x_i\)&lt;br /&gt;
 \(r_j' = r_j \ \forall j \neq i,o\)&lt;/p&gt;

    &lt;p&gt;&lt;em&gt;b) Compute new reserve quntity of token o&lt;/em&gt;&lt;br /&gt;
 \(r_o' = R_o(x_i, \{r_k\}; \mathcal{C}) \Leftrightarrow Solving\ Z=0\)&lt;/p&gt;

    &lt;p&gt;&lt;em&gt;c) Compute swapped quntity&lt;/em&gt;&lt;br /&gt;
 \(x_o := X_o(x_i, \{r_k\}; \mathcal{C}) = r_o - r_o'\)&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;Slippage
\(S(x_i, \{r_k\}; \mathcal{C}) = \dfrac{x_i/x_o}{_iE_o} - 1\)&lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Divergence loss&lt;br /&gt;
value of token \(o\) is increased by \(\rho\) while others stay the same&lt;br /&gt;
token \(_i\) is a numeraire.&lt;br /&gt;
&lt;em&gt;a) Calculate the original pool value&lt;/em&gt;&lt;br /&gt;
\(V(\{r_k\}; \mathcal{C}) = \sum_j{_iE_o(\{r_k\}; \mathcal{C}) \cdot r_j }\)&lt;/p&gt;

    &lt;p&gt;&lt;em&gt;b) Calculate the reserve value if held outside of the pool&lt;/em&gt;&lt;br /&gt;
\(V_{held}(\rho; \{r_k\}, \mathcal{C}) = V(\{r_k\}; \mathcal{C}) + [_iE_o(\{r_k\}; \mathcal{C}) \cdot r_o] \cdot \rho\)&lt;/p&gt;

    &lt;p&gt;&lt;em&gt;c) Obtain re-balanced reserve quantities&lt;/em&gt;&lt;br /&gt;
\(\rho = \dfrac{_jE_o(\{r_k'\};\mathcal{C})}{_jE_o(\{r_k\};\mathcal{C})} -1\)&lt;br /&gt;
\(Z(\{r_k'\};\mathcal{C}) = 0\)&lt;br /&gt;
\(r_k' = R_k(\rho,\{r_k\};\mathcal{C})\)&lt;/p&gt;

    &lt;p&gt;&lt;em&gt;d) Calculate the new pool value&lt;/em&gt;&lt;br /&gt;
\(V'(\rho,\{r_k'\}; \mathcal{C}) = \sum_j{_iE_j(\{r_k'\};\mathcal{C}) \cdot r_j'}\)&lt;/p&gt;

    &lt;p&gt;&lt;em&gt;e) Calculate the divergence loss&lt;/em&gt;&lt;br /&gt;
\(L(\rho, \{r_k'\}; \mathcal{C}) = \dfrac{V'(\rho, \{r_k'\}; \mathcal{C})}{V_{held}'(\rho, \{r_k'\}; \mathcal{C})} -1\)&lt;/p&gt;
  &lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;img src=&quot;../../assets/images/functions-amm-dex.png&quot; /&gt;
&lt;img src=&quot;../../assets/images/graphs-amm-dex.png&quot; /&gt;&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;Formulas of major AMM-based Dex&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;Uniswap V2&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;a) Conservation function&lt;br /&gt;
\(\mathcal{C} = r_1 \cdot r_2\)&lt;/p&gt;

&lt;p&gt;b) Spot exchange rate&lt;br /&gt;
\(_1E_2 = \dfrac{r_1}{r_2}\)&lt;/p&gt;

&lt;p&gt;c) Swap amount&lt;br /&gt;
\(r_1' = r_1 + x_1\)&lt;br /&gt;
\(r_2' = \dfrac{\mathcal{C}}{r_1'}\)  &lt;br /&gt;
\(x_2 = r_2 - r_2'\)&lt;/p&gt;

&lt;p&gt;d) Slippage&lt;br /&gt;
\(S(x_1) = \dfrac{x_1/x_2}{_1E_2} -1 = \dfrac{x_1}{r_1}\)&lt;/p&gt;

&lt;p&gt;e) Divergence loss&lt;br /&gt;
\(\dfrac{V}{2} = V_1 = V_2 = r_1\)&lt;br /&gt;
\(V_{held} = V + V_2 \cdot \rho = r_1 \cdot (2 + \rho)\)&lt;br /&gt;
\(\dfrac{V'}{2} = V_1' = V_2' = r_1' = r_1 \cdot \sqrt{1 + \rho}\)&lt;br /&gt;
Note that \(r_2' = \dfrac{r_2}{\sqrt{1 + \rho}}\) and \(p' = \dfrac{(1 + \rho)r_1}{r_2}\)&lt;br /&gt;
\(L(\rho) = \dfrac{V'}{V_{held}}-1 = \dfrac{\sqrt{1 + \rho}}{1 + \dfrac{\rho}{2}}-1\)&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Uniswap V3&lt;/strong&gt;&lt;br /&gt;
a) Conservation function&lt;br /&gt;
Suppose a user supplies \(\mathcal{C_1}\) token 1 and \(\mathcal{C_2}\) token 2&lt;br /&gt;
His liquidity is only provided for swapping within a specific range of exchange rates: \([\dfrac{\mathcal{C_1}}{\mathcal{C_2}\mathcal{A}}, \dfrac{\mathcal{C_1}\mathcal{A}}{\mathcal{C_2}}]\) where \(\mathcal{A} &amp;gt; 1\) and initial exchange rate is \(\dfrac{\mathcal{C_1}}{\mathcal{C_2}}\)&lt;br /&gt;
\(r_1^{equiv} = \dfrac{\mathcal{C_1}}{1-\dfrac{1}{\sqrt{\mathcal{A}}}}\ and\ r_2^{equiv} = \dfrac{\mathcal{C_2}}{1-\dfrac{1}{\sqrt{\mathcal{A}}}}\)&lt;/p&gt;

&lt;p&gt;Conservation function looks like this:&lt;br /&gt;
\([r_1 + (r_1^{equiv} - \mathcal{C_1})] \cdot [r_2 + (r_2^{equiv} - \mathcal{C_2})] = r_1^{equiv} \cdot r_2^{equiv}\)&lt;br /&gt;
\((r_1 + \dfrac{\mathcal{C_1}}{\sqrt{\mathcal{A}}-1}) \cdot (r_2 + \dfrac{\mathcal{C_2}}{\sqrt{\mathcal{A}}-1}) = \dfrac{\mathcal{A} \cdot \mathcal{C_1} \cdot \mathcal{C_2}}{(\sqrt{\mathcal{A}}-1)^2}\)&lt;/p&gt;

&lt;p&gt;b) Exchange rate&lt;br /&gt;
\(_1E_2 = \dfrac{r_1 + \dfrac{\mathcal{C_1}}{\sqrt{\mathcal{A}}-1}}{r_2 + \dfrac{\mathcal{C_2}}{\sqrt{\mathcal{A}}-1}}\)&lt;/p&gt;

&lt;p&gt;c) Swap amount&lt;br /&gt;
\(r_1' = r_1 + x_1\)&lt;br /&gt;
\(r_2' = \dfrac{\mathcal{C_1}\mathcal{C_2}}{(1-\dfrac{1}{\sqrt{\mathcal{A}}})^2} / (r_1' + \dfrac{C_1}{\sqrt{\mathcal{A}}-1}) - \dfrac{\mathcal{C_2}}{\sqrt{\mathcal{A}}-1}\)&lt;br /&gt;
\(x_2' = r_2 - r_2'\)&lt;/p&gt;

&lt;p&gt;d) Slippage&lt;br /&gt;
\(S(x_1) = \dfrac{x_1/x_2}{_1E_2} -1 = \dfrac{x_1}{r_1 + \dfrac{\mathcal{C_1}}{\sqrt{\mathcal{A}}-1}}\)&lt;/p&gt;

&lt;p&gt;e) Divergence loss&lt;/p&gt;

\[L(\rho) = \dfrac{V'}{V_{held}}-1 \\
=  \begin{cases}
   \dfrac{(\rho +1 ) \cdot \sqrt{\mathcal{A}}-1}{2+\rho},&amp;amp;-1 \le \rho \le \dfrac{1}{\mathcal{A}}-1 \\
   \dfrac{\dfrac{\sqrt{1+\rho}}{1+\dfrac{\rho}{2}}-1}{1-\dfrac{1}{\sqrt{\mathcal{A}}}}, &amp;amp; \dfrac{1}{\mathcal{A}} -1 \le \rho \le \mathcal{A}-1 \\
   \dfrac{\sqrt{\mathcal{A}}-1-\rho}{2+\rho}, &amp;amp; \rho \ge \mathcal{A}-1
   \end{cases}\]

&lt;p&gt;&lt;strong&gt;Balancer&lt;/strong&gt;&lt;br /&gt;
a) Conservation function&lt;br /&gt;
\(\prod_k r_k^{w_k}\)&lt;/p&gt;

&lt;p&gt;b) Spot exchange rate&lt;br /&gt;
\(_1E_2 = \dfrac{r_1 \cdot w_2}{r_2 \cdot w_1}\)&lt;/p&gt;

&lt;p&gt;c) Swap amount&lt;br /&gt;
\(r_1' = r_1 + x_1\)&lt;br /&gt;
\(r_2' = r_2(\dfrac{r_1}{r_1'})^{\dfrac{w_1}{w_2}}\)&lt;br /&gt;
\(x_2 = r_2 - r_2'\)&lt;/p&gt;

&lt;p&gt;d) Slippage&lt;br /&gt;
\(S(x_1) = \dfrac{x_1/x_2}{_1E_2} -1 = \dfrac{\dfrac{x_1}{r_1} \cdot \dfrac{w_1}{w_2}}{1 - (\dfrac{r_1}{r_1'})^{\dfrac{w_1}{w_2}}}-1\)&lt;/p&gt;

&lt;p&gt;e) Divergence loss&lt;br /&gt;
\(V = \dfrac{V_1}{w_1} = \dfrac{V_2}{w_2} = \dfrac{V_k}{w_k} = \dfrac{r_1}{w_1}\)&lt;br /&gt;
\(V_{held} = V + V_2 \cdot \rho = V \cdot(1 + w_2 \cdot \rho)\)&lt;br /&gt;
\(V' = \dfrac{V_1'}{w_1} = \dfrac{r_1'}{w_1} = \dfrac{r_1 \cdot (1 + \rho)^{w_2}}{w_1} = V \cdot (1 + \rho)^{w_2}\)&lt;br /&gt;
\(L(\rho) = \dfrac{V'}{V_{held}} -1 = \dfrac{(1+\rho)^{w_2}}{1 + w_2 \cdot \rho} -1\)&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Curve&lt;/strong&gt;&lt;br /&gt;
a) Conservation function&lt;br /&gt;
\(A(\dfrac{\sum_k r_k}{\mathcal{C}} -1) = \dfrac{(\dfrac{\mathcal{C}}{n})^n}{\prod_k r_k} -1\)&lt;/p&gt;

&lt;p&gt;b) Spot exchange rate&lt;br /&gt;
\(Z(r_1, r_2) = \dfrac{(\dfrac{\mathcal{C}}{n})^n}{r_1r_2\prod_{k\ne1,2} r_k} -1 -\mathcal{A}(\dfrac{r_1 + r_2 + \sum_{k\ne1,2} r_k}{\mathcal{C}}-1)\)&lt;br /&gt;
\(_1E_2 = \dfrac{\partial Z(r_1, r_2) / \partial r_2}{\partial Z(r_1, r_2) / \partial(r_1)} = \dfrac{r_1 \cdot [\mathcal{A}\cdot r_2 \cdot \prod_k r_k + \mathcal{C} \cdot (\dfrac{\mathcal{C}}{n})^n]}{r_2 \cdot [\mathcal{A}\cdot r_1 \cdot \prod_k r_k + \mathcal{C} \cdot (\dfrac{\mathcal{C}}{n})^n]}\)&lt;/p&gt;

&lt;p&gt;c) Swap amount&lt;br /&gt;
\(r_1' = r_1 + x_1\)&lt;br /&gt;
\(r_2' = \dfrac{\sqrt{\dfrac{4\mathcal{C}(\dfrac{C}{n})^n}{\mathcal{A} \cdot \prod_{k \ne 2}^{'}} + [(1 - \dfrac{1}{\mathcal{A}})\mathcal{C} - \sum_{k \ne 2}^{'}]^2} + (1 - \dfrac{1}{\mathcal{A}})\mathcal{C} - \sum_{k \ne 2}^{'}}{2}\)&lt;br /&gt;
\(x_2 = r_2 - r_2'\)&lt;br /&gt;
where \(\prod_{k \ne 2}^{'} = r_1' \cdot \prod_{k \ne 1,2} r_k \:\) and \(\sum_{k \ne 1,2}^{'} = r_1' + \sum_{k \ne 1,2}r_k\)&lt;/p&gt;

&lt;p&gt;d) Slippage&lt;/p&gt;

\[S(x_1) = \dfrac{x_1 / x_2}{_1E_2} -1 \\
= \dfrac{\dfrac{x_1 \cdot [\mathcal{A} \cdot r_1 \prod_k r_k + \mathcal{C} \cdot (\dfrac{\mathcal{C}}{n})^n]}{r_1 \cdot [\mathcal{A} \cdot r_2 \prod_k r_k + \mathcal{C} \cdot (\dfrac{\mathcal{C}}{n})^n]}}{1 - \dfrac{\sqrt{\dfrac{4\mathcal{C}(\dfrac{\mathcal{C}}{n})^n}{a\cdot\prod_{k\ne 2}^{'}} + [(1 - \dfrac{1}{a})\mathcal{C - \sum_{k \ne 2}^{'}}]^2}+ (1 - \dfrac{1}{a})\mathcal{C} - \sum_{k \ne 2}^{'}}{2r_2}}\]

&lt;p&gt;&lt;strong&gt;DODO&lt;/strong&gt;&lt;br /&gt;
a) Spot exchange rate&lt;/p&gt;

\[_1E_2 =
\begin{cases}
P[1 + \mathcal{A}((\dfrac{\mathcal{C_2}}{r_2})^2 -1)], &amp;amp; r_1 \ge \mathcal{C_1} \\
P/[1 + \mathcal{A}((\dfrac{\mathcal{C_1}}{r_1})^2 -1)], &amp;amp; r_1 \le \mathcal{C_1}

\end{cases}\]

&lt;p&gt;b) Conservation function&lt;/p&gt;

\[r_1 - \mathcal{C_1} = \int_{r_2}^{\mathcal{C_2}}P[1+\mathcal{A}((\dfrac{\mathcal{C_2}}{\delta})^2 -1)]d\delta \\
= P \cdot (\mathcal{C_2} - r_2) \cdot [1 + \mathcal{A} \cdot (\dfrac{\mathcal{C_2}}{r_2}-1)], \,\: r_1 \ge \mathcal{C_1}\]

\[r_2 - \mathcal{C_2} = \int_{r_1}^{\mathcal{C_1}}\dfrac{1+\mathcal{A}((\dfrac{\mathcal{C_1}}{\delta})^2 -1)}{P}d\delta \\
= \dfrac{(\mathcal{C_1} - r_1) \cdot [1 + \mathcal{A} \cdot (\dfrac{\mathcal{C_1}}{r_1}-1)]}{P}, \,\: r_1 \le \mathcal{C_1}\]

&lt;p&gt;c) Swap amount&lt;br /&gt;
\(r_1' = r_1 + x_1\)&lt;/p&gt;

\[r_2 =
\begin{cases}
\dfrac{
   \mathcal{C_1} - r_1' + P \cdot \mathcal{C_2} \cdot (1 - 2\mathcal{A}) + \sqrt{[\mathcal{C_1} - r_1' + P \cdot \mathcal{C_2} \cdot (1 - 2\mathcal{A})]^2 + 4\mathcal{A} \cdot (1 - \mathcal{A}) \cdot (P \cdot \mathcal{C_2})^2}
}{2P \cdot (1 - \mathcal{A})}, &amp;amp; r_1' \ge \mathcal{C_1} \\
\mathcal{C_2} + \dfrac{(C_1 - r_1')\cdot [1 + \mathcal{A} \cdot (\dfrac{\mathcal{C_1}}{r_1'}-1)]}{P}, &amp;amp; r_1' \le \mathcal{C_1}
\end{cases}\]

\[x_2 = r_2 - r_2'\]

&lt;p&gt;d) Slippage&lt;/p&gt;

\[S(x_1) =
\begin{cases}
\dfrac{2 \cdot (1 - \mathcal{A} \cdot x_1)}{r_1' - \mathcal{C_1} + \mathcal{C_2} \cdot P - \sqrt{[\mathcal{C_1}-r_1'+P\cdot \mathcal{C_2} \cdot (1 - 2\mathcal{A})]^2 + 4\mathcal{A} \cdot (1 - \mathcal{A}) \cdot (P \cdot \mathcal{C_2})^2} } -1, &amp;amp; r_1' \ge \mathcal{C_1} \\
\dfrac{x_1}{(r_1' - \mathcal{C_1}) \cdot [1 + \mathcal{A} \cdot (\dfrac{\mathcal{C_1}}{r_1'} -1)]} -1, &amp;amp; r_1' \le \mathcal{C_1}
\end{cases}\]

</description>
        <pubDate>Sun, 23 Oct 2022 00:00:00 +0000</pubDate>
        <link>https://ppumang.github.io/defi/SoK-DEX-with-AMM-Protocols/</link>
        <guid isPermaLink="true">https://ppumang.github.io/defi/SoK-DEX-with-AMM-Protocols/</guid>
        
        
        <category>defi</category>
        
      </item>
    
      <item>
        <title>ppumang's dev blog - Comparison of limit Order Book, amm, pmm mechanism</title>
        <description>&lt;p&gt;&lt;strong&gt;Limit Order Book mechanism&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;peer-to-peer swap (wallstreet-like method)&lt;/li&gt;
  &lt;li&gt;Usually off-chain&lt;/li&gt;
  &lt;li&gt;Gnosis, dYdX&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;pros&lt;/em&gt;&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;fast&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;em&gt;cons&lt;/em&gt;&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Presence of centralized party&lt;/li&gt;
  &lt;li&gt;Expensive gas fee&lt;/li&gt;
  &lt;li&gt;Hard to bootstrap liquidity( need to have a matching buyer if you want to sell a token )&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;AMM(Automated Market Maker)&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;peer-to-pool method&lt;/li&gt;
  &lt;li&gt;Algorithm automatically decides price of tokens&lt;/li&gt;
  &lt;li&gt;Uniswap , Curve, Balancer, DODO&lt;/li&gt;
  &lt;li&gt;Constant Product Market Maker of the form \(XY = k\) is the most common AMM algorithm&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;pros&lt;/em&gt;&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Easier liquidity provision (No need to find buyers)&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;em&gt;cons&lt;/em&gt;&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Impermanent loss and slippage occur&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;PMM(Proactive Market Maker)&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Invented by DODO team to reduce impermanent loss and slippage&lt;/li&gt;
  &lt;li&gt;Onchain generalization of orderbook trading&lt;/li&gt;
  &lt;li&gt;Utilizes oracles to gather accurate market prices. PMM use this information to estimate midprice \(i\)&lt;/li&gt;
  &lt;li&gt;Proactively adjusts parameters such as asset ratio and curve slop&lt;br /&gt;
 \(P_{margin} = iR\)&lt;br /&gt;
 \(if\ B &amp;lt; B_0 \rightarrow R = 1 - k + (\dfrac{B_0}{B})^2k\)&lt;br /&gt;
 \(if\ Q &amp;lt; Q_0 \rightarrow R = 1 / (1 - k + (\dfrac{Q_0}{Q})^2k)\)&lt;br /&gt;
 \(else \rightarrow R = 1\)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;pros&lt;/em&gt;&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Better liquidity and price stability&lt;/li&gt;
  &lt;li&gt;Reduces barrier-to-entry for smaller projects&lt;/li&gt;
  &lt;li&gt;Customizable and free market making&lt;/li&gt;
  &lt;li&gt;Enables crowdpooling&lt;/li&gt;
  &lt;li&gt;Can be reversioned to AMM by setting k to 1&lt;/li&gt;
  &lt;li&gt;Capable of supporting stablecoin trading, as it’s virtually identical to Curve&lt;/li&gt;
&lt;/ol&gt;
</description>
        <pubDate>Sun, 23 Oct 2022 00:00:00 +0000</pubDate>
        <link>https://ppumang.github.io/defi/Comparison-of-Limit-order-book,-AMM,-PMM-mechanism/</link>
        <guid isPermaLink="true">https://ppumang.github.io/defi/Comparison-of-Limit-order-book,-AMM,-PMM-mechanism/</guid>
        
        
        <category>defi</category>
        
      </item>
    
      <item>
        <title>ppumang's dev blog - What is liquidity pool?</title>
        <description>&lt;blockquote&gt;
  &lt;p&gt;&lt;strong&gt;What is an Order Book&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;ul&gt;
  &lt;li&gt;A trade is transacted when buyer and seller meet at the same price. It directly connects buyer and seller&lt;/li&gt;
  &lt;li&gt;&lt;em&gt;cons: You have to set a price that someone else is willing to buy or sell at&lt;/em&gt;&lt;/li&gt;
  &lt;li&gt;solution: Liquidity pool&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
  &lt;p&gt;&lt;strong&gt;What is a liquidity pool?&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;ul&gt;
  &lt;li&gt;An algorithm called &lt;em&gt;Automated Market Maker(AMM)&lt;/em&gt; determines the price of an asset, and trade is peer-to-pool, rather than peer-to-peer.&lt;/li&gt;
  &lt;li&gt;Because trade is peer-to-pool, sellers can sell there tokens even though there are no buyers.&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
  &lt;p&gt;&lt;strong&gt;How does a liquidity pool work?&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;ul&gt;
  &lt;li&gt;A liquidity pool is composed of two different tokens, and buyers or sellers can swap their tokens with a ratio determined by AMM.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Dex&lt;/strong&gt;es hook up two different liquidity pools together in order to make it possible to swap any two tokens&lt;/li&gt;
  &lt;li&gt;Liquidity Providers(LP) receives transaction fees for rewards of providing liquidity. If there are only a few LP, return is high but the price is volatile. If LP is big, return is smaller but the price if more stable&lt;/li&gt;
  &lt;li&gt;As larger the liquidity, it’s harder to change the price of a token.&lt;/li&gt;
  &lt;li&gt;Most liquidity pools want to have 50:50 ratio (in prices) of tokens in it.&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
  &lt;p&gt;&lt;strong&gt;Arbitrage Trades&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;ul&gt;
  &lt;li&gt;As liquidity changes, the price of a token will be different from that of other exchanges. This helps to keep a stable price of a token.&lt;/li&gt;
&lt;/ul&gt;
</description>
        <pubDate>Sat, 22 Oct 2022 00:00:00 +0000</pubDate>
        <link>https://ppumang.github.io/defi/What-is-liquidity-pool/</link>
        <guid isPermaLink="true">https://ppumang.github.io/defi/What-is-liquidity-pool/</guid>
        
        
        <category>defi</category>
        
      </item>
    
      <item>
        <title>ppumang's dev blog - What is an impermanent loss?</title>
        <description>&lt;p&gt;&lt;strong&gt;Unrealized loss that occurs when your share of liquidity provider position becomes uneven compared to it’s original position&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Happens to liquidity providers&lt;/li&gt;
  &lt;li&gt;When price of a token goes up, the price of the token in the liquidity pool is cheaper then another exchange, an arbitrage opportunity is created.&lt;/li&gt;
  &lt;li&gt;The price of the token goes up, matching the price in another exchange, while volume in the liquidity pool decreases.&lt;/li&gt;
  &lt;li&gt;Liquidity provider does gain money through this event, but he would have made more money if he just held his token.&lt;/li&gt;
  &lt;li&gt;This also happens when the price of a token drops. Liquidity provider will lose more value by prividing liquidity, then if he just held the token. This loss will be bigger if the price change is larger.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;img src=&quot;../../assets/images/impermanent-loss-graph.png&quot; /&gt;&lt;/p&gt;
</description>
        <pubDate>Sat, 22 Oct 2022 00:00:00 +0000</pubDate>
        <link>https://ppumang.github.io/defi/What-is-an-impermanent-loss/</link>
        <guid isPermaLink="true">https://ppumang.github.io/defi/What-is-an-impermanent-loss/</guid>
        
        
        <category>defi</category>
        
      </item>
    
      <item>
        <title>ppumang's dev blog - What is an automated market maker(amm)?</title>
        <description>&lt;p&gt;&lt;strong&gt;What is an AMM?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;AMM allows traders to buy and sell certain coins using an algorithm that dictates how expensive something should be, based on how much of it. Simply, it’s a supply &amp;amp; demand based on algorithm.&lt;/p&gt;

\[X \times Y = k\]

&lt;p&gt;X and Y being the number of tokens in the liquidity pool, there product remains the same.&lt;/p&gt;

&lt;p&gt;Suppose there are 50,000 token X and Y are present in a liquidity pool. If you sell 7,000 X token to the liquidity pool, then you get 6140 Y token, Because&lt;/p&gt;

\[(50,000+7,000) \times (50,000 - 6,140) \approx 50,000 \times 50,000\]
</description>
        <pubDate>Sat, 22 Oct 2022 00:00:00 +0000</pubDate>
        <link>https://ppumang.github.io/defi/What-is-an-Automated-Market-Maker(AMM)/</link>
        <guid isPermaLink="true">https://ppumang.github.io/defi/What-is-an-Automated-Market-Maker(AMM)/</guid>
        
        
        <category>defi</category>
        
      </item>
    
      <item>
        <title>ppumang's dev blog - Uniswap vs curve dao vs balancer</title>
        <description>&lt;blockquote&gt;
  &lt;p&gt;Uniswap&lt;/p&gt;
&lt;/blockquote&gt;

&lt;ul&gt;
  &lt;li&gt;Started late 2018&lt;/li&gt;
  &lt;li&gt;doesn’t have its own token&lt;/li&gt;
  &lt;li&gt;Constant Product Automated Market Maker Model&lt;/li&gt;
  &lt;li&gt;Small pool leads to slippage&lt;/li&gt;
  &lt;li&gt;Be careful of impermanent loss&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
  &lt;p&gt;Curve DAO&lt;/p&gt;
&lt;/blockquote&gt;

&lt;ul&gt;
  &lt;li&gt;Started as stable-coin-only DEX (StableSwap) (trade DAI, USDC, Tether without much slippage)&lt;/li&gt;
  &lt;li&gt;Added other coins like ETH, BTC as the size grow&lt;/li&gt;
  &lt;li&gt;Facilitates high liquidity with small slippage for stable coins&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;../../../../assets/papers/stableswap.pdf&quot;&gt;Bonding Curve&lt;/a&gt; - A method to minimize price slippage&lt;/li&gt;
  &lt;li&gt;You can supply liquidity and farm yield. Curve DAO gives you some additional coins on top of transaction fees. This reduces the risk of impermanent loss.&lt;/li&gt;
  &lt;li&gt;CRV is Curve’s governance token&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
  &lt;p&gt;Balancer&lt;/p&gt;
&lt;/blockquote&gt;

&lt;ul&gt;
  &lt;li&gt;Acts as an automatic portfolio manager, liquidity provider, and price sensor&lt;/li&gt;
  &lt;li&gt;At Uniswap you run the risk, at Curve you stake stable coins, at Balancer you can supply liquidity for any crypto assets&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;../../../../assets/papers/balancer-wp.pdf&quot;&gt;Whitepaper&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
        <pubDate>Sat, 22 Oct 2022 00:00:00 +0000</pubDate>
        <link>https://ppumang.github.io/defi/Uniswap-vs-Curve-DAO-vs-Balancer/</link>
        <guid isPermaLink="true">https://ppumang.github.io/defi/Uniswap-vs-Curve-DAO-vs-Balancer/</guid>
        
        
        <category>defi</category>
        
      </item>
    
      <item>
        <title>ppumang's dev blog - Blockchain projects 2022</title>
        <description>&lt;p&gt;&lt;strong&gt;Blockchain projects&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;&lt;a href=&quot;https://ethereum.org&quot; title=&quot;eth link&quot;&gt;Ethereum&lt;/a&gt;&lt;/strong&gt; - decentralized program&lt;/li&gt;
&lt;/ul&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;&lt;a href=&quot;https://www.corda.net/&quot;&gt;Corda&lt;/a&gt;&lt;/strong&gt; - distributed ledger(DLT)&lt;/li&gt;
&lt;/ul&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;&lt;a href=&quot;https://www.hyperledger.org&quot;&gt;Hyperledger(Fabric)&lt;/a&gt;&lt;/strong&gt; - open source project from linux to advance cross-industry collaborations by developing blockchains and distributed ledgers(DLT), particularily focusing on improving performance and reliability. Also incubates codebases and other technologies - OpenBlockchain, Sawtooth.&lt;/li&gt;
&lt;/ul&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;&lt;a href=&quot;https://nethermind.io/&quot;&gt;Nethermind&lt;/a&gt;&lt;/strong&gt; - Ethereum solutions for developers and enterprises&lt;/li&gt;
&lt;/ul&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;&lt;a href=&quot;https://www.fireblocks.com/&quot;&gt;Fireblocks&lt;/a&gt;&lt;/strong&gt; - Blockchain security solutions for institutions&lt;/li&gt;
&lt;/ul&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;&lt;a href=&quot;https://sorare.com/&quot;&gt;Sorare&lt;/a&gt;&lt;/strong&gt; - Blockchain-powered soccer playing game. Also is a marketplace for player cards&lt;/li&gt;
&lt;/ul&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;&lt;a href=&quot;https://www.moonpay.com/&quot;&gt;Moonpay&lt;/a&gt;&lt;/strong&gt; - On-ramp and off-ramp crypto-fiat currency exchange (on-ramp = crypto -&amp;gt; fiat, and off-ramp is opposite)&lt;/li&gt;
&lt;/ul&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;&lt;a href=&quot;https://apeboard.finance/dashboard&quot;&gt;Ape board&lt;/a&gt;&lt;/strong&gt; - Aggregates users’s defi portfolio and shows them in a single dashboard. It can track portfolios on addresses across 42 blockchains&lt;/li&gt;
&lt;/ul&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;&lt;a href=&quot;https://www.belfricsgroup.com/&quot;&gt;Belfrics group&lt;/a&gt;&lt;/strong&gt; - cryptocurrency exchange platform that uses blockchain to offer KYC(Know Your Customer) verification to its users&lt;/li&gt;
&lt;/ul&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;&lt;a href=&quot;https://pastel.network&quot;&gt;Pastel Network&lt;/a&gt;&lt;/strong&gt; - NFT focused blockchain&lt;/li&gt;
&lt;/ul&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;&lt;a href=&quot;https://zerion.io/&quot;&gt;Zerion&lt;/a&gt;&lt;/strong&gt; - Crypto wallet for NFT &amp;amp; Defi portfolio tracker&lt;/li&gt;
&lt;/ul&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;&lt;a href=&quot;https://www.buenbit.com/&quot;&gt;Buenbit&lt;/a&gt;&lt;/strong&gt; - cryptocurrency trading platform specifically targeting the Latin American market&lt;/li&gt;
&lt;/ul&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;&lt;a href=&quot;https://fumbi.network/sk/&quot;&gt;Fumbi&lt;/a&gt;&lt;/strong&gt; - cryptocurrency trading platform&lt;/li&gt;
&lt;/ul&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;&lt;a href=&quot;https://nayms.com/&quot;&gt;Nayms&lt;/a&gt;&lt;/strong&gt; -  Insurtech&lt;/li&gt;
&lt;/ul&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;&lt;a href=&quot;https://blockdaemon.com/&quot;&gt;Blockdaemon&lt;/a&gt;&lt;/strong&gt; - node management tool&lt;/li&gt;
&lt;/ul&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;&lt;a href=&quot;https://solrise.finance/&quot;&gt;Solrise Finance&lt;/a&gt;&lt;/strong&gt; - decentralized fund management and investment protocol on Solana&lt;/li&gt;
&lt;/ul&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;&lt;a href=&quot;https://bottlepay.com/&quot;&gt;Bottlepay&lt;/a&gt;&lt;/strong&gt; - Send and receive payments. Powered by Lightcoin&lt;/li&gt;
&lt;/ul&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;&lt;a href=&quot;https://openocean.finance/&quot;&gt;OpenOcean&lt;/a&gt;&lt;/strong&gt; - aggregates price information of multiple decentralized exchanges and compares them to prices offered by centralized exchanges&lt;/li&gt;
&lt;/ul&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;&lt;a href=&quot;https://synapse.network/&quot;&gt;Synapse Network&lt;/a&gt;&lt;/strong&gt; - cross-chain investment ecosystem. It opens the way for small investors to invest in promising startups in their earliest development phases&lt;/li&gt;
&lt;/ul&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;&lt;a href=&quot;https://www.bitsika.com/&quot;&gt;bitsika&lt;/a&gt;&lt;/strong&gt; - social payment app that allows you to perform financial transactions, including sending and receiving money, intra-African remittances, crypto, virtual cards, and bills&lt;/li&gt;
&lt;/ul&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;&lt;a href=&quot;https://www.mercadobitcoin.com.br/&quot;&gt;Mercado bitcoin&lt;/a&gt;&lt;/strong&gt; -  trade multi-category crypto-assets&lt;/li&gt;
&lt;/ul&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;&lt;a href=&quot;https://www.texture.capital/&quot;&gt;Texture capital&lt;/a&gt;&lt;/strong&gt; - help companies raise capital and connect investors with unique opportunities&lt;/li&gt;
&lt;/ul&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;&lt;a href=&quot;https://www.telco.in/&quot;&gt;Telcoin&lt;/a&gt;&lt;/strong&gt; - Ethereum-secured platform that makes it possible to send money instantly across the globe&lt;/li&gt;
&lt;/ul&gt;

</description>
        <pubDate>Mon, 17 Oct 2022 00:00:00 +0000</pubDate>
        <link>https://ppumang.github.io/etc/blockchain-projects-2022/</link>
        <guid isPermaLink="true">https://ppumang.github.io/etc/blockchain-projects-2022/</guid>
        
        
        <category>etc</category>
        
      </item>
    
      <item>
        <title>ppumang's dev blog - Team and execution ( sam altman )</title>
        <description>&lt;blockquote&gt;
  &lt;p&gt;Team and execution&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;3. Team&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Choosing a cofounder randomly is really really bad.&lt;/li&gt;
  &lt;li&gt;Almost every successful companies are built by cofounders.&lt;/li&gt;
  &lt;li&gt;Cofounder has to be &lt;strong&gt;tough and calm&lt;/strong&gt;.&lt;/li&gt;
  &lt;li&gt;Try &lt;strong&gt;not to hire&lt;/strong&gt;. Only hire when you are desperate.&lt;/li&gt;
  &lt;li&gt;Before hiring a first employee, write down what culture your company want. &lt;strong&gt;Hire carefully&lt;/strong&gt; and get the best people.&lt;/li&gt;
  &lt;li&gt;Mediocre engineers do not build great companies and they can kill a startup. Hiring a new employee is betting your company’s future.&lt;/li&gt;
  &lt;li&gt;Build at least 100 employees with personal &lt;strong&gt;referals&lt;/strong&gt;.&lt;/li&gt;
  &lt;li&gt;What to consider&lt;/li&gt;
&lt;/ul&gt;

&lt;ol&gt;
  &lt;li&gt;Are they smart?&lt;/li&gt;
  &lt;li&gt;Do they get things done?&lt;/li&gt;
  &lt;li&gt;Do I want to spend a lot of time around them?&lt;/li&gt;
&lt;/ol&gt;

&lt;ul&gt;
  &lt;li&gt;Also&lt;/li&gt;
&lt;/ul&gt;

&lt;ol&gt;
  &lt;li&gt;Good communication skills&lt;/li&gt;
  &lt;li&gt;Risk taking (Mckinsey between startup? probably not work out)&lt;/li&gt;
  &lt;li&gt;Manically determined(workaholic)&lt;/li&gt;
  &lt;li&gt;Pass the animal test(describe what the employee is good at)&lt;/li&gt;
  &lt;li&gt;Would feel comfortable reporting to them?&lt;/li&gt;
&lt;/ol&gt;

&lt;ul&gt;
  &lt;li&gt;Do some project together before hiring.&lt;/li&gt;
  &lt;li&gt;Be generous in equity for your employees.&lt;/li&gt;
  &lt;li&gt;Give credit to your team, &lt;strong&gt;take responsibility by yourself&lt;/strong&gt;.&lt;/li&gt;
  &lt;li&gt;Don’t micromanage.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Fire fast&lt;/strong&gt; if not working out, company politics, being nagative.&lt;/li&gt;
  &lt;li&gt;When your cofounder leaves before 4 years, he will get nothing. This is a promise between the cofounders.&lt;/li&gt;
  &lt;li&gt;Don’t work remotely in early startup.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;4. Execution&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Becoming a CEO means your signing to do the execution for years-long time. What you do becomes a culture of the company.&lt;/li&gt;
  &lt;li&gt;The CEO has five jobs.&lt;/li&gt;
&lt;/ul&gt;

&lt;ol&gt;
  &lt;li&gt;Set the vision&lt;/li&gt;
  &lt;li&gt;Raise money&lt;/li&gt;
  &lt;li&gt;Evangelize&lt;/li&gt;
  &lt;li&gt;Hire and manage&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Make sure the entire company executes&lt;/strong&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;ul&gt;
  &lt;li&gt;Execution = &lt;strong&gt;What to do?&lt;/strong&gt; + &lt;strong&gt;Can you get it done?&lt;/strong&gt;&lt;/li&gt;
  &lt;li&gt;Can you get it done? = Focus + Intensity&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Focus&lt;/strong&gt;
    &lt;ol&gt;
      &lt;li&gt;What are you spending time and money on?&lt;/li&gt;
      &lt;li&gt;What are the two or three most important things?
        &lt;ul&gt;
          &lt;li&gt;Most startups are not focused enough&lt;/li&gt;
          &lt;li&gt;Startup is zero or one. If you work really hard in fields that people don’t care so much, nobody cares.&lt;/li&gt;
          &lt;li&gt;Set overarching goals and repeat them. KPI&lt;/li&gt;
        &lt;/ul&gt;
      &lt;/li&gt;
    &lt;/ol&gt;
  &lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Intensity&lt;/strong&gt;
    &lt;ol&gt;
      &lt;li&gt;Quick&lt;/li&gt;
      &lt;li&gt;Do whatever it takes&lt;/li&gt;
      &lt;li&gt;Show up(get on plane in marginal situations)&lt;/li&gt;
      &lt;li&gt;Don’t give up&lt;/li&gt;
      &lt;li&gt;Be courageous
        &lt;ul&gt;
          &lt;li&gt;Relentless operating rhythm(Facebook : &lt;strong&gt;move fast and break things&lt;/strong&gt;)&lt;/li&gt;
          &lt;li&gt;Obsession with execution quality&lt;/li&gt;
          &lt;li&gt;Bias towards action. Great founders sticks to small things, but move quickly and get things done quickly. &lt;strong&gt;Every time you talk to them, they’ve gotten new things done.&lt;/strong&gt; For this, you need to break it down into smaller projects.&lt;/li&gt;
        &lt;/ul&gt;
      &lt;/li&gt;
    &lt;/ol&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
  &lt;p&gt;&lt;strong&gt;Always keep momentum. Keep growing&lt;/strong&gt;. Vision is no use before winning. Before that, focus on your product and win in the market. Sales fix everything.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;ul&gt;
  &lt;li&gt;The best way to keep momentum is to set an operating rhythm.
    &lt;ul&gt;
      &lt;li&gt;Shipping product&lt;/li&gt;
      &lt;li&gt;Launching new features&lt;/li&gt;
      &lt;li&gt;Reviewing/reporting metrics and milestones&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
&lt;/ul&gt;
</description>
        <pubDate>Wed, 12 Oct 2022 00:00:00 +0000</pubDate>
        <link>https://ppumang.github.io/how%20to%20start%20a%20startup/Team-and-execution-(-sam-altman-)/</link>
        <guid isPermaLink="true">https://ppumang.github.io/how%20to%20start%20a%20startup/Team-and-execution-(-sam-altman-)/</guid>
        
        
        <category>how to start a startup</category>
        
      </item>
    
      <item>
        <title>ppumang's dev blog - How to start a startup( sam altman )</title>
        <description>&lt;blockquote&gt;
  &lt;p&gt;How to start a startup?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;ol&gt;
  &lt;li&gt;Idea&lt;/li&gt;
  &lt;li&gt;Product&lt;/li&gt;
  &lt;li&gt;Team&lt;/li&gt;
  &lt;li&gt;Execution&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Good execution is much harder then good idea.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Idea&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;Ideas should be &lt;strong&gt;Mission-driven&lt;/strong&gt;. Then you will be able to persuade other people ( your team and investors )&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Start in a small market&lt;/strong&gt;, and expand quickly.&lt;/li&gt;
  &lt;li&gt;Consider the &lt;strong&gt;future size of the market&lt;/strong&gt;, not only the current size of the market. You can change everything in a startup but market. What good for being a student is that you can anticipate which market will grow really fast, because what you and your friends use will become a future. (metaverse??)&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Why now&lt;/strong&gt; this idea, this particular time, this particular startup?&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Talk to your customers&lt;/strong&gt; for the first version.&lt;/li&gt;
  &lt;li&gt;You should describe your service in &lt;strong&gt;one sentence&lt;/strong&gt;.&lt;/li&gt;
  &lt;li&gt;Meet your potential &lt;strong&gt;cofounders&lt;/strong&gt; while you are a student. This is more important then building a startup&lt;/li&gt;
  &lt;li&gt;Think first about the &lt;strong&gt;market&lt;/strong&gt;, demand of market.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;2. Product&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;Before your startup have a &lt;strong&gt;great product&lt;/strong&gt;, nothing else is important.&lt;/li&gt;
  &lt;li&gt;If your users &lt;em&gt;like&lt;/em&gt; your product, your company will fail. Your users should &lt;strong&gt;love&lt;/strong&gt; your product. It’s more important to build a product that small number of people &lt;strong&gt;love&lt;/strong&gt;, then a product that many people &lt;em&gt;like&lt;/em&gt;.&lt;/li&gt;
  &lt;li&gt;Thinking of growth before having a product that people LOVE, you’ll probably end up losing your resources.&lt;/li&gt;
  &lt;li&gt;Building a good product is hard. &lt;strong&gt;Target small users&lt;/strong&gt;, but it should be loved.&lt;/li&gt;
  &lt;li&gt;Don’t use ads for initial users. Find potential users manually, recruit them by your hands. &lt;strong&gt;Organic&lt;/strong&gt; is important.&lt;/li&gt;
  &lt;li&gt;Use a &lt;strong&gt;feedback cycle&lt;/strong&gt;. Get user feedbaack, use them for product decisions( What do they like? What would they pay for? What would make them recommend it? ), and get user feedback again.&lt;/li&gt;
  &lt;li&gt;Focus on growth, then anything else.&lt;/li&gt;
&lt;/ul&gt;

&lt;hr /&gt;
&lt;p&gt;If you don’t achieve above, &lt;strong&gt;ANYTHING&lt;/strong&gt; matters. So, in your early stage, just keep working on great idea, and great product.&lt;/p&gt;
</description>
        <pubDate>Tue, 11 Oct 2022 00:00:00 +0000</pubDate>
        <link>https://ppumang.github.io/how%20to%20start%20a%20startup/How-to-start-a-startup(-sam-altman-)/</link>
        <guid isPermaLink="true">https://ppumang.github.io/how%20to%20start%20a%20startup/How-to-start-a-startup(-sam-altman-)/</guid>
        
        
        <category>how to start a startup</category>
        
      </item>
    
      <item>
        <title>ppumang's dev blog - Eigenvector , eigenvalue and eigenbasis</title>
        <description>\[Ax = \lambda x\]

&lt;p&gt;Then \(\lambda\) is the eigenvalue of \(A\), and \(x\) is the eigenvector of \(A\).&lt;/p&gt;

&lt;p&gt;Geometrically, \(x\) stays in the same direction after linear transformation \(A\), with it’s length multiplied by \(\lambda\).&lt;/p&gt;

&lt;p&gt;Since \(\lambda x = \lambda I x\), \(Ax = \lambda x \Leftrightarrow (A - \lambda I)x = 0\).&lt;/p&gt;

&lt;p&gt;\(A - \lambda I\)
is also a linear transformation.&lt;/p&gt;

\[\exists x \quad s.t \quad (A - \lambda I) x = 0 \Leftrightarrow det(A - \lambda I) = 0\]

&lt;p&gt;In order to squeeze a vector into zero through linear transformation \(A\), \(A\) has to squeeze a vectorspace into lower dimension, which means it’s determinant is zero.&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;Eigenbasis&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;If every basis vectors are eigenvectors they are called \(eigenbasis\).&lt;/p&gt;

&lt;p&gt;\(A = \begin{bmatrix} -1 &amp;amp; 0 \\ 0 &amp;amp; 2 \end{bmatrix}\)
transforms \(\begin{bmatrix} 1 \\ 0 \end{bmatrix}\) to \(\begin{bmatrix} -1 \\ 0 \end{bmatrix}\), and \(\begin{bmatrix} 0 \\ 1 \end{bmatrix}\) into \(\begin{bmatrix} 0 \\ 2 \end{bmatrix}\)&lt;/p&gt;

&lt;p&gt;Eigenbasis is useful because it’s coresponding matrix is diagonal. Diagonal matrices are useful because it’s easy to multiply.&lt;/p&gt;

\[D = \begin{bmatrix} d_1 &amp;amp; 0 \\ 0 &amp;amp; d_2 \end{bmatrix} \rightarrow D^n = \begin{bmatrix} d_1^n &amp;amp; 0 \\ 0 &amp;amp; d_2^n \end{bmatrix}\]

&lt;p&gt;Suppose you have to compute \(A^{100}\). It’s a very hard problem. But if you can find eigenvectors of \(A\), you can easily compute \(A^{100}\) by changing basis to \(A\)’s eigenvectors.&lt;/p&gt;

&lt;p&gt;If you choose \(A\)’s basis, it becomes eigenbasis of that vectorspace because only their length changes after multiplying \(A\).&lt;/p&gt;

&lt;p&gt;In this new vectorspace’s perspective, \(A\) is a diagonal matrix.&lt;/p&gt;

&lt;p&gt;So, in order to compute \(A^{100}\), you can move the coordinate system to which has \(A\)’s eigenvectors as basis, compute \(A_{\mathbb{A}}^{100}\) (which is diagonal), and change the basis back to standard basis.&lt;/p&gt;

\[A = \begin{bmatrix} 3 &amp;amp; 1 \\ 0 &amp;amp; 2 \end{bmatrix} \rightarrow 
\lambda_1 = 3, 
v_1 = \begin{bmatrix} 1 \\ 0 \end{bmatrix},
\lambda_2 = 2, 
v_1 = \begin{bmatrix} -1 \\ 1 \end{bmatrix}\]

\[\begin{bmatrix} 1 &amp;amp; -1 \\ 0 &amp;amp; 1 \end{bmatrix}^{-1} A \begin{bmatrix} 1 &amp;amp; -1 \\ 0 &amp;amp; 1 \end{bmatrix} 
= \begin{bmatrix} 1 &amp;amp; -1 \\ 0 &amp;amp; 1 \end{bmatrix}^{-1} \begin{bmatrix} 3 &amp;amp; 1 \\ 0 &amp;amp; 2 \end{bmatrix} \begin{bmatrix} 1 &amp;amp; -1 \\ 0 &amp;amp; 1 \end{bmatrix} 
= \begin{bmatrix} 3 &amp;amp; 0 \\ 0 &amp;amp; 2 \end{bmatrix}
= A_{\mathbb{A}}\]
</description>
        <pubDate>Mon, 10 Oct 2022 00:00:00 +0000</pubDate>
        <link>https://ppumang.github.io/linear%20algebra/Eigenvector-,-eigenvalue-and-eigenbasis/</link>
        <guid isPermaLink="true">https://ppumang.github.io/linear%20algebra/Eigenvector-,-eigenvalue-and-eigenbasis/</guid>
        
        
        <category>linear algebra</category>
        
      </item>
    
      <item>
        <title>ppumang's dev blog - Cramer's rule</title>
        <description>&lt;p&gt;Cramer’s rule is used when solving the system&lt;/p&gt;

\[Ax = b\]

&lt;p&gt;As seen in &lt;a href=&quot;https://ppumang.github.io/linear algebra/Determinant&quot; title=&quot;Go google&quot;&gt;Determinant&lt;/a&gt;, determinants can be viewed as area(or volume) of a matrix.&lt;/p&gt;

\[x = \begin{bmatrix} x_1 \\ x_2 \end{bmatrix}, \: b = \begin{bmatrix} b_1 \\ b_2 \end{bmatrix}\]

\[det( \begin{bmatrix} 1 &amp;amp; x_1 \\ 0 &amp;amp; x_2 \end{bmatrix} ) = Area(\begin{bmatrix} 1 &amp;amp; x_1 \\ 0 &amp;amp; x_2 \end{bmatrix}) = x_2\]

&lt;p&gt;As linear transformation \(A\) multiplicates the area of a matrix by \(det(A)\), the above equation can be adjusted as&lt;/p&gt;

\[det(A \begin{bmatrix} 1 &amp;amp; x_1 \\ 0 &amp;amp; x_2 \end{bmatrix} ) =
det(
\left[ \begin{array}{c|c}
A \begin{bmatrix} 1 \\ 0 \end{bmatrix} &amp;amp; 
A \begin{bmatrix} x_1 \\ x_2 \end{bmatrix}
\end{array}\right]
) =
det(A)x_2\]

&lt;p&gt;which yields 
\(x_2 = \dfrac{det(\left[ \begin{array}{c|c}
A \begin{bmatrix} 1 \\ 0 \end{bmatrix} &amp;amp; 
\begin{bmatrix} b_1 \\ b_2 \end{bmatrix}
\end{array}\right] )}{det(A)}\)&lt;/p&gt;

&lt;p&gt;Note that 
\(det(\left[ \begin{array}{c|c}
A \begin{bmatrix} 1 \\ 0 \end{bmatrix} &amp;amp; 
\begin{bmatrix} b_1 \\ b_2 \end{bmatrix}
\end{array}\right] )\)
 is matrix \(A\), with it’s \(2nd\) column replaced by \(b\).&lt;/p&gt;

&lt;p&gt;Similarly,
\(x_1 = \dfrac{det(\left[ \begin{array}{c|c}
\begin{bmatrix} b_1 \\ b_2 \end{bmatrix} &amp;amp; 
A \begin{bmatrix} 0 \\ 1 \end{bmatrix}
\end{array}\right] )}{det(A)}\)&lt;/p&gt;

&lt;p&gt;The generalized cramer’s rule in \(n\)-dimensional space is&lt;/p&gt;

\[x_j = \dfrac{det(B_j)}{det(A)} \\ where \: B_j = 
\begin{bmatrix}
a_{11} &amp;amp; \cdots &amp;amp; b_1 &amp;amp; \cdots &amp;amp; a_{1n} \\
a_{21} &amp;amp; \cdots &amp;amp; b_2 &amp;amp; \cdots &amp;amp; a_{2n} \\
\vdots &amp;amp; \ddots &amp;amp; \vdots &amp;amp; \ddots &amp;amp; \vdots \\
a_{n1} &amp;amp; \cdots &amp;amp; b_n &amp;amp; \cdots &amp;amp; a_{nn}
\end{bmatrix}\]

</description>
        <pubDate>Mon, 10 Oct 2022 00:00:00 +0000</pubDate>
        <link>https://ppumang.github.io/linear%20algebra/Cramer's-rule/</link>
        <guid isPermaLink="true">https://ppumang.github.io/linear%20algebra/Cramer's-rule/</guid>
        
        
        <category>linear algebra</category>
        
      </item>
    
      <item>
        <title>ppumang's dev blog - Change of basis</title>
        <description>&lt;p&gt;As we saw in &lt;a href=&quot;https://ppumang.github.io/linear algebra/Intuitive-understanding-of-multiplying-a-matrix&quot;&gt;Intuitive understanding of multiplying a matrix&lt;/a&gt;, matrix multiplication can be seen as change of basis, preserving a vector’s coefficients.&lt;/p&gt;

&lt;p&gt;In this point of view, a single vector can be represented differently according to what basis you choose.&lt;/p&gt;

&lt;p&gt;If a vectorspace \(\mathbb{A}\) chooses \(\begin{bmatrix} a_{11} \\ a_{21} \end{bmatrix}\) and \(\begin{bmatrix} a_{12} \\ a_{22} \end{bmatrix}\) as it’s basis,&lt;/p&gt;

&lt;p&gt;\(\begin{bmatrix} a_{11} \\ a_{21} \end{bmatrix}_{\mathbb{R}} = \begin{bmatrix} 1 \\ 0 \end{bmatrix}_{\mathbb{A}}\)
and
\(\begin{bmatrix} a_{12} \\ a_{22} \end{bmatrix}_{\mathbb{R}} = \begin{bmatrix} 0 \\ 1 \end{bmatrix}_{\mathbb{A}}\)&lt;/p&gt;

&lt;p&gt;In \(\mathbb{R}\), \(90^\circ\) rotation of \(\begin{bmatrix} a_{11} \\ a_{21} \end{bmatrix}_{\mathbb{R}}=\begin{bmatrix} 0 &amp;amp; -1 \\ 1 &amp;amp; 0 \end{bmatrix}_{\mathbb{R}} \begin{bmatrix} a_{11} \\ a_{21} \end{bmatrix}_{\mathbb{R}}\)&lt;/p&gt;

&lt;p&gt;In \(\mathbb{A}\), \(90^\circ\) rotation of 
\(\begin{bmatrix} 1 \\ 0 \end{bmatrix}_{\mathbb{A}}
=\begin{bmatrix} a_{11} &amp;amp; a_{12} \\ a_{21} &amp;amp; a_{22} \end{bmatrix}^{-1} 
\begin{bmatrix} 0 &amp;amp; -1 \\ 1 &amp;amp; 0 \end{bmatrix} 
\begin{bmatrix} a_{11} &amp;amp; a_{12} \\ a_{21} &amp;amp; a_{22} \end{bmatrix} 
\begin{bmatrix} 1 \\ 0 \end{bmatrix}_{\mathbb{A}}\)&lt;/p&gt;

&lt;p&gt;So, if you want to perform linear transformation \(P_{\mathbb{R}}\) to \(\begin{bmatrix} x \\ y \end{bmatrix}_{\mathbb{A}}\), you can do&lt;/p&gt;

\[A^{-1}PA \begin{bmatrix} x \\ y \end{bmatrix}\]

</description>
        <pubDate>Mon, 10 Oct 2022 00:00:00 +0000</pubDate>
        <link>https://ppumang.github.io/linear%20algebra/Change-of-basis/</link>
        <guid isPermaLink="true">https://ppumang.github.io/linear%20algebra/Change-of-basis/</guid>
        
        
        <category>linear algebra</category>
        
      </item>
    
      <item>
        <title>ppumang's dev blog - Inner product and duality</title>
        <description>&lt;p&gt;&lt;em&gt;Definition of inner product&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;(symmetricity)&lt;/em&gt; : \(&amp;lt;x,y&amp;gt; = &amp;lt;y,x&amp;gt; \forall x,y \in X\)&lt;/p&gt;

&lt;p&gt;&lt;em&gt;(bilinearity)&lt;/em&gt; : \(&amp;lt;c_1x_1 + c_2x_2, y&amp;gt; = c_1&amp;lt;x_1, y&amp;gt; + c_2&amp;lt;x_2, y&amp;gt; \forall x_1, x_2, y \in X \: and \: \forall c_1, c_2 \in \mathbb{R}\)&lt;/p&gt;

&lt;p&gt;In \(n\)-dinemsional space, inner product is defined as elementwise product between \(n\)-dimensional vectors.&lt;/p&gt;

\[x = \begin{bmatrix} x_1 \\ x_2 \end{bmatrix} y = \begin{bmatrix} y_1 \\ y_2 \end{bmatrix}\]

\[x^Ty = \begin{bmatrix} x_1 x_2 \end{bmatrix} \begin{bmatrix} y_1 \\ y_2 \end{bmatrix} = x_1y_1 + x_2y_2\]

&lt;p&gt;If you see \(x^T\) as \(1 \times 2\) matrix, multiplying \(x^T\) is same as performing linear transformation from \(2\)-dimensional space to \(1\)-dimensional space (scalar).&lt;/p&gt;

&lt;p&gt;Let \(u = \begin{bmatrix} \dfrac{x_1}{\|x\|} \\ \\  \dfrac{x_2}{\|x\|} \end{bmatrix} = \begin{bmatrix} u_1 \\ u_2 \end{bmatrix}\), which is a unit vector.&lt;/p&gt;

&lt;p&gt;\(u^T\) projects \(\begin{bmatrix} 1 \\ 0 \end{bmatrix}\) into \(u_1\), and \(\begin{bmatrix} 0 \\ 1 \end{bmatrix}\) into \(u_2\). (&lt;em&gt;Note that it transforms 2d-vector into scalar&lt;/em&gt;)&lt;/p&gt;

&lt;p&gt;Let \(p_1\) be the projection from \(\begin{bmatrix} 1 \\ 0 \end{bmatrix}\) to \(u\), and \(p_2\) be the projection from \(\begin{bmatrix} 0 \\ 1 \end{bmatrix}\) to \(u\).&lt;/p&gt;

&lt;p&gt;Then \(\overline{Op_1} = u_1\) and \(\overline{Op_2} = u_2\) due to similarity.&lt;/p&gt;

&lt;p&gt;This means that a projection can also be seen as the \(length\) of a projection vetor. (specifically, it’s the &lt;em&gt;signed length&lt;/em&gt;, but let’s not think about that right now.)&lt;/p&gt;

&lt;p&gt;Lets get back to the projection&lt;/p&gt;

&lt;p&gt;\(xy = x^Ty = \begin{bmatrix} x_1 x_2 \end{bmatrix} \begin{bmatrix} y_1 \\ y_2 \end{bmatrix} = x_1y_1 + x_2y_2\).&lt;/p&gt;

&lt;p&gt;\(u_1y_1 + u_2y_2\)
is the length of projection vector from \(y\) to \(x\).&lt;/p&gt;

\[duality \: \rightarrow \: xy = \|x\|(u_1y_1 + u_2y_2) = x_1y_1 + x_2y_2\]
</description>
        <pubDate>Sun, 09 Oct 2022 00:00:00 +0000</pubDate>
        <link>https://ppumang.github.io/linear%20algebra/Inner-product-and-duality/</link>
        <guid isPermaLink="true">https://ppumang.github.io/linear%20algebra/Inner-product-and-duality/</guid>
        
        
        <category>linear algebra</category>
        
      </item>
    
      <item>
        <title>ppumang's dev blog - Determinant</title>
        <description>&lt;blockquote&gt;
  &lt;p&gt;Intuitive understanding of determinant&lt;/p&gt;
&lt;/blockquote&gt;

&lt;ol type=&quot;I&quot;&gt;
    &lt;li&gt; Area(Volume) of a matrix &lt;/li&gt;
    &lt;li&gt; How much a matrix modifies the area(volume) of a target matrix through linear transformation &lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The first meaning and the second are basically the same if you set identity matrix as the target matrix.&lt;/p&gt;

&lt;p&gt;If \(det(A) &amp;gt; 0\), it changes the area(volume) of target matrix, preserving it’s direction.&lt;/p&gt;

&lt;p&gt;If \(det(A) &amp;lt; 0\), it inverts the order of target matrix’s column vectors through linear transformation.&lt;/p&gt;

&lt;p&gt;If \(det(A) = 0\), it squeezes some vectors to zero.&lt;/p&gt;

&lt;p&gt;For example, Let \(A=\begin{bmatrix} 1 &amp;amp; 0 \\ 0 &amp;amp; 0 \end{bmatrix}\)&lt;/p&gt;

&lt;p&gt;Then \(A\) transforms \(2\)-dimensional space into a line \(y=0\). In this case, \(det(A) = 0\)&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;Characteristics of determinant&lt;/p&gt;
&lt;/blockquote&gt;

&lt;ul&gt;
  &lt;li&gt;
    &lt;p&gt;commutative : &lt;br /&gt;
\(det(AB) = det(A)det(B) \: where \: A, B \in \mathbb{R}^{n\times n}\)&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;cofactor : &lt;br /&gt;
\(det(A) = \sum_{j} a_{ij}A_{ij} \: where \: A_{ij} = (-1)^{i+j}det(M_{ij})\)&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;decomposition : &lt;br /&gt;
\(det(A) = det(P^{-1}LU) = \pm (products \: of \: pivots)\)&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;permutation : &lt;br /&gt;
\(det(A) = \sum_{\sigma}a_{1\sigma_{1}}a_{2\sigma_{2}}\cdots a_{n\sigma_{n}}det(P_{\sigma}) \\ det(A) = a_{11}a_{22} - a_{12}a_{21}\) comes from this rule.&lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;if \(A\) is inversible : &lt;br /&gt;
\(A^{-1} = \dfrac{adj(A)}{det(A)}\)&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;cramer’s rule : &lt;br /&gt;
\(x_j = \dfrac{det(B_j)}{det(A)} \\ where \: B_j = 
\begin{bmatrix}
a_{11} &amp;amp; \cdots &amp;amp; b_1 &amp;amp; \cdots &amp;amp; a_{1n} \\
a_{21} &amp;amp; \cdots &amp;amp; b_2 &amp;amp; \cdots &amp;amp; a_{2n} \\
\vdots &amp;amp; \ddots &amp;amp; \vdots &amp;amp; \ddots &amp;amp; \vdots \\
a_{n1} &amp;amp; \cdots &amp;amp; b_n &amp;amp; \cdots &amp;amp; a_{nn}
\end{bmatrix}\)&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Sylvester’s determinant identity : &lt;br /&gt;
\(det(I_m + AB^T) = det(I_n + B^TA) \\
where A,B \in \mathbb{R^{m \times n}}\)&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;Schur complement :&lt;/li&gt;
&lt;/ul&gt;

\[A = \begin{bmatrix} A_{11} &amp;amp; A_{12} \\ A_{21} &amp;amp; A_{22} \end{bmatrix} \Rightarrow A^{-1}=\begin{bmatrix}
A_{11}^{-1} + A_{11}^{-1}A_{12}S^{-1}A_{21}A_{11}^{-1} &amp;amp; -A{11}^{-1}A_{12}S^{-1} \\
-S{-1}A_{21}A_{11}^{-1} &amp;amp; S^{-1} 
\end{bmatrix} \\\]

\[where \: S = A_{22} - A_{21}A_{11}^{-1}A_{12}\]

&lt;ul&gt;
  &lt;li&gt;Sherman-Woodbury-Morfison identity : &lt;br /&gt;
\((A + BD^{-1}C)^{-1} = A^{-1} -A^{-1}B(D + CA^{-1}B)^{-1}CA^{-1}\)&lt;/li&gt;
&lt;/ul&gt;
</description>
        <pubDate>Sun, 09 Oct 2022 00:00:00 +0000</pubDate>
        <link>https://ppumang.github.io/linear%20algebra/Determinant/</link>
        <guid isPermaLink="true">https://ppumang.github.io/linear%20algebra/Determinant/</guid>
        
        
        <category>linear algebra</category>
        
      </item>
    
      <item>
        <title>ppumang's dev blog - Column space, null space and rank</title>
        <description>&lt;blockquote&gt;
  &lt;p&gt;Column space of matrix \(A\)&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Span of matrix \(A\)’s column vectors. &lt;br /&gt;
Intuitively, it can also be seen as &lt;strong&gt;span of &lt;em&gt;changed basis&lt;/em&gt;&lt;/strong&gt;, because \(A\) changes the \(i'th\) basis into it’s \(i'th\) column.&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;Null space(kernel) of matrix \(A\)&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Linear subspace of the domain of the map which is mapped to the zero vector. &lt;br /&gt;
As \(A\) can be seen as linear transformation, vector in \(A\)’s nullspace squeezes to zero when transformed by \(A\).&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;Rank of matrix \(A\)&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The definition of rank is the dimension of vectorspace generated by columns of \(A\). &lt;br /&gt;
Intuitively, if \(A\) squeezes \(m\)-dimensional space into \(n\)-dimensional space, \(n\) is the rank of \(A\)&lt;/p&gt;
</description>
        <pubDate>Sun, 09 Oct 2022 00:00:00 +0000</pubDate>
        <link>https://ppumang.github.io/linear%20algebra/Column-space,-Null-space-and-Rank/</link>
        <guid isPermaLink="true">https://ppumang.github.io/linear%20algebra/Column-space,-Null-space-and-Rank/</guid>
        
        
        <category>linear algebra</category>
        
      </item>
    
      <item>
        <title>ppumang's dev blog - Intuitive understanding of multiplying a matrix</title>
        <description>&lt;blockquote&gt;
  &lt;p&gt;Multiplying matrices can be seen as change of basis&lt;/p&gt;
&lt;/blockquote&gt;

\[A = \begin{bmatrix}
a_{11} &amp;amp; a_{12} \\
a_{21} &amp;amp; a_{22}
\end{bmatrix} \quad 

x=\begin{bmatrix}
x_1 \\
x_2
\end{bmatrix}
\quad
\hat i=\begin{bmatrix} 1 \\ 0 \end{bmatrix}
\quad
\hat j=\begin{bmatrix} 0 \\ 1 \end{bmatrix}\]

\[x=x_1\begin{bmatrix}1 \\ 0\end{bmatrix}
+ x_2\begin{bmatrix}0 \\ 1 \end{bmatrix}\]

\[Ax = x_1 \times A\begin{bmatrix}1 \\ 0\end{bmatrix} 
+ x_2 \times A\begin{bmatrix}0 \\ 1\end{bmatrix}
= 
x_1\begin{bmatrix}
a_{11} \\
a_{21}
\end{bmatrix} + x_2\begin{bmatrix}
a_{12} \\
a_{22}
\end{bmatrix}\]

&lt;blockquote&gt;
  &lt;p&gt;Applying matrices several time can be seen as applying linear transformations several time&lt;/p&gt;
&lt;/blockquote&gt;

\[A = \begin{bmatrix}
a_{11} &amp;amp; a_{12} \\
a_{21} &amp;amp; a_{22}
\end{bmatrix} \quad 

B = \begin{bmatrix}
b_{11} &amp;amp; b_{12} \\
b_{21} &amp;amp; b_{22}
\end{bmatrix} \quad\]

\[BAI = BA = B \times 
\begin{bmatrix}
a_{11} &amp;amp; a_{12} \\
a_{21} &amp;amp; a_{22}
\end{bmatrix}
 = \left[ \begin{array}{c|c}
   B \begin{bmatrix} a_{11} \\ a_{21} \end{bmatrix} &amp;amp; 
   B \begin{bmatrix} a_{12} \\ a_{22} \end{bmatrix}
\end{array}\right]\]

\[BAx = x_1 \times B \begin{bmatrix} a_{11} \\ a_{21} \end{bmatrix} + x_2 \times B \begin{bmatrix} a_{12} \\ a_{22} \end{bmatrix}\]

&lt;blockquote&gt;
  &lt;p&gt;If \(A\) is non-squared, it transforms a vector to another dimension.&lt;/p&gt;
&lt;/blockquote&gt;

\[A \in \mathbb{R}^{n\times m} \quad x \in \mathbb{R}^m\]

&lt;p&gt;if \(n &amp;lt; m\), then \(A\) squeezes \(m\)-dimensional vector in to \(n\)-dimensinal vector&lt;/p&gt;

&lt;p&gt;if \(n = 1\) and \(m = 3\), multiplying \(A\) squeezes \(3\)-dimensional vector into scalar. Generally, in this case, a plane squeezes into a scalar.&lt;/p&gt;

&lt;p&gt;else if \(n &amp;gt; m\), \(A\) puts \(m\)-dimensional space in \(n\)-dimensional space&lt;/p&gt;

&lt;p&gt;if \(n = 3\) and \(m = 1\), generally, multiplying \(A\) puts a scalar into \(3\)-dimensional space.&lt;/p&gt;
</description>
        <pubDate>Sat, 08 Oct 2022 00:00:00 +0000</pubDate>
        <link>https://ppumang.github.io/linear%20algebra/Intuitive-understanding-of-multiplying-a-matrix/</link>
        <guid isPermaLink="true">https://ppumang.github.io/linear%20algebra/Intuitive-understanding-of-multiplying-a-matrix/</guid>
        
        
        <category>linear algebra</category>
        
      </item>
    
      <item>
        <title>ppumang's dev blog - How does a website work?</title>
        <description>&lt;p&gt;Everyday, we search through google, click the link of a website, and contents of the website just pop up.&lt;/p&gt;

&lt;p&gt;This seems so obvious, but how does it actually work? We’ll go through details of how these web contents is delivered to us.&lt;/p&gt;

&lt;p&gt;What we expect from a website is a view( fancy designs of a website ) which contains data(in the form of text, images, graphs… etc.) These data are present in a server. So, a client has to access server and fetch data. To achieve this, there should be a server running 24 hours a day, and it receives http request from a client, access a database with TCP protocol, fetch data(or update, delete, create) and send the result back to the client.&lt;/p&gt;

&lt;p&gt;So, the essense of a website is to &lt;strong&gt;manipulate database from client(browser), through a server&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;A website is composed of three parts. &lt;strong&gt;Frontend&lt;/strong&gt;, &lt;strong&gt;backend&lt;/strong&gt; and &lt;strong&gt;database&lt;/strong&gt;.&lt;/p&gt;

&lt;h2 id=&quot;frontend&quot;&gt;&lt;strong&gt;Frontend&lt;/strong&gt;&lt;/h2&gt;
&lt;ul&gt;
  &lt;li&gt;Draws content on a browser&lt;/li&gt;
  &lt;li&gt;It can’t save data permanently. Instead, it draws screen based on html, css, javascript, images, and data it received from server&lt;/li&gt;
  &lt;li&gt;html - the content that we can see on a website ( text, boxes, textareas… etc. )&lt;/li&gt;
  &lt;li&gt;css - decorates and puts html elements on the right place. ( colors of texts, positions of boxes, background image of website… etc. )&lt;/li&gt;
  &lt;li&gt;javascript - gives functionality to website. ( sending form data to server when a button is pressed, fetching data by requesting http request to the server… etc. )&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;backend&quot;&gt;&lt;strong&gt;Backend&lt;/strong&gt;&lt;/h2&gt;
&lt;ul&gt;
  &lt;li&gt;A computer running 24hours a day.&lt;/li&gt;
  &lt;li&gt;Listens to requests and respond to it. (API)&lt;/li&gt;
  &lt;li&gt;Connects to database and manipulate data&lt;/li&gt;
  &lt;li&gt;python - django, flask, fast api…&lt;/li&gt;
  &lt;li&gt;java - spring&lt;/li&gt;
  &lt;li&gt;javascript - node js&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;database&quot;&gt;&lt;strong&gt;Database&lt;/strong&gt;&lt;/h2&gt;
&lt;ul&gt;
  &lt;li&gt;Saves a huge amount of data in a efficient way&lt;/li&gt;
  &lt;li&gt;Tree-like data structures are commonly used&lt;/li&gt;
  &lt;li&gt;Can find data efficiently by indexing&lt;/li&gt;
  &lt;li&gt;Schema is used to save data in a structured form&lt;/li&gt;
  &lt;li&gt;Interacts with backend for data manipulation&lt;/li&gt;
  &lt;li&gt;SQL - MySQL, Postgresql, Oracle DB … etc.&lt;/li&gt;
  &lt;li&gt;NoSQL - Mongodb, Couchdb, Dynamo DB, Firebase rdb … etc.&lt;/li&gt;
  &lt;li&gt;In-memory DB - redis, memcached, cassandra… etc.&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
  &lt;p&gt;This post is for beginners and non-programmers, so strict definitions are ignored for the convinience of understanding&lt;/p&gt;
&lt;/blockquote&gt;
</description>
        <pubDate>Fri, 07 Oct 2022 00:00:00 +0000</pubDate>
        <link>https://ppumang.github.io/web/How-does-a-website-work/</link>
        <guid isPermaLink="true">https://ppumang.github.io/web/How-does-a-website-work/</guid>
        
        
        <category>web</category>
        
      </item>
    
      <item>
        <title>ppumang's dev blog - What are the components of ethereum ecosystem?</title>
        <description>&lt;p&gt;&lt;strong&gt;P2P network&lt;/strong&gt; &lt;br /&gt;
Ethereum runs on the Ethereum main network, which is addressable on TCP port 30303, and runs a protocol called ÐΞVp2p.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Consensus rules&lt;/strong&gt; &lt;br /&gt;
Ethereum’s consensus rules are defined in the reference specification, the &lt;strong&gt;&lt;a href=&quot;https://ethereum.github.io/yellowpaper/paper.pdf&quot;&gt;Yellow Paper&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Transactions&lt;/strong&gt;&lt;br /&gt;
Ethereum transactions are network messages that include (among other things) a sender, recipient, value, and data payload.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;State machine&lt;/strong&gt;&lt;br /&gt;
Ethereum state transitions are processed by the Ethereum Virtual Machine (EVM), a stack-based virtual machine that executes bytecode (machine-language instructions). EVM programs, called “smart contracts,” are written in high-level languages (e.g., Solidity) and compiled to bytecode for execution on the EVM.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Data structures&lt;/strong&gt;&lt;br /&gt;
Ethereum’s state is stored locally on each node as a database (usually Google’s LevelDB), which contains the transactions and system state in a serialized hashed data structure called a &lt;strong&gt;Merkle Patricia Tree&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Consensus algorithm&lt;/strong&gt;&lt;br /&gt;
Ethereum uses Bitcoin’s consensus model, Nakamoto Consensus, which uses sequential single-signature blocks, weighted in importance by PoW to determine the longest chain and therefore the current state. However, there are plans to move to a PoS weighted voting system, codenamed Casper, in the near future.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Economic security&lt;/strong&gt;&lt;br /&gt;
Ethereum currently uses a PoW algorithm called Ethash, but this will eventually be dropped with the move to PoS at some point in the future.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Clients&lt;/strong&gt;&lt;br /&gt;
Ethereum has several interoperable implementations of the client software, the most prominent of which are Go-Ethereum (Geth) and Parity.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Note: Ethereum finalized ‘&lt;strong&gt;The Merge&lt;/strong&gt;’ at block #15,537,393 on September 15, 2022, at 1:42:42 EST. Which means that Ethereum has moved from PoW to PoS. Instead of mining, Ethereum will rely on stakers to secure the network.&lt;/em&gt;&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;This article is scrapped from “Mastering Ethereum”&lt;/p&gt;
&lt;/blockquote&gt;
</description>
        <pubDate>Fri, 07 Oct 2022 00:00:00 +0000</pubDate>
        <link>https://ppumang.github.io/ethereum/What-are-the-components-of-Ethereum-ecosystem/</link>
        <guid isPermaLink="true">https://ppumang.github.io/ethereum/What-are-the-components-of-Ethereum-ecosystem/</guid>
        
        
        <category>ethereum</category>
        
      </item>
    
      <item>
        <title>ppumang's dev blog - Ethereum's development stages</title>
        <description>&lt;p&gt;Ethereum’s development was planned over four distinct stages.&lt;br /&gt;
&lt;strong&gt;Frontier&lt;/strong&gt;, &lt;strong&gt;Homestead&lt;/strong&gt;, &lt;strong&gt;Metropolis&lt;/strong&gt;, and &lt;strong&gt;Serenity&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Block #0
&lt;strong&gt;Frontier&lt;/strong&gt; — The initial stage of Ethereum, lasting from July 30, 2015, to March 2016.&lt;/p&gt;

&lt;p&gt;Block #200,000
Ice Age — A hard fork to introduce an exponential difficulty increase, to motivate a transition to PoS when ready.&lt;/p&gt;

&lt;p&gt;Block #1,150,000
&lt;strong&gt;Homestead&lt;/strong&gt; — The second stage of Ethereum, launched in March 2016.&lt;/p&gt;

&lt;p&gt;Block #1,192,000
DAO — A hard fork that reimbursed victims of the hacked DAO contract and caused Ethereum and Ethereum Classic to split into two competing systems.&lt;/p&gt;

&lt;p&gt;Block #2,463,000
Tangerine Whistle — A hard fork to change the gas calculation for certain I/O-heavy operations and to clear the accumulated state from a denial-of-service (DoS) attack that exploited the low gas cost of those operations.&lt;/p&gt;

&lt;p&gt;Block #2,675,000
Spurious Dragon — A hard fork to address more DoS attack vectors, and another state clearing. Also, a replay attack protection mechanism.&lt;/p&gt;

&lt;p&gt;Block #4,370,000
&lt;strong&gt;Metropolis Byzantium&lt;/strong&gt; — Metropolis is the third stage of Ethereum. Launched in October 2017, Byzantium is the first part of Metropolis, adding low-level functionalities and adjusting the block reward and difficulty.&lt;/p&gt;

&lt;p&gt;Block #7,280,000
Constantinople / St. Petersburg — Constantinople was planned to be the second part of Metropolis with similar improvements. A few hours before its activation, a critical bug was discovered. The hard fork was therefore postponed and renamed St. Petersburg.&lt;/p&gt;

&lt;p&gt;Block #9,069,000
Istanbul — An additional hard fork with the same approach, and naming convention, as for the prior two.&lt;/p&gt;

&lt;p&gt;Block #9,200,000
Muir Glacier — A hard fork whose sole purpose was to adjust the difficulty again due to the exponential increase introduced by Ice Age.&lt;/p&gt;

&lt;p&gt;In 2022-10-07, Ethereum’s block height is 15,694,029&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;This article is scrapped from “Mastering Ethereum”&lt;/p&gt;
&lt;/blockquote&gt;
</description>
        <pubDate>Fri, 07 Oct 2022 00:00:00 +0000</pubDate>
        <link>https://ppumang.github.io/ethereum/Ethereum's-development-stages/</link>
        <guid isPermaLink="true">https://ppumang.github.io/ethereum/Ethereum's-development-stages/</guid>
        
        
        <category>ethereum</category>
        
      </item>
    
      <item>
        <title>ppumang's dev blog - How is ethereum different from bitcoin?</title>
        <description>&lt;p&gt;Ethereum’s purpose is not primarily to be a digital currency payment network.&lt;/p&gt;

&lt;p&gt;While the digital currency &lt;strong&gt;ether&lt;/strong&gt; is intended as a &lt;strong&gt;utility currency&lt;/strong&gt; to pay for use of the Ethereum platform as the world computer.&lt;/p&gt;

&lt;p&gt;Ethereum is designed to be a &lt;strong&gt;general-purpose programmable blockchain&lt;/strong&gt; that runs a virtual machine capable of executing code of arbitrary and unbounded complexity.&lt;/p&gt;

&lt;p&gt;Ethereum’s language is &lt;strong&gt;Turing complete&lt;/strong&gt;, meaning that Ethereum can straightforwardly function as a general-purpose computer.&lt;/p&gt;

&lt;p&gt;The Ethereum platform was designed to abstract detailed implementations of peer-to-peer networks, blockchains, consensus algorithms, etc… providing a deterministic and secure programming environment for decentralized blockchain applications.&lt;/p&gt;

&lt;p&gt;While bitcoin keeps track of bitcoin’s ownership, ethereum tracks the &lt;strong&gt;state transition&lt;/strong&gt; of a general-purpose data store, which is stored in key-value tuple.&lt;/p&gt;

&lt;p&gt;Ethereum can load code into its state machine and run that code, storing the resulting state changes in its blockchain.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;&lt;strong&gt;About Turing completeness&lt;/strong&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Note: Turing machine is a machine composed of memory, head, state and symbols. Head reads memory from left to right, performing jobs pre-determined by symbols, and overwrites the state in it’s position.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;If a machine is Turing-complete, it means it can simulate any Turing machine.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Due to the fact that it can simulate any programs, Turing-complete machines can be stuck in infinite loops or computation that needs huge resoureces. And it is also proven that we cannot predict whether a program will end in finite time or not.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;To solve this problem, Ethereum introduced the concept of &lt;strong&gt;gas&lt;/strong&gt;. While running a smart contract, in each operations( computations, data access, etc. ), a pre-defined amount of gas is used. When sending transaction to trigger execution, a user has to set a &lt;strong&gt;gas limit&lt;/strong&gt;. If a gas used in execution exceeds the gas limit, the EVM will terminate the execution, leaving the state unchanged.&lt;/em&gt;&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;This article is scrapped from “Mastering Ethereum”&lt;/p&gt;
&lt;/blockquote&gt;
</description>
        <pubDate>Thu, 06 Oct 2022 00:00:00 +0000</pubDate>
        <link>https://ppumang.github.io/ethereum/How-is-Ethereum-different-from-Bitcoin/</link>
        <guid isPermaLink="true">https://ppumang.github.io/ethereum/How-is-Ethereum-different-from-Bitcoin/</guid>
        
        
        <category>ethereum</category>
        
      </item>
    
      <item>
        <title>ppumang's dev blog - What happens if two independent blocks are created at the same time?</title>
        <description>&lt;p&gt;Every nodes should reach a consensus and save same transactions, same blocks.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;../../assets/images/fork_consensus.png&quot; /&gt;&lt;/p&gt;
&lt;figcaption&gt;A bitcoin network that reached consensus, &quot;bitcoin book&quot;&lt;/figcaption&gt;

&lt;p&gt;When mining bitcoin, if a mining block finds the correct nonce, it propagates a new block( block A ) to other nodes.&lt;/p&gt;

&lt;p&gt;If a mining node receives a propagated block( block A ) before finding the nonce, it stops current POW and start POW of the block after the received block.&lt;/p&gt;

&lt;p&gt;It takes time for a new block to propagate to every nodes. So, before it’s propagated to every node, another node that hasn’t received the new node might succeed in POW, and start propagating another new block( block B ).&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;../../assets/images/fork_conflict.png&quot; /&gt;&lt;/p&gt;
&lt;figcaption&gt;propagating to different blocks, &quot;bitcoin book&quot;&lt;/figcaption&gt;

&lt;p&gt;In this case, some nodes receives block A before block B, while some nodes receives block B before block A. When this happens, a bitcoin network is &lt;strong&gt;forked&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;../../assets/images/fork_conflict2.png&quot; /&gt;&lt;/p&gt;
&lt;figcaption&gt;A forked bitcoin network, &quot;bitcoin book&quot; &lt;/figcaption&gt;

&lt;p&gt;Which block should be selected? block A or block B?&lt;/p&gt;

&lt;p&gt;Mining nodes doesn’t care if the network is forked or not. They just keep mining the next node.&lt;/p&gt;

&lt;p&gt;Let’s say a mining node succeeded POW, made new block ( block C ) on top of block A, and propagated it to other nodes.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;../../assets/images/fork_resolving.png&quot; /&gt;&lt;/p&gt;
&lt;figcaption&gt;Block C is mined and propagated, &quot;bitcoin book&quot;&lt;/figcaption&gt;

&lt;p&gt;When a node receives block C lengthening block A, the blockchain with block A is longer than the blockchain with block B. This makes blockchain with block A more &lt;strong&gt;credible&lt;/strong&gt; then the other. So the node chooses blockchain with block A, and fork is resolved.&lt;/p&gt;

&lt;p&gt;Block that has not been chosen is called an &lt;strong&gt;orphan block&lt;/strong&gt; or &lt;strong&gt;stale block&lt;/strong&gt;. In this case, block B is an orphan block.&lt;/p&gt;

&lt;p&gt;Conventionally, if a network is forked, a node chooses the longest one.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;../../assets/images/fork_resolved.png&quot; /&gt;&lt;/p&gt;
&lt;figcaption&gt;Fork resolved, &quot;bitcoin book&quot;&lt;/figcaption&gt;

&lt;p&gt;Although blockchain with block B is one height shorter then block A, it still has chance to become longer then blockchain with block A.&lt;/p&gt;

&lt;p&gt;It’s a common sense that if block height differs more than 5 blocks, it’s almost impossible for defeated chain to win.&lt;/p&gt;

&lt;p&gt;So, if a block has more than 5 blocks on top of it, it’s considered &lt;strong&gt;safe&lt;/strong&gt;, meaning that it will not be defeated by another forked blockchain.&lt;/p&gt;
</description>
        <pubDate>Wed, 05 Oct 2022 00:00:00 +0000</pubDate>
        <link>https://ppumang.github.io/bitcoin/What-happens-if-two-independent-blocks-are-created-at-the-same-time/</link>
        <guid isPermaLink="true">https://ppumang.github.io/bitcoin/What-happens-if-two-independent-blocks-are-created-at-the-same-time/</guid>
        
        
        <category>bitcoin</category>
        
      </item>
    
  </channel>
</rss>