freemartianPositions & Portfolios
    Updated 2025-02-14
    WITH positions_api AS (
    SELECT
    value AS temp_value
    FROM (
    SELECT
    livequery.live.udf_api(
    'https://raw.githubusercontent.com/mehdimarjan/Opensea/refs/heads/main/positions.json'
    ) AS response
    ),
    LATERAL FLATTEN(input => response:data)
    ),

    positions AS(
    SELECT
    value:user_address::string AS user,
    value:id::string AS position_id,
    value:wallet_position_asset::string AS position_asset,
    value:wallet_position_amount::string AS position_amount,
    value:chain_position::string AS chain_position,
    'Position' AS label
    FROM
    positions_api, LATERAL FLATTEN(input => temp_value)
    ),

    portfolios AS (
    SELECT
    user_address,
    key::string AS chain_name,
    value::string AS amount,
    'Portfolio' AS label
    FROM (
    SELECT
    value:user_address::STRING AS user_address,
    value:chain_distribution AS chain_distribution,
    FROM (
    SELECT
    Last run: about 2 months agoAuto-refreshes every 1 hour
    USER
    CHAIN
    AMOUNT
    1
    0x03739f52ab1bd514682c6e21de70e06a676920f0arbitrum323.825504476
    2
    0x03739f52ab1bd514682c6e21de70e06a676920f0polygon0.1226524607
    3
    0x03739f52ab1bd514682c6e21de70e06a676920f0base39.596227813
    4
    0x03739f52ab1bd514682c6e21de70e06a676920f0binance-smart-chain6804.867471404
    5
    0x03739f52ab1bd514682c6e21de70e06a676920f0blast62.099779958
    6
    0x03739f52ab1bd514682c6e21de70e06a676920f0ethereum12408.392466233
    7
    0x0871deb34bfd2052b1c10dc4f6c0912a2a47e927polygon17.418274646
    8
    0x0871deb34bfd2052b1c10dc4f6c0912a2a47e927polygon-zkevm58.881891501
    9
    0x0871deb34bfd2052b1c10dc4f6c0912a2a47e927blast836.462006665
    10
    0x0871deb34bfd2052b1c10dc4f6c0912a2a47e927base19681.086542157
    11
    0x0871deb34bfd2052b1c10dc4f6c0912a2a47e927ethereum744396.24909885
    12
    0x0871deb34bfd2052b1c10dc4f6c0912a2a47e927optimism0.05267185026
    13
    0x0871deb34bfd2052b1c10dc4f6c0912a2a47e927arbitrum336.371964329
    14
    0x0871deb34bfd2052b1c10dc4f6c0912a2a47e927binance-smart-chain69.494732011
    15
    0x0ae87d9ec2c6ddd30f61935b0c323fd08cebbdf2ethereum141776.310356081
    16
    0x0ae87d9ec2c6ddd30f61935b0c323fd08cebbdf2arbitrum4026.845755837
    17
    0x104b2fdd2b89176c7e349ddc3fa95371a5f1961eethereum249.825599734
    18
    0x11095ef3777113eed4721b8f8b76659bf720c9ddethereum113663.535380276
    19
    0x1811cfd037a33d65e7e75e1aa6cd0d6c6ea67141ethereum7822.278878366
    20
    0x36fc00f224f72abdf182f16d940e31621f583a93optimism4662.245463256
    ...
    241
    17KB
    2s