feat(prediction-markets): implement prediction market lifecycle via tweet commands - #1
Merged
Merged
Conversation
…weet commands - Add new .openspec.yaml, design.md, proposal.md, and specs for prediction markets. - Create a new on-chain `PredictionMarket` module to manage market creation, betting, and resolution. - Implement parimutuel payout logic and escrow for multiple coin types. - Extend Nautilus enclave to parse new commands for market creation, betting, and resolution. - Update API worker to handle new command types and integrate with the indexer for event tracking. - Add deployment script for contract publishing and environment variable management.
- Updated deploy script to parse and sync contract IDs (package ID, registry IDs, enclave IDs) into the .env files of all consuming services (api, web, indexer). - Introduced a declarative mapping (ENV_SYNC_MAP) for deployed outputs to their respective environment variables. - Enhanced error handling to skip absent outputs instead of overwriting existing values with empty strings. - Added support for optional Railway environment variable synchronization, which is now opt-in via a command-line flag. - Updated documentation and example .env files to reflect new environment variable requirements. - Refactored code for clarity and maintainability, ensuring that the deploy process is consistent and reliable.
…v and improve variable management
Implements the add-service-testing OpenSpec change: - core/api/indexer/worker/tools/nautilus-server: wiremock + #[sqlx::test] coverage. Promoted indexer/worker/tools binaries to lib+bin so handlers, pollers, and the login flow are reachable from tests. - Threaded configurable base URLs through Config and nautilus AppState so external API calls (Enoki, Twitter, TwitterAPI.io) are mockable; added build_router helpers for in-process/HTTP handler tests. - web: vitest + Testing Library unit tests (pkce, api, useXAuth) and a Playwright E2E suite (navigation, oauth callback, dashboard) with route mocks. - CI: .github/workflows/test.yml runs cargo test --workspace (Postgres + Redis services) and the web vitest + Playwright jobs. - docs: local-dev-guide Testing section (Postgres/Redis prerequisites). Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
…lows - Introduced a new script `scripts/test-flows.ts` to automate testing of the bot's transfer and prediction-market command lifecycles against a local stack. - Implemented functionality to post real command tweets and trigger the API webhook, polling for terminal status in the `webhook_events` table. - Added npm script `pnpm test-flows` for easy execution and included environment variable configurations for flexibility. - Created detailed specifications for the new capabilities and requirements of the test script. - Updated `scripts/package.json` to include necessary dependencies and scripts. - Ensured that sensitive information is not logged during execution.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PredictionMarketmodule to manage market creation, betting, and resolution.