OpenTool Store Events
How to use opentool/store to write app activity events to OpenPond.
OpenTool Store Events
Use opentool/store to persist app activity (swaps, orders, lends, status updates) into your OpenPond app timeline.
Install
bash
npm install opentoolConfigure
store() uses:
OPENPOND_API_KEY(required)BASE_URL(optional, defaults tohttps://api.openpond.ai)
You can also pass config directly in the second argument.
Minimal event
ts
import { store } from "opentool/store";
await store({
source: "my-strategy",
ref: "heartbeat-2026-02-21T06:00:00Z",
status: "info",
eventLevel: "decision",
action: "custom",
metadata: {
message: "bot online",
},
});Execution event (recommended shape)
For execution actions like swap, order, lend, borrow, bridge, stake, withdraw, and liquidity actions, include market.
ts
import { store } from "opentool/store";
await store({
source: "uniswap-rebalance",
ref: "0x8a4f...txhash",
status: "confirmed",
eventLevel: "execution",
action: "swap",
chainId: 1,
notional: "1250.50",
market: {
market_type: "dex_pool",
venue: "uniswap",
environment: "1",
canonical_symbol: "dex_pool:uniswap:1:0x88e6a0c2ddd26feeb64f039a2c41296fcb3f5640",
chain_id: 1,
pool_address: "0x88e6a0c2ddd26feeb64f039a2c41296fcb3f5640",
base: "ETH",
quote: "USDC",
},
metadata: {
txHash: "0x8a4f...txhash",
amountIn: "0.5",
amountOut: "1250.50",
},
});Event levels
decision: strategy intent/outcome (hold,rebalance,open,close,noop, etc.).execution: atomic execution (order,swap,lend,borrow, etc.) with canonicalmarket.lifecycle: status progression for a prior execution ref.
Action names by level
Decision actions (recommended list):
holdrebalanceopenclosenooprisk_onrisk_off
Execution actions (exact canonical list for eventLevel: "execution"):
stakeunstakeswapbridgeordertradelendborrowrepaywithdrawprovide_liquidityremove_liquidityclaim
Lifecycle actions (exact list for eventLevel: "lifecycle"):
- Same as execution actions (
stake,unstake,swap,bridge,order,trade,lend,borrow,repay,withdraw,provide_liquidity,remove_liquidity,claim).
Custom actions:
custom(or any non-canonical string) is valid fordecisionevents.customis not valid forexecutionorlifecycleevents.
Canonical market types
perpspotdex_poolbridge_routelending_marketstaking_positionvault_positionsystem
Practical rules
- Keep
sourcestable per strategy/tool. - Keep
refidempotent per action/tx so retries do not create duplicate semantics. - Use decimal strings for
notional. - Put protocol-specific details in
metadata; keep cross-app identity inmarket.
Read back events
ts
import { retrieve } from "opentool/store";
const result = await retrieve({
source: "uniswap-rebalance",
limit: 50,
});
console.log(result.items);