<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by David Bouba on Medium]]></title>
        <description><![CDATA[Stories by David Bouba on Medium]]></description>
        <link>https://medium.com/@davidbouba?source=rss-f0f63c349cef------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*Ew0NRWUtY27EDPacPzm9sA.png</url>
            <title>Stories by David Bouba on Medium</title>
            <link>https://medium.com/@davidbouba?source=rss-f0f63c349cef------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 18 Nov 2026 09:31:47 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@davidbouba/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Introducing: Swaap Protocol]]></title>
            <link>https://medium.com/swaap-finance/introducing-swaap-protocol-ab732a947d5d?source=rss-f0f63c349cef------2</link>
            <guid isPermaLink="false">https://medium.com/p/ab732a947d5d</guid>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[web3]]></category>
            <category><![CDATA[decentralized-exchange]]></category>
            <category><![CDATA[decentralized-finance]]></category>
            <category><![CDATA[ethereum]]></category>
            <dc:creator><![CDATA[David Bouba]]></dc:creator>
            <pubDate>Fri, 08 Oct 2021 16:21:12 GMT</pubDate>
            <atom:updated>2022-05-11T13:49:39.641Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TQfAXUzV50qPdwE2gkf8OA.png" /></figure><p><strong><em>Swaap = HODL + AMM - IL</em></strong></p><p><em>We build the pure market making protocol. No IL, only yields.</em></p><p><em>We envision a world where capital efficiency would be both simple and open to everyone, not just quants.</em></p><p><strong><em>TL;DR</em></strong><em>: 0-impermanent loss, dynamic liquidity efficiency, built-in market risks coverage and multi-asset support.</em></p><h3>Liquidity dilemma in traditional finance 🏊</h3><p>Liquidity is a critical aspect of every market. It represents the ability to sell/buy assets with ease and at low costs. When liquidity is high it essentially means less risks and more efficiency for capital flows.</p><p>In traditional finance, providing liquidity is taken care of by market makers (MM) who act as buffers between sellers and buyers. Their role consists in continuously offering short and long positions to fill sell/buy orders that traders would eventually place. Thus offering a kind of “fluidity” or liquidity to the market.</p><p>Under its purest form, market making generates revenues solely from the intermediary role market makers play, and these latter avoid asset exposure risks at all cost. It means that they try to minimise the time to settle their long/short positions and hedge themselves against any potential risk of depreciation/appreciation of their securities at the same time.</p><p>The <a href="https://en.wikipedia.org/wiki/Bid%E2%80%93ask_spread"><strong>bid-ask spread</strong></a> — which corresponds to the difference between the sell and buy prices applied by the market makers — is the common answer to that dual problem and is optimized to be both market competitive as well as a form of insurance against market risks. This spread needs to be completely dynamic to be able to take into account the ever-changing conditions that markets usually display. Simply put, market makers charge low fees to drastically increase trading volumes and the overall revenue when market is safe, and apply higher fees when market becomes particularly wild to be able to maintain its operations at low risk, continue to earn fees and keep their capital safe from losses.</p><p>When done efficiently at scale it can be a rather profitable activity: <em>Citadel Securities’s </em>reported<em> </em>$6.7B in revenue gives us a powerful reminder of it<em>. RobinHood</em> Q2 2021 earnings call is another good illustration with a reported $451M in “transaction-based” revenue, as a payment for order flow (PFOF) — which corresponds only to a fraction of what its market maker partners earn.</p><p>Now, when looking at the centralized cryptocurrency market we can see that the same logic applies with <em>Coinbase</em> charging a dynamic spread based on market conditions for its asset swap service. It totally makes sense as, despite having different market conditions, the risk exposure remains.</p><h3>The emergence of AMMs 🤖</h3><p>As a decentralized alternative that embraces the security, transparency and efficiency of blockchain, Automated Market Maker (AMM) systems — first introduced in <a href="https://np.reddit.com/r/ethereum/comments/55m04x/lets_run_onchain_decentralized_exchanges_the_way/">2016</a> by <em>Vitalik Buterin</em> — quickly became popular, especially under the constant product form imagined by <em>Uniswap</em> and later on generalized by <em>Balancer </em>to multi-asset pools with arbitrary weightings.</p><p>While it is able to provide a simple and elegant link between price, liquidity and efficiency (cf. fig.1), it fails to capture the market complexity.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/297/1*gh35sRDaNmnVY7S5avb42A.png" /><figcaption>fig.1: Uniswap’s AMM -like curve</figcaption></figure><p>This is mostly due to the fact that no usage of global market data (<em>e.g. </em>volatility, price, etc.) is made.</p><p>As a result, the system is static — which means not competitive and running high capital risks— and forced to address two rather different problems at the same time: market liquidity and price discovery.</p><p>While addressing the former can offer the same service than the one market maker provide in a traditional financial markets, addressing the latter one with the current AMM implementations (Uniswap, Balancer, etc.) corresponds to a continuous portfolio rebalancing and is equivalent to increase the pool’s risk exposure to poorly performing assets which directly translates into what has been called the<em> “impermanent loss” (IL)</em>.</p><blockquote>To put it in another perspective: investing in the popular BTC-ETH-stablecoin pool in 2015 in such AMMs would have led to an astonishing +90% loss in capital (fee collection excluded) compared to an HODL strategy.</blockquote><p>And in this case, to <em>only</em> counterbalance the effect of impermanent loss you would have needed an APY of +100% every single year over this 6 years period 😞</p><p>Even a “top10 market cap. cryptos” pool would have lead to a +95% IL…!</p><h3>Why do we need a better solution? 🤔</h3><p>Today, the best investment vehicles in the whole blockchain landscape are the projects themselves, offering X00%+ <a href="https://en.wikipedia.org/wiki/Compound_annual_growth_rate">CAGR</a> over the past decade.</p><p>Basically, continuously selling highly performant assets — which traditional AMMs do— is usually not a good choice for non expert users as it will essentially translate to either:</p><ol><li>accept important impermanent losses</li><li>setup a complex and real-time portfolio management policy</li><li>invest in highly correlated asset pools to avoid IL</li></ol><blockquote>In other words, today’s DEXes’ users are facing a <strong>poor-performance</strong> / <strong>poor-UX / poor-risk-management </strong>dilemma.</blockquote><p>On the other side, TradFi with the Index ETFs has seen a democratisation of investing by providing efficient, diversified, and passive investment products at the same time.</p><p>Index ETFs have indeed the appealing property of being a rather simple and passive investment vehicle allowing everyone with a capital to gain exposure to the growing economy, and have displayed <a href="https://www.aei.org/carpe-diem/the-sp-500-index-out-performed-hedge-funds-over-the-last-10-years-and-it-wasnt-even-close/">better-than-hedge-fund </a>performances in the last decade.</p><h3>👋 the Matrix Market Maker</h3><p><a href="http://swaap.finance/"><strong>Swaap</strong></a> has been designed to solve this exact aforementioned dilemma.</p><p>First, it totally decouples the market-making from the price discovery by leveraging on-chain data from oracles such as <em>Chainlink</em>, removing <em>de facto</em> the impermanent loss.</p><p>Then, it provides adaptive market making fee regimes based on market conditions thanks to a stochastic approach. On the one hand, it is more competitive than traditional automated AMMs when the market is less risky. On the other hand, fees are increased to account for additional risk in volatile market conditions.</p><p>Finally, it handles multi-asset pools by design, thus allowing for a diversified and passive form of investing.</p><p>All those features come built-in in the <strong>Swaap DEX </strong>thanks to our new market maker system. We called it the <strong>Matrix Market Maker (MMM)<em> </em></strong>and we discuss it in more details in our recently released <a href="https://swaap.finance/whitepaper.pdf">whitepaper</a>.</p><p>It is now possible for the first time to both a) invest in the best crypto projects as with HODL / Index ETFs strategies, while b) harvesting high yields for your liquidity — at the same time, in the same place, with minimal risk!</p><h3><strong>Join the community </strong>🤗</h3><p><strong>Website:</strong> <a href="http://swaap.finance/">swaap.finance</a></p><p><strong>Twitter:</strong> <a href="https://twitter.com/SwaapFinance">twitter.com/SwaapFinance</a></p><p><strong>GitHub: </strong><a href="https://github.com/swaap-labs">github.com/swaap-labs</a></p><p><strong>Whitepaper: </strong><a href="https://www.swaap.finance/whitepaper.pdf">swaap.finance/whitepaper.pdf</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ab732a947d5d" width="1" height="1" alt=""><hr><p><a href="https://medium.com/swaap-finance/introducing-swaap-protocol-ab732a947d5d">Introducing: Swaap Protocol</a> was originally published in <a href="https://medium.com/swaap-finance">Swaap</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Real-time machine learning in Go at Zenly]]></title>
            <link>https://medium.com/zenlyapp/real-time-machine-learning-in-go-at-zenly-5fece526b2ac?source=rss-f0f63c349cef------2</link>
            <guid isPermaLink="false">https://medium.com/p/5fece526b2ac</guid>
            <category><![CDATA[grpc]]></category>
            <category><![CDATA[golang]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[docker]]></category>
            <dc:creator><![CDATA[David Bouba]]></dc:creator>
            <pubDate>Thu, 29 Nov 2018 19:57:50 GMT</pubDate>
            <atom:updated>2018-11-30T14:21:55.903Z</atom:updated>
            <content:encoded><![CDATA[<p>Zenly is a social map app that allows you to share where you are and what you’re up to with your best friends without ever taking your phone out of your pocket. We use real time location as an enabler to get friends together more often in real life and we’re trying to make sure that no one ever sends a “where are you?” text again 🤗</p><p>Whether it’s about knowing which venue your mates are hanging out in, suggest relevant new friends or identify your means of transportation, such tasks often translate to complex underlying patterns.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*61R6Dzz6z2-0E4bvfEfazg.png" /></figure><h4>Machine learning + live = 😍</h4><p>Rule-based models can be a good start for most applications when dealing with low-dimensionality problems. They are fast to implement and only require a good comprehension of what is going on under the hood regarding the input-output relationship we are trying to abstract.</p><p>Yet, as our app gets richer and richer, so do our users’ behavior and it rapidly gets impossible to make these kind of systems evolve, or even to maintain them.</p><p>Furthermore, for some application the decision-making is not performed offline, but rather triggered by some users’s action and it needs to be served live with low-latency. In such scenarios, the provided solution should at least answer to the two following questions:</p><ul><li>how to port an <strong>R&amp;D</strong> model to <strong>production</strong> ?</li><li>how to satisfy <strong>real-time </strong>constraints ?</li></ul><p>In this post, we will give an overview on how Zenly uses machine learning in production for real-time applications.</p><h4><a href="https://github.com/znly/go-ml-transpiler">go-ml-transpiler</a>: compile model in Go</h4><p>For offering a good trade-off between performance and productivity, <em>Go</em> has been widely used at Zenly. In addition, <em>Go</em> has the benefit of coming with powerful built-in concurrency features, which is more than welcomed for the backend of a mobile app like ours.</p><p>On the other side, the data-science team mostly runs experiments in Python for its simplicity and the importance of its ML ecosystem and community, or Spark<em> </em>to<em> </em>leverage its distributed architecture when dealing with large amounts of data.</p><blockquote>Being able to iterate quickly on modeling is a hard-constraint for us as it is the core of what’s driving innovation here.</blockquote><p>Also, for a wide range of problems, classic machine learning algorithms such as <a href="https://en.wikipedia.org/wiki/Gradient_boosting"><strong>gradient tree boosting</strong></a> or <a href="https://en.wikipedia.org/wiki/Random_forest"><strong>random forest</strong></a> give state-of-the-art results. They have the advantage of being interpretable as well, which can sometimes be of a great help when debugging. Last but not least, once trained they are fully describable as if / else operations which make them easily portable.</p><p>As a result, we came out with the idea of exporting such Python/Scala-Spark trained models as a self-contained <em>Go</em> library, and developed a small Python package: <a href="https://github.com/znly/go-ml-transpiler"><strong><em>go-ml-transpiler</em></strong></a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XVOcfKuJEIFwRT7oHPJUqg.png" /></figure><p>Basically — with <em>go-ml-transpiler — </em>you can train your model in Python<em> </em>or<em> </em>in<em> </em>Spark<em> </em>as usual, then simply export it as <em>Go</em> code. For now it only supports <a href="https://xgboost.readthedocs.io/en/latest/"><strong>XGBoost</strong></a> (Python/Scala-Spark) and <a href="http://scikit-learn.org/"><strong>Scikit-Learn</strong></a> random forest (Python), both for classification and regression objectives.</p><p>Here’s an example of a <em>Scala-Spark </em>to<em> Go </em>pipeline:</p><ol><li>Train your XGBoost model in Spark</li></ol><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/e2812d8c95f620fee5c866a143a7da54/href">https://medium.com/media/e2812d8c95f620fee5c866a143a7da54/href</a></iframe><p>At this point your model is trained and can be loaded in Python.<br>Or you could also have trained your model directly in Python.</p><p>2. … and then just load it in Python and transpile it to <em>Go</em></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/29dded2334356cba6bb022a8726924f5/href">https://medium.com/media/29dded2334356cba6bb022a8726924f5/href</a></iframe><p>It outputs a production-ready machine learning prediction API which can be compiled in any <em>Go</em> project.</p><h4>Go + gRPC + Docker for a simple real-time serving</h4><p>As an illustration, we provide a very basic serving service using gRPC and Docker.</p><p>We use gRPC<em> </em>as a communication framework for three main reasons: it is easy, fast and strongly-typed. gRPC provides a simple API definition through Protobuf, which can be compiled in all major languages (see <a href="https://grpc.io/docs/">grpc.io/docs</a>).</p><p>A basic gRPC service would look like this:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/f307abc9dfcbb5764cbf47e4f8dddd9e/href">https://medium.com/media/f307abc9dfcbb5764cbf47e4f8dddd9e/href</a></iframe><p>Defining a client is also straightforward. Sending a request to the server in <em>Go </em>would look like this:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/3117d1f3c9b07d7d45c0f299c583d536/href">https://medium.com/media/3117d1f3c9b07d7d45c0f299c583d536/href</a></iframe><p>This server can also be requested through any of the supported languages in few lines of code. Here’s an example of a Python client:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/9e4c669952c70f282a144b6f87c0206e/href">https://medium.com/media/9e4c669952c70f282a144b6f87c0206e/href</a></iframe><p>where service_pb2.py and service_pb2_grpc.py are generated by the protocol buffer compiler and provide all the necessary classes and methods to set up a gRPC server/client and handle requests in Python.</p><p>Finally, the server application is containerized with Docker and is now ready to serve!</p><p>You can find the code right <a href="https://github.com/znly/go-ml-transpiler/tree/master/serving">here</a> 🤖</p><h4><strong><em>Benchmark</em></strong></h4><p>To assess the performance of this approach, we trained on the <a href="https://archive.ics.uci.edu/ml/datasets/Breast+Cancer+Wisconsin+(Diagnostic)">Breast Cancer Wisconsin</a> dataset an ensemble model composed of a Random Forest model and an XGBoost model (100 trees for both models), and evaluated:</p><ol><li>the transpiled model latency (binary classification)</li><li>the serving latency (ensemble model + Docker + gRPC)</li></ol><p>Our configuration was the following:</p><pre>Model: MacBook Pro (15-inch, 2017)<br>Processor: Intel(R) Core(TM) i7-7920HQ CPU @ 3.10GHz<br>Memory: 16 GB 2133 MHz LPDDR3</pre><p>Here are the results:</p><ul><li>~5us/op for the transpiled model (<strong>vs</strong> <em>~4ms/op in Python):</em> <br>→ this is a <strong>~800x </strong>boost in<strong> </strong>performance</li><li>~220us/op for the serving latency</li></ul><h4>Discussion</h4><p>By adopting a very simple pipeline we achieved a very competitive end-to-end latency for a machine learning serving service. This pipeline relies on a strongly-typed communication protocol, has auto-scaling capabilities using Docker, and can handle intensive training with Spark.</p><p>We are only in the beginning of empowering our real-time features with machine learning, yet it has unlocked a vast range of opportunities and will continue to boost creativity at Zenly.</p><p><em>To try Zenly out → </em><a href="https://zen.ly/app"><em>https://zen.ly/app</em></a><em> </em>✌️</p><p><em>Special thanks to </em><a href="https://medium.com/u/81b8053240af"><em>Nicolas FALLOURD</em></a><em>, </em><a href="https://medium.com/u/f97528b99b4f"><em>Julien Martin</em></a><em> for the cool illustrations, and to </em><a href="https://medium.com/u/280d29b36a3"><em>Xabier Jaureguiberry</em></a><em>, </em><a href="https://medium.com/u/fc940015fec5"><em>Pierre Leveau</em></a><em>, </em><a href="https://medium.com/u/c8c1a851b538"><em>Antoine Sinton</em></a><em> and </em><a href="https://medium.com/u/772a096f404a"><em>Alexis Bonillo</em></a><em> who helped in reviewing this post.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5fece526b2ac" width="1" height="1" alt=""><hr><p><a href="https://medium.com/zenlyapp/real-time-machine-learning-in-go-at-zenly-5fece526b2ac">Real-time machine learning in Go at Zenly</a> was originally published in <a href="https://medium.com/zenlyapp">zenly blog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>