Back to Docs/OpenTool Store Events

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 opentool

Configure

store() uses:

  • OPENPOND_API_KEY (required)
  • BASE_URL (optional, defaults to https://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 canonical market.
  • lifecycle: status progression for a prior execution ref.

Action names by level

Decision actions (recommended list):

  • hold
  • rebalance
  • open
  • close
  • noop
  • risk_on
  • risk_off

Execution actions (exact canonical list for eventLevel: "execution"):

  • stake
  • unstake
  • swap
  • bridge
  • order
  • trade
  • lend
  • borrow
  • repay
  • withdraw
  • provide_liquidity
  • remove_liquidity
  • claim

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 for decision events.
  • custom is not valid for execution or lifecycle events.

Canonical market types

  • perp
  • spot
  • dex_pool
  • bridge_route
  • lending_market
  • staking_position
  • vault_position
  • system

Practical rules

  • Keep source stable per strategy/tool.
  • Keep ref idempotent 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 in market.

Read back events

ts
import { retrieve } from "opentool/store"; const result = await retrieve({ source: "uniswap-rebalance", limit: 50, }); console.log(result.items);