It's difficult to determine the exact amount of X that was sold without more information, but we can calculate the minimum amount that needs to be bought back to maintain the floor price.
Given that the floor price is 0.01 Y per X and the new price is 0.009 Y per X, we know that the price has dropped by 0.001 Y per X. To maintain the floor price, the protocol needs to buy back enough X to increase the total amount of Y in the pool by 0.001 Y per X.
Let's denote the amount of X sold as S, and the amount of Y required to buy back those X at the current price of 0.009 Y per X as Y_buyback.
We know that:
S * 0.009 Y = Y_buyback
and we want to find the value of S such that the total amount of Y in the pool is sufficient to support the floor price of 0.01 Y per X for all 10,000 X.
Let's denote the new amount of Y in the pool after the buyback as Y_new. Then we have:
Y_new = Treasury Balance of Y + Y_buyback
The total amount of Y in the pool should be at least equal to the total supply of X times the floor price:
Y_new >= 10,000 X * 0.01 Y
Substituting the expression for Y_new in terms of Treasury Balance of Y and Y_buyback:
Treasury Balance of Y + Y_buyback >= 10,000 X * 0.01 Y
Simplifying:
Y_buyback >= 10,000 X * 0.01 Y - Treasury Balance of Y
Substituting the value of Treasury Balance of Y and the floor price of 0.01 Y per X:
Y_buyback >= 10,000 X * 0.01 Y - 100 Y
Therefore, the minimum amount of Y required to buy back enough X to maintain the floor price is:
Y_buyback >= 100 Y - 100 Y = 0 Y
However, since the price has already dropped to 0.009 Y per X, the protocol needs to buy back enough X at the current price to increase the total amount of Y in the pool by at least 0.001 Y per X, as calculated earlier.
The total amount of Y required to buy back enough X at the current price of 0.009 Y per X to increase the total amount of Y in the pool by 0.001 Y per X is:
Y_buyback = (S * 0.009 Y) / (0.01 Y per X - 0.009 Y per X)
where S is the total amount of X that needs to be bought back.
Therefore, the minimum amount of X that was sold to cause the price to drop to 0.009 Y per X is:
S >= (0.001 Y/X * 1,000 X) / (0.001 Y/X) = 100 X
The protocol needs to buy back at least 100 X at the current price of 0.009 Y per X to maintain the floor price, which requires a minimum of 100 X * 0.009 Y = 0.9 Y.