-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* merge Former-commit-id: 510ea9c * brontes-exports Former-commit-id: 82776b2 * Delete brontes-exports/builder-info/03-27 directory (#537) Former-commit-id: 21cae97 * test Former-commit-id: 666f144 * :test Former-commit-id: 39a67ef * new range Former-commit-id: b91dbd6 * teesting post run Former-commit-id: 5bb0b0b * export Former-commit-id: 2ea1677 * mid run Former-commit-id: 5b95638 * mid run update Former-commit-id: d688799 * updated data Former-commit-id: e4a473d * checking cex data fix Former-commit-id: 0025287 * testing Former-commit-id: 1097f8d * Delete brontes-exports directory (#585) Former-commit-id: 794a489 * Ludwig/markout review (#624) * wip * make clippy happy * wip * finished review, added docs Former-commit-id: 2282560 * first draft Former-commit-id: f2759d54d02d76e71e709eaec22eb3d0e8b4edcd * create cex-quotes feature Former-commit-id: 85ad5f1926a0796bc00c13d292059ac5c297d4c5 * reduced quality paramater for optimistic to 65% Former-commit-id: db271cdb5af9ca5362a9aa9d30280478be783362 * add note on builder pnl calc limitations Former-commit-id: 86108d828f13acba04625f6b54b51cbac2bca373 * todo update main Former-commit-id: d03565bd35fe6e9d6b125fc501b7985a26a91358 * updated docs * deleted tree.json --------- Co-authored-by: root <[email protected]>
- Loading branch information
1 parent
319622f
commit 511ff24
Showing
39 changed files
with
1,350 additions
and
1,139 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,54 @@ | ||
# Liquidation Inspector | ||
|
||
The Liquidation Inspector is designed to detect and analyze the profitability of liquidation events. | ||
|
||
**What is a Liquidation?** | ||
|
||
A liquidation occurs when a borrower's collateral is forcibly sold to repay their outstanding debt, typically when the collateral's value falls below a certain threshold. | ||
|
||
## Methodology | ||
|
||
### Step 1: Retrieve Relevant Transactions | ||
|
||
The inspector retrieves transactions in the block that involve `swap` or `liquidation` actions. | ||
|
||
### Step 2: Identify Potential Liquidations | ||
|
||
For each relevant transaction, we: | ||
|
||
1. Split the actions into swaps and liquidations. | ||
2. Filter out transactions with no liquidation events. | ||
|
||
### Step 3: Analyze Liquidation Candidates | ||
|
||
For each potential liquidation, we: | ||
|
||
1. Collect all addresses involved in the transaction. | ||
2. Calculate the balance changes (deltas) for all actions in the transaction. | ||
|
||
### Step 4: Calculate Profitability | ||
|
||
We apply specific criteria to determine the profitability of each liquidation: | ||
|
||
1. Calculate USD value of token transfers using DEX pricing data. | ||
2. Compute gas costs for the transaction. | ||
3. Determine profitability by subtracting gas costs from revenue. | ||
4. Apply a maximum profit threshold to filter out unrealistic opportunities. | ||
|
||
### Step 5: Generate Liquidation Bundle | ||
|
||
For confirmed liquidation opportunities: | ||
|
||
1. Construct a `Liquidation` structure containing: | ||
|
||
- Liquidation transaction hash | ||
- Liquidation swaps | ||
- Liquidation events | ||
- Gas details | ||
|
||
2. Create a `Bundle` with: | ||
- A header summarizing key information (profit, gas used, transaction hash) | ||
- The detailed `Liquidation` data | ||
|
||
> **Note on Pricing:** | ||
> The inspector uses DEX pricing data to value token transfers. If reliable pricing data is unavailable, the liquidation is flagged, and profit is set to zero to avoid false positives. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.