nx_fin_liquidity.nx
buildroot/runtime/nx_fin_liquidity.nx
about
nx_fin_liquidity.nx -- the market-IMPACT model: finer than R1's flat ADV cap. Uses the square-root impact law
(Almgren): impact grows with sqrt(order/ADV), so doubling size ~1.4x's the cost, not 2x. impact_bps =
k_bps * sqrt(participation), participation = order/ADV. Composes me_isqrt (nx_fin_metrics). Gives the $ cost of
trading AND the inverse -- the largest order that keeps impact within a bound = the honest, per-name answer to
the SCALING WALL ("how much can a growing stake actually deploy here"). k_bps is DATA (per-name/regime). Pure,
i64. license_tier: ORIGINAL
dependencies 2 imports · 1 importers
imports: nx_syscalls.nxnx_fin_metrics.nx
imported by: nx_fin_liquidity_gate.nx
structs
| none |
consts
| 9 | const K_MAGIC_1000000: i64 = 1000000 |
| 10 | const K_MAGIC_10000: i64 = 10000 |
functions
| 14 | func lq_impact_bps(order_cents: i64, adv_cents: i64, k_bps: i64) -> i64 |
| 21 | func lq_slippage_cost_cents(order_cents: i64, impact_bps: i64) -> i64 { return order_cents * impact_bps / K_MAGIC_10000 } called by 1: main |
| 25 | func lq_max_order_for_impact(adv_cents: i64, max_impact_bps: i64, k_bps: i64) -> i64 called by 1: main |