Skip to content

feat: relax debt to escrow ratio requirements - #18

Merged
tmigone merged 2 commits into
mainfrom
tmigone/relax-funding-ratio
Sep 16, 2026
Merged

tmigone merged 2 commits into
mainfrom
tmigone/relax-funding-ratio

Conversation

@tmigone

@tmigone tmigone commented Sep 15, 2026

Copy link
Copy Markdown
Member

The escrow currently holds ~2.87M GRT against ~1M GRT of debt (2.87x). Most of that gap is not the funding formula, the algorithm targets ~1.67x and never withdraws. Balances are a high-water mark that only drains when receivers collect. The escrow has no metric to tell the two apart and no way of withdrawing to reduce the balance if needed.

Changes

Observability: new metrics added escrow_target_grt{receiver} and escrow_total_target_grt, expose the target balance the algorithm is aiming for, so idle capital (balance - target) is directly measurable per receiver and in aggregate. Targets are recorded for every receiver, including those already above target, which is precisely the over-funded case that was previously invisible.

New balance_fill_factor config field, replaces the hardcoded 0.6 in next_balance, defaulting to 0.8. The target settles at roughly debt / balance_fill_factor, so this moves steady-state funding from ~1.67x to ~1.25x debt.

Signed-off-by: Tomás Migone <tomas@edgeandnode.com>
@github-actions

Copy link
Copy Markdown
Contributor

Coverage Report for CI Build 35007570941

Coverage decreased (-0.2%) to 46.133%

Details

  • Coverage decreased (-0.2%) from the base build.
  • Patch coverage: 38 uncovered changes across 3 files (24 of 62 lines covered, 38.71%).
  • No coverage regressions found.

Uncovered Changes

File Changed Covered %
crates/bin/escrow_manager/src/main.rs 48 24 50.0%
crates/bin/escrow_manager/src/metrics.rs 11 0 0.0%
crates/bin/escrow_manager/src/config.rs 3 0 0.0%

Coverage Regressions

No coverage regressions found.


Coverage Stats

Coverage Status
Relevant Lines: 2198
Covered Lines: 1014
Line Coverage: 46.13%
Coverage Strength: 158.73 hits per line

💛 - Coveralls

Signed-off-by: Tomás Migone <tomas@edgeandnode.com>
@tmigone
tmigone merged commit e91b024 into main Sep 16, 2026
13 checks passed
@github-actions github-actions Bot mentioned this pull request Sep 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants