fix(gemini-titan): add terms acceptance flow before order submission#1326
fix(gemini-titan): add terms acceptance flow before order submission#1326AbhilashG12 wants to merge 2 commits into
Conversation
- Add getTerms(), getTermsStatus(), acceptTerms() methods - Auto-check and accept terms before placing orders - Add error mapping for terms rejection - Update OpenAPI spec with new endpoints - Add unit tests with mocks Fixes pmxt-dev#1068
PR Review: FAILWhat This DoesAdds a Gemini Titan terms-acceptance preflight before Blast RadiusGemini Titan trading path only: Consumer VerificationBefore (base branch): // base core/src/exchanges/gemini-titan/fetcher.ts
async submitRawOrder(payload) {
return this.postAuthenticated('/v1/prediction-markets/order', payload);
}After (PR branch): // PR core/src/exchanges/gemini-titan/fetcher.ts:155-164
async getTermsStatus() {
return this.postAuthenticated('/v1/prediction-markets/terms/status', {});
}The same PR's OpenAPI/spec declares that endpoint as Test Results
Findings
PMXT Pipeline Check
Semver Impactpatch -- intended Gemini Titan trading bug fix with no SDK API break. RiskThe preflight is on the order-submission path, so if Gemini's terms status endpoint is GET-only, all Gemini Titan order submissions will fail before reaching |
- Properly mock GeminiAuth - Fix http client mock - Use as any for private method spying - Reset termsAccepted flag in tests Fixes pmxt-dev#1068
PR Updated ✅Fix applied:
|
PR Review: PASS (NOT VERIFIED)What This DoesThis adds a Gemini Titan terms-acceptance preflight before authenticated order submission. Before posting an order, the fetcher checks Blast RadiusGemini Titan authenticated trading paths only: Consumer VerificationBefore (base branch): [
["headers", {"request":"/v1/prediction-markets/order","nonce":123,"symbol":"PM-GEMINI","side":"buy"}],
["POST", "https://api.gemini.com/v1/prediction-markets/order", {}, {"headers":{"X-GEMINI-PAYLOAD":"mock"}}]
]After (PR branch): [
["headers", {"request":"/v1/prediction-markets/terms/status","nonce":123}],
["GET", "https://api.gemini.com/v1/prediction-markets/terms/status", {"headers":{"X-GEMINI-PAYLOAD":"mock"}}],
["headers", {"request":"/v1/prediction-markets/terms/accept","nonce":123}],
["POST", "https://api.gemini.com/v1/prediction-markets/terms/accept", {}, {"headers":{"X-GEMINI-PAYLOAD":"mock"}}],
["headers", {"request":"/v1/prediction-markets/order","nonce":123,"symbol":"PM-GEMINI","side":"buy"}],
["POST", "https://api.gemini.com/v1/prediction-markets/order", {}, {"headers":{"X-GEMINI-PAYLOAD":"mock"}}]
]I could not verify the real Gemini terms endpoints against production because this review environment does not have Gemini trading credentials and should not place live orders. Test Results
FindingsNo blocking findings. PMXT Pipeline Check
Semver Impactpatch -- authenticated Gemini order submission now performs a required venue preflight/acceptance flow without changing the public PMXT API. RiskThe unverified risk is the exact live Gemini terms endpoint contract and whether the venue accepts authenticated |
What this PR does
Adds automatic terms acceptance for Gemini-Titan orders.
The problem
Gemini now requires users to accept their Prediction Markets terms before placing orders. New API keys can't place any orders until terms are accepted.
The fix
PMXT now:
Changes
Fixes #1068