Query editor
WITH ohm_mint_cushions as (SELECTdate_trunc('minute', evt_block_time) as evt_block_time, amount_/1e9 as amount, evt_tx_hash as tx_hashFROM olympusdao_ethereum.OlympusMinter_evt_MintWHERE policy_ = 0x73df08ce9dcc8d74d22f23282c4d49f13b4c795e --cushion swaps),bond_txs as (SELECTevt_block_time, amount/1e18 as dai_amount, payout/1e8 as ohm_amount, evt_tx_hashFROM bondprotocol_ethereum.BondFixedTermTeller_evt_Bonded),ohm_price as (SELECTdate_trunc('minute',minute) as minute, priceFROM prices.usdWHERE contract_address = 0x64aa3364F17a4D01c6f1751Fd97C2BD3D7e7f1D5AND minute > cast('2024-01-26' as timestamp) -- first upper cushion was 27th),joined_prices as (SELECTa.evt_block_time, a.amount as ohm_amount, b.dai_amount, c.price as ohm_market_price, a.tx_hash as tx_hashFROM ohm_mint_cushions ALEFT JOIN bond_txs B ON A.tx_hash = B.evt_tx_hashLEFT JOIN ohm_price C ON c.minute = a.evt_block_time),trades as (SELECTevt_block_time as block_time, ohm_amount, dai_amount, dai_amount/ohm_amount as bond_price, ohm_market_price as market_price, ((dai_amount/ohm_amount) - ohm_market_price) / ohm_market_price * -100 as discount_percent, '<a href=https://etherscan.io/tx//' || cast(tx_hash AS VARCHAR) || ' target=_blank"> ' || cast(tx_hash AS VARCHAR) || '</a>' AS etherscanFROM joined_pricesORDER BY 1 DESC)SELECTdate_trunc('month', block_time) as month, CASEWHEN date_trunc('month', block_time) = CAST('2024-01-01 00:00' AS TIMESTAMP) THEN 'January 2024'WHEN date_trunc('month', block_time) = CAST('2024-02-01 00:00' AS TIMESTAMP) THEN 'February 2024'WHEN date_trunc('month', block_time) = CAST('2024-03-01 00:00' AS TIMESTAMP) THEN 'March 2024'WHEN date_trunc('month', block_time) = CAST('2024-04-01 00:00' AS TIMESTAMP) THEN 'April 2024'WHEN date_trunc('month', block_time) = CAST('2024-05-01 00:00' AS TIMESTAMP) THEN 'May 2024'