Skip to content

Feature: Add interest rate model configuration endpoint #87

@Smartdevs17

Description

@Smartdevs17

Problem

Interest rate parameters in interest_rate.rs are initialized once but there's no way to query the current model parameters or adjust them without redeployment.

Context

DeFi protocols need to adjust interest rates based on market conditions. Governance should be able to update rate parameters.

Proposed Solution

Add query and update functions:

pub fn get_interest_rate_config(env: Env) -> InterestRateConfig { ... }
pub fn update_interest_rate_config(env: Env, admin: Address, config: InterestRateConfig) -> Result<(), Error> { ... }

Acceptance Criteria

  • Query function returns current interest rate parameters
  • Admin can update parameters (with authorization)
  • Parameter validation (rates within bounds)
  • Events emitted on parameter changes
  • Tests for query and update

Technical Notes

  • File: stellar-lend/contracts/hello-world/src/interest_rate.rs

Constraints

  • Admin-only updates with governance controls

Metadata

Metadata

Assignees

No one assigned

    Labels

    Stellar WaveIssues in the Stellar wave programenhancementNew feature or requestmediumDifficulty: Mediumsmart-contractsSoroban smart contracts

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions