project screenshot 1
project screenshot 2
project screenshot 3
project screenshot 4
project screenshot 5

Seabass (CBaaS)

A Circuit Breakers as a Service platform. It's a constructor for circuit breakers that triggers pre-set risk management functions based on specified asset price fluctuations within a defined time period.

Seabass (CBaaS)

Created At

ETHGlobal Paris

Project Description

Problem

Blockchain developers, particularly in DeFi, face significant risks from sudden asset price fluctuations. These can trigger a wave of liquidations, disrupt token sales, cause automated trading systems to misfire, and destabilize stablecoins. Recent examples include the USDC depegging event in March 2023, the FTX crash, and Terra Luna's drastic price drop in 2022. These events led to widespread market disruptions, financial losses, and operational chaos. Implementing a circuit breaker to manage these risks is complex and time-consuming.

How This Problem is Solved Now

Developers currently have the option to use services such as Chainlink's circuit breakers to handle the associated risks. However, deploying these solutions requires the creation of entirely new smart contracts that inherit from multiple contracts and follow a predetermined structure. This procedure not only increases the complexity of integration but also necessitates expensive audits.

Our Solution

The Seabass constructor is a robust feature that enables developers to create custom circuit breakers. These circuit breakers are tailored to specific asset price fluctuations and time periods, providing a powerful tool for managing financial risks in the volatile crypto market.

Developers can define parameters for the circuit breaker in the constructor. These parameters include the asset whose price is to be monitored, the percentage of price fluctuation that should trigger the circuit breaker, and the time period within which this fluctuation should occur.

For instance, a developer can set parameters such as "Trigger a specific function if the price of an asset deviates by 20% within 5 blocks."

Once these parameters are set, Seabass handles the rest. It continuously monitors the price of the specified asset. If the price of the asset deviates by the specified percentage within the specified time period, Seabass triggers the circuit breaker and calls the specified function.

Use Cases

Early Warning System: Seabass can serve as an early warning system, monitoring the price of a specified asset and triggering an alert if the price deviates significantly from its peg. This allows developers to take preemptive measures before the situation worsens.

Automated Risk Management: Seabass can be programmed to trigger certain risk management functions when the circuit breaker is activated. This could include pausing certain operations or adjusting collateral requirements.

Time-Sensitive Actions: During a depegging event or a market crash, Seabass can trigger functions to adjust collateral requirements or liquidation thresholds, helping to mitigate the risks associated with such events.

User Flow

  1. Developers initiate a circuit breaker on Seabass by specifying the asset to monitor, the price fluctuation threshold, and the risk management functions to trigger.
  2. Seabass then monitors the price feed of the specified asset.
  3. If the price fluctuates beyond the set threshold within the defined time period, Seabass triggers the pre-set risk management functions.

How it's Made

The project is a sophisticated implementation of a subscription-based circuit breaker system using Chainlink Keepers. The system aims to monitor specific Chainlink price feeds for fluctuations beyond a certain deviations, at which point it performs a predetermined action. The system uses the Factory design pattern and Chainlink Upkeeps for automated operation. It also incorporates a novel method of handling LINK token swaps from ERC-20 to ERC-677 to fund upkeep operations.

Here's an overview and technical description of the system:

  1. Factory and Circuit Breaker Contracts: The primary entry point to the system is a Factory contract. This Factory contract allows users to create personalized Circuit Breaker contracts by specifying the price feed to monitor, the oracle deviation limits, subscription period (for now it’s only one-time payment), external contract to interact with, and a function selector. The function selector specifies a function to call on the external contract when the circuit breaker is triggered. Users can thus customize the action that gets executed during a large price fluctuation.

  2. Subscription-Based Model: Users pay for their subscription when creating the Circuit Breaker. The subscription fee is used to fund the operation of the Chainlink Upkeeps, and a 10% fee is taken as profit for the system provider.

  3. LINK Token Swap: As Chainlink Upkeeps require funding in ERC-677 LINK tokens, the system includes functionality to swap ERC-20 LINK tokens to ERC-677. This step is necessary as users will typically pay their subscription fees in the more widely used ERC-20 LINK tokens.

  4. Chainlink Upkeeps: Each Circuit Breaker contract registers a Chainlink Upkeep upon creation. These Upkeeps are automated tasks that continually check if the price feed fluctuation exceeds the user-specified threshold. If the fluctuation threshold is exceeded, the Upkeep calls the performUpkeep function on the Circuit Breaker contract, triggering the user-specified action on the external contract.

  5. Security: The system includes safeguards to ensure that only authorized entities can interact with the circuit breakers. For example, the performUpkeep function can only be called by the Chainlink KeeperRegistry contract, ensuring that the circuit breaker actions can only be triggered by the automated Chainlink Keepers and not by arbitrary external actors.

This system offers a flexible and automated solution for users who want to take precautionary actions based on specific price feed fluctuations. Its subscription-based model makes it accessible for various users, and the use of Chainlink Upkeeps ensures reliable and continual operation.

background image mobile

Join the mailing list

Get the latest news and updates