PR: #27 (commit 4a9a6d3)
File: crates/charon-core/src/types.rs, line 74
net_profit_usd_cents: u64 introduces two problems:
- USD conversion requires oracle price at type layer, before business logic runs. Authoritative profit representation is in debt token base unit (e.g., USDT wei). Storing USD cents discards sub-cent precision that matters when profit window is narrow and gas is tight.
- Profit ranking in priority queue will be wrong for positions whose token-native profit rounds to same cent bucket but differ in actual value.
Risk: Bot deprioritizes a more profitable liquidation because its USD-cent representation ties with a less profitable one.
Fix: Replace net_profit_usd_cents: u64 with net_profit_wei: U256 denominated in debt token base unit. USD display conversion belongs in metrics/reporting layer only.
PR: #27 (commit 4a9a6d3)
File: crates/charon-core/src/types.rs, line 74
net_profit_usd_cents: u64introduces two problems:Risk: Bot deprioritizes a more profitable liquidation because its USD-cent representation ties with a less profitable one.
Fix: Replace
net_profit_usd_cents: u64withnet_profit_wei: U256denominated in debt token base unit. USD display conversion belongs in metrics/reporting layer only.