hessPolygon Vs Ethereum (Repay)
    Updated 2022-07-13
    with deposit as ( select date(block_timestamp) as date ,LENDING_POOL ,DEPOSITOR , amount_usd , (amount_usd*0.024647)/100 as fee
    from polygon.sushi.ez_lending
    where action = 'Deposit'
    )
    ,
    withdraw as ( select date(block_timestamp) as date ,LENDING_POOL ,DEPOSITOR , amount_usd , (amount_usd*0.024647)/100 as fee
    from polygon.sushi.ez_lending
    where action = 'Withdraw')
    ,
    borrow as ( select date(block_timestamp) as date , LENDING_POOL ,borrower , amount_usd , (amount_usd*0.25)/100 as fee
    from polygon.sushi.ez_borrowing
    where action = 'Borrow')
    ,
    repay as ( select date(block_timestamp) as date ,LENDING_POOL ,borrower , amount_usd , (amount_usd*0.25)/100 as fee
    from polygon.sushi.ez_borrowing
    where action = 'Repay')
    ,
    eth_deposit as ( select date(block_timestamp) as date , blockchain ,LENDING_POOL ,DEPOSITOR , amount_usd , (amount_usd*0.024647)/100 as fee
    from flipside_prod_db.crosschain.ez_lending
    where action = 'Deposit'
    )
    ,
    eth_withdraw as ( select date(block_timestamp) as date , blockchain ,LENDING_POOL ,DEPOSITOR , amount_usd , (amount_usd*0.024647)/100 as fee
    from flipside_prod_db.crosschain.ez_lending
    where action = 'Withdraw')
    ,
    eth_borrow as ( select date(block_timestamp) as date , blockchain ,LENDING_POOL ,borrower , amount_usd , (amount_usd*0.25)/100 as fee
    from flipside_prod_db.crosschain.ez_borrowing
    where action = 'Borrow')
    ,
    eth_repay as ( select date(block_timestamp) as date , blockchain ,LENDING_POOL ,borrower , amount_usd , (amount_usd*0.25)/100 as fee
    from flipside_prod_db.crosschain.ez_borrowing
    where action = 'Repay')
    select 'Polygon' as type , sum(fee) as total_fee , avg(fee) as avg_fee
    from repay
    Run a query to Download Data