# Ripcord Guide

All [Index Coop Leverage Tokens](https://docs.indexcoop.com/index-coop-community-handbook/products/trade/index-coop-leverage-suite) have an emergency de-lever function that can be triggered by anyone (i.e. publicly callable). This function - Ripcord - can be called when a token's leverage ratio surpasses a pre-defined limit and approaches the liquidation threshold; more information on [Ripcord parameters](https://docs.indexcoop.com/index-coop-community-handbook/products/leverage/fli-technical-documentation/fli-product-parameters#ripcord-parameters) is available here. Ripcord provides additional safety and redundancy to the [Leverage Keeper System](https://docs.indexcoop.com/index-coop-community-handbook/products/trade/fli-keeper-bot-integration) operated by Index Coop today.

An ETH reward is also paid out to Ripcord callers for protecting tokens from liquidation. The amount of the reward varies based on where a leverage token is deployed; see the table below:

<table><thead><tr><th width="170">Network</th><th width="397">Leverage Tokens</th><th>Ripcord Reward</th></tr></thead><tbody><tr><td><a href="https://docs.indexcoop.com/index-coop-community-handbook/products/leverage/index-coop-leverage-suite#technical-implementation-ethereum">Ethereum</a></td><td>ETH2x, BTC2x</td><td>1 ETH</td></tr><tr><td><a href="https://docs.indexcoop.com/index-coop-community-handbook/products/leverage/index-coop-leverage-suite#technical-implementation-arbitrum">Arbitrum</a></td><td>ETH3x, ETH2x, iETH1x, BTC3x, BTC2x, iBTC1x</td><td>0.25 ETH</td></tr><tr><td><a href="https://docs.indexcoop.com/index-coop-community-handbook/products/leverage/index-coop-leverage-suite#technical-implementation-base">Base</a></td><td>ETH3x, ETH2x</td><td>0.25 ETH</td></tr></tbody></table>

A step-by-step guide for calling Ripcord using Arbiscan is provided below.

***

### Step 1: Identify the Correct Contract

Each leverage token has a dedicated `Leverage Strategy Extension` contract that enables rebalancing; the Ripcord function per leverage token can be found in this contract. Using the table below, identify the `Leverage Strategy Extension` contract associated with the token that you want to call Ripcord for:

<table><thead><tr><th width="141">Network</th><th width="156">Leverage Token</th><th>Leverage Strategy Extension</th></tr></thead><tbody><tr><td><a href="https://docs.indexcoop.com/index-coop-community-handbook/products/leverage/index-coop-leverage-suite#technical-implementation-ethereum">Ethereum</a></td><td>ETH2x</td><td><a href="https://etherscan.io/address/0x500f8a8b67153966dfdf770bc41ccfbe5dd5f0e7#code">0x500f8A8b67153966dFdF770BC41ccFBe5dd5F0e7</a></td></tr><tr><td><a href="https://docs.indexcoop.com/index-coop-community-handbook/products/leverage/index-coop-leverage-suite#technical-implementation-ethereum">Ethereum</a></td><td>BTC2x</td><td><a href="https://etherscan.io/address/0xd9b86cadbdf1fd260b9d4e70f5f4067729cdcd77#code">0xD9b86CaDbDf1Fd260b9D4e70f5f4067729cDcd77</a></td></tr><tr><td><a href="https://docs.indexcoop.com/index-coop-community-handbook/products/leverage/index-coop-leverage-suite#technical-implementation-arbitrum">Arbitrum</a></td><td>ETH3x</td><td><a href="https://arbiscan.io/address/0x165edf07bb61904f47800e13f5120e64c4b9a186#code">0x165EDF07Bb61904f47800e13F5120E64C4B9A186</a></td></tr><tr><td><a href="https://docs.indexcoop.com/index-coop-community-handbook/products/leverage/index-coop-leverage-suite#technical-implementation-arbitrum">Arbitrum</a></td><td>ETH2x</td><td><a href="https://arbiscan.io/address/0xb5ef3fe96e4cf0bb8529c9a761e2cb6f2f440cb3#code">0xb5Ef3FE96e4cf0BB8529c9a761e2Cb6F2f440cb3</a></td></tr><tr><td><a href="https://docs.indexcoop.com/index-coop-community-handbook/products/leverage/index-coop-leverage-suite#technical-implementation-arbitrum">Arbitrum</a></td><td>iETH1x</td><td><a href="https://arbiscan.io/address/0xcb3ebcdd25eca9f0755b13b3dc87a7252ef4eb47">0xcB3eBCdd25EcA9F0755b13b3DC87a7252ef4eB47</a></td></tr><tr><td><a href="https://docs.indexcoop.com/index-coop-community-handbook/products/leverage/index-coop-leverage-suite#technical-implementation-arbitrum">Arbitrum</a></td><td>BTC3x</td><td><a href="https://arbiscan.io/address/0x3e262dc5b9aa18d6a8236c11caa979f89473dc39#code">0x3e262dC5B9aa18D6A8236C11CAa979f89473dC39</a></td></tr><tr><td><a href="https://docs.indexcoop.com/index-coop-community-handbook/products/leverage/index-coop-leverage-suite#technical-implementation-arbitrum">Arbitrum</a></td><td>BTC2x</td><td><a href="https://arbiscan.io/address/0x04d58e7051e7f0ea4b01bb648d61f4a641b2c08b">0x04D58e7051E7f0EA4b01BB648D61f4A641b2c08B</a></td></tr><tr><td><a href="https://docs.indexcoop.com/index-coop-community-handbook/products/leverage/index-coop-leverage-suite#technical-implementation-arbitrum">Arbitrum</a></td><td>iBTC1x</td><td><a href="https://arbiscan.io/address/0xb1aad804e4da225237b88aa62dfddc719715dc44">0xb1aaD804E4Da225237b88AA62dFDDc719715Dc44</a></td></tr><tr><td><a href="https://docs.indexcoop.com/index-coop-community-handbook/products/leverage/index-coop-leverage-suite#technical-implementation-base">Base</a></td><td>ETH3x</td><td><a href="https://basescan.org/address/0x1cf7c6c4c8997fc047effa0d5b119f174f08b08b#code">0x1cf7c6C4c8997fc047effA0D5B119F174f08B08b</a></td></tr><tr><td><a href="https://docs.indexcoop.com/index-coop-community-handbook/products/leverage/index-coop-leverage-suite#technical-implementation-base">Base</a></td><td>ETH2x</td><td><a href="https://basescan.org/address/0xafbd1f46aa2db385bb09e40e40c857bd2e755f92">0xAFBd1f46Aa2db385bB09E40e40c857BD2e755F92</a></td></tr></tbody></table>

Next, you will engage with the read and write functions on the selected contract.

***

### Step 2: Check if Token Should Rebalance

After selecting the appropriate contract, navigate to the *Contract > Read Contract* tab. Select the `shouldRebalance` function and click *Query*. In the extremely unlikely event that Ripcord can be called as a result of an exceptionally high leverage ratio, this function will return:

* a string value for the DEX used for rebalancing; ex. "`UniswapV3ExchangeAdapterV2`"
* a uint8 value of "`3`" which indicates Ripcord can be called

As an example, we will use the [ETH3x Leverage Strategy Extension](https://arbiscan.io/address/0x165edf07bb61904f47800e13f5120e64c4b9a186#code) contract. See the screenshot below for a *simulated* scenario where Ripcord would be callable.

<figure><img src="https://2404196717-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MJY-enmfAw5ra2s-8QX%2Fuploads%2FHUFOU1B2PJXguTYbAgCA%2FScreenshot%202024-11-15%20at%205.17.22%E2%80%AFPM.png?alt=media&#x26;token=a2613a26-06c8-40e8-9bc6-3d3b74998e48" alt=""><figcaption></figcaption></figure>

<figure><img src="https://2404196717-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MJY-enmfAw5ra2s-8QX%2Fuploads%2FvqOprBGTAPR781Ug4G2p%2FETH3x%20shouldRebalance.png?alt=media&#x26;token=bec7cb1a-3c15-4879-875f-be0eb506cbde" alt=""><figcaption><p><code>shouldRebalance</code> function</p></figcaption></figure>

If the returned uint8 value is `3`, then Ripcord can be called. In this case, copy the string value for the enabled exchange - ex.`UniswapV3ExchangeAdapterV2` - you will need it for Step 3.

If the uint8 value is `0`, `1`, or `2`, the Ripcord function cannot be called and subsequent steps will fail.

***

### Step 3: Call Ripcord

If Ripcord is callable, navigate to the *Write Contract* tab on the same Leverage Strategy Extension contract. If you haven't already, connect a wallet - specifically an EOA - so that you may write to the contract.

Expand the `ripcord` function and paste the string value of the enabled exchange from Step 2, which is `UniswapV3ExchangeAdapterV2` in this example. After verifying the transaction details, click *Write* and sign the transaction in the connected wallet.

<figure><img src="https://2404196717-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MJY-enmfAw5ra2s-8QX%2Fuploads%2Fw8QI2pQFHFYjfs5f3L5h%2FScreenshot%202024-11-15%20at%204.54.47%E2%80%AFPM.png?alt=media&#x26;token=0cae0675-56cf-4e9a-8926-8f78d40250dc" alt=""><figcaption></figcaption></figure>

Assuming the token's leverage ratio remains above the emergency threshold during the same block, the Ripcord transaction should execute successfully. The token will be rebalanced according to preset Ripcord parameters and the ETH reward will be paid out to the caller's address.

***

Questions?

Drop into the [**Index Coop Discord Server**](https://discord.com/invite/indexcoop) - this is the fastest way to have a real person answer any questions you have!
