Skip to Content
Future workUser experienceAccelerated deposits

Accelerated Deposits

The standard deposit flow requires a maturity wait before Gummiworm will absorb a deposit. This wait exists to ensure sufficient L1 finality before funds are credited on L2, and on Cardano it is on the order of one hour. During this time, a depositing user cannot access their funds in the L2 ledger.

Accelerated deposits allow a user to bypass this wait by swapping their pending deposit with a liquidity provider (LP) who already has funds in the L2 main compartment. The depositor receives immediate L2 credit; the LP takes over the pending deposit and waits for Gummiworm to absorb it in the normal course of consensus.

Mechanism

Accelerated deposit matching is automatic — it is handled by the L2 ledger, not by individual liquidity providers submitting transactions.

Gummiworm issues a new command to notify the L2 ledger of deposits that have newly crossed their swap start time. Upon receiving this notification, the L2 ledger:

  1. If a counterparty is available: immediately executes the swap — transferring value from the LP’s main-compartment account to the depositor’s main-compartment account, and reassigning ownership of the deposit compartment to the LP.
  2. If no counterparty is available: marks the deposit compartment as swap-eligible.

Swap-eligible deposit compartments remain available for matching. When a subsequent L2 transaction is processed that could serve as a counterparty — for example, a new limit order placed in Sugar Rush — the L2 ledger matches it against the most appropriate swap-eligible deposit compartment at that time.

When Gummiworm later absorbs the deposit via ApplyDepositDecisions, the L2 ledger credits the absorbed funds to whoever currently owns the deposit compartment — the LP if a swap occurred, or the original depositor if it did not.

Timing

To limit the LP’s exposure, a pending deposit is only eligible for a swap once Gummiworm has reasonable confidence that the deposit exists on L1. This is controlled by a new swap duration parameter.

The swap start time is defined as:

swap_start=request.validity_end+submission_duration+swap_duration\mathrm{swap\_start} = \mathrm{request.validity\_end} + \mathrm{submission\_duration} + \mathrm{swap\_duration}

The swap end time is equal to the deposit’s absorption end time. This aligns the swap expiry with the absorption expiry, so that the existing silence duration between absorption end and the refund effect’s validity start also protects swaps from happening too close to the deposit’s expiry.

A deposit is eligible for a swap if:

  1. Swap maturity. The deposit’s swap start time is no later than the block brief’s creation end time.
  2. Swap non-expiry. The deposit’s swap end time is no earlier than the competing fallback’s validity start time, mirroring the absorption non-expiry check.
  3. Not yet absorbed. The deposit has not already been absorbed.
  4. Existence. The fast-consensus leader sees the deposit on the L1 blockchain, in the same way as the absorption existence check.

The swap start time is earlier than the absorption start time, which is why the swap is useful: the LP waits for absorption while the depositor transacts immediately.

Parameter values

The swap duration must be no greater than the maturity duration, ensuring that the swap start time never exceeds the absorption start time. The suggested swap duration is 5 minutes, which should normally be enough for an L1 deposit transaction to achieve enough block confirmations after its submission deadline for an LP to be comfortable swapping for it.

Risk: Refund Address

The L1 deposit utxo datum specifies the original depositor’s address as the refund destination. If Gummiworm evacuates before absorbing the deposit, the refund transaction returns the L1 funds to the original depositor — not to the LP who already credited them on L2.

The LP’s exposure is bounded: it lasts from the moment the swap is executed until Gummiworm absorbs the deposit, a window of at most the remaining absorption duration. Given the low probability of a Gummiworm evacuation in this window, this risk is small and can be priced into the LP’s fee.

Note

A more complete solution would be to introduce a new Gummiworm effect that atomically re-creates the deposit utxo with the LP’s address as the refund destination. This would eliminate the residual risk entirely, at the cost of an additional L1 transaction per accelerated deposit. We leave this as a potential future refinement.

Sugar Rush Integration

In Sugar Rush, users can opt their limit orders into supporting accelerated deposits. These orders act as standing bridge liquidity: when a deposit becomes swap-eligible, the Sugar Rush ledger immediately matches it against an eligible order if one exists. Conversely, when an opt-in order is placed and swap-eligible deposit compartments are already waiting, the ledger matches them at that point.

This means the same liquidity that provides price discovery on the exchange also provides deposit acceleration — no separate bridge infrastructure is required, and LPs do not need to actively monitor for swap opportunities.

Last updated on