neo_nguyenPendle x Lombard (Raw)
    Updated 9 hours ago
    with

    pendle_pool as( select chain, protocol, symbol, sy, mk, price from $query('f90ce887-7773-43b6-ac7d-a666182c79e0') group by 1,2,3,4,5,6 ),

    pendle_ethereum as(
    select from_address as pool, case when amount is null then raw_amount/1e18 else amount end amount, contract_address, block_timestamp from ethereum.core.ez_token_transfers union all
    select to_address as pool, case when amount is null then 0-raw_amount/1e18 else 0-amount end amount, contract_address, block_timestamp from ethereum.core.ez_token_transfers ),

    pendle_base as(
    select from_address as pool, case when amount is null then raw_amount/1e18 else amount end amount, contract_address, block_timestamp from base.core.ez_token_transfers union all
    select to_address as pool, case when amount is null then 0-raw_amount/1e18 else 0-amount end amount, contract_address, block_timestamp from base.core.ez_token_transfers ),

    pendle_ethereum_tvl as(
    select date_trunc('week',block_timestamp) time, chain, protocol, symbol, sy, sum(amount*price) tvl
    from pendle_ethereum tb1
    join pendle_pool tb2 on tb1.contract_address = tb2.sy and tb1.pool = '0x0000000000000000000000000000000000000000'
    where chain = 'Ethereum' and symbol like '%LBTC%'
    group by 1,2,3,4,5),

    pendle_base_tvl as(
    select date_trunc('week',block_timestamp) time, chain, protocol, symbol, sy, sum(amount*price) tvl
    from pendle_base tb1
    join pendle_pool tb2 on tb1.contract_address = tb2.sy and tb1.pool = '0x0000000000000000000000000000000000000000'
    where chain = 'Base' and symbol like '%LBTC%'
    group by 1,2,3,4,5),

    pendle_protocol as(
    select * from pendle_ethereum_tvl union all
    select * from pendle_base_tvl)

    select
    time, chain, sy,
    case when symbol = 'LBTC' and chain = 'Ethereum' then 'LBTC (Ether)'
    when symbol = 'LBTC' and chain = 'Base' then 'LBTC (Base)'
    else symbol end symbol,
    tvl,
    Last run: about 9 hours agoAuto-refreshes every 24 hours
    TIME
    CHAIN
    SY
    SYMBOL
    TVL
    TOTAL_TVL
    1
    2025-03-31 00:00:00.000Base0xb261266cb30c255cb9c73ebf4a3ead9398d23ab4LBTC (Base)-121704.2972843448267992.8424628
    2
    2025-03-31 00:00:00.000Ethereum0xac614884b52dbab8728476b5d50f0d672baed31fLBTC (Bera Concrete)-1231670.3387555337382350.2952244
    3
    2025-03-31 00:00:00.000Ethereum0xc781c0cc527cb8c351be3a64c690216c535c6f36LBTC (Ether)-22901327.843957514671057.1987992
    4
    2025-03-31 00:00:00.000Ethereum0x9d6ec7a7b051b32205f74b140a0fa6f09d7f223eLBTC (Corn)-97352.783646541166998.96387866
    5
    2025-03-24 00:00:00.000Base0xb261266cb30c255cb9c73ebf4a3ead9398d23ab4LBTC (Base)1356549.6348037248389697.1397471
    6
    2025-03-24 00:00:00.000Ethereum0xac614884b52dbab8728476b5d50f0d672baed31fLBTC (Bera Concrete)66807.87190341738614020.6339799
    7
    2025-03-24 00:00:00.000Ethereum0xc781c0cc527cb8c351be3a64c690216c535c6f36LBTC (Ether)-121135082.0465937572385.0427567
    8
    2025-03-24 00:00:00.000Ethereum0x9d6ec7a7b051b32205f74b140a0fa6f09d7f223eLBTC (Corn)-576285.35686831264351.7475252
    9
    2025-03-17 00:00:00.000Ethereum0xc781c0cc527cb8c351be3a64c690216c535c6f36LBTC (Ether)9675367.64500152158707467.089346
    10
    2025-03-17 00:00:00.000Base0xb261266cb30c255cb9c73ebf4a3ead9398d23ab4LBTC (Base)-192685.4106406847033147.5049434
    11
    2025-03-17 00:00:00.000Ethereum0xac614884b52dbab8728476b5d50f0d672baed31fLBTC (Bera Concrete)-174403.05363317638547212.7620765
    12
    2025-03-17 00:00:00.000Ethereum0x9d6ec7a7b051b32205f74b140a0fa6f09d7f223eLBTC (Corn)-81599.40667951840637.1043935
    13
    2025-03-10 00:00:00.000Ethereum0xc781c0cc527cb8c351be3a64c690216c535c6f36LBTC (Ether)-295886.97855096149032099.444345
    14
    2025-03-10 00:00:00.000Base0xb261266cb30c255cb9c73ebf4a3ead9398d23ab4LBTC (Base)-713751.019622147225832.9155841
    15
    2025-03-10 00:00:00.000Ethereum0xac614884b52dbab8728476b5d50f0d672baed31fLBTC (Bera Concrete)-172652.59656277538721615.8157096
    16
    2025-03-10 00:00:00.000Ethereum0x9d6ec7a7b051b32205f74b140a0fa6f09d7f223eLBTC (Corn)-257040.477438181922236.511073
    17
    2025-03-03 00:00:00.000Ethereum0xc781c0cc527cb8c351be3a64c690216c535c6f36LBTC (Ether)15356.8313544149327986.422896
    18
    2025-03-03 00:00:00.000Base0xb261266cb30c255cb9c73ebf4a3ead9398d23ab4LBTC (Base)2024963.76656747939583.9352062
    19
    2025-03-03 00:00:00.000Ethereum0xac614884b52dbab8728476b5d50f0d672baed31fLBTC (Bera Concrete)245529.99924261138894268.4122724
    20
    2025-03-03 00:00:00.000Ethereum0x9d6ec7a7b051b32205f74b140a0fa6f09d7f223eLBTC (Corn)-2151450.61770272179276.98851118
    88
    11KB
    72s