Bifrost Integration Chat — 2026-02-24 (Tuesday)
Channel: #forsyt-bm-integration (Suntech Innovation Slack)
Bhargav — 11:23 AM
GM @Michael Cheremuhin We want to move ahead and get the production API keys. It has been difficult to test and integrate with your staging keys.
We have been trying to use recovery APIs because we were not getting all the markets when we compared with 1 exch.
So, we want to integrate your production APIs to get all the markets and seamlessly integrate all the markets.
We need the prod keys ASAP.
Michael Cheremuhin — 2:55 PM
hi @Bhargav. guess some confusion around UAT which doesn't have live odds identical to prod. sure, let us prepare the prod access to unblock
Michael Cheremuhin — 5:23 PM
@Bhargav please check if you are able to connect to prod instances:
Bifrost Prod RabbitMQ ssl: false
Bifrost Prod RabbitMQ virtual host: /customers
Bifrost Prod RabbitMQ username: forsyt-mq
Bifrost Prod RabbitMQ password: FD7zVC7s2BrFppCfzY
Customer topics prefix: forsyt
Bifrost Prod Placebet API access token: 4eWdzS66FNJWFJ56FS
whitelisted IPs:
- 108.61.221.157
- 45.76.139.124
- 94.204.88.0/21
******************************************************************************
Bifrost Prod Placebet REST API URL: https://api.bifrost.bet/api/v1/bets/place
Bifrost Prod Placebet REST API Swagger: https://api.bifrost.bet/swagger-ui/index.html```
> **Thread** (2 replies):
>
> **Michael Cheremuhin** — 5:45 PM
> @Bhargav for now I have enabled bookmaker cricket content. I strongly suggest to start with it to get the initial integration and then adding more content once we have initial state of integration
>
> **Michael Cheremuhin** — 1:40 PM
> @Bhargav overall, I have a green light for proceeding with your integration to prod. please switch to prod env and let's do some checks
>
---
**Badal Agrawal** — 5:33 PM
Please add [pmalik.forsyt.io](http://pmalik.forsyt.io) into the slack group.
> **Thread** (4 replies):
>
> **Michael Cheremuhin** — 5:33 PM
> @Badal Agrawal you mean `pmalik@forsyt.io`?
>
> **Badal Agrawal** — 5:34 PM
> Yes, my bad
>
> **Michael Cheremuhin** — 5:34 PM
> @Andriy Pravdyvyi
>
> **Andriy Pravdyvyi** — 5:40 PM
> The user has already been added to Slack.
> Pls, ask him to check his email.
> 📎 1.png
>
---
**Badal Agrawal** — 5:33 PM
@Michael Cheremuhin
---
**Badal Agrawal** — 5:33 PM
@Andriy Pravdyvyi
---
**Andriy Pravdyvyi** — 5:34 PM
Ok, in 15 min
---
**Prashant Malik** — 5:55 PM
hi all thx for adding me
---
**Prashant Malik** — 5:59 PM
i just integrated the prod api and now i am getting all the markets with prices , we will test it with a live match when the actual updates are happening today .
Here is our design for integration , if you think we are doing something that we shouldnt be doing or there is an alternate way then pls let us know
How Hannibal Integrates with Bifrost
1. Two Communication Channels
A. RabbitMQ (real-time push) — 6 queues consumed continuously:
┌───────────────────────────────┬────────────────────────────┬──────────────────────────────────────────────────────┐
│ Queue │ Proto Type │ Purpose │
├───────────────────────────────┼────────────────────────────┼──────────────────────────────────────────────────────┤
│ forsyt.category.queue │ bifrost.Category │ Sport/league categories │
├───────────────────────────────┼────────────────────────────┼──────────────────────────────────────────────────────┤
│ forsyt.event.queue │ bifrost.Event │ Fixtures (match metadata, teams, start times) │
├───────────────────────────────┼────────────────────────────┼──────────────────────────────────────────────────────┤
│ forsyt.market-catalogue.queue │ bifrost.MarketCatalogue │ Market definitions (name, runners, type) │
├───────────────────────────────┼────────────────────────────┼──────────────────────────────────────────────────────┤
│ forsyt.market-book.queue │ bifrost.MarketBook │ Live prices (odds, volumes, status) — highest volume │
├───────────────────────────────┼────────────────────────────┼──────────────────────────────────────────────────────┤
│ forsyt.bets.snapshot.queue │ bifrost.BetSnapshot │ Bet confirmation/status updates │
├───────────────────────────────┼────────────────────────────┼──────────────────────────────────────────────────────┤
│ forsyt.bets.outcomes.queue │ bifrost.BetOutcomeSnapshot │ Settlement results (win/lose/void) │
└───────────────────────────────┴────────────────────────────┴──────────────────────────────────────────────────────┘
The first 4 are data queues (best-effort, always ack). The last 2 are financial queues (requeue on error up to 3 times, then
reject to DLQ).
B. REST API (https://api.bifrost.bet/api/v1/) — two use cases:
- Recovery (startup + periodic) — requests are async; results arrive back via the same RabbitMQ queues
- Bet placement — synchronous POST, immediate response
2. Recovery Pipeline (Startup + Every 10 Minutes)
On startup (5s delay) and every 10 minutes, we run a 2-pass recovery:
Pass 1: Events Recovery
POST /api/v1/recovery/events { sportId: "2" }
→ Wait ~10s for events to arrive via RabbitMQ
→ Result: ~23 cricket events populate our cache
Pass 2: Market Batch Recovery
- Ask our Betfair adapter for all active cricket fixtures (next 7 days, live + upcoming)
- Cross-reference Betfair fixture IDs with Bifrost event IDs (via externalIds mapping + team name matching)
- Send ONE batch call:
POST /api/v1/recovery/markets {
eventIds: ["35293179", "22.148402", "35296119", ...], // ~40 IDs
includeMarketBook: true,
includeMarketCatalogue: true
}
→ Wait ~10s for catalogues + books to arrive via RabbitMQ
→ Result: ~418 market catalogues with live prices
Rate limit awareness: All recovery endpoints share a single 60s server-side cooldown. We enforce a 65s minimum between any two
recovery calls and handle HTTP 429 / 400 "Rate limit" with retry + backoff.
3. What We Cache and How We Use It
All RabbitMQ data goes into an in-memory cache with version-based dedup:
BifrostCache
├── events: eventId → BifrostEvent (teams, start time, status)
├── marketCatalogues: marketId → BifrostMarketCatalogue (name, runners, type)
├── marketBooks: marketId → BifrostMarketBook (live odds, volumes, status)
├── betfairEventMap: betfairEventId → bifrostEventId (cross-provider mapping)
└── eventMarkets: eventId → Set<marketId> (index)
When a user opens a cricket fixture page:
1. HTTP request fetches markets from cache (instant, no API call)
2. WebSocket subscription starts receiving real-time price deltas from market-book.queue updates
4. Market ID Conventions We Handle
┌────────┬───────────────────────┬─────────────┬────────────────────────────────────────────────┐
│ Prefix │ Source │ Example │ Content │
├────────┼───────────────────────┼─────────────┼────────────────────────────────────────────────┤
│ 1.x │ Betfair exchange │ 1.234567890 │ Match Odds (we only keep MATCH_ODDS from 1.x) │
├────────┼───────────────────────┼─────────────┼────────────────────────────────────────────────┤
│ 9.x │ Bifrost session/fancy │ 9.4808965 │ Over Runs, Session markets — live matches only │
├────────┼───────────────────────┼─────────────┼────────────────────────────────────────────────┤
│ 14.x │ Bifrost sportsbook │ 14.123456 │ Player props, innings, balls & wickets │
└────────┴───────────────────────┴─────────────┴────────────────────────────────────────────────┘
5. Bet Placement Flow
User clicks odds → Frontend POST /api/bets →
Backend POST https://api.bifrost.bet/api/v1/bets/place {
marketId, selectionId, side, odds, stake,
memberCode: "forsyt",
ipAddress: "108.61.221.157",
currency: "HKD"
}
→ Synchronous response (accepted/rejected)
→ Bet status updates arrive via forsyt.bets.snapshot.queue
→ Settlement arrives via forsyt.bets.outcomes.queue
6. What We DON'T Use
- No on-demand per-fixture recovery (everything is batch)
- No Redis/persistent storage for Bifrost data (pure in-memory cache, re-populated on restart)
- No polling — all real-time data is push via RabbitMQ
- We don't consume 1.x exchange markets from Bifrost (those come from our direct Betfair integration)
7. Connection Details
RabbitMQ: mq.bifrost.bet:5577 (amqp, no SSL)
vhost: /customers
user: forsyt-mq
REST API: https://api.bifrost.bet/api/v1/
Bearer token auth
Queue prefix: forsyt
Member code: forsyt
---
In summary: We connect via RabbitMQ for continuous real-time data (events, catalogues, prices, bet outcomes) and use the REST API
only for recovery (bulk data sync on startup/periodic) and bet placement. The RabbitMQ connection is the primary data channel —
recovery just ensures we don't miss anything.
---
**Prashant Malik** — 7:02 PM
- errorCode: 2039
- errorMessage: "Bet placement failed by provider"
Error code 2039 is a Bifrost-specific code meaning the upstream provider (the actual bookmaker behind Bifrost) rejected the bet.
This is not a format issue on our side — the request is well-formed and accepted by Bifrost's API, but the underlying provider
declines it.
Common reasons for 2039:
1. Account not fully activated — credit/trading limits not set up on Bifrost's provider side
2. Insufficient credit — the forsyt member account has no balance/credit allocated in production
3. Market suspended at provider level — the market might be temporarily suspended upstream
This is something you need to raise with the Bifrost team. You can share this with them:
Our bets are being rejected with error code 2039 ("Bet placement failed by provider"). The HTTP request is accepted (returns
PENDING), but the bet snapshot comes back as FAILED immediately.
Example request:
{
"sportId": "2",
"marketId": "9.4814194",
"runnerId": 7114746,
"size": 1,
"memberSize": 1,
"odds": 71,
"side": "BACK",
"memberCode": "forsyt",
"currency": "HKD",
"ipAddress": "108.61.221.157"
}
Response: betId: 1187, status: PENDING → snapshot: status: FAILED, errorCode: 2039
Is the forsyt production account fully activated with trading credit? Bets worked on preprod.
---
**Prashant Malik** — 7:18 PM
any resolution here , this is urgent we are testing in a live match , we only have a few hours to test and fix bugs in our system , please resolve this asap
> **Thread** (6 replies):
>
> **Michael Cheremuhin** — 7:19 PM
> i’m aligning some things with trading team. eta 20 mins
>
> **Prashant Malik** — 7:21 PM
> thx
>
> **Prashant Malik** — 7:41 PM
> any updates ?
>
> **Michael Cheremuhin** — 7:43 PM
> that is currently between trading team and our business unit to allign, as trading team is not really happy to have any test bets in production
>
> **Prashant Malik** — 7:49 PM
> consider them as real bets , we have already paid a deposit , yoiu can deduct from that if we loose
>
> **Prashant Malik** — 8:04 PM
> any updates , we are loosing time , we will just do a few small bets and then we are releasing it to customers
>
---
**Michael Cheremuhin** — 8:23 PM
@Prashant Malik we alligned internally and here is the plan that we need to follow:
1. you finish the integration with UAT env (you already have the access there). trading team will provide you with live events the way so you always have something to place on. it won't mimic production coverage, but should be enough to do the integration
2. once you are happy with integration, you need to provide us with the access to your membersite. our business acceptance testing team will take the testing on priority to check that limits are correct and general flows are not corrupted
3. once business acceptance testing is done and we have a green light from them, we will enable the bet placement for you in PROD env and you'll be free to go live with our content
---
**Michael Cheremuhin** — 8:23 PM
currently in UAT you have Eng v Pakistan game running
---
**Prashant Malik** — 8:25 PM
ok how can i give you access to our membersite , i can do it right now
> **Thread** (10 replies):
>
> **Michael Cheremuhin** — 8:26 PM
> for business acceptance testing we need to use UAT integration, as there are unobvious flows that needs to be reproduced from our end, which we can't do in PROD
>
> **Michael Cheremuhin** — 8:27 PM
> please switch to UAT env and give us access in any way that we can use to access your site
>
> **Prashant Malik** — 8:50 PM
> here is the invite link , its a one time use invite , you can access the product after login through this link https://forsyt.io/join?ref=PLR-589CT9
>
> **Michael Cheremuhin** — 8:51 PM
> will it work only via social account access? we need the account which we can share among multiple team members
>
> **Michael Cheremuhin** — 8:52 PM
> also, is it already re-connected to UAT env?
>
> **Prashant Malik** — 8:53 PM
> it only works with social account , its connected to UAT for bet placement and prod for rabbitmq
>
> **Michael Cheremuhin** — 8:54 PM
> i'm afraid I can't share my social account with other team members
>
> **Michael Cheremuhin** — 8:54 PM
> I need to collect the access data, confirm that it works and pass it futher the pipeline
>
> **Prashant Malik** — 8:54 PM
> u can create a new email id just for testing on gmail and use that
>
> **Michael Cheremuhin** — 9:23 PM
> @Prashant Malik i've passed the request to IT team to provide us with gmail account. we'll proceed once it's prepared
>
---
*endyroot joined the channel* — 8:30 PM
---
**Prashant Malik** — 8:50 PM
here is the invite link , its a one time use invite , you can access the product after login through this link https://forsyt.io/join?ref=PLR-589CT9
> **Thread** (160 replies):
>
> **Michael Cheremuhin** — 2:20 PM
> @Prashant Malik hi! can you please add balance to nodenode725@gmail.com
>
> **Prashant Malik** — 4:03 PM
> added
>
> **Prashant Malik** — 5:00 PM
> any updates
>
> **Prashant Malik** — 6:23 PM
> The match is about to start in a few minutes will we be able to place a bet today
>
> **Michael Cheremuhin** — 6:27 PM
> @Prashant Malik you mean Sri Lanka v New Zealand game?
>
> **Michael Cheremuhin** — 6:28 PM
> let me check what's available and if this event can be used
>
> **Prashant Malik** — 6:41 PM
> ya
>
> **Prashant Malik** — 7:16 PM
> match has started any updates
>
> **Michael Cheremuhin** — 8:01 PM
> @Prashant Malik you switched back to PROD env, right?
>
> **Prashant Malik** — 8:13 PM
> only the rabbit mq part is prod , the betting is on preprod
>
> **Michael Cheremuhin** — 8:25 PM
> i'm afraid it won't work this way as preprod and prod has different events and markets ids for that part of content
>
> **Michael Cheremuhin** — 8:26 PM
> give me some time to allign with conformance team what might be the days and slots, so we switch everything for that period and run through all the cases in one go
>
> **Prashant Malik** — 8:35 PM
> i can put everything on preprod or prod , whatever you want right now
>
> **Prashant Malik** — 8:36 PM
> just that on preprod it doesnt work properly , the population of markets doesnt work , thats why i was using markets from prod and betting from preprod .
>
> **Prashant Malik** — 8:36 PM
> lemme know please , its urgent for us , I have no idea why its taking so muc time
>
> **Michael Cheremuhin** — 8:54 PM
> i'm getting the account fully workable for conformance team at this moment, but the fact that they should login through gmail adds some complications
>
> **Michael Cheremuhin** — 8:54 PM
> if we'd have just email login, we'd already started
>
> **Michael Cheremuhin** — 8:57 PM
> @Prashant Malik please give another invitation link
>
> **Prashant Malik** — 8:58 PM
> https://forsyt.io/join?ref=PLR-NUMRLR
>
> **Michael Cheremuhin** — 9:02 PM
> gmail is blocked for that part of our network
>
> **Michael Cheremuhin** — 9:03 PM
> any option to get us email login so team can start the testing 9:30uk time tomorrow?
>
> **Prashant Malik** — 9:21 PM
> you can use the Email option now , just give any valid email address , it will send a code to that email use that code to login
>
> **Prashant Malik** — 9:21 PM
> https://forsyt.io/join?ref=PLR-7FW6D3
>
> **Michael Cheremuhin** — 9:21 PM
> please enable this one nodenode725@gmail.com
>
> **Prashant Malik** — 9:24 PM
> pls send me the code it must be in your email
>
> **Michael Cheremuhin** — 9:24 PM
> 044561
>
> **Prashant Malik** — 9:24 PM
> its enabled now
>
> **Michael Cheremuhin** — 9:26 PM
> finally, i'm in
>
> **Michael Cheremuhin** — 9:27 PM
> ok, please switch the integration to Preprod env for tomorrow 9:00uk time, our team will take it
>
> **Prashant Malik** — 9:43 PM
> its on preprod now , when they login tomorrow u will have to just give them the new code that will be sent to the email.
> but as i said in preprod the markets dont populate , only a few come , so there will be a few markets for India vs Zimbabwe
>
> **Michael Cheremuhin** — 2:18 PM
> @Prashant Malik hi! can you please disable geo restrictions for a while, seems like your system is blocking some access
>
> **Prashant Malik** — 2:19 PM
> there is no geo restriction in our system , what is blocking for you ?
>
> **Michael Cheremuhin** — 2:19 PM
> works fine from my pc, but traders get into loop loading and then back to login screen after entering verification code
>
> **Michael Cheremuhin** — 2:19 PM
> not sure why it's happening as it works for me
>
> **Prashant Malik** — 2:20 PM
> what url are they using to login
>
> **Prashant Malik** — 2:21 PM
> just ask them to use https://forsyt.io
>
> **Prashant Malik** — 2:25 PM
> also are you giving them the new code generated on the email , everytime a new login happens a new code is generated
>
> **Michael Cheremuhin** — 2:32 PM
> yes, i don't think this is the reason
>
> **Michael Cheremuhin** — 2:33 PM
> after the verification code is entered, can it be doing and redirections to gmail hosts? that our part of network is very strict on security
>
> **Michael Cheremuhin** — 2:59 PM
> just tried again full flow:
> 1. open incognito
> 2. enter https://forsyt.io/
> 3. enter email
> 4. enter verification code
> and it's back to login page
>
> **Michael Cheremuhin** — 3:07 PM
> @Prashant Malik
>
> **Prashant Malik** — 3:08 PM
> No it should not go to Gmail
>
> **Michael Cheremuhin** — 3:09 PM
> then i don't understand what might be the problem
>
> **Michael Cheremuhin** — 3:09 PM
> do you have any authorization errors on backend side?
>
> **Michael Cheremuhin** — 3:12 PM
> let us check with security team if they can see which redirect might be blocking by firewall
>
> **Prashant Malik** — 3:17 PM
> it does go to web3auth to do authentication
>
> **Prashant Malik** — 3:18 PM
> https://web3auth.io/
>
> **Prashant Malik** — 4:06 PM
> any updates ? is everything resolved now ?
>
> **Michael Cheremuhin** — 4:40 PM
> waiting for IT team to bring the answers :disappointed:
>
> **Prashant Malik** — 6:39 PM
> The match is starting in 20 minutes , and today it's an India match , we really want to give to our customers. Any chance we can get clearance now ??
>
> **Michael Cheremuhin** — 6:54 PM
> I understand @Prashant Malik. we are doing our best to bypass that, but it's still pending
>
> **Prashant Malik** — 2:22 PM
> any updates ?
>
> **Michael Cheremuhin** — 3:14 PM
> @Prashant Malik hi! we are still struggling to get our conformance team the access to your membersite as some redirection after code verification gets blocked by our security rules. I understand that we are very short on time before IPL, we are doing our best to find a way to bypass that.
> having a simple flow to login with username/password at least temporaly available (for 2-3 hours sessions) would help us a lot, but while you don't have we are looking for walkaround
>
> **Michael Cheremuhin** — 3:15 PM
> hope I can find some way today and potentially talk to weekend shift if anyone available can take that asap
>
> **Michael Cheremuhin** — 3:47 PM
> do you think username/password login can be added temporaly?
>
> **Prashant Malik** — 4:22 PM
> try login now you will see a Dev login yellow button after you click signin , click it and just type the username as abcd
>
> Please test it asap and let me know when we can go ahead
> 📎 image.png
>
> **Michael Cheremuhin** — 4:22 PM
> on it
>
> **Michael Cheremuhin** — 4:59 PM
> @Prashant Malik we got in
>
> **Michael Cheremuhin** — 4:59 PM
> are you connected to preprod env?
>
> **Michael Cheremuhin** — 5:01 PM
> do you have our event and market for https://forsyt.io/fixture/35307534
>
> **Michael Cheremuhin** — 5:15 PM
> did the recovery, seems to appear
>
> **Prashant Malik** — 5:20 PM
> Ok great
>
> **Prashant Malik** — 5:20 PM
> Are you able to test
>
> **Prashant Malik** — 5:20 PM
> Pls lemme know if you need something from me
>
> **Michael Cheremuhin** — 5:27 PM
> @Prashant Malik inside markets we have oddsType. looks like you are handling harjeets as decimals
>
> **Michael Cheremuhin** — 5:28 PM
> also prices doesn't seem to reflecting on change, but lines do
>
> **Michael Cheremuhin** — 5:28 PM
> also max stake doesn't seem to be updating
>
> **Michael Cheremuhin** — 5:33 PM
> let me know if you need a reference to source fields
>
> **Prashant Malik** — 5:34 PM
> pls send
>
> **Michael Cheremuhin** — 5:37 PM
> 1. market catalogue => oddsType for decimal or harjeets
>
> **Michael Cheremuhin** — 5:37 PM
> 2. prices sit inside runner, guess just need a check
>
> **Prashant Malik** — 5:38 PM
> indian markets work on decimals so we are using that , is there an issue with that ?
>
> **Michael Cheremuhin** — 5:38 PM
> 3. max stake sits near the prices
>
> **Michael Cheremuhin** — 5:38 PM
> the case is - we provide cricket in harjeets and other content in decimal. the math to switch is pretty simple:
>
> **Michael Cheremuhin** — 5:41 PM
> decimal price = 1 + (harjeet_price / 100)
> harjeet_price = (decimal_price * 100) - 100
>
> **Michael Cheremuhin** — 5:41 PM
> if you'll decide to do the conversion, don't miss converting bets odds as well
>
> **Michael Cheremuhin** — 5:41 PM
> please rely on market odds type
>
> **Prashant Malik** — 5:42 PM
> ok
>
> **Prashant Malik** — 5:49 PM
> do we need to fix these now before you can clear us or do we fix these later ??
>
> **Michael Cheremuhin** — 5:49 PM
> we can't proceed without this with bet placement
>
> **Michael Cheremuhin** — 5:53 PM
> in particular lay bets will be absolutely incorrect
>
> **Michael Cheremuhin** — 5:58 PM
> without max stake members might be either limited or placing bets that won't get matched
>
> **Prashant Malik** — 6:41 PM
> ok the changes have been made can you please reinitiate recovery so that things are populated and you can test
>
> **Michael Cheremuhin** — 6:53 PM
> done. passing back
>
> **Pran** — 7:02 PM
> @Michael Cheremuhin can you suggest some sample market to check for harjeets that we can see on our platform
>
> **Michael Cheremuhin** — 7:03 PM
> overall was expecting it here https://forsyt.io/fixture/35307534
>
> **Michael Cheremuhin** — 7:03 PM
> but markets seem to drop off
>
> **Michael Cheremuhin** — 7:04 PM
> can you see why that happened?
>
> **Prashant Malik** — 7:06 PM
> it happens all the time on preprod m prod runs smoothly and all markets are there and they never drop off
>
> **Michael Cheremuhin** — 7:06 PM
> but why it dropped overall? if you have event and markets entities, what's the reason to be removed?
>
> **Michael Cheremuhin** — 7:07 PM
> i've resent the event now and it came back
>
> **Michael Cheremuhin** — 7:07 PM
> but markets are in incorrect state
>
> **Michael Cheremuhin** — 7:08 PM
> can't see prices to be updating
>
> **Prashant Malik** — 7:08 PM
> because they are populated when the server starts , they ar epopulated in the srever cache when we do any fix and restart the server they dropoff and the preprod is unreliable in giving us those markets again
>
> **Prashant Malik** — 7:09 PM
> prod always gives the markets consistently
>
> **Michael Cheremuhin** — 7:09 PM
> during prematch markets are not updating constantly
>
> **Michael Cheremuhin** — 7:11 PM
> as i look now - event is traded live for you, but only eventual updates are reflected
>
> **Michael Cheremuhin** — 7:12 PM
> 📎 image.png
>
> **Michael Cheremuhin** — 7:12 PM
> 📎 image.png
>
> **Michael Cheremuhin** — 7:14 PM
> seems like receiving market catalogues causes markets to go off from site
>
> **Michael Cheremuhin** — 7:14 PM
> market catalogues might get updated after creation
>
> **Michael Cheremuhin** — 7:16 PM
> so, we need to track down:
> 1. the reason why markets go off from site
> 2. why prices updates are skipping
>
> **Michael Cheremuhin** — 7:16 PM
> seems like you might need some persistence layer on your side for data consistency
>
> **Michael Cheremuhin** — 7:18 PM
> trying recovery myself but can't get markets back on site
>
> **Michael Cheremuhin** — 7:18 PM
> please check
>
> **Prashant Malik** — 7:23 PM
> Ok let me add persistence, it's not needed if the api works consistently but I will add it in any case , again reiterating prod bifrost works flawlessly
>
> **Michael Cheremuhin** — 7:32 PM
> we have full log of every message updating the prices, if you have something to compare with, we can check update to update. if you have only current state with zero details if any new message came in and was processed/skipped, i'm not sure what might be the options to investigate
>
> **Michael Cheremuhin** — 7:35 PM
> please also check if there any combinations for possible data corruption like market catalogue updated and market book not, vice versa, or both are updated etc
>
> **Prashant Malik** — 9:10 PM
> i have added a persistence layer of cache , you can test it now
>
> **Michael Cheremuhin** — 9:14 PM
> perfect. do you know why there are no our markets at https://forsyt.io/fixture/35307534? what might be missing there
>
> **Prashant Malik** — 9:19 PM
> because we are not getting any events from preprod api for that match
>
> **Michael Cheremuhin** — 9:24 PM
> let me resend it
>
> **Michael Cheremuhin** — 9:25 PM
> did the resend
>
> **Michael Cheremuhin** — 9:25 PM
> 📎 image.png
>
> **Michael Cheremuhin** — 9:26 PM
> can you see what was the last message?
>
> **Michael Cheremuhin** — 9:29 PM
> potentially and statistically missing events/markets mapping is one of the most common case. we need to be bulletproof here
>
> **Michael Cheremuhin** — 9:30 PM
> i expect you should've been received something like this:
> ```{
> "eventId": "22.148406",
> "name": "England v New Zealand",
> "startTime": "2026-02-27T13:30",
> "categoryId": "9.2322",
> "competitors": [
> {
> "id": "18",
> "shortName": "NZ",
> "fullName": "New Zealand"
> },
> {
> "id": "38",
> "shortName": "England",
> "fullName": "England"
> }
> ],
> "externalIds": [
> {
> "provider": "1",
> "eventId": "35307534"
> }
> ],
> "status": "",
> "version": "1772196601222",
> "sportId": "2"
> }```
>
> **Michael Cheremuhin** — 9:30 PM
> should i also resend the category? might it be the case?
>
> **Prashant Malik** — 9:36 PM
> These are setMarketBook status transitions
> (BALL_RUNNING:left_right_arrow:OPEN) for the England vs NZ match (the 9.2257xxx market IDs
>
> lemme check
>
> **Michael Cheremuhin** — 9:37 PM
> i'd expect markets showing no matter if it's open or ball running, we can proceed with markets later. we need to understand the case when all the markets drop off
>
> **Prashant Malik** — 9:38 PM
> now they will not drop off , its persisted in cache but the england new zealand match is a diferrent case
>
> **Michael Cheremuhin** — 9:38 PM
> what's missing there? let me resend the markets now
>
> **Michael Cheremuhin** — 9:39 PM
> did resend the catalogues:
>
> **Michael Cheremuhin** — 9:39 PM
> 📎 image.png
>
> **Michael Cheremuhin** — 9:39 PM
> as well as books:
>
> **Michael Cheremuhin** — 9:39 PM
> 📎 image.png
>
> **Michael Cheremuhin** — 9:47 PM
> overall, we need to have some flow where you can validate the missing content by market id or event id. like for given event id grab everything that exists and everything that is missing, and same for market id. let's imagine IPL finals and nothing on site. what we gonna do?
>
> **Prashant Malik** — 9:50 PM
> do you have any documentation on the details that are sent in each message
>
> **Michael Cheremuhin** — 9:50 PM
> 📎 BFST-Bifrost API Public Documentation-160226-104956.pdf
>
> **Michael Cheremuhin** — 9:51 PM
> sure, we have a description for each field + protos
>
> **Prashant Malik** — 10:28 PM
> there was an issue with the persistent cache that was implemented , its fixed now . Can we test now
>
> **Michael Cheremuhin** — 10:28 PM
> sure. let me resend the event first
>
> **Michael Cheremuhin** — 10:28 PM
> oh, can see market on site. let me try changing the markets
>
> **Michael Cheremuhin** — 10:32 PM
> a bit strange case - when i'm changing the prices only second update is applied
>
> **Michael Cheremuhin** — 10:32 PM
> when i change once - it's skipped. second update applied
>
> **Michael Cheremuhin** — 10:32 PM
> tried multiple times, sustainable
>
> **Michael Cheremuhin** — 10:33 PM
> market status change doesn't apply, might be the same reason
>
> **Prashant Malik** — 10:50 PM
> can you send some new messages i just put some logging to debug
>
> **Michael Cheremuhin** — 10:51 PM
> the event is not showing anymore
>
> **Michael Cheremuhin** — 10:51 PM
> 📎 image.png
>
> **Michael Cheremuhin** — 10:51 PM
> but i've sent some messages
>
> **Michael Cheremuhin** — 10:52 PM
> i'm done for today, please let me know if you'll have any updates to proceed further
>
> **Prashant Malik** — 10:54 PM
> - ACCEPTED by the backend (no rejections)
> - Pushed via WS to 3 connected clients on fixture 35307534
>
> The backend is working correctly — every update is accepted and broadcast. The prices changed: 112→98→90→82→80 (back) and 125→112→101→91→89 (lay).
>
> **Prashant Malik** — 10:55 PM
> pls try with a fixture that is still active
>
> **Michael Cheremuhin** — 10:57 PM
> i can try later today, but https://forsyt.io/fixture/35307534 doesn't seem to load
>
> **Prashant Malik** — 11:01 PM
> that match is over
>
> **Prashant Malik** — 11:02 PM
> you can try with https://forsyt.io/fixture/35312080?sportId=27
>
> **Michael Cheremuhin** — 11:04 PM
> will check in couple of hours and will get back
>
> **Pran** — 2:35 AM
> @Michael Cheremuhin any updates?
>
> **Michael Cheremuhin** — 3:07 AM
> @Pran I think overall we are in a good shape before monday:
> 1. updates seems to be reflecting
> 2. you've added a layer to track down the updates from us
> 3. you've added the support for harjeets prices (not validated yet)
>
> **Michael Cheremuhin** — 3:08 AM
> on monday we will proceed with the following:
> 1. my team will check the markets updates lags
> 2. we will also check new events hitting the membersite
>
> **Michael Cheremuhin** — 3:08 AM
> once we move on over that, will proceed with conformance team to do the trading flow and check bet placement
>
> **Michael Cheremuhin** — 3:09 AM
> after bet placement is done, we will need to also check the following:
> 1. settlement
> 2. rain settlement
> 3. resettlement
> 4. settled and unsettled bets voiding/unvoiding
>
> **Michael Cheremuhin** — 3:22 AM
> btw, what's your policy on resettlement and markets voiding after the settlement? we have the following cases:
> 1. bets might be voided after settlement, rare case but might be happening
> 2. market might be resettled by moving from settled status and back to settled with changed bets outcomes
> please check if that's supported
>
> **Michael Cheremuhin** — 3:22 AM
> also make sure that you check max stake (runner level) before accepting the bet as any bet exceeding max stake will get rejected
>
> **Michael Cheremuhin** — 3:23 AM
> and double check to be sending us both memebrsize and size if you have PT, and equal values if you don't. both fields in bet place request are mandatory
>
> **Prashant Malik** — 4:15 AM
> What's Ready
>
> Market updates (prices) — Full pipeline working: RabbitMQ → cache → WS → frontend. WS-first strategy with HTTP polling fallback only when WS disconnects.
>
> Settlement — Full flow implemented: forsyt.bets.outcomes.queue → BifrostBetConsumer → settlementService. Supports WON, LOST, VOID, HALF_WON, HALF_LOST, PUSH.
> Financial queue has 3 retries + DLQ.
>
> Max stake (runner level) — Checked in placeOrder() via getBetslip(). Reads maxStakeCurrencies[HKD] or maxStake from the best price level on the runner before
> sending to Bifrost. Rejects if exceeded.
>
> memberSize + size — Both always sent in bet placement request. memberSize = full member stake, size = memberSize * (1 - ptPercent/100). When PT=0 both are equal.
> Both are mandatory fields.
>
> Rain settlement — Handled passively. Bifrost sends PUSH outcome which maps to void (stake refund, zero P&L). No proactive rain detection — relies entirely on
> Bifrost sending the correct outcome.
>
>
> We need to think about resettlement and void after resettlement , will have an implementation by monday for that
>
> **Michael Cheremuhin** — 4:57 AM
> we will return to full testing on monday. i will also run some checks over the weekend.
>
> **Prashant Malik** — 2:28 AM
> When Bifrost sends a new outcome for an already-settled bet (e.g. changing WIN to LOSE), the system now detects this via a version number on each outcome
> message. If the version is higher and the outcome is different, it first atomically reverses everything the original settlement created — user balance,
> transaction records, state trackers, commission records and ledger entries, margin records and ledger entries, and Take propagation — then
> re-settles the bet with the new outcome through the normal settlement flow. Stale messages (lower or equal version) are silently ignored. Same outcome at a
> higher version just bumps the version without touching financials.
>
> Admin void of a settled order now uses the same shared reversal logic instead of the old inline code that only handled balance and order fields. It reverses the
> full settlement first, then void-settles through the standard path — so commission, margin, ledger, and Take are all correctly handled.
>
> **Prashant Malik** — 3:03 PM
> any updates
>
---