package lastcall // lockedUSD is tUSD the reserve holds on behalf of open positions and pending // limit orders. Payouts, spot sales and pool withdrawals may only spend the rest, // so a margin or an escrow can always be returned to its owner. var lockedUSD int64 func lock(amount int64) { lockedUSD += amount } func unlock(amount int64) { lockedUSD -= amount } func freeReserve() int64 { free := usd.BalanceOf(deskAddr) - lockedUSD if free < 0 { return 0 } return free } // LockedUSD is the part of the reserve owed back as margin and limit escrow. func LockedUSD() int64 { return lockedUSD }