All blogposts
Leverage Token Guide for Programmatic Issuance and Redemption
Leverage Token Guide for Programmatic Issuance and Redemption
Get all the contracts and calls you need for accessing FLIs programmatically.
3/15/2024
Index Coop

Content
The legacy FLI tokens have been migrated to the new ETH2x and BTC2x tokens. Under the hood of the FLIs, traditional cToken positions have been exchanged for the new 2x tokens built on Index Protocol. As a result, programmatic redemption of FLIs has changed slightly, and a secondary redemption transaction is required to unwind the nested 2x tokens. This resource outlines the relevant contracts and calls you may need for accessing FLIs programmatically.
Are you a liquidity provider for FLIs? If so, contact us in Discord about potential gas refunds for migrating your liquidity to the new 2x tokens
____________________________________________________________
Redeeming FLI Tokens via Set Debt Issuance Module V2
For context, the legacy FLI tokens have historically used the Set Debt Issuance Module (eth:0x39F024d621367C044BacE2bf0Fb15Fb3612eCB92) for issuance and redemption transactions. However, as a result of the migration, the Set Debt Issuance Module V2 (eth:0x69a592D2129415a4A1d1b1E309C17051B7F28d57) must now be used to redeem or issue FLI tokens. The relevant calls are identical on the V1 and V2 modules.
Token Approvals: you may need to approve FLI tokens for spending on the DIMv2
redeem 100 ETH2x-FLI tokens
_setToken (address):
_quantity (uint256): 100000000000000000000
_to (address): [
insert address that collateral should be sent to
]
redeem 50 BTC2x-FLI tokens
_setToken (address):
_quantity (uint256): 50000000000000000000
_to (address): [
insert address that collateral should be sent to
]
Here are some onchain examples where 674 ETH2x-FLI and 814 BTC2x-FLI were redeemed.
Once you redeem a FLI token, you will receive a new 2x token as the output; this is attributed to the migration, which replaced the previous cToken components with the new 2x tokens. The new 2x tokens have been deployed with an initial price of $100, so the exchange rate between ETH2x-FLI/ETH2x is currently 0.324 and the exchange rate between BTC2x-FLI/BTC2x is 0.257; you can find current exchange rates and broader leverage token data in this Dune dashboard. To completely close the leverage position at this point, you will need to execute another redemption for the new 2x tokens (info below).
____________________________________________________________
Redeeming New 2x Tokens via Index Debt Issuance Module V2_1
To redeem or issue the new 2x tokens, you must use the Index Protocol Debt Issuance Module 2_1 (eth:0x04b59F9F09750C044D7CfbC177561E409085f0f3). This is the most modern version of the Debt Issuance Module deployed for Index Protocol. issue and redeem calls are identical to earlier versions of the module on Set Protocol.
Token Approvals: you may need to approve 2x tokens for spending on the module
redeem ETH2x (example: 100 tokens)
_setToken (address):
_quantity (uint256): 100000000000000000000
_to (address): [
insert address that collateral should be sent to
]
redeem BTC2x (example: 50 tokens)
_setToken (address):
_quantity (uint256): 50000000000000000000
_to (address): [
insert address that collateral should be sent to
]
Because these 2x tokens have open debt positions in Aave V3, the module will transfer in the required debt amounts from the caller and use those funds to repay the debt on behalf of the SetToken. All debt is paid down first, then equity positions are returned to the specified address. There is a 0.10% redemption fee on the new 2x tokens.
____________________________________________________________
Issuing New 2x Tokens via Index Debt Issuance Module V2_1
Token Approvals: you may need to approve aToken components for spending on the DIMv2_1
issue ETH2x (example: 100 tokens)
_setToken (address):
_quantity (uint256): 100000000000000000000
_to (address): [
insert address that ETH2x should be sent to
]
issue BTC2x (example: 50 tokens)
_setToken (address):
_quantity (uint256): 50000000000000000000
_to (address): [
insert address that BTC2x should be sent to
]
Because the new 2x tokens include open debt positions, all collateral will be transferred in first then debt will be returned to the minting address. There is also a 0.10% issuance fee on the new 2x tokens.
____________________________________________________________
Redemptions are also supported via the Index Coop App, with a separate guide for “Unwrapping FLIs” available here. The Flash Mint SDK is also available for minting and redeeming the new 2x tokens using ETH or ERC20s, abstracting away the complexity of the debt positions.
Are you a liquidity provider for FLIs? If so, contact us in Discord about potential gas refunds for migrating your liquidity to the new 2x tokens
Dive deeper
Watch, read, and learn everything you need to master our leverage tokens.
Subscribe to our newsletter
Join over 6,000 subscribers in receiving weekly updates about our products, DeFi, and the onchain structured products space.
FAQs
Index Coop yield tokens simplify earning yield in DeFi by automating complex strategies and diversifying across protocols. They are user-friendly and cost-efficient, appealing to both new and seasoned DeFi users.
Leverage tokens automate a leveraged position by utilizing onchain money markets like Aave or Morpho to borrow funds, amplifying a user's exposure to an asset without requiring manual management. The token's smart contracts autonomously handle the borrowing, lending, and rebalancing of assets, maintaining a consistent leverage ratio despite market fluctuations. This automation eliminates the complexities of collateral management and liquidation risks, while also charging low, transparent fees that avoid expensive funding rates often charged by perps.
Index Coop is a decentralized autonomous organization (DAO) that specializes in creating and maintaining onchain structured products. Index Coop aims to democratize access to the crypto market, empowering everyone to participate in the growing digital asset ecosystem with ease.
No, yield automatically compounds and accrues to the token price. The value of the tokens you hold in your wallet will simply go up over time without the need to claim or compound rewards.
Index Coop products protect you from liquidation with automated risk management that rebalances assets to maintain a target leverage ratio that avoids liquidation.
INDEX is the ERC-20 governance token on Ethereum for Index Coop. INDEX empowers its holders to participate in decision-making processes that shape the future of Index Coop.
Yes, all Index Coop products are instantly redeemable for their underlying value at all times.
Yes, all Index Coop smart contracts have been audited by leading independent security firms such as OpenZeppelin, ABDK, Isosiro, & more. There is also an active bug bounty program through ImmuneFi. Audit information is published in the docs here.
Streaming fees (an annual fee paid continuously block-by-block), mint and redeem fees (only on leverage tokens), and borrow costs (interest paid to borrow funds from onchain markets when using leverage).