Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

IAsyncSwapAMM

Git Source

Inherits: IAsyncSwapOrder

Title: Async Swap AMM Interface

Author: Async Labs

This interface defines the functions for the Async CSMM (Constant Sum Market Maker) contract.

Functions

executeOrder

Fill an async order in an Async Swap AMM.

function executeOrder(AsyncOrder calldata order, bytes calldata fillerData)
  external
  returns (Currency currencyFill, uint256 amountOut);

Parameters

NameTypeDescription
orderAsyncOrderThe async order to be filled.
fillerDatabytesABI-encoded (address filler, uint256 amountOut).

Returns

NameTypeDescription
currencyFillCurrencyThe currency the filler must settle into the PoolManager.
amountOutuint256The amount of currencyFill to settle.

withdraw

function withdraw(PoolKey memory key, bool zeroForOne, uint256 amount, address user) external;

batch

function batch(
  AsyncOrder[] memory buys,
  AsyncOrder[] memory sells,
  bytes[] calldata buysData,
  bytes[] calldata sellsData
) external;

Structs

UserParams

Struct representing the user parameters for executing an async order.

struct UserParams {
  address user;
  address executor;
}

Properties

NameTypeDescription
useraddress
executoraddress