---
# System prepended metadata

title: Forced Take-out Example Scenario
tags: [Legacy]

---

---
tags: Legacy
---

# Forced Take-out Example Scenario

## Start


<b>State:</b>
Delegator 1: 10 Pool Tokens, 0 Data
Delegator 2: 10 Pool Tokens, 0 Data
Broker Pool: 20 Pool Value, 0 Free Funds, 20 Staked on Streams
Withdraw Queue: Empty
t: 0

<b>Parameters</b>

grace_period: 7 Days

## Delegator 1 Puts All Tokens in Withdraw Queue at t = 0



<b>State:</b>
Delegator 1: 10 Pool Tokens, 0 Data
Delegator 2: 10 Pool Tokens, 0 Data
Broker Pool: 20 Pool Value, 0 Free Funds, 20 Staked on Streams
Withdraw Queue: [(Address = Delegator 1 Address, Tokens =10 Pool Tokens, t=0)]
t: 0

## Delegator 2 Puts 5 Tokens in Withdraw Queue at t=2

<b>State:</b>
Delegator 1: 10 Pool Tokens, 0 Data
Delegator 2: 10 Pool Tokens, 0 Data
Broker Pool: 20 Pool Value, 0 Free Funds, 20 Staked on Streams
Withdraw Queue: [(Address = Delegator 1 Address, Tokens =10 Pool Tokens, t=0), (Address = Delegator 2 Address, Tokens =5 Pool Tokens, t=2)]
t: 2


## Delegator 1 Calls Force Withdraw at t = 3

The top of the withdraw queue is checked and it has t=0. Since 3 - 0 < grace_period = 7, nothing happens and it terminates.

<b>State:</b>
Delegator 1: 10 Pool Tokens, 0 Data
Delegator 2: 10 Pool Tokens, 0 Data
Broker Pool: 20 Pool Value, 0 Free Funds, 20 Staked on Streams
Withdraw Queue: [(Address = Delegator 1 Address, Tokens =10 Pool Tokens, t=0), (Address = Delegator 2 Address, Tokens =5 Pool Tokens, t=2)]
t: 3


## Broker Unstakes 5 DATA at t = 5

The broker unstakes 5 DATA which immediately goes to paying off 5 of the tokens (1 to 1 exchange rate here). The values are changed for delegator 1, broker pool, and the first withdraw queue item

<b>State:</b>
Delegator 1: 5 Pool Tokens, 5 Data
Delegator 2: 10 Pool Tokens, 0 Data
Broker Pool: 15 Pool Value, 0 Free Funds, 15 Staked on Streams
Withdraw Queue: [(Address = Delegator 1 Address, Tokens =5 Pool Tokens, t=0), (Address = Delegator 2 Address, Tokens =5 Pool Tokens, t=2)]
t: 5


## Delegator 2 Adds 5 More Tokens at t = 6

A new item is added to the withdraw queue

<b>State:</b>
Delegator 1: 5 Pool Tokens, 0 Data
Delegator 2: 10 Pool Tokens, 0 Data
Broker Pool: 15 Pool Value, 0 Free Funds, 15 Staked on Streams
Withdraw Queue: [(Address = Delegator 1 Address, Tokens =5 Pool Tokens, t=0), (Address = Delegator 2 Address, Tokens =5 Pool Tokens, t=2), (Address = Delegator 2 Address, Tokens =5 Pool Tokens, t=6)]
t: 6

## Delegator 2 Calls Force Withdraw at t = 10

The first item of the queue is checked and has a time greater than 7 days so it is force withdrawn. The second item is checked and likewise the same happens. Then the third item is checked but it does not have a time greater than 7 days so it is left. The stake is taken from the streams and paid out to the delegators who are owed.

<b>State:</b>
Delegator 1: 0 Pool Tokens, 10 Data
Delegator 2: 5 Pool Tokens, 5 Data
Broker Pool: 5 Pool Value, 0 Free Funds, 5 Staked on Streams
Withdraw Queue: [(Address = Delegator 2 Address, Tokens =5 Pool Tokens, t=6)]
t: 10