<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>Operate: Calculate exchange prices on</title><link>https://rajkoz.com/posts/fluid-vault-smart-contracts-deep-dive/3-liquidity-layer/6-calculate-exchange-prices/</link><description>Recent content in Operate: Calculate exchange prices on</description><generator>Hugo -- 0.152.2</generator><language>en-us</language><atom:link href="https://rajkoz.com/posts/fluid-vault-smart-contracts-deep-dive/3-liquidity-layer/6-calculate-exchange-prices/index.xml" rel="self" type="application/rss+xml"/><item><title>LiquidityCalcs: calcExchangePrices</title><link>https://rajkoz.com/posts/fluid-vault-smart-contracts-deep-dive/3-liquidity-layer/6-calculate-exchange-prices/liquiditycalcs-calc-exchange-prices/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://rajkoz.com/posts/fluid-vault-smart-contracts-deep-dive/3-liquidity-layer/6-calculate-exchange-prices/liquiditycalcs-calc-exchange-prices/</guid><description>&lt;p&gt;This is the function we will be analyzing:&lt;/p&gt;
&lt;figure&gt;
&lt;img loading="lazy" src="https://rajkoz.com/fluid-vault/liquidity-layer/calc-exchange-prices.png"
alt="Liquidity layer" width="100%"/&gt;
&lt;/figure&gt;
&lt;p&gt;This function is part of the &lt;code&gt;LiquidityCalcs&lt;/code&gt; library, which can be found in the libraries folder:&lt;/p&gt;
&lt;figure&gt;
&lt;img loading="lazy" src="https://rajkoz.com/fluid-vault/liquidity-layer/lib.png"
alt="Liquidity layer" width="40%"/&gt;
&lt;/figure&gt;
&lt;p&gt;Every DeFi lending protocol has to track interest paid by borrowers and yield gained by suppliers. Usually, these are handled by separate indexes which are multiplied by principal, and that is what this function does with exchange prices.&lt;/p&gt;
&lt;p&gt;But besides that, Fluid introduces one important add-on, which is logic for explicitly tracking who pays interest and who does not.&lt;/p&gt;</description></item></channel></rss>