# LENDING AUCTION NFT #### MainPool: ActivePool that transfer staked NFT(Legions/Treasures) to MagicDepositor. #### ReservePool : Pool that will be queued , if upcomming nft is more valuable than earlier deposited nft after MainPool is full. ## Legion/Treasure NFT Deposit Flow ```mermaid graph TD; U[User] --> D[Deposit NFT] D --> M{Main Pool is full} M --> |No| P[Put in Main Pool] M --> |Yes| H{Rarity is higher than the existing} H --> |No| R[Put in Reserve Pool] H --> |Yes| O[Push out those NFT who have lowest rarity and the latest one in MainPool and unstake from atlasmine] O --> RP[Put the pushed out one in Reserve Pool] RP --> MP[Put the new one in Main Pool] R --> E[End] MP --> MD P --> MD[Transfer MAINPOOL Nft to MagicDepositor] MD --> SN[Stake NFT to Atlasmine] SN --> E ``` ## Legion/Treasure NFT Withdraw Flow ```mermaid graph TD; U[User] --> W[Withdraw NFT] W --> M{Withdrawl Delay} M --> |InComplete| CW[NFT Can't Withdraw ] M --> |Complete| CRP{Staked NFT in which Pool} CRP --> MainPool[Main Pool ] MainPool --> CRPMP{Reserve Pool Empty} CRPMP --> |YES|FW CRPMP --> |NO| NR[Remove Staked NFT from MainPool] NR --> POR[Push out those NFT from ReservePool who have highest rarity and the oldest by time ] POR --> FW CRP --> ReservePool[Reserve Pool] ReservePool --> FW[Withdraw NFT to user] FW --> E[END] CW --> E[END] ```