Ripcord Guide

a step-by-step guide for calling the Ripcord function

All Index Coop Leverage Tokens 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 is available here. Ripcord provides additional safety and redundancy to the Leverage Keeper System 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:

Network
Leverage Tokens
Ripcord Reward

ETH2x, BTC2x

1 ETH

ETH3x, ETH2x, iETH1x, BTC3x, BTC2x, iBTC1x

0.25 ETH

ETH3x, ETH2x

0.25 ETH

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:

Network
Leverage Token
Leverage Strategy Extension

ETH2x

BTC2x

ETH3x

ETH2x

iETH1x

BTC3x

BTC2x

iBTC1x

ETH3x

ETH2x

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 contract. See the screenshot below for a simulated scenario where Ripcord would be callable.

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.

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 - this is the fastest way to have a real person answer any questions you have!

Last updated