> For the complete documentation index, see [llms.txt](https://docs.delphirhc.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.delphirhc.com/contracts/interfaces.md).

# Interfaces

## Oracle

```solidity
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.26;

interface IDelphiOracle {
    /// Time-weighted average tick over the last `window` seconds, in the
    /// pool's currency1/currency0 orientation.
    function consultTick(address token, uint32 window) external view returns (int24 meanTick);

    /// Time-weighted price of one whole token in the pool's quote asset,
    /// in the quote asset's smallest unit.
    function consult(address token, uint32 window) external view returns (uint256 price);

    /// Quote-asset amount for `baseAmount` of `token` at the TWAP.
    function quote(address token, uint256 baseAmount, uint32 window) external view returns (uint256 quoteAmount);

    /// Quote asset of the token's pool. address(0) is native ETH.
    function quoteOf(address token) external view returns (address);

    /// Number of observations recorded so far, capped by cardinality.
    function observationCount(address token) external view returns (uint16);

    /// Timestamp of the oldest observation still in the buffer.
    function oldestObservation(address token) external view returns (uint32);

    /// 0 below the minimum observation count, 1 once readable,
    /// 2 once at least one day of history exists.
    function maturity(address token) external view returns (uint8);

    /// Latest truncated tick, the value the TWAP extrapolates from.
    function truncatedTick(address token) external view returns (int24);

    /// Quote-asset amount a buyer must spend to push spot up by `ticks`
    /// (about 0.01% each) given current in-range liquidity.
    function depth(address token, uint24 ticks) external view returns (uint256 quoteAmount);
}
```

## Factory

```solidity
struct LaunchParams {
    string name;
    string symbol;
    string metadataURI;     // where the image, description and links live; may be empty
    address quote;          // must be allowlisted; address(0) is ETH
    uint256 startMarketCap; // whole supply at the opening price, in quote units
    uint256 initialBuy;     // optional quote amount to buy with at launch
    uint16 creatorTaxBps;   // extra fee to the creator, 0 to 1000
    address creatorWallet;  // receives creator fees; address(0) means the launcher
    bool holderRewards;     // send creator fees to holders instead, via a HolderRewards contract
}

/// `snipeExempt` lists wallets that skip the snipe tax; the creator always does.
function launch(LaunchParams calldata p, address[] calldata snipeExempt)
    external payable returns (address token, PoolId poolId);

function launchFee() external view returns (uint256);              // flat fee in wei, 0.01 ETH
function launchFeeFor(address account) external view returns (uint256); // 0 for exempt wallets
function metadataURI(address token) external view returns (string memory);
function rewardsOf(address token) external view returns (address);      // HolderRewards, or address(0)
```

## Buyback

```solidity
// On the hook
function sweepProtocol(address currency) external returns (uint256); // send accrued protocol fees to the buyback, anyone may call

// On the buyback
function execute() external returns (uint256 toTeam, uint256 spent, uint256 burned); // anyone may call
function preview() external view returns (uint256 toTeam, uint256 spend);
function totalBurned() external view returns (uint256);
function totalToTeam() external view returns (uint256);
```

## Holder rewards

Deployed by the factory for launches that chose holder fee sharing, and set as the token's creator so the creator share and any creator tax accrue to it.

```solidity
function pull() external returns (uint256);            // collect fees waiting at the hook, anyone may call
function pending(address holder) external view returns (uint256); // claimable now, in the quote asset
function claim() external returns (uint256);           // pull, then pay the caller
function effectiveSupply() external view returns (uint256); // balances that earn: everything not in the pool or burned
function totalDistributed() external view returns (uint256);
```

The transaction value is the launch fee plus, for ETH pairs, the initial buy.

## Hook, beyond the oracle

```solidity
function currentFeeBps(address token) external view returns (uint256);                 // base + creator tax + snipe tax now
function currentFeeBpsFor(address token, address trader) external view returns (uint256); // the same, honouring exemptions
function creatorAccruedOf(address token) external view returns (uint256);              // unclaimed creator fees
function claimCreator(address token) external returns (uint256);                       // creator wallet only
function snipeExempt(bytes32 poolId, address account) external view returns (bool);
```

## Router

```solidity
function swapExactIn(
    PoolKey calldata key,
    bool zeroForOne,
    uint256 amountIn,
    uint256 minOut,
    address recipient,
    uint256 deadline
) external payable returns (uint256 amountOut);
```

## Feed factory and feed

```solidity
// Factory
function create(address token, uint32 window) external returns (address feed);
function feeds(address token, uint32 window) external view returns (address);

// Feed (AggregatorV3-compatible)
function latestRoundData() external view returns (uint80, int256, uint256, uint256, uint80);
function latestAnswer() external view returns (int256);
function decimals() external view returns (uint8);
function description() external view returns (string memory);
function version() external pure returns (uint256);
function maturity() external view returns (uint8);
function observationCount() external view returns (uint16);
```

## Constants

| Name                 | Value                     | Meaning                                                       |
| -------------------- | ------------------------- | ------------------------------------------------------------- |
| Minimum observations | 12                        | Below this, reads revert and maturity is 0                    |
| Mature after         | 1 day                     | Maturity becomes 2 once the first observation is this old     |
| Max tick move        | 300 ticks per second      | Cap on how fast the recorded tick may change                  |
| Catch-up cap         | 30 seconds                | Idle time counts toward the allowance only up to this         |
| Buffer size          | 8,192 observations        | Maximum history per pool                                      |
| Base fee             | 1%                        | Split 70/30 creator/protocol                                  |
| Creator tax          | 0 to 10%                  | Chosen at launch, paid to the creator in full                 |
| Snipe tax            | 99% falling to 0 over 3 s | First seconds after launch, to the protocol, exemptions apply |
| Launch fee           | 0.01 ETH                  | Flat, to the treasury; zero for exempt wallets                |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.delphirhc.com/contracts/interfaces.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
