Sandeshsushi lending failure
    Updated 2022-10-03
    with borrow_contracts as
    (
    select
    distinct borrows.origin_to_address,
    contr_data.symbol
    from ethereum.sushi.ez_borrowing borrows
    left join
    ethereum.core.dim_contracts contr_data
    on borrows.origin_to_address=contr_data.address
    ),
    borrow_data AS
    (
    select
    f.block_timestamp,
    f.tx_hash,
    f.from_address,
    f.to_address,
    b.symbol,
    f.gas_price,
    f.CUMULATIVE_GAS_USED,
    f.status
    from ethereum.core.fact_transactions f
    right join borrow_contracts b
    on f.to_address = b.origin_to_address
    where f.status is not null
    and b.symbol is not null
    )
    select * from borrow_data

    Run a query to Download Data