Skip to content

[executor] Multi-liquidation batcher: group same-chain opportunities into a single tx #18

@obchain

Description

@obchain

Context

When multiple Venus positions become liquidatable in the same block (common after a large oracle update), submitting them as one batched tx amortizes the base cost and wins the race against competitors submitting one-off txs.

Scope

  • Extend CharonLiquidator.sol with a batchExecuteLiquidations(LiquidationParams[] calldata) entry point, or
  • Add a sibling CharonMulticall.sol contract for batching
  • Rust side: Batcher in charon-executor/ that groups opportunities per block per chain
  • Gas cap per batch (configurable) so we don't overshoot block gas limit
  • Fall back to individual txs if any batch member fails simulation

Acceptance criteria

  • Solidity contract compiles and passes fork tests for 2- and 3-position batches
  • Rust Batcher groups by chain correctly when multiple opportunities arrive in one block
  • Batch gas estimation stays under the configured cap
  • Failed simulation on one member logs WARN and proceeds with the rest

References

  • PRD section 6c (Multi-Liquidation Batching)

Metadata

Metadata

Assignees

No one assigned

    Labels

    layer:rustRust crates (core / scanner / protocols / executor / cli)priority:p2-polishNice-to-have / polishstatus:readyScoped and ready to pick uptype:featureNew capability or deliverable

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions