Skip to content

FluidDexLite ​

Git Source

Inherits:CoreInternals

Functions ​

constructor ​

solidity
constructor(address auth_, address liquidity_, address deployerContract_);

swapSingle ​

Swap through a single dex pool

Uses swapIn for positive amountSpecified (user provides input), _swapOut for negative (user receives output).

solidity
function swapSingle(
    DexKey calldata dexKey_,
    bool swap0To1_,
    int256 amountSpecified_,
    uint256 amountLimit_,
    address to_,
    bool isCallback_,
    bytes calldata callbackData_,
    bytes calldata extraData_
) external payable _reentrancyLock returns (uint256 amountUnspecified_);

Parameters

NameTypeDescription
dexKey_DexKeyThe dex pool to swap through.
swap0To1_boolWhether to swap from token0 to token1 or vice versa.
amountSpecified_int256The amount to swap (positive for exact input, negative for exact output).
amountLimit_uint256The minimum/maximum amount for the unspecified side.
to_addressThe recipient address.
isCallback_bool
callbackData_bytes
extraData_bytes

swapHop ​

Swap through a path of dex pools

Uses swapIn for positive amountSpecified (user provides input), _swapOut for negative (user receives output).

solidity
function swapHop(
    address[] calldata path_,
    DexKey[] calldata dexKeys_,
    int256 amountSpecified_,
    uint256[] calldata amountLimits_,
    TransferParams calldata transferParams_
) external payable _reentrancyLock returns (uint256 amountUnspecified_);

Parameters

NameTypeDescription
path_address[]The path of the swap.
dexKeys_DexKey[]The dex pools to swap through.
amountSpecified_int256The amount to swap (positive for exact input, negative for exact output).
amountLimits_uint256[]The minimum/maximum amount for the unspecified side for all swaps.
transferParams_TransferParamsThe parameters for the transfer.

Returns

NameTypeDescription
amountUnspecified_uint256The amount of the unspecified token.

readFromStorage ​

solidity
function readFromStorage(bytes32 slot_) external view returns (uint256 result_);

fallback ​

solidity
fallback(bytes calldata data_) external payable _reentrancyLock returns (bytes memory);

receive ​

solidity
receive() external payable;