Skip to content

Conversation

@vitaliybezz
Copy link
Contributor

@vitaliybezz vitaliybezz commented Nov 5, 2025

  • Complete refactoring of Liquidation bot with modular, extendible, self-contained architecture.
  • Inventory-based liquidation model - bot maintains asset balances and liquidates using available inventory.
  • NEAR Intents integration via 1-Click API for post liquidation swaps.
  • Market scans with allowlists and ignore-lists by asset.
  • Both NEP-141 and NEP-245 liquidations (tested).
  • Full and partial liquidation strategies.
  • Multiple collateral management strategies (hold, swap to borrow, swap to primary).
  • Detailed tracking and logging throughout
  • Dockerization.

TODO next:

  • Swapchain using multiple swap providers (1Click, Ref/Rhea, Near Fast unstake etc).
  • Ref/Rhea integration and testing (It is implemented, but not tested yet).
  • Pre-liquidation swap if needed.

This change is Reviewable

Copy link
Collaborator

@royalf00l royalf00l left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall looks good, just some minor details.

Ideally there would be some more test coverage on the liquidator as well since it's a backend service.

Also worth noting that the first next step is supporting deposits into intents and withdraws from intents. https://docs.near-intents.org/near-intents/market-makers/passive-deposit-withdrawal-service. This is necessary for liquidators who don't keep stables always deposited on Intents or want to liquidate collateral on other venues

@github-actions
Copy link

github-actions bot commented Nov 6, 2025

Name Deployment
Registry gh-283.templar-in-training.testnet
Default market default-19242841901.gh-283.templar-in-training.testnet

Installed near-sandbox into /home/runner/work/contracts/contracts/target/debug/build/near-sandbox-utils-2ad3b5a56a37a3e2/out/.near/near-sandbox-2.8.0/near-sandbox

Gas Report

Snapshot Limits

harvest_yield

Iterations Gas
0 3.5 Tgas
391 14.9 Tgas

Estimated snapshot limit: 9635

apply_interest

Iterations Gas
0 3.6 Tgas
391 13.2 Tgas

Estimated snapshot limit: 11505

Action Gas Descriptors

Action Gas
collateralize 12.5 Tgas
withdraw_collateral 9.4 Tgas
borrow 14.9 Tgas
repay 13.8 Tgas
supply 8.5 Tgas
create_supply_withdrawal_request 3.1 Tgas
execute_next_supply_withdrawal_request 11.4 Tgas

@vitaliybezz vitaliybezz requested a review from royalf00l November 6, 2025 01:31
Copy link
Collaborator

@peer2f00l peer2f00l left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just small things that can be cleaned later. LGTM.

Copy link
Collaborator

@petarvujovic98 petarvujovic98 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the new abstractions to balance and inventory management.
In general looks good, just a few nits here and there, but not blockers

@vitaliybezz vitaliybezz merged commit 62d6101 into dev Nov 10, 2025
16 of 17 checks passed
@vitaliybezz vitaliybezz deleted the feat/liquidator-intents branch November 10, 2025 19:34
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.

5 participants