You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
PR:#29 (feat/04-toml-config-loader) File: crates/charon-core/src/config.rs, line 36 (BotConfig.min_profit_usd)
f64 for financial threshold. Project rule: USD / token values never in f64/f32. Same issue PR #27 addressed for net_profit_wei. Threshold comparison against oracle-derived profit (currently slated to land as U256 after issue #66) will require a lossy cast.
Impact:
Precision loss on large denominations.
NaN-safety: any arithmetic that produces NaN compares false against all thresholds — profitable liquidation silently dropped.
min_profit_wei: U256 with config value as decimal string, parsed via custom serde deser. Denomination tied to a reference token (USDT on BSC — 18 dec).
min_profit_usd_1e6: u64 fixed-point 6-decimal. Simpler to render in config.
Prefer the latter for human-authored TOML ergonomics. Update config/default.toml accordingly:
PR: #29 (feat/04-toml-config-loader)
File: crates/charon-core/src/config.rs, line 36 (BotConfig.min_profit_usd)
f64 for financial threshold. Project rule: USD / token values never in f64/f32. Same issue PR #27 addressed for net_profit_wei. Threshold comparison against oracle-derived profit (currently slated to land as U256 after issue #66) will require a lossy cast.
Impact:
Fix: Two options:
min_profit_wei: U256with config value as decimal string, parsed via custom serde deser. Denomination tied to a reference token (USDT on BSC — 18 dec).min_profit_usd_1e6: u64fixed-point 6-decimal. Simpler to render in config.Prefer the latter for human-authored TOML ergonomics. Update config/default.toml accordingly: