Folks Finance TVL

    Q109. Calculate the TVL on Folks Finance- broken out by deposited and borrowed.

    Loading...
    Loading...
    Loading...
    Loading...

    Q109. Calculate the TVL on Folks Finance- broken out by deposited and borrowed.

    Method

    • TVL = Deposit + Mint - Withdraw

    I used the algorand.application_call_transaction table based on TRY_BASE64_DECODE_STRING(tx_message:txn:apaa[0]::STRING) to find the action type as below :

    • ‘m‘ : Mint
    • ‘d‘ : Deposit
    • ‘b‘ : Borrow
    • ‘r‘ : Withdraw

    on folk finance pools which include:

    ALGO, USDC, USDt, goBTC, goETH, gALGO3, Planet , USDC/USDt TMP1.1, USDC/USDt PLP, ALGO/USDC TMP1.1, ALGO/USDC PLP, ALGO/gALGO3 TMP1.1, ALGO/gALGO3 PLP

    Then I joined with algorand.asset_transfer_transaction table based on tx_group_id and got the values separately.

    TVL = Deposit + Mint - Withdraw

    33.5M + 14.69 - 20.5 = 27.69

    TVL

    27.69M ALGO

    8.1 M Dollar

    Conclusion

    To calculate TVL:

    Amount of deposit and mint based on ALGO together, minus withdraw, amount of lock 27.69M ALGO and 8.1M dollar.