Squidlor
Loading docs

Taking longer than usual. Check your connection, or reload the page.

Smart contracts

The contract set behind Squidlor: what each one does, how they inherit, and which you should actually interact with.

Squidlor's oracle contracts live in two repositories that deploy independently.

Which contract do I interact with?

You are…Read
A DeFi protocol consuming a priceSquidlorOracleAggregator for the pair. Standard Chainlink interface.
A protocol that wants only Squidlor's own feed, no cross-oracle layerThe pair's SquidPriceFeed proxy. Also a Chainlink interface.
Discovering addresses programmaticallyAggregatorRegistry, by pair name.
Running a relayerSquidlorAdapterV2.updateDataFeedsValues.
Auditing how a price was formedThe aggregator's sources(), then each adapter's latestPrice().

Important

The aggregator is almost always the right answer. Reading a SquidPriceFeed directly gets you Squidlor's own price with no cross-oracle protection; Layer 3 of the aggregation architecture is skipped entirely. Do that only if you specifically want the single source.

Inheritance in the oracle core

OracleVerifier          calldata parsing + ECDSA verification
      │
      ▼
SquidlorAdapter         storage layout, rounds, update flow
      │
      ▼
SquidlorAdapterV2       signer-set management, Ownable2Step ownership

Separately, one stateless proxy per asset:

SquidPriceFeed (abstract)
      │
      ├── BtcPriceFeed      ├── NvdaPriceFeed
      ├── EthPriceFeed      ├── TslaPriceFeed
      ├── SolPriceFeed      ├── AaplPriceFeed
      ├── BnbPriceFeed      └── GooglPriceFeed
      └── XrpPriceFeed

Each subclass supplies just a dataFeedId() and a description(). All of them read the same SquidlorAdapterV2.

The contract set

Oracle core: squid-contract

ContractRole
OracleVerifierAbstract. Locates the signed payload in calldata, recovers each signer, dedupes with a per-feed bitmap, enforces the signer threshold, and medians the verified values.
SquidlorAdapterAbstract. Storage layout, round bookkeeping, the update entry point, and staleness bounds.
SquidlorAdapterV2Concrete. Adds signer-set management (addSigner, removeSigner, setRequiredSigners) and two-step ownership.
SquidPriceFeedAbstract per-asset facade implementing AggregatorV3Interface over the adapter. Stateless.
*PriceFeedOne concrete proxy per asset.

Aggregation and economics: aggregator-contract

ContractRole
SquidlorOracleAggregatorOne per pair. Cross-oracle aggregation with health filtering. The consumer-facing contract.
ChainlinkSourceAdapter wrapping a Chainlink aggregator.
SquidSourceAdapter wrapping a SquidPriceFeed.
AggregatorRegistryUUPS-upgradeable registry mapping pair names to aggregator addresses.
RewardDistributorEpoch-based reward distribution.
FeeCollectorFee accrual and treasury split.
SquidlorCommitRevealRandomnessCommit-reveal randomness with a reveal delay.
EventOracleAggregatorThe event-outcome equivalent of the price aggregator.
OperatorSignedEventSourceFast-path event source: operator signature, no bond.

Design constraints that shaped all of it

Pure EVM. Solidity ≥ 0.8 and standard ecrecover. No precompiles, no chain-specific opcodes. This is what makes a new-chain deployment a forge script rather than a port.

Storage derived from feed IDs. Slots are computed as keccak256(abi.encode(feedId, "squid.price")) rather than assigned by declaration order. New assets cannot collide with existing storage, so adding one never requires a migration, even across proxy upgrades.

Batch updates. One updateDataFeedsValues call carries every feed. The relayer's per-feed cost approaches zero as the asset list grows.

Adapters over modification. Adding an oracle network means writing a *Source contract and calling addSource. SquidlorOracleAggregator is never edited to accommodate a provider.

Stateless facades. SquidPriceFeed holds no price data. It reads through to the adapter, which means a feed proxy can never hold a divergent copy of a price.

Verification

Contracts are deployed and verified on Arc's explorer, which is Blockscout; see deployed addresses for links.