Abbas_ra21Levana pnl Daily osmo 2
    Updated 2024-12-12
    -- forked from Levana pnl Daily osmo @ https://flipsidecrypto.xyz/edit/queries/400367fa-3423-41bc-92f6-d3ea9668d578

    with main2 AS (
    select
    m.block_timestamp,
    m.tx_id,
    pos_id,
    Trader,
    CASE
    when ATTRIBUTE_VALUE='osmo1nzddhaf086r0rv0gmrepn3ryxsu9qqrh7zmvcexqtfmxqgj0hhps4hruzu' THEN 'BTC'
    when ATTRIBUTE_VALUE='osmo1hd7r733w49wrqnxx3daz4gy7kvdhgwsjwn28wj7msjfk4tde89aqjqhu8x' THEN 'ATOM'
    when ATTRIBUTE_VALUE='osmo127aqy4697zqn27z0vqr3x2n8lraf27t7udvl6ef5hcwmwhjadegq9vytdj' THEN 'OSMO'
    when ATTRIBUTE_VALUE='osmo19c7hdlfvu7cddr0smfz9luaj8375qhfr3s0gtsk087laqfzxlu3qsnk47e' THEN 'axlETH'
    when ATTRIBUTE_VALUE='osmo186nlf2fwfglq8u4nj3f7mwg8uc79j22qhaau4scdyur47e0fatas34vcn9' THEN 'SEI'
    when ATTRIBUTE_VALUE='osmo1d5zsvupzvq5ru6635a0agrcdrj0t8ycj8vpewm8z4y8xf85gvh3qk0ka33' THEN 'DOT'
    when ATTRIBUTE_VALUE='osmo16v36jtfjc933htukqfrk8lk8e2uj8xpp3zjdh0ll04qe9jevlnrsuwhhx8' THEN 'EURO'
    when ATTRIBUTE_VALUE='osmo1rhgn3mp5q7vfr43xgzwtcrnklll6w7e0gv5jvmk9sz26qvcnf3tsw8axyn' THEN 'GBP'
    when ATTRIBUTE_VALUE='osmo164357hnc5jc0pw9lv958h6chrpjucr4sy47hwpm9k4av6zh74gnq7uvcpj' THEN 'BNB'
    when ATTRIBUTE_VALUE='osmo1kqzkupfec3zemmaj3kuhcf0h2wke02wa7sgp2a9vq5mugtgs5pzs8avjzt' THEN 'TIA'
    when ATTRIBUTE_VALUE='osmo1jprh8f4ytxar0q3z5n5p6swqnmunnsvuuhnhteskwxjzyc8jayms4r7e3e' THEN 'SOL'
    when ATTRIBUTE_VALUE='osmo1353cxacx74lfugp0sdkdpasa7d09rlwwdaeeql9usw2w6g773vqsxgp053' then 'INJ'
    when ATTRIBUTE_VALUE='osmo19uqdjvk6j9yjtev7j25sc0v0mszqy3jwwak8z4n0qf6l4wp9csvq0jn0qw' THEN 'LINK'
    when ATTRIBUTE_VALUE='osmo1u7usfl8wxtzkwllagxxv9u0y5ulv4gyan47gmn76re0830ndk8hsnd05l9' THEN 'LUNA'
    when ATTRIBUTE_VALUE='osmo1my45yym085dj5jxrtdgy2y4wjlvxf2uwp8plmxq25e0phdyuckzqq5r73w' then 'DYDX'
    when ATTRIBUTE_VALUE='osmo1mrc3zk2fvqvcg9j693u0mlcd8g6329e3w9ld4t7qg20635sfcvuswaxgjm' THEN 'RUNE'
    when ATTRIBUTE_VALUE='osmo19ua8dlul0hq9jfwfq9d0eqcz0lvx5jd8segmn85rz2nv94jlhwcqnkypv3' THEN 'DOGE'
    when ATTRIBUTE_VALUE='osmo1gprafrgxx0tlf4u3dxnxcvvmsg2yl4hgqxc68xmkq07h2n0lk9zqycckgc' then 'AVAX'
    when ATTRIBUTE_VALUE='osmo1dyt0wupd5sdefwh53y6e6murnnpfeg27rc7aknhm7tynqzphuwfsr7d4h2' then 'NTRN'
    when ATTRIBUTE_VALUE='osmo1wszczd8y6lk53ygr59cxt60ualydtwsnr7tu63zkgvu704r7yqdshc47w8' then 'PYTH'
    end AS Pool,
    avg(Volume) AS "Trade Volume",
    avg(pnl_usd) AS pnl_usd
    from
    osmosis.core.fact_msg_attributes m
    inner join (
    Last run: about 1 month ago
    WEEK
    POOL
    PNL
    1
    2024-04-01 00:00:00.000axlETH-22548.501325099
    2
    2023-12-11 00:00:00.000DOGE1006.181503642
    3
    2024-09-09 00:00:00.000EURO-1.435815907
    4
    2024-12-09 00:00:00.000PYTH-2155.050750872
    5
    2024-01-01 00:00:00.000LUNA-1697.550580136
    6
    2024-07-22 00:00:00.000-48731.734807813
    7
    2024-06-17 00:00:00.000-12250.516090698
    8
    2023-10-02 00:00:00.000axlETH797.786375968
    9
    2024-07-08 00:00:00.000OSMO-3475.291288567
    10
    2023-10-30 00:00:00.000BTC5469.728485043
    11
    2024-01-08 00:00:00.000AVAX-1076.768797246
    12
    2024-11-25 00:00:00.000TIA-8038.40170316
    13
    2023-11-20 00:00:00.000RUNE-1222.455686694
    14
    2023-10-09 00:00:00.000EURO80.128158159
    15
    2024-06-03 00:00:00.000DYDX-3213.414794541
    16
    2023-11-06 00:00:00.000LUNA-242.416548353
    17
    2024-06-17 00:00:00.000LINK-1686.756475106
    18
    2024-10-28 00:00:00.000BNB22.902740222
    19
    2023-11-06 00:00:00.000SEI-195.632094953
    20
    2024-11-04 00:00:00.000DYDX-511.721304916
    ...
    1198
    59KB
    461s