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

ProvisionerV2

Inherits: IProvisionerV2, Auth2Step, ReentrancyGuardTransient

Entry and exit point for {MultiDepositorVault}. Handles all deposits and redemptions Uses {IPriceAndFeeCalculator} to convert between tokens and vault units. Supports both sync and async deposits; only async redeems. Manages deposit caps, refund timeouts, and request replay protection. All assets must flow through this contract to enter or exit the vault. Sync deposits are processed instantly, but stay refundable for a period of time. Async requests can either be solved by authorized solvers, going through the vault, or directly by anyone willing to pay units (for deposits) or tokens (for redeems), pocketing the solver tip, always paid in tokens

Constants

RELEVANT_AMOUNT_SLOT

ERC7201-compliant transient storage slot for the relevant amount

Equal to keccak256(abi.encode(uint256(keccak256(“aera.provisioner.relevantAmount”)) - 1)) & ~bytes32(uint256(0xff))

bytes32 internal constant RELEVANT_AMOUNT_SLOT = 0x35763d55300b221a73cb498654a5b850852575e97ef00a6947ad36dc59da0d00

PRICE_FEE_CALCULATOR

The price and fee calculator contract

IPriceAndFeeCalculatorV2 public immutable PRICE_FEE_CALCULATOR

MULTI_DEPOSITOR_VAULT

The multi depositor vault contract

address public immutable MULTI_DEPOSITOR_VAULT

SOLVING_GATE_ENABLED

Whether this provisioner supports solving status gating

bool public immutable SOLVING_GATE_ENABLED

State Variables

tokensDetails

Mapping of token to token details

depositCap

Maximum total value of deposits in numeraire terms

depositRefundTimeout

Time period in seconds during which sync deposits can be refunded

syncDepositHashes

Mapping of active sync deposit hashes

True if a sync deposit is active with the hashed parameters

asyncRequestHashes

Mapping of async request hash to its existence (deposits and redeems share one domain)

True if request exists, false if it was refunded or solved Collision between deposit and redeem hashes is impossible because the hash includes RequestType

userUnitsRefundableUntil

Mapping of user address to timestamp until which their units are locked

_syncRedeemMaxPriceAge

Maximum allowed vault price age for sync redeems (seconds)

_syncRedeemRelativeCapBps

Relative cap in bps of epoch-start vault value for sync redeems

_syncRedeemMaxDynamicPremiumBps

Maximum global dynamic premium in bps for sync redeems

_syncRedeemEpochTimestamp

Timestamp of the current sync redeem epoch (from PFC vault state)

_syncRedeemAbsoluteCapNumeraire

Absolute cap in numeraire per epoch for sync redeems

_syncRedeemEpochRedeemedNumeraire

Numeraire amount redeemed globally so far in the current sync redeem epoch

_depositCancellationsEnabled

Whether user-initiated deposit request cancellations are enabled

_redeemCancellationsEnabled

Whether user-initiated redeem request cancellations are enabled

_redeemCancellationCapNumeraire

Maximum redeem request size eligible for user self-cancellation, in numeraire

_depositCancellationFeeNumeraire

Fixed deposit cancellation fee for self-cancels before deadline, in numeraire

_redeemCancellationFeeNumeraire

Fixed redeem cancellation fee for self-cancels before deadline, in numeraire

_redeemCancellationDynamicFeeCapNumeraire

Dynamic redeem cancellation fee cap for self-cancels before deadline, in numeraire

depositReceiverApprovals

Whether a receiver has approved a depositor to deposit on their behalf

solvingGate

Returns the current solving gate address

Functions

anyoneButVault

Ensures the caller is not the vault

solvingNotPaused

Reverts if the solving gate is set and reports that solving is paused

Parameters

Name
Type
Description

token

IERC20

The ERC20 token being solved

constructor

deposit

Deposit tokens directly into the vault

Caller must be the receiver or approved by the receiver via {setDepositReceiverApproval}

Parameters

Name
Type
Description

token

IERC20

The token to deposit

tokensIn

uint256

The amount of tokens to deposit

minUnitsOut

uint256

The minimum amount of units expected

receiver

address

The address that receives units

