They close last friday of the month. You can see that, if this is a red month, a green candle appears near the last friday, if its a green month, a red candle appearing before the last friday.
The BTC futures raders need to repay their long/short position before the last trade to repay the margin at the current settlement. So if they are short they re bought the borrowed margin before the last trade, if they are long they selling the extra and repay the borrowed at the settlement price.