<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Uniswap on Bitsy Services Wiki</title>
    <link>https://wiki.bitsy.services/wiki/defi/uniswap/</link>
    <description>Recent content in Uniswap on Bitsy Services Wiki</description>
    <generator>Hugo</generator>
    <language>en</language>
    <atom:link href="https://wiki.bitsy.services/wiki/defi/uniswap/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>ISwapRouter — Uniswap V3 Swap Guide</title>
      <link>https://wiki.bitsy.services/wiki/defi/uniswap/iswap-router/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      <guid>https://wiki.bitsy.services/wiki/defi/uniswap/iswap-router/</guid>
      <description>&lt;p&gt;&lt;code&gt;ISwapRouter&lt;/code&gt; is the interface your contract (or off-chain script) calls to execute token swaps through Uniswap V3 pools. It lives at:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;@uniswap/v3-periphery/contracts/interfaces/ISwapRouter.sol&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;The canonical deployment is the &lt;strong&gt;SwapRouter&lt;/strong&gt; contract. On most chains the address is &lt;code&gt;0xE592427A0AEce92De3Edee1F18E0157C05861564&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;blockquote class=&#39;book-hint &#39;&gt;&#xA;&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; Uniswap has since shipped &lt;strong&gt;SwapRouter02&lt;/strong&gt; (combines V2 + V3 routing) and the &lt;strong&gt;UniversalRouter&lt;/strong&gt; (V2, V3, Permit2, NFT purchases). For new integrations, evaluate those first — they offer better gas efficiency and approval flows via &lt;a href=&#34;https://docs.uniswap.org/contracts/permit2/overview&#34;&gt;Permit2&lt;/a&gt;. This guide covers the original SwapRouter, which remains widely deployed and is the simplest to learn from.&lt;/p&gt;</description>
    </item>
    <item>
      <title>SwapRouter vs SwapRouter02 vs UniversalRouter</title>
      <link>https://wiki.bitsy.services/wiki/defi/uniswap/swap-routers/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      <guid>https://wiki.bitsy.services/wiki/defi/uniswap/swap-routers/</guid>
      <description>&lt;p&gt;Uniswap has shipped three generations of swap routers. Each builds on the last, adding protocol support and improving gas efficiency and approval UX. This page compares all three to help you choose the right one.&lt;/p&gt;&#xA;&lt;h2 id=&#34;at-a-glance&#34;&gt;At a Glance&lt;a class=&#34;anchor&#34; href=&#34;#at-a-glance&#34;&gt;#&lt;/a&gt;&lt;/h2&gt;&#xA;&lt;table&gt;&#xA;  &lt;thead&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;th&gt;&lt;/th&gt;&#xA;          &lt;th&gt;&lt;strong&gt;SwapRouter&lt;/strong&gt;&lt;/th&gt;&#xA;          &lt;th&gt;&lt;strong&gt;SwapRouter02&lt;/strong&gt;&lt;/th&gt;&#xA;          &lt;th&gt;&lt;strong&gt;UniversalRouter&lt;/strong&gt;&lt;/th&gt;&#xA;      &lt;/tr&gt;&#xA;  &lt;/thead&gt;&#xA;  &lt;tbody&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;Protocols&lt;/td&gt;&#xA;          &lt;td&gt;V3 only&lt;/td&gt;&#xA;          &lt;td&gt;V2 + V3&lt;/td&gt;&#xA;          &lt;td&gt;V2 + V3 + V4 + NFTs&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;Approval model&lt;/td&gt;&#xA;          &lt;td&gt;Per-token &lt;code&gt;approve&lt;/code&gt;&lt;/td&gt;&#xA;          &lt;td&gt;Per-token &lt;code&gt;approve&lt;/code&gt;&lt;/td&gt;&#xA;          &lt;td&gt;&lt;a href=&#34;https://docs.uniswap.org/contracts/permit2/overview&#34;&gt;Permit2&lt;/a&gt; signatures&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;Multi-call batching&lt;/td&gt;&#xA;          &lt;td&gt;No&lt;/td&gt;&#xA;          &lt;td&gt;&lt;code&gt;multicall()&lt;/code&gt;&lt;/td&gt;&#xA;          &lt;td&gt;Command-based execution&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;ETH handling&lt;/td&gt;&#xA;          &lt;td&gt;Manual wrap/unwrap&lt;/td&gt;&#xA;          &lt;td&gt;Built-in wrap/unwrap&lt;/td&gt;&#xA;          &lt;td&gt;Built-in wrap/unwrap&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;Gas efficiency&lt;/td&gt;&#xA;          &lt;td&gt;Baseline&lt;/td&gt;&#xA;          &lt;td&gt;Moderate improvement&lt;/td&gt;&#xA;          &lt;td&gt;Best (single &lt;code&gt;transferFrom&lt;/code&gt; per token)&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;Interface&lt;/td&gt;&#xA;          &lt;td&gt;&lt;code&gt;ISwapRouter&lt;/code&gt;&lt;/td&gt;&#xA;          &lt;td&gt;&lt;code&gt;ISwapRouter02&lt;/code&gt;&lt;/td&gt;&#xA;          &lt;td&gt;Encoded command bytes&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;Status&lt;/td&gt;&#xA;          &lt;td&gt;Legacy — widely deployed&lt;/td&gt;&#xA;          &lt;td&gt;Production — simpler integration&lt;/td&gt;&#xA;          &lt;td&gt;&lt;strong&gt;Recommended&lt;/strong&gt; for new projects&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;  &lt;/tbody&gt;&#xA;&lt;/table&gt;&#xA;&lt;h2 id=&#34;swaprouter-v3&#34;&gt;SwapRouter (V3)&lt;a class=&#34;anchor&#34; href=&#34;#swaprouter-v3&#34;&gt;#&lt;/a&gt;&lt;/h2&gt;&#xA;&lt;p&gt;The original V3 swap router. It exposes a clean Solidity interface (&lt;code&gt;ISwapRouter&lt;/code&gt;) with four functions: &lt;code&gt;exactInputSingle&lt;/code&gt;, &lt;code&gt;exactInput&lt;/code&gt;, &lt;code&gt;exactOutputSingle&lt;/code&gt;, and &lt;code&gt;exactOutput&lt;/code&gt;. See the &lt;a href=&#34;https://wiki.bitsy.services/wiki/defi/uniswap/iswap-router&#34;&gt;ISwapRouter guide&lt;/a&gt; for full details.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Ticks</title>
      <link>https://wiki.bitsy.services/wiki/defi/uniswap/ticks/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      <guid>https://wiki.bitsy.services/wiki/defi/uniswap/ticks/</guid>
      <description>&lt;p&gt;A &lt;a href=&#34;../&#34;&gt;Uniswap&lt;/a&gt; V3 or V4 pool does not track a continuous price. It tracks an integer called the &lt;em&gt;current tick&lt;/em&gt;, and the price is a function of that integer. Every position&amp;rsquo;s range boundary, every initialized price point, and every sqrt-price stored on chain is ultimately a tick.&lt;/p&gt;&#xA;&lt;p&gt;Ticks exist because &lt;a href=&#34;../../virtual-reserves&#34;&gt;concentrated liquidity&lt;/a&gt; needs to discretize the price axis. Liquidity providers must choose a range, and the pool must be able to add or remove their liquidity efficiently as the price crosses range boundaries. Doing that with arbitrary-precision real numbers is intractable; doing it on a lattice of integer tick indices is fast and deterministic.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Single-Tick Liquidity</title>
      <link>https://wiki.bitsy.services/wiki/defi/uniswap/single-tick-liquidity/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      <guid>https://wiki.bitsy.services/wiki/defi/uniswap/single-tick-liquidity/</guid>
      <description>&lt;p&gt;A single-tick liquidity position is a &lt;a href=&#34;../&#34;&gt;Uniswap&lt;/a&gt; V3/V4 position whose range is exactly one &lt;a href=&#34;ticks&#34;&gt;tick&lt;/a&gt; wide — the narrowest range the protocol allows. Inside that one tick the position stops behaving like a curve and starts behaving like a &lt;em&gt;fixed-price block of depth&lt;/em&gt;: trades fill at an almost constant rate until the position is exhausted, then price jumps to the next tick. It is the building block behind on-chain limit orders (&amp;ldquo;range orders&amp;rdquo;) and behind the price corridor a &lt;a href=&#34;../../par-token&#34;&gt;par token&lt;/a&gt; lives in.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Fee Distribution in Concentrated Liquidity</title>
      <link>https://wiki.bitsy.services/wiki/defi/uniswap/fee-distribution/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      <guid>https://wiki.bitsy.services/wiki/defi/uniswap/fee-distribution/</guid>
      <description>&lt;p&gt;In &lt;a href=&#34;../&#34;&gt;Uniswap V2&lt;/a&gt;, every liquidity provider owns a fraction of a single, full-range pool. Fees accrue to the reserves themselves, so an LP&amp;rsquo;s share grows automatically: when you burn your LP token you withdraw slightly more of each asset than you deposited, and the difference is your fees. No per-LP bookkeeping is needed because there is nothing to book — the pool is one giant homogeneous pot.&lt;/p&gt;&#xA;&lt;p&gt;&lt;a href=&#34;https://docs.uniswap.org/concepts/protocol/concentrated-liquidity&#34;&gt;Concentrated liquidity&lt;/a&gt; breaks that symmetry. Each position occupies its own price range, and only positions whose range contains the current price earn fees on a given swap. The naïve implementation would keep a list of active positions and, on each swap, iterate over them paying out pro-rata. That would be catastrophic: gas per swap would scale with the number of LPs, and a single spammer could brick the pool by opening a million dust positions.&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
