@viraeai/virae-strategy-core
v0.13.0
Published
Deterministic, side-effect-free trading strategy decisions, execution policies, and replay contracts.
Downloads
2,973
Maintainers
Readme
Virae Strategy Core
Deterministic, side-effect-free trading strategy decisions, execution policies, and replay contracts.
Strategies at a glance
| Strategy | Markets | What the core produces | Highlights |
| --- | --- | --- | --- |
| Crypto Tail | BTC/ETH/SOL/DOGE/XRP/BNB Up/Down (15m and 1h) | WAIT / SKIP / ELIGIBLE, entry plan, chase, exit, lifecycle commands | Time-and-distance signal, TWAP/spot consistency, spread/depth/risk gates, bounded lifecycle |
| Pre-M | BTC 15m Up/Down before market open | 12 dual-sided BUY ladder intents and fill-aware take-profit SELL intents | Safe/Normal/Aggressive ladders, stable per-round keys, explicit cancellation deadline |
| Musk Tweet Count | Current and next Polymarket tweet-count markets | Sleeve evaluations plus one canonical selected or rejected intent | Low/high-tail No, late directional Yes, lottery Yes, next-market preposition |
| Weather Temperature | Daily high/low temperature buckets | Ranked YES limit-order intents and per-bucket evaluations | GFS ensemble probabilities, station-local timing, Strict/Core/Wide profiles, TOP1 or adjacent TOP2 |
| Hit Price Snipe | Crypto hit-price markets | Confirm-hit/Pre-hit decision, FAK intent, fill/PnL simulation, system matrix | Exact crossing semantics, source/freshness/edge gates, explicit small-win/large-loss evidence |
| BTC 15m Value Snipe | Recurring BTC 15m on Polymarket and Predict.fun (simulation contract) | Venue-aware value decision and two system matrices | Shared fair-value policy with explicit host-supplied venue fees and slippage |
| Memecoin Momentum Guard | Solana memecoin discovery universe | WAIT / SKIP / ELIGIBLE entry plus executable-proceeds exit decisions | Persistent momentum, security, quote, daily-risk, TP/SL/risk/time-stop gates |
| Memecoin Launch Scout | Newly launched Solana pools | Small time-boxed entries plus executable-proceeds exits | New-pool age, 5m participation, holder/security, sellability, profit-after-hold and hard deadline gates |
Why use this package
- Reproducible: pure synchronous functions with explicit time and normalized snapshots.
- Auditable: stable manifests, reason codes, intent keys, and machine-readable strategy catalog.
- Fail closed: malformed, stale, unavailable, or out-of-policy inputs do not authorize execution.
- Execution-neutral: returns decisions, plans, and intents; never reads a wallet, signs, submits, or moves funds.
- Integration-friendly: focused package subpaths, TypeScript declarations, replay support, and a bundled AI skill.
Experimental software. The models are explicit heuristics, not guarantees of accuracy or profitability. Validate every strategy with replay, paper trading, and your own market-rule analysis before risking funds.
Install
npm install --save-exact @viraeai/[email protected]Pin exact versions in money-moving systems. Review the changelog and replay representative fixtures before every upgrade.
Discover and import strategies
The root exports every strategy and VIRAE_STRATEGY_CORE_CATALOG. Prefer a focused subpath in production consumers.
import { VIRAE_STRATEGY_CORE_CATALOG } from '@viraeai/virae-strategy-core';
import { decideCryptoTailEntry } from '@viraeai/virae-strategy-core/crypto-tail';
import { buildPreMarketEntryPlan } from '@viraeai/virae-strategy-core/pre-market';
import { decideMuskTweetCountEntry } from '@viraeai/virae-strategy-core/musk-tweet-count';
import { decideWeatherTemperatureEntry } from '@viraeai/virae-strategy-core/weather-temperature';
import { runHitPriceSnipeSystemSimulationMatrix } from '@viraeai/virae-strategy-core/hit-price-snipe';
import { runBtc15mValueSnipeSystemSimulationMatrix } from '@viraeai/virae-strategy-core/btc15m-value-snipe';
import { decideMemecoinMomentumEntry } from '@viraeai/virae-strategy-core/memecoin-momentum-guard';
for (const strategy of VIRAE_STRATEGY_CORE_CATALOG) {
console.log(strategy.key, strategy.manifest.modelVersion, strategy.capabilities);
}Every catalog entry declares its package module, hosted Auto Trade keys, manifest, and capabilities. The capabilities explicitly report networkAccess: false and orderSubmission: false.
How it fits into a trading system
market / forecast / oracle / risk adapters
|
v
normalized snapshot
|
v
Virae Strategy Core
decision / plan / order intent
|
v
host validation -> durable claim -> venue adapter
|
v
reconciliation and settlement| Strategy Core owns | The execution host owns | | --- | --- | | Deterministic gates and selection | Market discovery and settlement-rule verification | | Configuration normalization | Network calls and timestamp-to-freshness checks | | Prices, sizes, reason codes, and intent keys | Durable risk, concurrency, balance, and compliance controls | | Pure chase, exit, or lifecycle policies where exported | Signing, submission, cancellation, reconciliation, and settlement | | Versioned manifests and replayable contracts | Monitoring, alerts, audit storage, secrets, and wallets |
Calling this package never submits an order. A returned ELIGIBLE, generated intent, or entry plan is input to a separate host-side safety and execution flow.
Decision semantics by strategy
- Crypto Tail:
WAITmeans a fresh snapshot in the same round may qualify;SKIPmeans do not submit;ELIGIBLEpermits building an execution plan, not sending it. - Pre-M:
buildPreMarketEntryPlanreturns either twelve intents or a typed failure. Take-profit generation uses reconciled net open shares only. - Musk Tweet Count: the selector prioritizes an eligible next-market preposition, then the first eligible current sleeve. Rejected candidates are returned for audit and are never executable.
- Weather Temperature: the decision returns
ENTRY_INTENTS,NO_ELIGIBLE_BUCKET, orINVALID_INPUT, plus an evaluation for every bucket and typed diagnostics. - Hit Price Snipe:
ELIGIBLEmeans a normalized Confirm-hit or explicitly modeled Pre-hit passed the pure gates. The host must prove resolution-source equivalence before execution. - BTC 15m Value Snipe:
ELIGIBLEmeans the shared recurring-market gates and venue-specific price-model/all-in-cost edge gate passed. The host remains responsible for exact fees, slippage, submission, and reconciliation. - Memecoin Momentum Guard:
ELIGIBLEmeans a persistent multi-signal observation and a fresh executable quote passed security, activity, impact, pool-share, sellability, cooldown, exposure, and daily-risk gates. The host still owns token discovery, quote provenance, durable claims, signing, submission, reconciliation, and exit scheduling.
See the public API guide for functions and types, and the integration guide for the production host contract.
Hosted execution with Virae Agents
Supported strategies can also run through Virae Agents, which provides market data, persistent scheduling, execution, reconciliation, monitoring, and an operational interface around the versioned strategy logic.
The hosted product and this library are separate execution boundaries. Current Paper/Live availability is shown in the Agents interface.
AI agents can use the bundled virae-strategy-core skill to list the installed catalog, evaluate user-supplied snapshots, and replay them locally. It produces decisions and intents only.
Safety boundary
This package intentionally does not provide live data clients, freshness guarantees, private-key handling, geographic or compliance checks, durable idempotency, order submission, persistence, or profitability claims.
Before submission, a host must revalidate market state, data freshness, tick/precision, minimum size, balance, exposure, risk stops, live-trading gates, and durable deduplication. A timeout is an unknown order outcome, not proof of failure; reconcile before retrying. Read the production safety checklist.
Documentation
- Crypto Tail strategy design
- Pre-M strategy design
- Musk Tweet Count strategy design
- Weather Temperature strategy design
- Hit Price Snipe contract
- BTC 15m Value Snipe contract
- Memecoin Momentum Guard contract
- Public API guide
- Integration and safety boundary
- Testing and replay
- Release process
- Contributing, security, and changelog
Development
Requires Node.js 20 or newer.
npm ci
npm run check
npm run test:coveragenpm run check runs strict type checking, all Jest suites, a production build, an actual tarball installation into a temporary consumer, CommonJS/ESM loading, and downstream TypeScript compilation. The repository also includes a runnable Crypto Tail decision example.
License and required attribution
CPAL-1.0 © Virae Labs. Graphical executables, including Larger Works, must prominently display “Powered by Virae Strategy Core” linked to https://www.virae.ai/, as specified in Exhibit B of LICENSE. External network deployment also triggers the source-availability obligations in CPAL-1.0.
