---
# System prepended metadata

title: Runtime Verification asks

---

# Runtime Verification asks

1. **Token supplies held by a pool**

```sql=
select block_number, reserve0, reserve1 
from eth.uniswap_v2.pool_stats 
where pool_address = '0x004375dff511095cc5a197a54140a24efef3a416' -- USDC/WBTC
  and block_timestamp_last > UNIX_TIMESTAMP()-60*60*4 -- Last 4 hours
order by block_number desc
limit 1
```

1. **Amount of circulating liquidity token of a pool**

```sql=
select total_supply from eth.tokens where address = '0x004375dff511095cc5a197a54140a24efef3a416' -- USDC/WBTC
```

3. **State of variables of a contract at a given block;**

Is this the alerting scenario? Or do they want a custom dataset of this?

4. **Market share of the pool (relative to the total supply of assets deposited there)**

Market share as compared to what? There is only 1 pool per asset pair per protocol (see [createPair](https://docs.uniswap.org/protocol/V2/reference/smart-contracts/factory#createpair)). Is this compared to other protocols?

5. **Number of holders for liquidity token at given block/time interval**

We could do something similar to nft_owners for this scenario, but we don't have an easy way to do it today.

6. **Top X holders of the liquidity token at given block/time interval**

We could use the same dataset as 5 for this.

7. **Number of traders (volume sources) for the pool at given block/time interval**

```sql=
select count(distinct sender) 
from eth.uniswap_v2.event_swaps 
where address = '0x004375dff511095cc5a197a54140a24efef3a416' 
  and block_timestamp > UNIX_TIMESTAMP()-60*60*4 -- Last 4 hours
```

8. **Top X traders (volume sources) for the pool at given block/time interval.**

```sql=
select sum(cast(amount0_in as integer)) as amount0_in_sum, sender
from eth.uniswap_v2.event_swaps 
where address = '0x004375dff511095cc5a197a54140a24efef3a416' 
  and block_timestamp > UNIX_TIMESTAMP()-60*60*4 -- Last 4 hours
group by sender
order by amount0_in_sum desc
limit 10
```

9. **Transaction IDs per block**

Not exactly sure what they mean by transaction ID - hash?
```sql=
select hash, block_number from eth.recent_transactions
```

10. **View-function calls with args**

Can be done using the Spice.xyz JSON-RPC proxy API.