keeperhub-plugins-spark

Production-grade v1.0.0 elite guide to Spark on KeeperHub.

nickthelegend/keeperhub-skills2 installsMITSynced Aug 26

Works with

Claude CodeCursorCodex CLIGitHub CopilotGemini CLI
---
name: keeperhub-plugins-spark
description: Production-grade v1.0.0 elite guide to Spark on KeeperHub.
license: MIT
---

# Spark

## Overview
Documentation for Spark integration and usage within the KeeperHub ecosystem.

[Plugins](https://docs.keeperhub.com/plugins)

Spark is a decentralized lending protocol built as an Aave V3 fork within the Sky/Maker ecosystem. Users can supply assets to earn interest, borrow against collateral, and deposit DAI into the sDAI savings vault to earn the DAI Savings Rate (DSR). SparkLend uses the same Pool interface as Aave V3 for core lending operations.
Supported chains: Ethereum (all contracts) and Gnosis Chain (lending contracts only, no sDAI). Read-only actions work without credentials. Write actions require a connected wallet.

## Supply Asset
Supply an asset to the SparkLend lending pool to earn interest. The supplied asset automatically starts accruing interest. Requires prior ERC-20 approval for the Pool contract.
Inputs:
Outputs: success, transactionHash, transactionLink, error

`success`

`transactionHash`

`transactionLink`

`error`

When to use: Earn yield on idle tokens, automate deposits when conditions are met, build supply strategies based on rate changes.

## Withdraw Asset
Withdraw a supplied asset from the SparkLend lending pool. Ensure the withdrawal does not bring the health factor below 1 if the asset is used as collateral.
Inputs:
Outputs: success, transactionHash, transactionLink, error

`success`

`transactionHash`

`transactionLink`

`error`

When to use: Withdraw funds when needed, automate withdrawals based on rate drops, rebalance collateral positions.

## Borrow Asset
Borrow an asset from SparkLend against supplied collateral. Variable rate (mode 2) is the standard borrowing mode.
Inputs:
Outputs: success, transactionHash, transactionLink, error

`success`

`transactionHash`

`transactionLink`

`error`

When to use: Borrow stablecoins against volatile assets, leverage positions, automate borrowing based on market conditions.

## Repay Debt
Repay a borrowed asset to the SparkLend lending pool. Use type(uint256).max as amount to repay the entire debt.

`type(uint256).max`

Inputs:
Outputs: success, transactionHash, transactionLink, error

`success`

`transactionHash`

`transactionLink`

`error`

When to use: Automate debt repayment when health factor drops, repay before liquidation, scheduled debt reduction.

## Set Asset as Collateral
Enable or disable a supplied asset as collateral in SparkLend. This toggles the entire supplied balance of the asset — there is no partial collateral in Aave V3/Spark.
Inputs:
Outputs: success, transactionHash, transactionLink, error

`success`

`transactionHash`

`transactionLink`

`error`

When to use: Enable collateral on a newly supplied asset before borrowing, disable collateral to protect an asset from liquidation, automate collateral management based on market conditions.

## Deposit DAI to sDAI
Deposit DAI into the sDAI savings vault (ERC-4626) to earn the DAI Savings Rate. Requires prior DAI approval for the sDAI contract. The DSR yield accrues automatically via the exchange rate between sDAI and DAI.
Inputs:
Outputs: success, transactionHash, transactionLink, error

`success`

`transactionHash`

`transactionLink`

`error`

When to use: Park idle DAI in the DSR for risk-free yield, automate DAI savings deposits, build yield farming pipelines.

## Redeem sDAI for DAI
Redeem sDAI shares for DAI from the savings vault. The DAI received includes accrued DSR yield based on the current exchange rate.
Inputs:
Outputs: success, transactionHash, transactionLink, error

`success`

`transactionHash`

`transactionLink`

`error`

When to use: Exit the DSR to redeploy capital, automate redemptions based on rate changes, withdraw savings for operational use.

## Get User Account Data
Get overall account health including total collateral, total debt, available borrow power, and health factor. Base currency values are denominated in USD with 8 decimal precision.
Inputs:
Outputs:
When to use: Monitor account health factor for liquidation protection, check borrow capacity before opening new positions, track portfolio-level collateral and debt.

## Get User Reserve Data
Get per-asset position data including supplied balance (spToken), stable and variable debt, borrow rates, and whether the asset is used as collateral. Uses the Pool Data Provider contract.
Inputs:
Outputs:
When to use: Check per-asset balances and debt, monitor supply APY for rate-based strategies, verify collateral status before borrowing.

## Get sDAI Balance
Check the sDAI balance of an address. The sDAI balance represents shares in the savings vault. Use “Convert sDAI to DAI Value” to see the underlying DAI value.
Inputs:
Outputs:
When to use: Check savings position size, monitor sDAI holdings across wallets, trigger actions based on balance thresholds.

## Get sDAI Total Assets
Get the total DAI held in the sDAI vault, representing the total value locked earning the DSR.
Inputs: None
Outputs:
When to use: Monitor total DSR TVL, track protocol-level savings growth, compare against other yield sources.

## Convert sDAI to DAI Value
Preview how much DAI a given amount of sDAI is worth at the current exchange rate. The rate increases over time as DSR yield accrues.
Inputs:
Outputs:
When to use: Check the current value of sDAI holdings in DAI terms, calculate realized yield, price sDAI for swaps or portfolio tracking.

### Health Factor Monitor with Discord Alert
Schedule (every 5 min) -> Spark: Get User Account Data -> Code (healthFactor / 1e18) -> Condition (< 1.5) -> Discord: Send Message

`Schedule (every 5 min) -> Spark: Get User Account Data -> Code (healthFactor / 1e18) -> Condition (< 1.5) -> Discord: Send Message`

Monitor your SparkLend health factor and send a Discord alert when it drops below 1.5, giving you time to act before liquidation.

### Repay on Low Health Factor
Schedule (every 5 min) -> Spark: Get User Account Data -> Code (healthFactor / 1e18) -> Condition (< 1.2) -> Spark: Repay Debt

`Schedule (every 5 min) -> Spark: Get User Account Data -> Code (healthFactor / 1e18) -> Condition (< 1.2) -> Spark: Repay Debt`

Automatically repay debt when health factor approaches the liquidation threshold. Requires wallet connection and token approval.

### I Savings Monitor
Schedule (daily) -> Spark: Get sDAI Balance -> Spark: Convert sDAI to DAI Value -> Code (compute yield) -> SendGrid: Send Email

`Schedule (daily) -> Spark: Get sDAI Balance -> Spark: Convert sDAI to DAI Value -> Code (compute yield) -> SendGrid: Send Email`

Track your sDAI position value daily and receive an email summary showing balance, current DAI value, and accrued yield.

### I TVL Tracker with Webhook
Schedule (hourly) -> Spark: Get sDAI Total Assets -> Code (format TVL) -> Webhook: Send HTTP Request

`Schedule (hourly) -> Spark: Get sDAI Total Assets -> Code (format TVL) -> Webhook: Send HTTP Request`

Monitor the total DAI locked in the sDAI vault and send hourly updates to an external dashboard or analytics service.

SparkLend uses the same Aave V3 Pool interface for supply, withdraw, borrow, and repay. The sDAI contract is an ERC-4626 vault wrapping DAI in the DAI Savings Rate and is available on Ethereum only (Gnosis uses sxDAI instead).
[Sky](https://docs.keeperhub.com/plugins/sky)
[Uniswap](https://docs.keeperhub.com/plugins/uniswap)

More Data Engineering skills

← All Data Engineering skills

Check your AI visibility

One URL in, a 0–100 score and the exact fixes out.

RUN THE CHECK

Browse all the tools

15 tools across six categories
13 of them never send your data anywhere

Free · No signup · No trial clock

SEE THE DIRECTORY