Skip to main content

ICallback

Git Source

This interface should be implemented by anyone wishing to use callbacks in the swap, borrow, and borrowLiquidity functions in the IAmmalgamPair interface.

Functions

swapCall

Handles a swap call in the Ammalgam protocol.

Callback passed as calldata to swap functions in IAmmalgamPair.

function swapCall(address sender, uint256 amountXAssets, uint256 amountYAssets, bytes calldata data) external;

Parameters

NameTypeDescription
senderaddressThe address of the sender initiating the swap call.
amountXAssetsuint256The amount of token X involved in the swap.
amountYAssetsuint256The amount of token Y involved in the swap.
databytesThe calldata provided to the swap function.

borrowCall

Handles a borrow call in the Ammalgam protocol.

Callback passed as calldata to borrow and borrowLiquidity functions in IAmmalgamPair.

function borrowCall(
address sender,
uint256 amountXAssets,
uint256 amountYAssets,
uint256 amountLAssets,
bytes calldata data
) external;

Parameters

NameTypeDescription
senderaddressThe address of the sender initiating the borrow call.
amountXAssetsuint256The amount of token X involved in the borrow.
amountYAssetsuint256The amount of token Y involved in the borrow.
amountLAssetsuint256The amount of liquidity involved in the borrow.
databytesThe calldata provided to the borrow function.