Skip to content

Latest commit

 

History

History
76 lines (62 loc) · 1.46 KB

tx-wallet.md

File metadata and controls

76 lines (62 loc) · 1.46 KB

每个钱包的原始交易

总交易笔数

with alltransactions
AS (

SELECT 
    block_time, 
    success, 
    gas_price/10^9 AS gas_prices, 
    gas_used,
    (gas_price*gas_used)/10^18 AS eth_paid_for_tx,
    hash
FROM ethereum.transactions
WHERE "from" = CONCAT('\x', substring('{{1. Eth Address}}' from 3))::bytea
AND block_time >= '{{2. Start Date}}'
AND block_time < '{{3. End Date}}')

SELECT
    count(*)
FROM alltransactions

交易成功率

with alltransactions
AS (

SELECT 
    block_time, 
    success, 
    gas_price/10^9 AS gas_prices, 
    gas_used,
    (gas_price*gas_used)/10^18 AS eth_paid_for_tx,
    hash
FROM ethereum.transactions
WHERE "from" = CONCAT('\x', substring('{{1. Eth Address}}' from 3))::bytea
AND block_time >= '{{2. Start Date}}'
AND block_time < '{{3. End Date}}')

SELECT
    success, 
    count(success)*100/sum(count(*)) over ()
FROM alltransactions
GROUP by success
ORDER BY success DESC

某时间的总交易笔数

with alltransactions
AS (

SELECT 
    block_time, 
    success, 
    gas_price/10^9 AS gas_prices, 
    gas_used,
    (gas_price*gas_used)/10^18 AS eth_paid_for_tx,
    hash
FROM ethereum.transactions
WHERE "from" = CONCAT('\x', substring('{{1. Eth Address}}' from 3))::bytea
AND block_time >= '{{2. Start Date}}'
AND block_time < '{{3. End Date}}')

SELECT
    block_time,
    COUNT(block_time) over (ORDER BY block_time ASC) AS "Total # of Transactions"
FROM alltransactions