Returns

Name
Type
Description

unitsOut

uint256

The amount of shares minted to the receiver

mint

Mint exact amount of units by depositing required tokens

Caller must be the receiver or approved by the receiver via {setDepositReceiverApproval}

Parameters

Name
Type
Description

token

IERC20

The token to deposit

unitsOut

uint256

The exact amount of units to mint

maxTokensIn

uint256

Maximum amount of tokens willing to deposit

receiver

address

The address that receives units

Returns

Name
Type
Description

tokensIn

uint256

The amount of tokens used to mint the requested shares

refundDeposit

Refund a deposit within the refund period

Parameters

Name
Type
Description

sender

address

The original depositor

receiver

address

The address whose units are reclaimed

token

IERC20

The deposited token

tokenAmount

uint256

The amount of tokens deposited

unitsAmount

uint256

The amount of units minted

refundableUntil

uint256

Timestamp until which refund is possible

requestDeposit

Create a new deposit request to be solved by solvers

Parameters

Name
Type
Description

token

IERC20

The token to deposit

tokensIn

uint256

The amount of tokens to deposit

minUnitsOut

uint256

The minimum amount of units expected

solverTip

uint256

The tip offered to the solver

deadline

uint256

Timestamp until which the request is valid

maxPriceAge

uint256

Maximum age of price data that solver can use

isFixedPrice

bool

Whether the request is a fixed price request

Returns

Name
Type
Description

depositHash

bytes32

requestHash The hash identifying the created request

requestRedeem

Create a new redeem request to be solved by solvers

Parameters

Name
Type
Description

token

IERC20

The token to receive

unitsIn

uint256

The amount of units to redeem

minTokensOut

uint256

The minimum amount of tokens expected

solverTip

uint256

The tip offered to the solver

deadline

uint256

Timestamp until which the request is valid

maxPriceAge

uint256

Maximum age of price data that solver can use

isFixedPrice

bool

Whether the request is a fixed price request

Returns

Name
Type
Description

redeemHash

bytes32

requestHash The hash identifying the created request

refundRequest

Refund an expired deposit or redeem request

Parameters

Name
Type
Description

token

IERC20

The token involved in the request

request

RequestV2

The request to refund

cancelRequest

Cancel an async deposit or redeem request

Parameters

Name
Type
Description

token

IERC20

The token involved in the request

request

RequestV2

The request to cancel

solveRequestsVault

Solve multiple requests using vault’s liquidity, with optional pre/post-solve guardian submissions for automatic fund movement

MUST revert if preSolveSubmitData is non-empty and vault.submit reverts

Parameters

Name
Type
Description

token

IERC20

The token for which to solve requests

requests

RequestV2[]

Array of requests to solve

preSolveSubmitData

bytes

Encoded operations to submit before solving (e.g., pull funds from yield source). If non-empty, calls vault.submit and reverts if it fails If empty, skipped

postSolveSubmitData

bytes

Encoded operations to submit after solving (e.g., push funds to yield source). If non-empty, calls vault.submit via try/catch - failures are swallowed. If empty, skipped

solveRequestsDirect

Solve multiple requests using solver’s own liquidity

Does not check the solving gate because direct solves are peer-to-peer and never touch the vault’s enter/exit flow, so they have no impact on underlying fund accounting The PFC vault-pause check still applies as the full-freeze mechanism

Parameters

Name
Type
Description

token

IERC20

The token for which to solve requests

requests

RequestV2[]

Array of requests to solve

setDepositDetails

Update deposit parameters

Parameters

Name
Type
Description

depositCap_

uint224

New maximum total value that can be deposited

depositRefundTimeout_

uint32

New time window for deposit refunds

setCancellationDetails

Sets cancellation toggles and enabled-side fee configuration

If a deposit/redeem cancellation is disabled, params related to it must be 0

Parameters

Name
Type
Description

depositCancellationsEnabled

bool

Whether user-initiated deposit requests can be cancelled

redeemCancellationsEnabled

bool

Whether user-initiated redeem requests can be cancelled

depositCancellationFeeNumeraire

uint80

Fixed deposit cancellation fee, in numeraire

redeemCancellationFeeNumeraire

uint80

Fixed redeem cancellation fee, in numeraire

redeemCancellationDynamicFeeCapNumeraire

uint80

Dynamic redeem cancellation fee cap, in numeraire

redeemCancellationCapNumeraire

uint80

Maximum redeem request size users can self-cancel, in numeraire

setTokenDetails

Update token parameters including push/pull funds SSTORE2 pointers

Admin must create SSTORE2 pointers externally before calling this function

Parameters

Name
Type
Description

token

IERC20

The token to update

details

TokenDetailsV2

The full token details struct. pushFundsSubmitDataPointer and pullFundsSubmitDataPointer must be valid SSTORE2 pointers or address(0) to disable

removeToken

Removes token from provisioner

Parameters

Name
Type
Description

token

IERC20

The token to be removed

setSyncRedeemDetails

Sets global sync redeem risk parameters

Only callable by authorized addresses. All parameters must be non-zero

Parameters

Name
Type
Description

maxPriceAge

uint24

Maximum allowed vault price age (seconds)

relativeCapBps

uint16

Relative cap in bps of epoch-start TVL (numeraire)

absoluteCapNumeraire

uint80

Absolute cap in numeraire per epoch

maxDynamicPremiumBps

uint16

Maximum global dynamic premium in bps

setDepositReceiverApproval

Approve or revoke a depositor’s permission to deposit on behalf of the caller

Parameters

Name
Type
Description

depositor

address

The address to approve or revoke

approved

bool

Whether the depositor is approved to deposit to the caller

setSolvingGate

Sets the solving gate contract that controls when solving is allowed

MUST only be callable by authorized addresses

Parameters

Name
Type
Description

solvingGate_

address

The new solving gate address. Use address(0) to disable gating (solving always open)

redeem

Synchronously redeem units for tokens using latest active price

Sync redeem must be enabled for token, vault must be active, and price must be fresh

Parameters

Name
Type
Description

token

IERC20

Token to receive

unitsIn

uint256

Units to redeem

minTokensOut

uint256

Minimum acceptable token output

receiver

address

Address receiving output tokens

Returns

Name
Type
Description

tokensOut

uint256

Actual token amount sent to receiver

withdraw

Synchronously withdraw exact tokens using latest active price

Sync redeem must be enabled for token, vault must be active, and price must be fresh

Parameters

Name
Type
Description

token

IERC20

Token to receive

tokensOut

uint256

Exact token output requested

maxUnitsIn

uint256

Maximum acceptable units to burn

receiver

address

Address receiving output tokens

Returns

Name
Type
Description

unitsIn

uint256

Actual units burned

getSyncRedeemEpochState

Returns current global sync redeem epoch state

MUST NOT revert; returns view-consistent epoch state (if PFC is paused, returns zero TVL and zero cap for the current epoch) (if PFC timestamp differs from stored, shows fresh epoch with 0 redeemed)

Returns

Name
Type
Description

epochTimestamp

uint256

Current anchor epoch timestamp from PFC

epochStartTvlNumeraire

uint256

Epoch-start TVL in numeraire

epochRedeemedNumeraire

uint256

Numeraire amount redeemed globally so far in current epoch

epochCapNumeraire

uint256

Effective current epoch cap in numeraire

getSyncRedeemDetails

Returns all sync redeem configuration and epoch state

Returns

Name
Type
Description

<none>

uint24

maxPriceAge Maximum allowed vault price age for sync redeems (seconds)

<none>

uint16

relativeCapBps Relative cap in bps of epoch-start TVL for sync redeems

<none>

uint16

maxDynamicPremiumBps Maximum global dynamic premium in bps for sync redeems

<none>

uint32

epochTimestamp Timestamp of the current sync redeem epoch (from PFC vault state)

<none>

uint80

absoluteCapNumeraire Absolute cap in numeraire per epoch for sync redeems

<none>

uint80

epochRedeemedNumeraire Numeraire amount redeemed globally so far in the current sync redeem epoch

getRelevantAmount

Read an amount relevant for current submit operation from transient storage

Returns

Name
Type
Description

<none>

uint256

The stored amount

maxDeposit

Return maximum amount that can still be deposited

Returns

Name
Type
Description

<none>

uint256

Amount of deposit capacity remaining

previewCancellationFeeNumeraire

Preview the cancellation fee for a request in numeraire terms

No guard checks (enable flags, cap, deadline) — those revert in cancelRequest

Parameters

Name
Type
Description

request

RequestV2

The request to preview the cancellation fee for

Returns

Name
Type
Description

<none>

uint256

The cancellation fee in numeraire

getCancellationDetails

Returns cancellation toggles and fee configuration

Returns

Name
Type
Description

<none>

bool

depositCancellationsEnabled Whether user-initiated deposit request cancellations are enabled

<none>

bool

redeemCancellationsEnabled Whether user-initiated redeem request cancellations are enabled

<none>

uint80

depositCancellationFeeNumeraire Fixed deposit cancellation fee, in numeraire

<none>

uint80

redeemCancellationFeeNumeraire Fixed redeem cancellation fee, in numeraire

<none>

uint80

redeemCancellationDynamicFeeCapNumeraire Dynamic redeem cancellation fee cap, in numeraire

<none>

uint80

redeemCancellationCapNumeraire Maximum redeem request size users can self-cancel, in numeraire

areUserUnitsLocked

Check if a user’s units are currently locked

Parameters

Name
Type
Description

user

address

The address to check

Returns

Name
Type
Description

<none>

bool

True if user’s units are locked, false otherwise

getDepositHash

Computes the hash for a sync deposit

Parameters

Name
Type
Description

user

address

The address making the deposit

receiver

address

The address receiving units from the deposit

token

IERC20

The token being deposited

tokenAmount

uint256

The amount of tokens to deposit

unitsAmount

uint256

Minimum amount of units to receive

refundableUntil

uint256

The timestamp until which the deposit is refundable

Returns

Name
Type
Description

<none>

bytes32

The hash of the deposit

getRequestHash

Computes the hash for a request

Parameters

Name
Type
Description

token

IERC20

The token in the request

request

RequestV2

The request to hash

Returns

Name
Type
Description

<none>

bytes32

The hash of the request

version

Returns the semantic version string for this contract surface

Returns

Name
Type
Description

<none>

string

The semantic version string

requestDeposit

Create a new deposit request to be solved by solvers

Parameters

Name
Type
Description

token

IERC20

The token to deposit

tokensIn

uint256

The amount of tokens to deposit

minUnitsOut

uint256

The minimum amount of units expected

solverTip

uint256

The tip offered to the solver

deadline

uint256

Timestamp until which the request is valid

maxPriceAge

uint256

Maximum age of price data that solver can use

isFixedPrice

bool

Whether the request is a fixed price request

receiver

address

The address that receives units when solved

Returns

Name
Type
Description

depositHash

bytes32

depositRequestHash The hash of the deposit request

requestRedeem

Create a new redeem request to be solved by solvers

Parameters

Name
Type
Description

token

IERC20

The token to receive

unitsIn

uint256

The amount of units to redeem

minTokensOut

uint256

The minimum amount of tokens expected

solverTip

uint256

The tip offered to the solver

deadline

uint256

Timestamp until which the request is valid

maxPriceAge

uint256

Maximum age of price data that solver can use

isFixedPrice

bool

Whether the request is a fixed price request

receiver

address

The address that receives tokens when solved

Returns

Name
Type
Description

redeemHash

bytes32

redeemRequestHash The hash of the redeem request

_solveRequestsVault

Internal solve logic shared by both solveRequestsVault overloads

Parameters

Name
Type
Description

token

IERC20

The token for which to solve requests

requests

RequestV2[]

Array of requests to solve

_pullFundsIfNeeded

Pull funds from yield source if vault idle balance is insufficient

Parameters

Name
Type
Description

token

IERC20

The redeem token

tokensOut

uint256

The amount of tokens needed for the redeem

_pushFundsIfConfigured

Push deposited funds to yield source if configured

Parameters

Name
Type
Description

tokenDetails

TokenDetailsV2

The token details storage reference

tokensIn

uint256

The amount of tokens deposited

_storeAmount

Store a uint256 amount in transient storage

Parameters

Name
Type
Description

amount

uint256

The amount to store

_syncDeposit

Handles a synchronous deposit, records the deposit hash, and enters the vault

Reverts if the deposit hash already exists. Sets the refundable period for the user

Parameters

Name
Type
Description

token

IERC20

The ERC20 token to deposit

tokenAmount

uint256

The amount of tokens to deposit

unitAmount

uint256

The amount of vault units to mint for the user

receiver

address

The address receiving the minted units

_syncRedeem

Executes a synchronous redeem: rolls epoch, checks epoch cap, exits vault, and emits event

Parameters

Name
Type
Description

token

IERC20

The ERC20 token to receive

tokensOut

uint256

The amount of tokens to send to the receiver

unitsIn

uint256

The amount of vault units to burn from the caller

receiver

address

The address to receive the tokens

epochRedeemNumeraire

uint256

The pre-computed numeraire value of this redeem for epoch cap accounting

priceTimestamp

uint256

The PFC anchor timestamp captured in _prepareSyncRedeem (used for epoch rollover)

_solveDepositVaultAutoPrice

Solves an async deposit request for the vault, transferring tokens or refunding as needed

  • Returns 0 if any of:

  • price age is too high, emits PriceAgeExceeded

  • request hash is not set, emits InvalidRequestHash

  • units out is less than min required, emits AmountBoundExceeded

  • deposit cap would be exceeded, emits DepositCapExceeded

  • If deadline not passed, processes deposit and emits DepositSolved

  • If deadline passed, refunds and emits DepositRefunded

  • Always unsets hash after processing

Parameters

Name
Type
Description

token

IERC20

The ERC20 token being deposited

depositMultiplier

uint256

The multiplier (in BPS) applied to the deposit for premium calculation

request

RequestV2

The deposit request struct containing all user parameters

priceAge

uint256

The age of the price data used for conversion

index

uint256

The index of the request in the given solving batch

Returns

Name
Type
Description

solverTip

uint256

The tip amount paid to the solver, or 0 if not processed

_solveDepositVaultFixedPrice

Solves a fixed price deposit request for the vault, transferring tokens or refunding as needed

User gets exactly min units out, but may over‑fund, the difference is paid to the solver as a tip

  • Returns 0 if any of:

  • price age is too high, emits PriceAgeExceeded

  • request hash is not set, emits InvalidRequestHash

  • tokens needed exceed the maximum allowed, emits AmountBoundExceeded

  • deposit cap would be exceeded, emits DepositCapExceeded

  • If deadline not passed, processes deposit and emits DepositSolved

  • If deadline passed, refunds and emits DepositRefunded

  • Always unsets hash after processing

Parameters

Name
Type
Description

token

IERC20

The ERC20 token being deposited

depositMultiplier

uint256

The multiplier (in BPS) applied to the deposit for premium calculation

request

RequestV2

The deposit request struct containing all user parameters

priceAge

uint256

The age of the price data used for conversion

index

uint256

The index of the request in the given solving batch

Returns

Name
Type
Description

solverTip

uint256

The tip amount paid to the solver, or 0 if not processed

_solveRedeemVaultAutoPrice

Solves an async redeem request for the vault, transferring tokens or refunding as needed

  • Returns 0 if any of:

  • price age is too high, emits PriceAgeExceeded

  • request hash is not set, emits InvalidRequestHash

  • token out after premium is less than min required, emits AmountBoundExceeded

  • If deadline not passed, processes redeem and emits RedeemSolved

  • If deadline passed, refunds and emits RedeemRefunded

  • Always unsets hash after processing

Parameters

Name
Type
Description

token

IERC20

The ERC20 token being redeemed

redeemMultiplier

uint256

The multiplier (in BPS) applied to the redeem for premium calculation

request

RequestV2

The redeem request struct containing all user parameters

priceAge

uint256

The age of the price data used for conversion

index

uint256

The index of the request in the given solving batch

Returns

Name
Type
Description

solverTip

uint256

The tip amount paid to the solver, or 0 if not processed

_solveRedeemVaultFixedPrice

Solves a fixed price redeem request for the vault, transferring tokens or refunding as needed

User gets exactly min tokens out, but may under‑fund, the difference is paid to the solver as a tip

  • Returns 0 if any of:

  • price age is too high, emits PriceAgeExceeded

  • request hash is not set, emits InvalidRequestHash

  • If deadline not passed, processes redeem and emits RedeemSolved

  • If deadline passed, refunds and emits RedeemRefunded

  • Always unsets hash after processing

Parameters

Name
Type
Description

token

IERC20

The ERC20 token being redeemed

redeemMultiplier

uint256

The multiplier (in BPS) applied to the redeem for premium calculation

request

RequestV2

The redeem request struct containing all user parameters

priceAge

uint256

The age of the price data used for conversion

index

uint256

The index of the request in the given solving batch

Returns

Name
Type
Description

solverTip

uint256

The tip amount paid to the solver, or 0 if not processed

_solveRequestDirect

Solves a direct request (deposit or redeem), transferring tokens and units between users

  • Returns early if request hash is not set, emits InvalidRequestHash

  • If deadline not passed, transfers units and tokens, emits DepositSolved/RedeemSolved

  • If deadline passed, refunds escrowed asset, emits DepositRefunded/RedeemRefunded

  • Always unsets hash after processing

Parameters

Name
Type
Description

token

IERC20

The ERC20 token involved in the request

request

RequestV2

The request struct containing all user parameters

_clearHashAndTransferRefund

Clears request hash, emits refund event, and transfers amount with requester fallback

Parameters

Name
Type
Description

token

IERC20

The token used to derive the request hash

request

RequestV2

The request to clear

requester

address

The fallback recipient when transfer to request.receiver fails

amount

uint256

The amount to transfer to the receiver (or requester on fallback)

transferToken

IERC20

The token to transfer (deposit token for deposits, vault units for redeems)

_transferWithFallback

Transfers amount to receiver and falls back to requester if receiver transfer fails

Parameters

Name
Type
Description

token

IERC20

The ERC20 token being transferred

requester

address

The original requester address used as fallback receiver

receiver

address

The intended receiver from the request

amount

uint256

The amount of tokens to transfer

_guardPriceAge

Checks if the price age exceeds the maximum allowed and emits an event if so

Parameters

Name
Type
Description

priceAge

uint256

The difference between when price was measured and submitted onchain

maxPriceAge

uint256

The maximum allowed price age

index

uint256

The index of the request in the given solving batch

Returns

Name
Type
Description

<none>

bool

True if price age is too high, false otherwise

_guardInvalidRequestHash

Checks if the request hash exists and emits an event if not

Parameters

Name
Type
Description

requestHash

bytes32

The request hash

Returns

Name
Type
Description

<none>

bool

True if hash does not exist, false otherwise

_guardInsufficientTokensForTip

Checks if there are enough tokens for the solver tip and emits an event if not

Parameters

Name
Type
Description

tokens

uint256

The number of tokens

solverTip

uint256

The solver tip amount

index

uint256

The index of the request in the given solving batch

Returns

Name
Type
Description

<none>

bool

True if not enough tokens for tip, false otherwise

_guardAmountBound

Checks if the amount is less than the bound and emits an event if so

Parameters

Name
Type
Description

amount

uint256

The actual amount

bound

uint256

The minimum required amount

index

uint256

The index of the request in the given solving batch

Returns

Name
Type
Description

<none>

bool

True if amount is less than bound, false otherwise

_guardDepositCapExceeded

Checks if the deposit cap would be exceeded and emits an event if so

Parameters

Name
Type
Description

totalUnits

uint256

The total units after deposit

index

uint256

The index of the request in the given solving batch

Returns

Name
Type
Description

<none>

bool

True if deposit cap would be exceeded, false otherwise

_rollEpochIfNeeded

Rolls the sync redeem epoch if the PFC timestamp has changed

Parameters

Name
Type
Description

pfcTimestamp

uint256

The current PFC vault state timestamp

Returns

Name
Type
Description

epochRedeemedNumeraire_

uint256

The epoch redeemed numeraire after potential roll (avoids subsequent SSLOADs)

_requireEpochCapNotExceeded

Checks that the sync redeem epoch cap is not exceeded and tracks the redemption

Parameters

Name
Type
Description

epochRedeemNumeraire

uint256

The pre-computed numeraire value of this redeem for epoch cap accounting

epochCapNumeraire

uint256

The effective epoch cap in numeraire

epochRedeemedNumeraire

uint256

The numeraire already redeemed in the current epoch (cached from _rollEpochIfNeeded)

_requireValidReceiver

Reverts if the caller is not the receiver and the receiver has not approved the caller

Parameters

Name
Type
Description

receiver

address

The address to validate

_checkSolvingNotPaused

Reverts if the solving gate is set and reports that solving is paused

Parameters

Name
Type
Description

token

IERC20

The ERC20 token being solved

_checkCallerNotVault

Reverts if the caller is the vault

_validateRequest

Validates common request parameters shared by requestDeposit and requestRedeem

Parameters

Name
Type
Description

receiver

address

The address receiving funds when request is solved

solverTip

uint256

The tip offered to the solver

deadline

uint256

Timestamp until which the request is valid

isFixedPrice

bool

Whether the request is a fixed price request

_computeDepositCancellationFeeTokens

Computes the pre-deadline deposit cancellation fee in request token terms

Oracle quoting floors and does not support rounding control, so a non-zero numeraire fee can round to zero request tokens for low-value cancellation fees

Parameters

Name
Type
Description

token

IERC20

Request token

Returns

Name
Type
Description

feeTokens

uint256

Fee amount in request token terms

_computeRedeemCancellationFeeNumeraire

Computes the pre-deadline redeem cancellation fee in numeraire

Parameters

Name
Type
Description

requestNumeraire

uint256

Redeem request size in numeraire

Returns

Name
Type
Description

feeNumeraire

uint256

Fee amount in numeraire

_computeRedeemCancellationFeeUnits

Computes the pre-deadline redeem cancellation fee in escrowed vault units

Parameters

Name
Type
Description

requestNumeraire

uint256

Redeem request size in numeraire

Returns

Name
Type
Description

feeUnits

uint256

Fee amount in units

_requireSyncDepositsEnabled

Reverts if sync deposits are not enabled for the token

Parameters

Name
Type
Description

token

IERC20

The ERC20 token to check

Returns

Name
Type
Description

tokenDetails

TokenDetailsV2

The token details storage reference

_requireSyncRedeemsEnabled

Reverts if sync redeems are not enabled for the token

Parameters

Name
Type
Description

token

IERC20

The ERC20 token to check

Returns

Name
Type
Description

tokenDetails

TokenDetailsV2

The token details storage reference

_requireDepositCapNotExceeded

Reverts if deposit cap would be exceeded by adding units

Parameters

Name
Type
Description

units

uint256

The number of units to add

_isDepositCapExceeded

Checks if deposit cap would be exceeded by adding units

Parameters

Name
Type
Description

units

uint256

The number of units to add

Returns

Name
Type
Description

<none>

bool

True if deposit cap would be exceeded, false otherwise

_tokensToUnitsFloorIfActive

Converts token amount to units, applying multiplier and flooring

Parameters

Name
Type
Description

token

IERC20

The ERC20 token

tokens

uint256

The amount of tokens

multiplier

uint256

The multiplier to apply

Returns

Name
Type
Description

<none>

uint256

The resulting units (floored)

_tokensToUnitsCeilIfActive

Converts token amount to units, reversing multiplier and ceiling

Parameters

Name
Type
Description

token

IERC20

The ERC20 token

tokens

uint256

The amount of tokens

multiplier

uint256

The multiplier to reverse

Returns

Name
Type
Description

<none>

uint256

The resulting units (ceiled)

_unitsToTokensFloorIfActive

Converts units to token amount, applying multiplier and flooring

Parameters

Name
Type
Description

token

IERC20

The ERC20 token

units

uint256

The amount of units

multiplier

uint256

The multiplier to apply

Returns

Name
Type
Description

<none>

uint256

The resulting token amount (floored)

_unitsToTokensCeilIfActive

Converts units to token amount, applying multiplier and ceiling

Parameters

Name
Type
Description

token

IERC20

The ERC20 token

units

uint256

The amount of units

multiplier

uint256

The multiplier to apply

Returns

Name
Type
Description

<none>

uint256

The resulting token amount (ceiled)

_computeEpochCap

Computes the effective epoch cap in numeraire

Returns

Name
Type
Description

epochCapNumeraire

uint256

The effective epoch cap (min of relative and absolute)

epochStartTvlNumeraire

uint256

The epoch-start TVL in numeraire

_computeDynamicPremiumBps

Computes the global dynamic redeem premium in bps based on price staleness

Returns 0 when maxDynamicPremiumBps is 0 (dynamic premium disabled) Callers enforce priceAge <= syncRedeemMaxPriceAge via require, so dynamicPremiumBps <= maxDynamic Division safety: syncRedeemMaxPriceAge > 0 is enforced by setSyncRedeemDetails

Parameters

Name
Type
Description

priceAge

uint256

The current price age in seconds

Returns

Name
Type
Description

dynamicPremiumBps

uint256

The computed dynamic premium in bps

_prepareSyncRedeem

Fetches the anchor timestamp, validates price age, and derives the effective multiplier

Parameters

Name
Type
Description

syncRedeemMultiplier

uint256

The base sync redeem multiplier for the token (in BPS)

Returns

Name
Type
Description

effectiveMultiplier

uint256

The multiplier after dynamic premium adjustment

priceTimestamp

uint256

The PFC anchor timestamp (consumed downstream for epoch rollover)

_getRequestType

Returns the request type based on whether the request is a deposit or redeem and fixed or auto price

Parameters

Name
Type
Description

isFixedPrice

bool

Whether the request is a fixed price request

isDeposit

bool

Whether the request is a deposit (true) or redeem (false)

Returns

Name
Type
Description

<none>

RequestType

The computed request type

_requireValidMultiplier

Reverts if a multiplier is outside [MIN_MULTIPLIER, ONE_IN_BPS]

Parameters

Name
Type
Description

multiplier

uint256

The multiplier to validate

_validateNonZeroAmounts

Reverts if either the units or tokens amount is zero

Parameters

Name
Type
Description

units

uint256

The units amount to validate

tokens

uint256

The tokens amount to validate

_getDepositHash

Get the hash of a deposit

Since refundableUntil is block.timestamp + depositRefundTimeout (which is subject to change), it’s theoretically possible to have a hash collision, but the probability is negligible and we optimize for the common case

Parameters

Name
Type
Description

sender

address

The user who made the deposit

receiver

address

The user that receives units from the deposit

token

IERC20

The token that was deposited

tokenAmount

uint256

The amount of tokens deposited

unitsAmount

uint256

The amount of units received

refundableUntil

uint256

The timestamp at which the deposit can be refunded

Returns

Name
Type
Description

<none>

bytes32

The hash of the deposit

_getRequestHashParams

Get the hash of a request from parameters

Parameters

Name
Type
Description

token

IERC20

The token that was deposited or redeemed

user

address

The user who made the request

receiver

address

The user that receives funds when request is solved

requestType

RequestType

The type of request

tokens

uint256

The amount of tokens in the request

units

uint256

The amount of units in the request

solverTip

uint256

The tip paid to the solver

deadline

uint256

The deadline of the request

maxPriceAge

uint256

The maximum age of the price data

Returns

Name
Type
Description

<none>

bytes32

The hash of the request

_getRequestHash

Get the hash of a request

Parameters

Name
Type
Description

token

IERC20

The token that was deposited or redeemed

request

RequestV2

The request to get the hash of

Returns

Name
Type
Description

<none>

bytes32

The hash of the request

_isRequestTypeDeposit

Returns true if the request type is a deposit

Parameters

Name
Type
Description

requestType

RequestType

The request type

Returns

Name
Type
Description

<none>

bool

True if deposit, false otherwise

_isRequestTypeAutoPrice

Returns true if the request type is fixed price

Parameters

Name
Type
Description

requestType

RequestType

The request type

Returns

Name
Type
Description

<none>

bool

True if fixed price, false otherwise

Last updated