<?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>Liquidate: Absorb on</title><link>https://rajkoz.com/posts/fluid-vault-smart-contracts-deep-dive/4-vault-protocol/8-liquidation/3-absorb/</link><description>Recent content in Liquidate: Absorb 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/4-vault-protocol/8-liquidation/3-absorb/index.xml" rel="self" type="application/rss+xml"/><item><title>Absorb implementation</title><link>https://rajkoz.com/posts/fluid-vault-smart-contracts-deep-dive/4-vault-protocol/8-liquidation/3-absorb/absorb-implementation/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://rajkoz.com/posts/fluid-vault-smart-contracts-deep-dive/4-vault-protocol/8-liquidation/3-absorb/absorb-implementation/</guid><description>&lt;p&gt;This is the function we are analyzing:&lt;/p&gt;
&lt;figure&gt;
&lt;img loading="lazy" src="https://rajkoz.com/fluid-vault/vault/absorb.png"
alt="Vault protocol" width="100%"/&gt;
&lt;/figure&gt;
&lt;p&gt;The primary purpose of this function is to liquidate all active ticks and branches above &lt;code&gt;maxTick&lt;/code&gt; and set a new state from where regular liquidation can continue later. 3 main parts are labeled on the image:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Liquidation of ticks above max ratio&lt;/li&gt;
&lt;li&gt;Liquidation of branches above max ratio&lt;/li&gt;
&lt;li&gt;Updating state with new &lt;code&gt;topTick&lt;/code&gt; and &lt;code&gt;vaultVariables&lt;/code&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id="1-liquidation-of-ticks-above-max-ratio"&gt;1. Liquidation of ticks above max ratio&lt;/h2&gt;
&lt;p&gt;This part is straightforward, although bitmap manipulation is a bit tricky. All it does is iterate over active ticks above &lt;code&gt;maxTick&lt;/code&gt; and absorb debt and collateral.&lt;/p&gt;</description></item></channel></rss>