Liquidation Module

Entangle has created a Liquidation Module to foster the easy integration of Liquid Vaults. Protocols may liquidate Liquid Vaults to USDC through a simple interface, requiring only one transaction.

To use the Liquidation Mechanism developers must integrate the function sellForLPAndWithdraw. This function takes four parameters: sid, synthAmount, chainID, and recipient.

function sellForLPAndWithdraw( uint128 sid, uint256 synthAmount, uint64 chainID, address recipient )

The function checks that sid belongs to lpStackingSynth and burns the specified amount of synth tokens from the sender's address. It then calculates the amount of LP tokens that the user will receive for the synthAmount.

The function withdraws LP from the farm and liquidity pool using MasterSynthChef smart contract, converts it to Op-token (USDC), and sends it to the recipient's address.

Last updated