hessRemaining Loans III
    Updated 2025-04-15
    with supply_decode as (select block_timestamp,
    tx_hash,
    regexp_substr_all(substr(input,11, len(input)), '.{64}') as segmented,
    '0x' || substr(segmented[0]::string, 25 ) as token_address,
    '0x' || substr(segmented[2]::string, 25 ) as user_address,
    livequery.utils.udf_hex_to_int(segmented [1] :: STRING) AS amount,
    case when token_address = '0x43edd7f3831b08fe70b7555ddd373c8bf65a9050' then amount/pow(10,18)
    when token_address = '0xb75d0b03c06a926e488e2659df1a861f860bd3d1' then amount/pow(10,6)
    when token_address = '0x5cf6826140c1c56ff49c808a1a75407cd1df9423' then amount/pow(10,6)
    when token_address = '0x160345fc359604fc6e70e3c5facbde5f7a9342d8' then amount/pow(10,18)
    when token_address = '0xe30fedd158a2e3b13e9badaeabafc5516e95e8c7' then amount/pow(10,18)
    when token_address = '0x3894085ef7ff0f0aedf52e2a2704928d1ec074f1' then amount/pow(10,6)
    when token_address = '0x80eede496655fb9047dd39d9f418d5483ed600df' then amount/pow(10,18)
    when token_address = '0x37a4dd9ced2b19cfe8fac251cd727b5787e45269' then amount/pow(10,18)
    when token_address = '0x5bff88ca1442c2496f7e475e9e7786383bc070c0' then amount/pow(10,18) end as amt
    from sei.core_evm.fact_traces
    where to_address = '0x4a4d9abd36f923cba0af62a39c01dec2944fb638'
    and left(input,10) in ('0x617ba037','0xe8eda9df')
    and (TX_STATUS = 'SUCCESS' or tx_status is null)
    and tx_hash != '0xc2a36963760985236d97ffc5e05102d4201186d8fd297b1a9fb28c5cebd1a1ab')
    ,
    supply_ez as ( select ifnull(block_timestamp,INSERTED_TIMESTAMP) as block_time,
    tx_hash,
    INSERTED_TIMESTAMP,
    case when contract_address = lower('0x809FF4801aA5bDb33045d1fEC810D082490D63a4') then '0xe30fedd158a2e3b13e9badaeabafc5516e95e8c7'
    when contract_address = lower('0xa524c4a280f3641743eBa56e955a1c58e300712b') then '0x5cf6826140c1c56ff49c808a1a75407cd1df9423'
    when contract_address = lower('0xc1a6F27a4CcbABB1C2b1F8E98478e52d3D3cB935') then '0x3894085ef7ff0f0aedf52e2a2704928d1ec074f1'
    when contract_address = lower('0x093066736E6762210de13F92b39Cf862eee32819') then '0x160345fc359604fc6e70e3c5facbde5f7a9342d8'
    when contract_address = lower('0xd3C367195f96A9387564287a28D935adb44D4531') then '0xe30fedd158a2e3b13e9badaeabafc5516e95e8c7'
    when contract_address = lower('0x1C4b5c523f859c0F1f14A722a1EAFDe10348F995') then '0x3ec3849c33291a9ef4c5db86de593eb4A37fde45'
    when contract_address = lower('0xF37d13B0008b177fF47296Fc0A15c9935086821d') then '0x3894085ef7ff0f0aedf52e2a2704928d1ec074f1'
    when contract_address = lower('0x945C042a18A90Dd7adb88922387D12EfE32F4171') then '0xb75d0b03c06a926e488e2659df1a861f860bd3d1'
    when contract_address = lower('0x04295E6912F95f2690993473E6CCAAE438Cf3f06') then lower('0x37a4dD9CED2b19Cfe8FAC251cd727b5787E45269')
    when contract_address = lower('0xC15dce4e1BfABbe0897845d7f7Ee56bc37113E08') then '0x80eede496655fb9047dd39d9f418d5483ed600df'
    when contract_address = lower('0x7090D5fdCEfB496651B55c20D56282CbcdDC2EE2') then '0x5bff88ca1442c2496f7e475e9e7786383bc070c0'
    when contract_address = lower('0x2a662eF26556a7d8795BF7a678E3Dd4b36FDec1e') then '0x43edd7f3831b08fe70b7555ddd373c8bf65a9050' end as token_address,
    Last run: 11 days ago
    DAY
    # of Borrows
    # of Repaid
    Borrow (USD)
    Repaid (USD)
    Remaining Debts
    Remaining Debts (USD)
    Remaining Loans
    Remaining Debt (USD)
    1
    2025-04-15 00:00:00.0001393846997027.963221117384844.908157210129612183.05506392295894243359.092214
    1
    113B
    9s