Closed nud3l closed 1 year ago
Am I on the right track here @daniel-savu ? This is the event I need to track:
LiquidatedBorrow {
liquidator: T::AccountId,
borrower: T::AccountId,
liquidation_currency_id: CurrencyId<T>,
collateral_currency_id: CurrencyId<T>,
repay_amount: BalanceOf<T>,
collateral_underlying_amount: BalanceOf<T>,
},
repay_amount corresponds to: Repaid debt amount and token
collateral_underlying_amount corresponds to: Seized collateral amount and token
Do you have any thoughts on how I can get cost of liquidation and Transaction id?
cost of liquidation
See this Discord discussion here and here. TLDR: collateral_underlying_amount - repay_amount
Transaction id
Good question, maybe there's a way to read that from the squid metadata of the event. You can check if the transaction id is used elsewhere in squid or the UI, or maybe ask Brendon.
The event should have a filed "extrinsic" with an id. That is the transaction id.
@daniel-savu @nud3l What currencies should I account for these values?
liquidation_currency_id: CurrencyId<T>,
collateral_currency_id: CurrencyId<T>,
What token would you to see cost of liquidation represented as since it seems like I will be calculating this from collateral_underlying_amount and repay_amount?
What token would you to see cost of liquidation represented as
The UI should display the cost of liquidation both in USD and the collateral_currency_id
Required data-points:
The USD amounts are not going to be stored in squid, so can be ignored.
Designs:
Blocker for https://github.com/interlay/interbtc-ui/issues/869