flyingfishPyth Oracles during puke copy copy
    Updated 2024-04-15
    -- forked from Pyth Oracles during puke copy @ https://flipsidecrypto.xyz/edit/queries/d8ce567e-6797-4de9-9bb7-314bba720a68

    -- forked from Pyth Oracles during puke @ https://flipsidecrypto.xyz/edit/queries/f62c47ea-ee7e-4109-aab0-e635411c57e7

    /*
    PYTH Oracles
    solana-mainnet-beta
    USDC: Gnt27xtC473ZT2Mw5u8wZ68Z3gULkSTb5DuxJy7eJotD Exponent -8
    USDT: 3vxLXJqLqF3JG5TCbYycbKWRBbCJQLxQmBGCkyqEEefL Exponent -8
    SOL: H6ARHf6YXhGYeQfUzQNGk6rDNnLBQKrenN712K4AQJEG Exponent -8
    ETH: JBu1AL4obBcCMqKBBxhpWCNUt136ijcuMZLFvTP7iWdB Exponent -8
    BTC: GVXRSBjFk6e6J3NbVPXohDJetcTjaeeuykUpbQF8UoMU
    */

    --0x020000000d000000010000000000000000d013b34a000000c0551a07000000003f857e0f00000000

    with price_accs as (
    select *
    from (
    values
    ('Gnt27xtC473ZT2Mw5u8wZ68Z3gULkSTb5DuxJy7eJotD', 'USDC')
    , ('3vxLXJqLqF3JG5TCbYycbKWRBbCJQLxQmBGCkyqEEefL', 'USDT')
    , ('H6ARHf6YXhGYeQfUzQNGk6rDNnLBQKrenN712K4AQJEG', 'SOL')
    , ('JBu1AL4obBcCMqKBBxhpWCNUt136ijcuMZLFvTP7iWdB', 'ETH')
    , ('GVXRSBjFk6e6J3NbVPXohDJetcTjaeeuykUpbQF8UoMU', 'BTC')
    ) t(price_account, symbol)
    )

    , raw_data as (
    select
    block_timestamp
    , block_id
    , decoded_instruction:accounts[1]:pubkey as price_account
    , decoded_instruction:accounts[0]:pubkey as funding_account
    , decoded_instruction:args:price::int / pow(10, 8) as price
    , decoded_instruction:args:conf::int / pow(10, 8) as confidence
    QueryRunArchived: QueryRun has been archived