Skip to main content
The API does not explicitly indicate that the amount has changed beyond an acceptable threshold. It always returns the latest calculated amount, and it is the integrator’s responsibility to detect significant changes and request user confirmation.

Key responsibility of the integrator

When performing a swap, the integrator must:
  • store the output amount returned by quote
  • compare it with the output amount returned by swap
  • detect significant deviations
  • explicitly confirm the new amount with the user
  • send a new swap request only after user approval
Automatic execution without user confirmation is not recommended when the amount changes significantly.

Why amount changes happen

Because of this, the amount returned by swap should always be treated as final and authoritative. Rubic recommends using a ±0.5% deviation threshold. If the new amount exceeds this range compared to the quoted amount, the integrator should pause execution and request user confirmation.

Amount comparison example

The following example checks whether the new amount differs from the quoted amount by more than 0.5%.

Handling amount change on the client

When an amount change is detected, the integrator should pause execution and notify the user.

Example handling logic

User confirmation UI

The integrator may choose any UI approach, as long as the confirmation is explicit.

Common UI patterns

  • confirmation modal
  • inline warning with accept / cancel buttons
  • full-screen confirmation step (mobile)

Important notes

  • The API does not signal that the amount change is significant
  • The integrator must perform the comparison manually
  • Users must explicitly approve any significant change
  • A new swap request is required after confirmation
  • Silent or automatic acceptance is strongly discouraged