Fix order match link

This commit is contained in:
ekzyis 2023-12-02 02:27:41 +01:00
parent 272591b015
commit 7fc63f44cd
1 changed files with 3 additions and 3 deletions

View File

@ -43,14 +43,14 @@ const click = (order) => {
const stake = order.quantity * (100 - order.price)
const certainty = (100 - order.price) / 100
const share = order.ShareDescription === 'YES' ? 'NO' : 'YES'
router.push(`/market/${marketId}/form/buy?stake=${stake}&certainty=${certainty}&share=${share}`)
router.push(`/market/${marketId}/form?stake=${stake}&certainty=${certainty}&share=${share}&side=BUY`)
}
if (order.side === 'SELL') {
// match SELL YES with BUY YES and vice versa
// SELL YES -> BUY YES, SELL NO -> BUY NO
const stake = order.quantity * order.price
const certainty = order.price / 100
const share = order.ShareDescription === 'YES' ? 'YES' : 'NO'
router.push(`/market/${marketId}/form/buy?stake=${stake}&certainty=${certainty}&share=${share}`)
router.push(`/market/${marketId}/form?stake=${stake}&certainty=${certainty}&share=${share}&side=BUY`)
}
}