Skip to content

feat(prediction-markets): implement prediction market lifecycle via tweet commands - #1

Merged
musashi0x merged 10 commits into
devfrom
feat/polymarket_integration
May 28, 2026
Merged

feat(prediction-markets): implement prediction market lifecycle via tweet commands#1
musashi0x merged 10 commits into
devfrom
feat/polymarket_integration

Conversation

@musashi0x

Copy link
Copy Markdown
Collaborator
  • 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.

musashi0x and others added 10 commits May 24, 2026 19:55
…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.
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.
@musashi0x
musashi0x merged commit b3133c3 into dev May 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant