Kolect Sentiment
/install kolect-sentiment
\r ---\r name: kolect-sentiment-feed\r description: Use this skill when the user wants to read, explain, or interact with the Kolect Sentiment Feed contract on Base, including querying sentiment, checking freshness, checking pending requests, and requesting new on-chain sentiment updates for supported symbols and time windows.\r ---\r \r
Kolect Sentiment Feed\r
\r
Purpose\r
\r
Use this skill for the Kolect Sentiment Feed contract, an on-chain sentiment oracle on Base.\r
\r
It stores normalized sentiment for supported (symbol, timeWindow) pairs through a request–response flow:\r
\r
- User requests an update on-chain\r
- Off-chain publisher fetches sentiment from Kolect API\r
- Publisher fulfills the request on-chain with normalized BPS data\r \r Use this skill when the user wants to:\r
- read the latest sentiment\r
- check freshness\r
- check pending request state\r
- request a new update\r
- understand how the oracle works\r
- integrate the feed into AI agents, trading, dashboards, or DeFi logic\r \r ---\r \r
Contract\r
\r
- Project: Kolect\r
- Module: Kolect Sentiment Feed\r
- Version: v1.0.0\r
- Network: Base\r
- Address:
0x6783ab3c181976e8c960c43d711aaf4da79a4e4b\r - Explorer:
https://base.blockscout.com/address/0x6783ab3c181976e8c960c43d711aaf4da79a4e4b\r - Website:
https://kolect.info\r - Twitter/X:
https://x.com/kolect_info\r \r ---\r \r
Interaction Types\r
\r
Read-only calls\r
Usually used to inspect current state:\r
getLatest(symbol, timeWindow)\risFresh(symbol, timeWindow)\rhasPendingRequest(symbol, timeWindow)\r \r These are normally read calls and do not require the contract request fee.\r \r
Write call\r
Used to initiate a new oracle update:\r
requestUpdate(symbol, timeWindow)\r \r This is not a free read. It is a state-changing transaction:\r- requires gas\r
- may require request fee payment\r
\r
Never present
requestUpdateas a free data read.\r \r ---\r \r
Data Model\r
\r Each feed is identified by:\r
symbol\rtimeWindow\r \r Examples:\r(BTC, 1d)\r(ETH, 1h)\r \r Each feed stores:\rnegativeBps\rneutralBps\rpositiveBps\rdataTimestamp— off-chain data time\rupdatedAt— on-chain fulfillment time\r \r
Invariant\r
\r
negativeBps + neutralBps + positiveBps = 10000\r
\r
Interpretation:\r
10000= 100.00%\r2500= 25.00%\r5000= 50.00%\r \r Always preserve and validate this rule.\r \r ---\r \r
Core Workflow\r
\r
1. Request update\r
Function:\r
requestUpdate(string symbol, string timeWindow)\r
\r
Should only succeed if:\r
- symbol is supported\r
- time window is supported\r
- feed is not already fresh\r
- no pending request exists\r
- required fee is paid\r \r
2. Off-chain processing\r
Publisher:\r
- listens to
UpdateRequested\r - fetches sentiment from Kolect API\r
- normalizes result into BPS\r \r
3. Fulfillment\r
Function:\r
fulfillRequest(requestId, negativeBps, neutralBps, positiveBps, dataTimestamp)\r
\r
Result:\r
- data stored on-chain\r
- request marked fulfilled\r
- event emitted\r \r
4. Failure\r
Function:\r
failRequest(requestId, errorCode)\r
\r
Used when data retrieval or fulfillment fails.\r
\r
---\r
\r
Functions\r
\r
User\r
requestUpdate(string symbol, string timeWindow)\r \r
View\r
getLatest(symbol, timeWindow)\risFresh(symbol, timeWindow)\rhasPendingRequest(symbol, timeWindow)\r \r
Publisher\r
fulfillRequest(...)\rfailRequest(...)\r \r
Owner\r
setSupportedSymbol(...)\rsetSupportedTimeWindow(...)\rsetUpdateInterval(...)\rsetRequestFee(...)\rwithdrawFees(...)\r \r Do not imply ordinary users can call owner-only functions.\r \r ---\r \r
Events\r
\r Important indexing events:\r
UpdateRequested\rRequestFulfilled\rRequestFailed\r \r Use these when discussing dashboards, Dune, subgraphs, analytics, or automation.\r \r ---\r \r
Decision Logic\r
\r
If the user wants the latest sentiment\r
- Identify
symbolandtimeWindow\r - Use
getLatest(symbol, timeWindow)\r - Present:\r
- negative / neutral / positive\r
- both BPS and %\r
dataTimestamp\rupdatedAt\r \r
If the user asks whether an update is needed\r
- Check
isFresh(symbol, timeWindow)\r - If fresh, explain no update may be needed\r
- If stale, explain
requestUpdatemay be appropriate\r \r
If the user wants to request an update\r
- Identify
symbolandtimeWindow\r - Check:\r
- supported symbol\r
- supported time window\r
- not fresh\r
- no pending request\r
- fee requirement\r
- Then prepare or describe
requestUpdate(symbol, timeWindow)\r \r
If the user asks why a request may fail\r
Likely reasons:\r
- unsupported symbol\r
- unsupported time window\r
- feed already fresh\r
- request already pending\r
- fee missing\r
- publisher fulfillment failure\r \r ---\r \r
Output Format\r
\r When reporting sentiment, use:\r \r
- Symbol: BTC\r
- Time window: 1d\r
- Negative: 2300 BPS (23.00%)\r
- Neutral: 4100 BPS (41.00%)\r
- Positive: 3600 BPS (36.00%)\r
- Data timestamp: [off-chain time]\r
- Updated on-chain at: [on-chain time]\r
- Fresh: [true/false if known]\r
- Pending request: [true/false if known]\r \r Do not report only raw integers unless explicitly requested.\r \r ---\r \r
Validation Rules\r
\r Whenever sentiment data is given, validate:\r
negativeBps + neutralBps + positiveBps == 10000\r- each value is non-negative\r
dataTimestamp= off-chain data time\rupdatedAt= on-chain update time\r \r If the sum is not10000, flag it as invalid.\r \r ---\r \r
Python Examples\r
\r
Read latest sentiment\r
\r
from web3 import Web3\r
\r
RPC_URL = "https://mainnet.base.org"\r
CONTRACT_ADDRESS = Web3.to_checksum_address("0x6783ab3c181976e8c960c43d711aaf4da79a4e4b")\r
\r
ABI = [\r
{\r
"inputs": [\r
{"internalType": "string", "name": "symbol", "type": "string"},\r
{"internalType": "string", "name": "timeWindow", "type": "string"}\r
],\r
"name": "getLatest",\r
"outputs": [\r
{"internalType": "uint256", "name": "negativeBps", "type": "uint256"},\r
{"internalType": "uint256", "name": "neutralBps", "type": "uint256"},\r
{"internalType": "uint256", "name": "positiveBps", "type": "uint256"},\r
{"internalType": "uint256", "name": "dataTimestamp", "type": "uint256"},\r
{"internalType": "uint256", "name": "updatedAt", "type": "uint256"}\r
],\r
"stateMutability": "view",\r
"type": "function"\r
}\r
]\r
\r
w3 = Web3(Web3.HTTPProvider(RPC_URL))\r
contract = w3.eth.contract(address=CONTRACT_ADDRESS, abi=ABI)\r
\r
symbol = "BTC"\r
time_window = "1d"\r
\r
negative_bps, neutral_bps, positive_bps, data_timestamp, updated_at = (\r
contract.functions.getLatest(symbol, time_window).call()\r
)\r
\r
print("Negative:", negative_bps, f"({negative_bps / 100:.2f}%)")\r
print("Neutral:", neutral_bps, f"({neutral_bps / 100:.2f}%)")\r
print("Positive:", positive_bps, f"({positive_bps / 100:.2f}%)")\r
print("Data timestamp:", data_timestamp)\r
print("Updated at:", updated_at)\r
````\r
\r
### Check freshness and pending request\r
\r
```python\r
from web3 import Web3\r
\r
RPC_URL = "https://mainnet.base.org"\r
CONTRACT_ADDRESS = Web3.to_checksum_address("0x6783ab3c181976e8c960c43d711aaf4da79a4e4b")\r
\r
ABI = [\r
{\r
"inputs": [\r
{"internalType": "string", "name": "symbol", "type": "string"},\r
{"internalType": "string", "name": "timeWindow", "type": "string"}\r
],\r
"name": "isFresh",\r
"outputs": [{"internalType": "bool", "name": "", "type": "bool"}],\r
"stateMutability": "view",\r
"type": "function"\r
},\r
{\r
"inputs": [\r
{"internalType": "string", "name": "symbol", "type": "string"},\r
{"internalType": "string", "name": "timeWindow", "type": "string"}\r
],\r
"name": "hasPendingRequest",\r
"outputs": [{"internalType": "bool", "name": "", "type": "bool"}],\r
"stateMutability": "view",\r
"type": "function"\r
}\r
]\r
\r
w3 = Web3(Web3.HTTPProvider(RPC_URL))\r
contract = w3.eth.contract(address=CONTRACT_ADDRESS, abi=ABI)\r
\r
symbol = "ETH"\r
time_window = "1h"\r
\r
fresh = contract.functions.isFresh(symbol, time_window).call()\r
pending = contract.functions.hasPendingRequest(symbol, time_window).call()\r
\r
print("Fresh:", fresh)\r
print("Pending:", pending)\r
```\r
\r
### Request an update\r
\r
```python\r
from web3 import Web3\r
\r
RPC_URL = "https://mainnet.base.org"\r
PRIVATE_KEY = "YOUR_PRIVATE_KEY"\r
ACCOUNT = "YOUR_WALLET_ADDRESS"\r
CONTRACT_ADDRESS = Web3.to_checksum_address("0x6783ab3c181976e8c960c43d711aaf4da79a4e4b")\r
\r
ABI = [\r
{\r
"inputs": [\r
{"internalType": "string", "name": "symbol", "type": "string"},\r
{"internalType": "string", "name": "timeWindow", "type": "string"}\r
],\r
"name": "requestUpdate",\r
"outputs": [],\r
"stateMutability": "payable",\r
"type": "function"\r
}\r
]\r
\r
w3 = Web3(Web3.HTTPProvider(RPC_URL))\r
contract = w3.eth.contract(address=CONTRACT_ADDRESS, abi=ABI)\r
\r
symbol = "BTC"\r
time_window = "1d"\r
request_fee_wei = 0 # replace with actual fee if needed\r
\r
tx = contract.functions.requestUpdate(symbol, time_window).build_transaction({\r
"from": ACCOUNT,\r
"nonce": w3.eth.get_transaction_count(ACCOUNT),\r
"value": request_fee_wei,\r
"gas": 300000,\r
"gasPrice": w3.eth.gas_price,\r
"chainId": 8453\r
})\r
\r
signed_tx = w3.eth.account.sign_transaction(tx, PRIVATE_KEY)\r
tx_hash = w3.eth.send_raw_transaction(signed_tx.raw_transaction)\r
print(tx_hash.hex())\r
```\r
\r
---\r
\r
## JavaScript Examples\r
\r
### Read latest sentiment\r
\r
```javascript\r
import { ethers } from "ethers";\r
\r
const RPC_URL = "https://mainnet.base.org";\r
const CONTRACT_ADDRESS = "0x6783ab3c181976e8c960c43d711aaf4da79a4e4b";\r
\r
const ABI = [\r
"function getLatest(string symbol, string timeWindow) view returns (uint256 negativeBps, uint256 neutralBps, uint256 positiveBps, uint256 dataTimestamp, uint256 updatedAt)"\r
];\r
\r
const provider = new ethers.JsonRpcProvider(RPC_URL);\r
const contract = new ethers.Contract(CONTRACT_ADDRESS, ABI, provider);\r
\r
const result = await contract.getLatest("BTC", "1d");\r
\r
console.log(Number(result.negativeBps), Number(result.neutralBps), Number(result.positiveBps));\r
console.log(Number(result.dataTimestamp), Number(result.updatedAt));\r
```\r
\r
### Check freshness and pending request\r
\r
```javascript\r
import { ethers } from "ethers";\r
\r
const RPC_URL = "https://mainnet.base.org";\r
const CONTRACT_ADDRESS = "0x6783ab3c181976e8c960c43d711aaf4da79a4e4b";\r
\r
const ABI = [\r
"function isFresh(string symbol, string timeWindow) view returns (bool)",\r
"function hasPendingRequest(string symbol, string timeWindow) view returns (bool)"\r
];\r
\r
const provider = new ethers.JsonRpcProvider(RPC_URL);\r
const contract = new ethers.Contract(CONTRACT_ADDRESS, ABI, provider);\r
\r
const fresh = await contract.isFresh("ETH", "1h");\r
const pending = await contract.hasPendingRequest("ETH", "1h");\r
\r
console.log("Fresh:", fresh);\r
console.log("Pending:", pending);\r
```\r
\r
### Request an update\r
\r
```javascript\r
import { ethers } from "ethers";\r
\r
const RPC_URL = "https://mainnet.base.org";\r
const PRIVATE_KEY = "YOUR_PRIVATE_KEY";\r
const CONTRACT_ADDRESS = "0x6783ab3c181976e8c960c43d711aaf4da79a4e4b";\r
\r
const ABI = [\r
"function requestUpdate(string symbol, string timeWindow) payable"\r
];\r
\r
const provider = new ethers.JsonRpcProvider(RPC_URL);\r
const wallet = new ethers.Wallet(PRIVATE_KEY, provider);\r
const contract = new ethers.Contract(CONTRACT_ADDRESS, ABI, wallet);\r
\r
const tx = await contract.requestUpdate("BTC", "1d", {\r
value: 0n // replace with actual request fee if needed\r
});\r
\r
console.log(tx.hash);\r
await tx.wait();\r
```\r
\r
---\r
\r
## Recommended Agent Behavior\r
\r
An AI agent should use the feed in this order:\r
\r
1. `getLatest(symbol, timeWindow)`\r
2. validate BPS values\r
3. `isFresh(symbol, timeWindow)`\r
4. `hasPendingRequest(symbol, timeWindow)`\r
5. only if stale and no pending request exists:\r
\r
* prepare or send `requestUpdate(symbol, timeWindow)`\r
\r
Recommended phrasing:\r
\r
> The Kolect Sentiment Feed lets the agent consume verifiable on-chain sentiment state. The agent should first read current state, then verify freshness, and only request a new update when needed.\r
\r
---\r
\r
## Action Policy\r
\r
* If the user asks for explanation only, explain the contract and do not push a write transaction.\r
* If the user asks for current sentiment, prefer read calls first.\r
* If the user asks to refresh, explain freshness and pending checks before suggesting `requestUpdate`.\r
* Never suggest owner-only functions unless the user is explicitly admin/operator.\r
* Never imply all interactions are free. Read calls are usually free from the contract side; write calls need gas and may need request fee.\r
\r
---\r
\r
## Safe Assumptions\r
\r
The model may assume:\r
\r
* this contract is on Base\r
* the address above is the intended deployment\r
* sentiment is normalized in BPS\r
\r
The model must not assume without checking:\r
\r
* supported symbols\r
* supported time windows\r
* current request fee\r
* current update interval\r
* whether a feed is fresh right now\r
* whether a request is pending right now\r
\r
These are dynamic contract states.\r
\r
---\r
\r
## Anti-Patterns\r
\r
Do not:\r
\r
* confuse BPS with percentages\r
* say the contract computes sentiment internally\r
* describe the feed as auto-updating on a timer\r
* assume request fee is zero\r
* merge `dataTimestamp` and `updatedAt`\r
* assume all symbols and time windows are supported by default\r
* tell the user to call `requestUpdate` before checking freshness and pending state\r
\r
---\r
\r
## Minimal Cheat Sheet\r
\r
**Chain:** Base\r
**Contract:** `0x6783ab3c181976e8c960c43d711aaf4da79a4e4b`\r
\r
**Main user action**\r
\r
* `requestUpdate(symbol, timeWindow)`\r
\r
**Main read functions**\r
\r
* `getLatest(symbol, timeWindow)`\r
* `isFresh(symbol, timeWindow)`\r
* `hasPendingRequest(symbol, timeWindow)`\r
\r
**Publisher functions**\r
\r
* `fulfillRequest(...)`\r
* `failRequest(...)`\r
\r
**Key events**\r
\r
* `UpdateRequested`\r
* `RequestFulfilled`\r
* `RequestFailed`\r
\r
**Core invariant**\r
\r
* `negativeBps + neutralBps + positiveBps = 10000`\r
\r
- 确保已安装 OpenClaw(本地或 Docker 部署)
- 在对话框中输入安装命令:
/install kolect-sentiment - 安装完成后,直接呼叫该 Skill 的名称或使用
/kolect-sentiment触发 - 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
Kolect Sentiment 是什么?
Query, check freshness, check pending requests, or request new sentiment updates on-chain for supported symbols and time windows via the Kolect Sentiment Fee... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 129 次。
如何安装 Kolect Sentiment?
在 OpenClaw 或 Claude Code 对话框中运行命令「/install kolect-sentiment」即可一键安装,无需额外配置。
Kolect Sentiment 是免费的吗?
是的,Kolect Sentiment 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。
Kolect Sentiment 支持哪些平台?
Kolect Sentiment 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。
谁开发了 Kolect Sentiment?
由 Kolect-info(@kolect-info)开发并维护,当前版本 v1.0.0。