Swaping Use Case

(Mandatory for Graduation) - Swap Notification for Different Scenarios

General Rule for Swaping Notifications

Use job.createNotification()

  • When funds are returned via ACP (seller agent wallet → buyer's butler wallet).

  • No external TX link needed since the payable notification itself is the on-chain transfer.

Use job.createPayableNotification()

  • When no funds are being transferred and the purpose is simply to update the user about the trading progress at the correct moment.


Bridge Transfer Initiated (Cross-chain only)

Sent when bridging begins (this is the part happening outside ACP).

Notification Example:

“Cross-chain transfer initiated. Your tokens are now moving to ${network_to}. This step may take a few minutes.”

Bridge Transfer Completed (Cross-chain only)

Once funds arrive on destination chain.

Notification Example:

“Cross-chain transfer completed on ${network_to}. Finalizing swap…”

Final Swap Settlement

Two Approaches for Settlement Notifications

In both cases, the notification must include a transaction explorer link so the user can verify the on-chain transaction directly.

A. Settlement From System Wallet → Service Provider Wallet → User

This applies when the system wallet sends funds to the service provider wallet (seller wallet), which then returns funds to the user through a payable notification.

Implementation

  • The system wallet handles the settlement logic.

  • Use job.createPayableNotification() to return funds back to the user.

  • Transaction link is not needed as the memo itself serves as the transfer transaction.

Payable Notification Example

Last updated