Oracle Architecture
How Agent Tresor determines market prices with zero point of failure.
1. The "Trinity" Strategy
Financial decisions made by the Treasurer Bot rely heavily on the price of ETH. Trusting a single source (oracle) is a security risk. If that source fails or is manipulated, the agent acts on false data.
To essentially eliminate this risk, Agent Tresor employs a Redundant Multi-Source Oracle System that aggregates data from three distinct, high-quality providers.
Chainlink
Decentralized on-chain feed. The "Supreme Truth" of DeFi.
Source: RPC (On-Chain)CoinGecko
Leading independent crypto data aggregator.
Source: Public APICoinbase
Top-tier US exchange market data.
Source: Public API2. Execution Mechanism
2.1 Randomized Selection
To prevent relying too much on one source (and hitting rate limits), the primary oracle is chosen at random (33% probability each) at the start of every cycle. This effectively acts as "Load Balancing" for API calls and ensures all oracles are battle-tested in production.
2.2 Robust Failover
If the chosen primary source fails (e.g., API downtime, Rate Limit 429), the bot automatically switches to the next available source in the list. It will iterate through all 3 sources before giving up.
2.3 The "Kill Switch" Protocol
Safety Rule: No Data = No Action
If ALL THREE sources fail to return a valid price, the Agent triggers a safety shutdown for the current cycle. It does NOT attempt to guess or use a default "hardcoded" price. This prevents the Treasury from buying or selling assets based on stale or incorrect market information.
