Skip to content

[New Agent Template]: Radiant Strategy Pack (Looping Lender, HF Shield, Auto-Compounder)Β #334

@Lexiie

Description

@Lexiie

🏷️ Agent Name

Radiant Strategy Pack

πŸ“ Agent Description

The Radiant Strategy Pack is a community-contributed collection of 3 DeFi agent templates designed for the Vibekit ecosystem. These agents automate multiple Radiant lending strategies on Arbitrum and leverage the Radiant Lending Plugin requested in Issue #310.

This agent pack provides automated looping, health factor protection, and auto-compounding of RDNT rewards. It exposes a clean strategy interface and allows end-users to run each strategy through a CLI without writing code.

Included strategies:

  1. Radiant Leveraged Looping Lender

    • Automates supply/borrow loops
    • HF-aware and borrow-cap aware
    • Safe stopping and guardrails
  2. Radiant Health Factor Shield

    • Monitors HF
    • Performs soft deleverage
    • Triggers hard emergency exit when needed
  3. Radiant Rewards Auto-Compounder

    • Claims RDNT
    • Swaps to target asset
    • Supplies back into Radiant

Key features:

  • Built on top of the Radiant Lending Plugin
  • Abstraction layer (RadiantClient) for clean interactions
  • CLI runner for non-developers
  • Full unit tests with mocks
  • Safe execution guardrails
  • Located in: typescript/community/agents/radiant-strategy-pack/

Implements and extends:
#310

πŸ”Œ Required Protocols

Primary protocols:

  • Radiant V2 Lending Protocol on Arbitrum One
  • Radiant Lending Onchain-Actions Plugin (markets, positions, actions)

Optional protocols:

  • None. All data is fetched on-chain via viem and Radiant contracts without external API dependencies.

πŸ€– Automation Level

Manual - User triggers each action

πŸ—οΈ Code Architecture

Skills & Tools structure:

  • Primary skills:
    • Fetch Radiant market data (APR, liquidity, prices)
    • Query user lending positions (collateral, debt, health factor)
    • Build lending transactions (supply, withdraw, borrow, repay, setCollateral)
  • Internal tools:
    • RadiantClient abstraction used by the strategies
    • Radiant onchain-actions plugin: markets, positions, actions
    • CLI wrapper for running strategies without writing code
  • MCP tools:
    • Not used in this agent. All tools are internal TypeScript modules.

Agent components:

  • Context providers:
    • Wallet / signer configuration for sending transactions (outside this package – tx builders only return calldata)
    • RPC provider via viem for on-chain reads
  • Hooks:
    • Logging hooks inside the strategies (loop iterations, HF checks, compound decisions)
    • Validation hooks for HF thresholds, borrow capacity, min compound threshold, and max loop limits
  • Configuration & environment:
    • Per-strategy config (asset, HF thresholds, loop count, minRewards, etc.)
    • Radiant network config via radiant.config.ts (addresses, decimals, chainId)
    • viem client configuration for RPC URL

Integration patterns:

  • All protocol interactions go through the Radiant onchain-actions plugin:
    • markets.ts for market data
    • positions.ts for user positions (HF, collateral, debt)
    • actions.ts for building supply/withdraw/borrow/repay/setCollateral txs
  • Strategies never call contracts directly; they call RadiantClient, which wraps the plugin.
  • Transaction builders return { to, data, value } only; the caller is responsible for signing & broadcasting transactions.
  • Error handling and safety:
    • Looping strategy stops on low HF or when max loop count is reached.
    • Health Factor Shield strategy has soft, hard, and full-exit modes based on HF bands.
    • Auto-compounder skips if rewards are below a minimum threshold and uses a simplified 1:1 mock swap model for RDNT β†’ target asset in the current version.

πŸ§ͺ Testing Requirements

Unit tests:

  • Radiant plugin:
    • markets.test.ts validates market data fetching.
    • positions.test.ts validates user position and health factor queries.
    • actions.test.ts validates tx builders for supply/withdraw/borrow/repay/setCollateral.
  • Strategy pack:
    • radiantLooping.test.ts covers looping lender behaviour (HF stop, maxLoops, borrow/supply ordering).
    • healthShield.test.ts covers HF shield soft/hard deleverage and emergency exit.
    • compounder.test.ts covers reward threshold and compound path.
    • cli.test.ts covers CLI argument parsing and correct strategy dispatch, all using a mocked RadiantClient.

Integration tests:

  • Local integration using mocked or forked RPC can be used to validate that:
    • Radiant plugin reads markets and positions correctly on Arbitrum.
    • Strategy pack composes plugin calls in the expected order.
  • These are optional for merge but supported by the architecture.

Live testing:

  • Designed to be run against Arbitrum mainnet or a mainnet fork:
    • User provides RPC URL and wallet with collateral.
    • CLI can be pointed to live Radiant markets.
  • Live testing is not required for inclusion as a community agent template, due to collateral and risk constraints, but the flows are compatible with live deployment.

πŸ“Ž Additional Information

Repository folder:
typescript/community/agents/radiant-strategy-pack/

This submission includes:

  • Complete strategy pack
  • Full strategy documentation
  • CLI runner for easy user execution
  • Unit test suite with mocks
  • RadiantClient abstraction layer
  • High-safety guardrails for DeFi automation

Implements the requirements from:
Issue #310 – Integrate Radiant Lending Protocol (Arbitrum)

βœ… Pre-submission Checklist

  • I have searched existing issues and templates to avoid duplicates
  • I have clearly described the agent's purpose and functionality
  • I have identified the required protocols and integrations
  • I understand this agent will be created in the typescript/community/ directory
  • I will wait for the Vibekit team to approve this issue before continuing to implementation

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions