For the complete documentation index, see llms.txt. This page is also available as Markdown.

ITurbineSettler

Git Source

Functions

executedSellAmounts

------------------------- EXTERNAL METHODS ------------------------- ///

Returns the cumulative executed sell amount for an order over all settlements

function executedSellAmounts(bytes32 orderHash) external view returns (uint256);

Parameters

Name
Type
Description

orderHash

bytes32

The hash of the order

Returns

Name
Type
Description

<none>

uint256

The executed sell amount

batchExecutedSellAmounts

Returns the cumulative executed sell amount for a batch of orders over all settlements

function batchExecutedSellAmounts(bytes32[] calldata orderHashes) external view returns (uint256[] memory);

Parameters

Name
Type
Description

orderHashes

bytes32[]

The hashes of the orders

Returns

Name
Type
Description

<none>

uint256[]

The executed sell amounts

renounceAdmin

Renounces the caller's admin role

Can only be called by an admin. If multiple admins exist, other admins retain their roles.

getTurbineLiquidityRouter

Returns the address of the TurbineLiquidityRouter

Return type is address to avoid unnecessary imports

Returns

Name
Type
Description

<none>

address

The address of the TurbineLiquidityRouter

getTurbineHook

Returns the address of the TurbineHook (via the TurbineLiquidityRouter)

Return type is address to avoid unnecessary imports

Returns

Name
Type
Description

<none>

address

The address of the TurbineHook

turbineSigner

Returns the address of the Turbine signer

Returns

Name
Type
Description

<none>

address

The address authorized to submit settlements

executeLiquidityActionsAndSettlement

Executes liquidity actions and a batch settlement

Parameters

Name
Type
Description

addLiquidityActions

AddLiquidityAppliedAction[]

The liquidity actions to add liquidity

removeLiquidityOffchainActions

RemoveLiquidityAppliedAction[]

The offchain-applied liquidity actions to remove liquidity

removeLiquidityOnchainActions

RemoveLiquidityIntentHash[]

Intent hashes for onchain liquidity removals

settlement

BatchSettlement

The settlement to execute

targetBlockNumber

uint256

The block number at which the settlement is valid

batchId

uint256

The unique identifier for this settlement batch

feeWithdrawer

Returns the address of the fee withdrawer

Returns

Name
Type
Description

<none>

address

The address authorized to withdraw fees

updateFeeWithdrawer

Updates the fee withdrawer address

Only callable by the admin

Parameters

Name
Type
Description

newFeeWithdrawer

address

The new fee withdrawer address

sweepFees

Sweeps all available balance of specified tokens to a specified recipient

Only callable by the fee withdrawer

Parameters

Name
Type
Description

tokens

address[]

The addresses of the tokens to sweep

to

address

The address to send the swept fees to

Events

TurbineSignerSet

------------------------- EVENTS ------------------------- ///

Emitted when the Turbine signer is set during construction

Parameters

Name
Type
Description

signer

address

The address of the Turbine signer (immutable after deployment)

TurbineSettlement

Emitted when a Turbine settlement is executed

Parameters

Name
Type
Description

batchId

uint256

The unique identifier for this settlement batch

OrderSettled

Emitted when an order is settled

Parameters

Name
Type
Description

owner

address

The owner of the settled order

orderHash

bytes32

The hash of the settled order

sellToken

address

buyToken

address

sellAmount

uint256

The amount of sell token

buyAmount

uint256

The amount of buy token

SmartOrderSettled

Emitted when a smart order is executed

Parameters

Name
Type
Description

smartOrderTarget

address

The contract that executed the calldata

orderHash

bytes32

The hash of this smart order. In case of pool swaps, this hash is zero.

sellToken

address

The sell token

buyToken

address

The buy token

expectedSellAmount

uint256

The amount of sell token we expect from this order

receivedSellAmount

uint256

The amount of sell token we received from this order

buyAmount

uint256

The amount of buy token

DEXSwapExecuted

Emitted when a DEX swap has been executed (typically via a Smart Order Router / aggregator).

Parameters

Name
Type
Description

target

address

The target contract used to execute the swap (router/aggregator/exchange).

sellToken

address

The token address being sold.

buyToken

address

The token address being purchased.

expectedSellAmount

uint256

The expected amount of sellToken to be sold.

receivedSellAmount

uint256

The actual amount of sellToken sold by the pool/received by the settler.

buyAmount

uint256

The amount of buyToken received from the swap.

TurbinePoolSwapExecuted

Emitted when a Turbine pool execution occurs

Parameters

Name
Type
Description

poolToken0

address

The address of token0 in the executed pool

poolToken1

address

The address of token1 in the executed pool

poolFee

uint24

The fee tier of the executed pool

zeroForOne

bool

Direction of the swap, true if swapping token0 for token1

amountIn

uint256

Input token amount

amountOut

uint256

Output token amount

FeeWithdrawerUpdated

Emitted when the fee withdrawer is updated

Parameters

Name
Type
Description

previous

address

The previous fee withdrawer address

newFeeWithdrawer

address

The new fee withdrawer address

FeesSwept

Emitted when protocol fees are swept

Parameters

Name
Type
Description

tokens

address[]

The addresses of the tokens swept

recipient

address

The address receiving the fees

Errors

OnlyTurbineSigner

------------------------- ERRORS ------------------------- ///

Only the turbine signer can call this function

OnlyFeeWithdrawer

Only the fee withdrawer can call this function

InsufficientTokensReceived

Insufficient amount of tokens received by the ITurbineSettler

Parameters

Name
Type
Description

expected

uint256

The expected amount

actual

uint256

The actual amount, smaller value than expected

InvalidCalldataTarget

Invalid calldata target. The calldata target cannot be the ITurbineSettler or the ITurbineLiquidityRouter.

Parameters

Name
Type
Description

calldataTarget

address

The calldata target

ExcessiveTokensDistributed

More than expected amount of tokens sent out from the ITurbineSettler

Parameters

Name
Type
Description

expected

uint256

The expected amount

actual

uint256

The actual amount, larger value than expected

InvalidBlockNumber

Current block number is not the target block number

InsufficientBuyTokenBalance

There is not enough buy token balance to pay out users

ZeroAddress

Zero address provided where not allowed

RouterNotSet

TurbineLiquidityRouter must be set before renouncing admin

MissingAllowance

The allowance for a limit order is missing, and the onchain allowance is not enough to fulfill the order.

Last updated

Was this helpful?