Positions, PnL, and Schedules
How positions are tracked, when schedules run, and what blocks activation.
Positions, PnL, and Schedules
This doc explains how OpenPond tracks positions and PnL, how schedules behave, and when schedule activation is blocked.
Core rules
- You can always create an app.
- Schedules are the lock. You can only enable a schedule if:
- No other enabled schedule is running for the same asset + chain, and
- There is no open position for that asset + chain.
- Disabling a schedule does not close a position. Closing is explicit.
- App deletion is blocked if there are enabled schedules or open positions.
Position snapshots
We write hourly position snapshots to power equity charts and guardrails:
- Net size + avg entry from
tradeFacts - Mark price from live price feeds
- Unrealized PnL computed at snapshot time
- Snapshots are only written when a position is open or equity changes materially
Required store-event formats
These formats allow the ledger to stay authoritative and reconcile correctly.
Hyperliquid (store event)
json
{
source: "hyperliquid" | "hyperliquid-testnet"
action: "order"
ref: cloid (preferred) or stable order id
network:"hyperliquid" | "hyperliquid-testnet"
walletAddress: "0x..."
metadata: {
symbol: "BTC", // base symbol
pair: "BTC/USDC",
size, notional, reduceOnly, tif, price,
environment: "mainnet" | "testnet",
assetSymbols: ["BTC"] // if DCA
}EVM (store event)
json
{
source: "evm"
action: "swap"
ref: txHash (or stable id + txHash in metadata)
chainId: 8453
walletAddress: "0x..."
metadata: {
txHash, swapHash,
tokenIn, tokenOut,
tokenInSymbol, tokenOutSymbol,
amountIn, amountOut,
pair: "BTC/USDC",
venue: "uniswap",
slippageBps
}What you’ll see in the UI
- Trade history and realized PnL come from
tradeFacts. - Open positions use live venue data and hourly snapshots.
- Performance is available globally and per‑app once snapshots are present.