# Use Locked Slot-Funds for Future Auctions
Currently funds locked on a slot are unlocked when the lease won with set auction finishes. At the same time, teams need to renew their leases before the end of their current lease if they don't want to interrupt their service. As they can't use the funds they contributed to their own initial auction bidding, this becomes an issue.
The primary objective is to allow funds locked in a slot to be able to participate on an upcoming auction for the same team. This needs to be done in between certain parameters so as to prevent some sort of arbitrage.
Usually teams will bid for a lease that starts right after the last LP of their current slot, or at most 1 LP before. At the same time, they tend to participate close to when this is happening, mostly around two LP's before that (~6mo on Polkadot). With this in mind, ideal locking scenario would be follow these conditions:
- Funds become available on `last_lp - 2`
- Funds can be use for an auction which has as a first lp `last_lp +- 1`
- Funds can only be used for the same paraID as before.
As a mean to win a slot auction, teams can either use a crowdloan or self-bid from a specific account.
### Auctions behaviour
When a sucessful bid is placed on an auction, then this pallet [locks the bid for that account and that paraID](https://github.com/paritytech/polkadot-sdk/blob/4c077b209b17fbc0d8fa1468feb2015f7505f060/polkadot/runtime/common/src/auctions.rs#L486). The moment the auction ends, [`manage_auction_end`](https://github.com/paritytech/polkadot-sdk/blob/4c077b209b17fbc0d8fa1468feb2015f7505f060/polkadot/runtime/common/src/auctions.rs#L575) runs to determine the winner and release any needed funds.
A full list of how crowdloans are working follows, but for now crowdloans are basically system accounts. As such, crowdloans and direct bids will be treated equally.
So independently of this being a bid placed by a crowdloan or a bid place directly by a non-system account, the process is: `Account places Bid -> Auction Pallet places lock`.
### Current Crowdloan Behaviours
Crowdloans have a set of behaviours today that might be useful for the previously set scenario.
From [`fn create`](https://github.com/paritytech/polkadot-sdk/blob/336916827f78a320fddbf1925984ec0a1f884376/polkadot/runtime/common/src/crowdloan/mod.rs#L376)
- A crowdloan can't be created for a LP that starts way in the future. [Ref](https://github.com/paritytech/polkadot-sdk/blob/336916827f78a320fddbf1925984ec0a1f884376/polkadot/runtime/common/src/crowdloan/mod.rs#L391). This is important for point (2) on the expective behaviour, however still to understand: (1) what that limit is; (2) if it works for the described option; (3) if there are any attack vectors that resulted on that condition being put.
- A crowdloan can't be created with the same a paraID that currently has a un-dissolved crowdloan. [Ref](https://github.com/paritytech/polkadot-sdk/blob/336916827f78a320fddbf1925984ec0a1f884376/polkadot/runtime/common/src/crowdloan/mod.rs#L413).
- Crowdloans are basically system accounts. This takes place apparently [here](https://github.com/paritytech/polkadot-sdk/blob/eeb368ed9ca3bc2af0ccf9dfddb985ddef8f4233/polkadot/runtime/common/src/crowdloan/mod.rs#L424C31-L424C44) and takes the form of `PalletId(*b"py/cfund")`, [ref](). [Example account](https://polkadot.subscan.io/account/13UVJyLnbVp77Z2t6qswWUQp3MAixTDadn2EjjG8iBcSdi79).
- When a crowdloan is active (didn't win an auction or ending_block is still in the future) then the system account can not send tokens back to the user who participated in set auctions. Afterwards, it can through [`dissolve`](https://github.com/paritytech/polkadot-sdk/blob/eeb368ed9ca3bc2af0ccf9dfddb985ddef8f4233/polkadot/runtime/common/src/crowdloan/mod.rs#L562).
- This [currency PR](https://github.com/paritytech/substrate/pull/12951) changed the behaviour of Crowdloans, allowing crowdloan funds to participate in Governance. Unsure if this will also help on this discussion.
### Non-desirable behaviours
- To be able to unlock the funds early. The entire objective of the funds that participate on an auction is to be locked for the duration of the lease. This will still hold true with the proposed solution as long as funds can't be retrieved.
- To use locked funds for Parachain X on Parachain Y.
### Pallets to be considered
- Crowdloan Pallet
- Slots Pallet
- Registrar Pallet