Auction is a process to settle delivery, which in turn determines the funding rate. It happens every hour, auction will take place 5 minutes prior to each funding round.
The system will take net delivery = (long delivered – short delivered) to the corresponding Repo order book. If net delivery > 0, the auction buys repo. If net delivery < 0, the auction sells repo. The net delivery will be used for market buying/selling in the repo book during the auction. All the executed bids/asks will be adjusted to the last traded price.
Total amount (BTC)
In this example, net delivery = 100-80 = 20 BTC. The system is going to buy 20 BTC of repo from the order book. Hence, all the orders executed at 0.01% will be repriced at 0.015%, the last traded price.
If the Repo order book does not have enough orders for auction, it is considered as delivery failure. The auction will buy/sell all existing ask/bid orders in a first-in-first-out basis, which means that those who confirmed to deliver will have their positions delivered first. In this situation, funding rate becomes the highest possible value, and those who are not able to have their positions delivered will also receive funding.
Funding occurs at every hour . You will have to pay or receive funding only if you are holding a Perpetual position at this time. Funding will be paid or receive in margin currency. If you close or deliver your position before the funding exchange then you will not pay or receive funding.
Funding = Position*funding rate
Funding rate = -(clearing price of auction) Take the previous example, the auction clearing price is 0.015%, the funding rate becomes -0.015% When funding rate is positive, long pays short. When funding rate is negative, short pays long.