Skip to content
Dune Analytics

@tianqi / tBTC系统清算过程

tBTC系统清算过程

Loading
 

About queries and results

Dune Analytics lets you explore, create, and share Ethereum analytics. You can find an endless amount of great queries and dashboards on Dune.

We have decoded Ethereum smart contract data so you can do powerful analysis with simple SQL queries and visualise the query results into beautiful graphs.

Dune Analytics is free for everyone forever. If you want extra features like private queries, export your results and more check out our Pro plan.

SQL query results

Loading
 

SQL query

1select * from keep_v110."TBTCSystem_evt_StartedLiquidation";
2select * from ethereum."contracts" where address = '\x8daebade922df735c38c80c7ebd708af50815faa'--0x27321f84704a599aB740281E285cc4463d89A3D5 
3--首先从清算合约中获取被清算的deposit
4select 
5date_trunc('day',a.evt_block_time) as d_date,
6a.operator,--签名者
7a.amount/1e18 as bonded_eth --绑定的ETH数量
8from keep_v110."TBTCSystem_evt_StartedLiquidation" t
9inner join keep_v110."KeepBonding_evt_BondSeized" a on a.destination = t."_depositContractAddress"
10where t."_depositContractAddress" = '\x77bcd4ec2f0db39c71a229150ef15fdfb73da684'
11
12--然后开始拍卖
13----先看看谁出了tBTC
14select * from keep_v110."TBTCSystem_evt_Liquidated" t
15inner join erc20."ERC20_evt_Transfer" a on a.evt_tx_hash = t.evt_tx_hash --从这里可以查到tBTC的交易情况
16where t."_depositContractAddress" = '\x77bcd4ec2f0db39c71a229150ef15fdfb73da684'
17----再看看最终还剩下多少ETH给到运行节点
18select 
19date_trunc('day',a.evt_block_time) as d_date,
20a.operator,--签名者
21a.amount/1e18 as bonded_eth --绑定的ETH数量
22 from keep_v110."TBTCSystem_evt_Liquidated" t
23inner join keep_v110."KeepBonding_evt_UnbondedValueDeposited" a on a.evt_tx_hash = t.evt_tx_hash --从这里可以查到tBTC的交易情况
24where t."_depositContractAddress" = '\x77bcd4ec2f0db39c71a229150ef15fdfb73da684'
25...