Deloop finds where your debts cancel out

When businesses owe each other in a loop, Deloop's agent checks each invoice against the payer's ledger and one NEAR transaction clears the loop.

On NEAR testnet: 40 NEAR owed, 30 cleared in one transaction, 10 paid.

One ledger, signed twice

The shop that sent the invoice proposes the debt. The shop that owes it confirms on-chain. Then Deloop looks for loops and picks the one that clears the most.

No money moved

Maya, Liam and Sarah each owed the next 10 NEAR. One clear_cycle call took 30 NEAR of debt off all three books, and every NEAR stayed in its account.

Owed between four shops
40.00
Cleared, no transfer
− 30.00
Left to pay
10.00 NEAR

From invoice to cleared, in four steps

01Reads invoices in any layout

Six plain-text invoices, six layouts. A regex parser reads them, or an LLM with a strict schema when a key is set.

samples/invoices
4 of 6 read
  • INV-A1 · Liam bills Maya 10
  • INV-B1 · Sarah bills Liam 10
  • INV-B2 · Dara bills Liam 5
  • INV-C1 · Maya bills Sarah 10
  • INV-C2 · Dara bills Sarah 7
  • INV-D1 · Maya bills Dara 5

02Checks the payer's own ledger

Every invoice must match the payer's books to the yoctoNEAR. A mismatch is flagged and never goes on-chain.

  • SINV-C2 flaggedInvoice says 7 NEAR, Sarah's books say 5Hold
  • LINV-B2 matchedLiam's books: 5 NEAR to Dara
  • MINV-A1 matchedMaya's books: 10 NEAR to Liam

03Gets both sides to sign

The shop that is owed proposes the debt on NEAR, and only the shop that owes can confirm it.

04Pays only what is left

After clearing, each shop pays its remainder with pay_debt. Here that was two payments of 5 NEAR.

Still owed after clearing 5 debts
10 NEAR 30 NEAR vs. 40 NEAR before

One transaction clears the whole loop

clear_cycle checks that every debt is confirmed, that each creditor is the next debtor and that the ring closes. Then it lowers every debt by the same amount, or reverts and changes nothing.

Anyone may call it; only debtor-signed debts can be cleared.

It costs gas, and no NEAR changes hands.

Each run logs a NEP-297 cycle_cleared event.

Open the event on NearBlocks

Why Deloop

A shop paid late pays its own suppliers late, and one slow invoice stalls a whole street. Cancelling the loops works: Slovenia's AJPES has cleared company debt in national set-off rounds for years.1

Deloop keeps the idea and drops the paperwork.

Clears the day both sides sign

State rounds wait for a date on the calendar. Deloop clears a loop once every debt in it is confirmed.

Joined by choice

No law makes anyone take part. A shop joins because it gets its cash back sooner.

Your books stay yours

The payables ledger is checked where it lives. Only debts both sides confirmed go on-chain.

The whole ring or nothing

One NEAR transaction lowers every debt in the loop together, or reverts and changes nothing.

1 AJPES, multilateral set-off of obligations (večstranski pobot), under Slovenia's Act on the Prevention of Late Payments.

Questions

What runs today, and what comes next.

See the contract on NearBlocks

Q1Is Deloop live on mainnet?

Deloop is live on NEAR testnet today, and we plan to launch on mainnet soon. Every figure on this page comes from the testnet run on 9 November 2026.

Q2Can debts be in USDC or another token?

Once Deloop is on mainnet, a debt can be in potentially any token on any blockchain, settled through NEAR Intents. The testnet version uses native NEAR.

Q3Who holds the keys?

In the demo a local API signs for the four test shops. In production each business signs with its own wallet and the agent only proposes.

Q4What if the agent misreads an invoice?

The reading still has to match the payer's own ledger. A wrong amount or supplier is flagged and stays off-chain.

Q5Which loop is cleared first?

The one worth the most: its smallest debt times its length. Ties go to the lower debt ids, so the same debts always give the same plan.