# Can bets settle after deadline?

**URL:** <https://forums.counterparty.io/t/can-bets-settle-after-deadline/2709>\
**Category:** Counterparty\
**Created:** [March 2, 2017, 3:42pm UTC](https://forums.counterparty.io/t/can-bets-settle-after-deadline/2709 "2017-03-02T15:42:07Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![JPJA](https://yyz2.discourse-cdn.com/flex004/user_avatar/forums.counterparty.io/jpja/32/1324_2.png) [@JPJA](https://forums.counterparty.io/u/JPJA)\
**Post date:** [March 2, 2017, 3:42pm UTC](https://forums.counterparty.io/t/can-bets-settle-after-deadline/2709/1 "2017-03-02T15:42:07Z")

</div>

All bets must have, among other parameters;

`deadline (integer): The time at which the bet should be decided/settled, in Unix time (seconds since epoch).`

`expiration (integer): The number of blocks after which the bet expires if it remains unmatched.`

From [the docs](http://counterparty.io/docs/api/). I can add that two bets must have identical deadlines to match. If the operator has not settled the bet within 2016 blocks (~14 days) after the deadline, the bet will expire and escrow returned.

The expiration is the number of blocks a bet stays open (can be matched). It’s comparable to an order on the DEX.

**My question** ; if the deadline is reached before a bet expires, can it still be matched? The deadline is a timestamp while the expiry is a block height number. Moreover, timestamps do not have to be in order.

`A timestamp is accepted as valid if it is greater than the median timestamp of previous 11 blocks, and less than the network-adjusted time + 2 hours. "Network-adjusted time" is the median of the timestamps returned by all nodes connected to you. As a result, block timestamps are not exactly accurate, and **they do not even need to be in order**. Block times are accurate only to within an hour or two.`

The reason I’m asking is a hypothetical lottery where at 4pm every Friday a winner is drawn. The timestamp is easy to set. It’s the upcoming Friday at 4pm (converted to UTC). However, you do not want a potential open bet to expire after that. Since you don’t know how many blocks there are until then, nor when your tx will be included, you’ll have to err a lot on the short end when selecting number of blocks to expiry. In a lottery with fixed odds especially, you’d want the expiry to be as late as possible. More open bets are also essential to add liquidity to the market.
