Query editor
/* XXX Curve is currently double-counting volume, so there's a discrepancy between this query *//* and what Curve UI shows. *//* - *//* Compare: *//* https://nomics.com/exchanges/curve-curve-finance-ethereum/markets/0xb9d7dddca9a4ac480991865efef82e01273f79c3-0xed279fdd11ca84beef15af5d39bb4d4bee23f0ca */WITH l3 AS (SELECT call_block_time AS time,output_0 / CAST(1e18 AS DOUBLE) AS lusd3CrvPriceFROM curvefi_ethereum.lusd_swap_call_get_virtual_price),bb AS (SELECT evt_block_time as time,CAST(sold_id AS INT) as inputToken,tokens_sold/1e18 as inputAmount,tokens_bought/1e18 as outputAmountfrom curvefi_ethereum.blusd_evt_TokenExchange),b AS (SELECT time,CASE inputToken WHEN 1 THEN inputAmount ELSE outputAmount END AS lusd3CrvAmount,CASE inputToken WHEN 1 THEN inputAmount / CAST(outputAmount AS DOUBLE) ELSE outputAmount / CAST(inputAmount AS DOUBLE) END AS exchangeRateFROM bb),ll AS (SELECT call_block_time,_burn_amount,i,output_0FROM curvefi_ethereum.lusd_swap_call_remove_liquidity_one_coinUNION ALLSELECT call_block_time,_burn_amount,i,output_0FROM curvefi_ethereum.lusd_swap_call_remove_liquidity_one_coin),l AS (SELECT call_block_time AS time,output_0 / CAST(_burn_amount AS DOUBLE) AS lusdWithdrawalRateFROM llWHERE i = CAST(0 AS INT256)AND _burn_amount <> CAST(0 AS UINT256)),uuu AS (SELECT time,lusd3CrvAmount /* bLUSDAmount, */,exchangeRate,TRY_CAST(NULL AS DECIMAL) AS lusd3CrvPrice,TRY_CAST(NULL AS DECIMAL) AS lusdWithdrawalRateFROM bUNION ALLSELECT time,NULL /* null as bLUSDAmount, */ AS lusd3CrvAmount,NULL AS exchangeRate,