How much of each Omnipool collateral can actually be sold in one trade

I built a small read only tool that asks the chain what Omnipool collateral is worth on the way out, and I want to put the numbers in front of people who know this protocol better than I do, because one of them does not make sense to me.

The tool is at github.com/seekdaseek/draught, MIT, about four hundred lines. It quotes real sells through the router using dryRunApi, reads the amount out from the router's own Executed event, and bisects to find the largest sell the chain will actually accept. Nothing is modelled. Where a size fails it records the chain's own error rather than reporting a zero.

Measured on 8 August at block 13,514,695, quoting into HOLLAR.

Thirteen of the eighteen Omnipool assets cannot have one hundred thousand dollars removed in a single trade. ENA caps out at about eleven thousand four hundred, vASTR at eleven thousand seven hundred, BNC at fifteen thousand. The largest are tBTC at two hundred eighty one thousand, aDOT at two hundred forty three thousand and GETH at two hundred forty one thousand.

The part I found more interesting is what the maximum costs. Selling the largest permitted size costs between twenty six and forty four percent against a small trade, and that range barely moves whether the pool is large or small. ENA at its cap costs 2,566 basis points and aDOT at its cap costs 4,147. The cap is a fixed fraction of each reserve, so the slippage at the cap is structural rather than a property of any one market.

Every one of the eighteen was stopped by MaxInRatioExceeded.

Here is the thing I cannot explain, and it is why I am posting rather than just publishing. The obvious way to compute the cap is the reserve divided by maxInRatio, which the chain reports as three. That figure comes out consistently four thirds above what actually executes, to three decimal places, on every asset, and across both ways of reading a reserve. I read the guard in the pallet and there is no adjustment in it that accounts for the difference. Either I am reading the reserve wrong or the effective limit is not what the constant suggests, and I would rather be told which.

If this is useful I will keep it running and publish a dated record, and add the money market side so the same question can be asked about borrowed positions rather than just the pool. If it is wrong I would like to know that faster.

Reply
Up
Share
Comments