Skip to content

Conversation

@anuragmath
Copy link
Contributor

Summary

This PR refactors the SmartCredit adapter to rely solely on on-chain event data instead of GraphQL. It correctly calculates TVL, borrowed, and staking values based on factory events and fixed income fund details.

Key Changes

  • Uses factory events (FixedIncomeFundCreationComplete, LoanContractCreated) to find all pools and loans.

  • Calculates TVL as:

      Deposited underlying tokens in fixed income funds.
    
      Collateral tokens locked in loan contracts.
    
  • Calculates borrowed value from invested amounts in fixed income funds, consistent with protocol logic.

  • Separates SMARTCREDIT token staking values from TVL.

@llamabutler
Copy link

The adapter at projects/smartcredit.js exports TVL:

ethereum                  897.15 k
ethereum-borrowed         271.27 k
borrowed                  271.27 k
ethereum-staking          262.11 k
staking                   262.11 k

total                    897.15 k 

@llamabutler
Copy link

The adapter at projects/smartcredit.js exports TVL:

ethereum                  974.67 k
ethereum-borrowed         276.99 k
borrowed                  276.99 k
ethereum-staking          0.00
staking                   0.00

total                    974.67 k 

@waynebruce0x waynebruce0x merged commit 83328f3 into DefiLlama:main Dec 3, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants