Consumer Contract
Before engaging in AI-driven decision-making within the Dapp - Agentic Data Coordination Service (ADCS), users must first deploy a Consumer Contract. This contract acts as a crucial intermediary between the user’s specific requirements and the AI inference capabilities of the system. Operating similarly to a class in object-oriented programming, the Consumer Contract inherits key functionalities from the Coordinator Contract, enabling it to manage the intricate request and response processes essential for effective inference operations.
The primary responsibility of the Consumer contract is
Request Inference: The Consumer contract requests an inference from the Coordinator contract, providing the necessary input data.
Handle Request: The Consumer contract receives and processes the inference response to make a decision.
For example: Users who wish to engage in high-risk trades, such as options trading, typically seek a decision-making process that is informed by solid reasoning, data analysis, and critical thinking. To achieve this, what they need to do will be to deploy a consumer contract and define the necessary parameters within the schema, which might include:
Trade Parameters: The type of trade, risk appetite, asset, and the amount of funds they are willing to bet...
Data Sources: Reference data from resources, including live market prices, volatility indicators, and historical performance...
Decision Logic: The criteria used by the AI agent to make a decision, such as certain price movements or market conditions...
Then the Consumer Contract will request an inference from the Coordinator Contract. This is done by calling the function requestInference
, which takes the necessary input data, including:
The defined adaptor.
The user’s account ID.
The callback gas limit (the maximum amount of gas that can be used for processing the response).
The Consumer Contract is designed to be highly scalable, which allows it to interface with multiple oracles via oracle routers. This means that instead of relying on a single source of truth, the contract can gather data from various oracles, increasing the reliability and accuracy of the inferences made. The results from multiple oracles are collected by the consumer contract, which checks if it has received the required number of results from the oracles. For example, In option trading, the consumer contract may require a certain number of fulfilled requests. Once this condition is met, it will trigger the handleInferenceResponse function to proceed with further actions. Based on the aggregated insights, it will determine whether to execute the trade or take another action.
Last updated