Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: migration to fix invalid liquidation vault state #597

Merged
merged 2 commits into from May 12, 2022

Conversation

sander2
Copy link
Member

@sander2 sander2 commented May 11, 2022

The liquidation vault currently has this:

toBeIssuedTokens: 0
issuedTokens: 6,354,070
toBeRedeemedTokens: 6,354,070
collateral: 30,544,076,056,403

This PR decrease toBeRedeemedTokens but not issuedTokens, so that afterwards people can liquidate_redeem. I confirmed that there is indeed an imbalance of 6,354,070 between the vault's issued tokens and the total issuance of kBTC. For future reference, this is how I checked:

  const vaults = await api.query.vaultRegistry.vaults.entries();
  console.log("vault total issued: ", vaults.map((v) => parseInt(v[1].unwrap().issuedTokens.toString())).reduce((a,b) => a+b));
  // compare against tokens.totalIssuance

At current market value, the worth of the locked KSM is 129.8% of the KBTC, so for now that is ok, although the exchange rate will plummet soon.

Also we unlock the vault's funds that got stuck due to the bug in cancel_redeem

@sander2 sander2 force-pushed the fix/liquidation-vault-migration branch from 367ddb6 to 57d3cac Compare May 11, 2022 17:26
@gregdhill gregdhill merged commit a8c0a15 into interlay:master May 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants