Quantillon Protocol

ExecutionPricingLibrary

Git Source

Title: ExecutionPricingLibrary

Linked vault integration for volume pricing, preserving reference accounting.

Functions

version

Linked library semantic version.

Uses the documented units and preserves reference-price accounting.

Notes:

  • security: Uses explicit contract access boundaries and checked arithmetic.

  • validation: Validates the documented preconditions; view interface reads delegate to the target contract.

  • state-changes: None.

  • events: None.

  • errors: Propagates invalid input, freshness, capacity or downstream contract errors as applicable.

  • reentrancy: No state changes.

  • access: Public read access.

  • oracle: Reference EUR/USD and observed venue depth where required; no oracle dependency for role and version reads.

function version() external pure returns (string memory);

Returns

NameTypeDescription
<none>stringresult Calculated result in the units described by this operation.

mint

Calculate and consume a mint quote, reverting below the user's floor.

Uses the documented units and preserves reference-price accounting.

Notes:

  • security: Called by delegatecall from the guarded vault flow.

  • validation: Validates the documented preconditions; view interface reads delegate to the target contract.

  • state-changes: Applies the effects described above.

  • events: Emits the events described above when applicable.

  • errors: Propagates invalid input, freshness, capacity or downstream contract errors as applicable.

  • reentrancy: Vault settlement is nonReentrant; publisher and reporter methods have no external state-changing callbacks.

  • access: Called from the guarded vault flow.

  • oracle: Reference EUR/USD and observed venue depth where required; no oracle dependency for role and version reads.

function mint(IExecutionPricing module, uint256 input, uint256 feeRate, uint256 ref, uint256 minimum)
    external
    returns (uint256 fee, uint256 backing, uint256 q);

Parameters

NameTypeDescription
moduleIExecutionPricingConfigured pricing module, or zero before activation.
inputuint256Gross USDC input.
feeRateuint256Protocol fee fraction in 18 decimals.
refuint256Reference EUR/USD price in 18 decimals.
minimumuint256Minimum QEURO output in 18 decimals.

Returns

NameTypeDescription
feeuint256Protocol fee in USDC.
backinguint256Net reference backing in USDC.
quint256QEURO output.

redeem

Calculate and consume a normal redemption quote.

Uses the documented units and preserves reference-price accounting.

Notes:

  • security: No execution cost is charged twice; gross = net + fee + spread.

  • validation: Validates the documented preconditions; view interface reads delegate to the target contract.

  • state-changes: Applies the effects described above.

  • events: Emits the events described above when applicable.

  • errors: Propagates invalid input, freshness, capacity or downstream contract errors as applicable.

  • reentrancy: Vault settlement is nonReentrant; publisher and reporter methods have no external state-changing callbacks.

  • access: Called from the guarded vault flow.

  • oracle: Reference EUR/USD and observed venue depth where required; no oracle dependency for role and version reads.

function redeem(IExecutionPricing module, uint256 q, uint256 feeRate, uint256 ref, uint256 minimum)
    external
    returns (uint256 gross, uint256 net, uint256 fee);

Parameters

NameTypeDescription
moduleIExecutionPricingConfigured pricing module, or zero before activation.
quint256QEURO input in 18 decimals.
feeRateuint256Protocol fee fraction in 18 decimals.
refuint256Reference EUR/USD price in 18 decimals.
minimumuint256Minimum USDC output in 6 decimals.

Returns

NameTypeDescription
grossuint256Reference-valued collateral removed.
netuint256User payout after execution spread and protocol fee.
feeuint256Protocol fee in USDC.

validateConfiguration

Check a governance module transition without discarding pending exposure.

Read-only contract interface.

Notes:

  • security: The vault enforces governance and pause requirements before delegation.

  • validation: Validates the documented preconditions; view interface reads delegate to the target contract.

  • state-changes: None.

  • events: None.

  • errors: Propagates invalid input, freshness, capacity or downstream contract errors as applicable.

  • reentrancy: No state changes.

  • access: Public read access.

  • oracle: Reference EUR/USD and observed venue depth where required; no oracle dependency for role and version reads.

function validateConfiguration(IExecutionPricing previous, address next) external view;

Parameters

NameTypeDescription
previousIExecutionPricingPrevious configured module.
nextaddressProposed module, or zero to deactivate.

routeFees

Route protocol fees independently of execution spreads.

Uses the documented units and preserves reference-price accounting.

Notes:

  • security: Delegatecalled within the vault's guarded settlement flow.

  • validation: Validates the documented preconditions; view interface reads delegate to the target contract.

  • state-changes: Applies the effects described above.

  • events: Emits the events described above when applicable.

  • errors: Propagates invalid input, freshness, capacity or downstream contract errors as applicable.

  • reentrancy: Vault settlement is nonReentrant; publisher and reporter methods have no external state-changing callbacks.

  • access: Called from the guarded vault flow.

  • oracle: Reference EUR/USD and observed venue depth where required; no oracle dependency for role and version reads.

function routeFees(
    IERC20 token,
    uint256 fee,
    uint256 split,
    IHedgerPool hedger,
    address collector,
    string memory source
) external;

Parameters

NameTypeDescription
tokenIERC20USDC token.
feeuint256Protocol fee amount.
splituint256Hedger reward fraction in 18 decimals.
hedgerIHedgerPoolHedger reward pool.
collectoraddressProtocol fee collector.
sourcestringAccounting source tag.

enforceDeviation

Enforce the vault's existing reference-price deviation policy.

Uses the documented units and preserves reference-price accounting.

Notes:

  • security: Preserves the 200 bps and one-block policy independently of execution pricing.

  • validation: Validates the documented preconditions; view interface reads delegate to the target contract.

  • state-changes: Applies the effects described above.

  • events: Emits the events described above when applicable.

  • errors: Propagates invalid input, freshness, capacity or downstream contract errors as applicable.

  • reentrancy: Vault settlement is nonReentrant; publisher and reporter methods have no external state-changing callbacks.

  • access: Called from the guarded vault flow.

  • oracle: Reference EUR/USD and observed venue depth where required; no oracle dependency for role and version reads.

function enforceDeviation(uint256 price, uint256 previous, uint256 lastBlock) external;

Parameters

NameTypeDescription
priceuint256Live reference price.
previousuint256Cached reference price.
lastBlockuint256Block of the previous cache update.

enforceCollateralization

Validate projected reference-valued collateralization.

Uses the documented units and preserves reference-price accounting.

Notes:

  • security: Execution spread reserves are excluded by the caller.

  • validation: Validates the documented preconditions; view interface reads delegate to the target contract.

  • state-changes: None.

  • events: None.

  • errors: Propagates invalid input, freshness, capacity or downstream contract errors as applicable.

  • reentrancy: No state changes.

  • access: Public read access.

  • oracle: Reference EUR/USD and observed venue depth where required; no oracle dependency for role and version reads.

function enforceCollateralization(uint256 collateral, uint256 supply, uint256 price, uint256 minimum)
    external
    pure;

Parameters

NameTypeDescription
collateraluint256Projected collateral in USDC units.
supplyuint256Projected QEURO supply.
priceuint256Reference price.
minimumuint256Minimum collateralization percentage scaled by 1e18.

collateralizationRatio

Compute the reference-valued collateralization ratio for the calling vault.

Uses the documented units and preserves reference-price accounting.

Notes:

  • security: Reads collateral only after nonzero reference backing is established.

  • validation: Validates the documented preconditions; view interface reads delegate to the target contract.

  • state-changes: None.

  • events: None.

  • errors: Propagates invalid input, freshness, capacity or downstream contract errors as applicable.

  • reentrancy: No state changes.

  • access: Public read access.

  • oracle: Reference EUR/USD and observed venue depth where required; no oracle dependency for role and version reads.

function collateralizationRatio(IERC20 token, uint256 price) public view returns (uint256 ratio);

Parameters

NameTypeDescription
tokenIERC20QEURO token used for total circulating supply.
priceuint256Reference USD per EUR price.

Returns

NameTypeDescription
ratiouint256Percentage scaled by 1e18, or zero for absent backing.

enforceMintEligibility

Enforce initialized pricing, active hedging and the live mint floor.

Read-only contract interface.

Notes:

  • security: Preserves the vault's bounded dust-supply bootstrap behavior.

  • validation: Validates the documented preconditions; view interface reads delegate to the target contract.

  • state-changes: None.

  • events: None.

  • errors: Propagates invalid input, freshness, capacity or downstream contract errors as applicable.

  • reentrancy: No state changes.

  • access: Public read access.

  • oracle: Reference EUR/USD and observed venue depth where required; no oracle dependency for role and version reads.

function enforceMintEligibility(IERC20 token, IHedgerPool hedger, uint256 cached, uint256 price, uint256 minimum)
    external
    view;

Parameters

NameTypeDescription
tokenIERC20QEURO token.
hedgerIHedgerPoolConfigured hedger pool.
cacheduint256Previously initialized reference price.
priceuint256Live reference price.
minimumuint256Minimum collateralization percentage scaled by 1e18.

Events

ProtocolFeeRouted

event ProtocolFeeRouted(string sourceType, uint256 totalFee, uint256 hedgerReserveShare, uint256 collectorShare);

PriceDeviationDetected

event PriceDeviationDetected(
    uint256 currentPrice, uint256 lastValidPrice, uint256 deviationBps, uint256 blockNumber
);