Graphlet-based Decentralized Finance Transaction Method Classification
Organizations: UTINAM Institute, UMR 6213 CNRS, Université Marie et Louis Pasteur, Besançon, France · Duke University, Durham, NC, USA · TU Wien, Vienna, Austria
Abstract
Decentralized Finance (DeFi) transactions involve complex interactions among accounts, smart contracts, and tokens. We investigate whether network topology can identify transaction methods that describe DeFi operations. We extract directed graphlet features to classify the 30 most frequent methods. Our results show that graphlet features complement event log counts in improving classification performance. Using SHapley Additive exPlanations (SHAP), we further derive model explanations that reveal method-specific graphlet structural patterns.
Figures & tables
| Features | # | F1-score | Precision | Recall | ROC-AUC | Best model |
| All graphlets | 1,680 | 0.693 | 0.790 | 0.699 | 0.984 | WeightedEnsemble_L2 |
| No graphlet counts | 40 | 0.691 | 0.787 | 0.697 | 0.984 | WeightedEnsemble_L2 |
| No account types | 505 | 0.592 | 0.727 | 0.599 | 0.969 | WeightedEnsemble_L2 |
| No token types | 504 | 0.669 | 0.793 | 0.667 | 0.981 | WeightedEnsemble_L2 |
| No token categories | 502 | 0.681 | 0.748 | 0.691 | 0.983 | WeightedEnsemble_L2 |
| No token types & categories | 1,006 | 0.638 | 0.746 | 0.632 | 0.977 | NeuralNetFastAI |
| Method | GPR (%) | Top 10 most important features |
|---|---|---|
| Transfer | 67.20 | 0_Contract (0.25) , Approval (0.09), Swap_4 (0.08), Sync (0.08), Swap_5 (0.06), 0_1_ETH/WETH (0.03) , 1_Contract (0.03) , Deposit_7 (0.03), Permit (0.02), 14_Address (0.02) |
| Execute | 62.28 | Permit (0.11), Swap_3 (0.08), 26_Address (0.07) , 1_Contract (0.05) , TransformedERC20 (0.05), OrderRecord (0.04), BridgeFill (0.03), 0_Contract (0.02) , 13_Address (0.02) , 16_Address (0.02) |
| Swap | 58.65 | Swap_3 (0.35), 26_Address (0.07) , Permit (0.05), 0_Contract (0.05) , TransformedERC20 (0.03), 1_Contract (0.03) , 16_Address (0.03) , 13_Address (0.02) , ClientData (0.02), 0 (0.02) |
| Swap Exact ETH For Tokens … | 74.99 | 1_Contract (0.09) , 0_Contract (0.07) , 0_1_Cryptocurrency (0.06) , Deposit_7 (0.06), 0_1_ETH (0.05) , Permit (0.03), 28_Address (0.02) , Swap_4 (0.02), 51_52_erc20 (0.02) , 2_Address (0.02) |
| Swap Exact Tokens For ETH … | 68.61 | Swap_4 (0.06), Permit (0.05), Swap_5 (0.05), 0_1_ETH (0.05) , 0_Contract (0.05) , 26_Address (0.04) , 1_Contract (0.04) , TransformedERC20 (0.04), 53_Address (0.03) , Withdrawal (0.03) |
| Deposit | 62.44 | 0_Contract (0.11) , Deposit_7 (0.10), 1_Contract (0.06) , Swap_5 (0.05), 4_Address (0.05) , Deposit_5 (0.04), LogDeposit (0.04), 14_Address (0.03) , Swap_4 (0.03), Permit (0.03) |
Appendix figures & tables6 assets
Supplementary material from the paper’s appendix.
Appendix
| F1-score | Precision | Recall | |||||||
|---|---|---|---|---|---|---|---|---|---|
| Transaction method | Graph. | Events | Comb. | Graph. | Events | Comb. | Graph. | Events | Comb. |
| Transfer | 0.976 | 0.969 | 0.982 | 0.959 | 0.945 | 0.971 | 0.994 | 0.994 | 0.993 |
| Execute | 0.964 | 0.927 | 0.969 | 0.964 | 0.892 | 0.962 | 0.964 | 0.965 | 0.977 |
| Swap | 0.986 | 0.855 | 0.988 | 0.987 | 0.942 | 0.982 | 0.985 | 0.783 | 0.995 |
| Swap Exact ETH For Tokens Supporting Fee On Transfer Tokens | 0.627 | 0.799 | 0.855 | 0.485 | 0.727 | 0.819 | 0.888 | 0.886 | 0.894 |
| Swap Exact Tokens For ETH Supporting Fee On Transfer Tokens | 0.604 | 0.929 | 0.983 | 0.522 | 0.955 | 0.984 | 0.717 | 0.905 | 0.983 |
| Method | % graphlet | GPR | Top 10 features (importance) | |
|---|---|---|---|---|
| Transfer | 586 | 99.6 | 67.2 | 0_Contract (0.25) , Approval (0.09), Swap_4 (0.08), Sync (0.08), Swap_5 (0.06), 0_1_ETH/WETH (0.03) , 1_Contract (0.03) , Deposit_7 (0.03), Permit (0.02), 14_Address (0.02) |
| Execute | 1000 | 96.8 | 62.28 | Permit (0.11), Swap_3 (0.08), 26_Address (0.07) , 1_Contract (0.05) , TransformedERC20 (0.05), OrderRecord (0.04), BridgeFill (0.03), 0_Contract (0.02) , 13_Address (0.02) , 16_Address (0.02) |
| Swap | 1000 | 66.4 | 58.65 | Swap_3 (0.35), 26_Address (0.07) , Permit (0.05), 0_Contract (0.05) , TransformedERC20 (0.03), 1_Contract (0.03) , 16_Address (0.03) , 13_Address (0.02) , ClientData (0.02), 0 (0.02) |
| Swap Exact ETH For Tokens … | 26 | 100 | 74.99 | 1_Contract (0.09) , 0_Contract (0.07) , 0_1_Cryptocurrency (0.06) , Deposit_7 (0.06), 0_1_ETH (0.05) , Permit (0.03), 28_Address (0.02) , Swap_4 (0.02), 51_52_erc20 (0.02) , 2_Address (0.02) |
| 0x0162e2d0 | 49 | 4.3 | 41.64 | 0x72…499f (0.44), 0x9f…c420 (0.11), 1_Contract (0.06) , Swap_3 (0.03), 4_Address (0.02) , Deposit_7 (0.02), OrderRecord (0.02), 0_Contract (0.02) , Withdrawal (0.02), 26_Address (0.02) |
| Swap Exact Tokens For ETH … | 250 | 99.9 | 68.61 | Swap_4 (0.06), Permit (0.05), Swap_5 (0.05), 0_1_ETH (0.05) , 0_Contract (0.05) , 26_Address (0.04) , 1_Contract (0.04) , TransformedERC20 (0.04), 53_Address (0.03) , Withdrawal (0.03) |
| Method | % graphlet | GPR | Top 10 features (importance) | |
|---|---|---|---|---|
| Propose Block | 9 | 64.2 | 54.93 | 0x98…f0b1 (0.26), Swap_3 (0.05), Permit (0.04), 4_Address (0.03) , 16_Address (0.03) , 69_Contract (0.02) , 0_1_Cryptocurrency (0.02) , Swap_4 (0.02), OrderRecord (0.02), TransformedERC20 (0.02) |
| Execute F Fs Yo | 139 | 95.1 | 72.34 | 7_Address (0.08) , Withdrawal (0.04), 32 (0.03), Swap_3 (0.03), TokenExchange (0.03), Swap_5 (0.03), 0_1_ETH (0.03) , 0_Contract (0.03) , 2_Address (0.03) , Sync (0.02) |
| Deposit ETH | 22 | 89.9 | 61.89 | Deposit_3 (0.13), 4_Address (0.10) , 0_Contract (0.09) , 0_1_ETH (0.05) , Swap_4 (0.05), ETHBridgeInitiated (0.04), Permit (0.04), 0 (0.03) , TransformedERC20 (0.03), Approval (0.02) |
| Sigma Buy | 50 | 38.4 | 39.59 | 0x24…4e08 (0.43), 0x33…feb3 (0.16), 1_Contract (0.05) , Swap_3 (0.03), 33_Address (0.03) , TransformedERC20 (0.02), 0_1_ETH/WETH (0.02) , 0_1_ETH (0.02) , 0_Contract (0.02) , 25_Address (0.02) |
| Stake | 105 | 41 | 43.74 | Staked (0.11), 0x22…c42e (0.08), Stake_2 (0.08), Stake_4 (0.07), Staked_2 (0.05), selfStake (0.04), Swap_3 (0.04), 0_Contract (0.04) , 0x7d…7692 (0.03), 0_1_Cryptocurrency (0.03) |
| Buy With Eth | 10 | 0 | 33.89 | TokensBoughtAndStaked (0.32), TokensBought (0.23), Swap_3 (0.04), 0_1_ETH (0.03) , 1_Contract (0.02) , 5_Address (0.02) , TransformedERC20 (0.02), Permit (0.02), OrderRecord (0.02), 0 (0.02) |
Decentralized Finance
Decentralized finance studies blockchain-based financial services, including lending, trading, liquidity provision, governance, and their security.
See all 30 papers