add scaled init asset/liab weight to dashboard

This commit is contained in:
saml33 2023-07-09 19:47:52 +10:00
parent f6b3d2c5e7
commit 5bbba8727c
2 changed files with 10 additions and 4 deletions

View File

@ -468,7 +468,7 @@ const Dashboard: NextPage = () => {
/>
<KeyValuePair
label="Maint Asset/Liab Weight"
value={`${formattedBankValues.maintAssetWeight}/
value={`${formattedBankValues.maintAssetWeight} /
${formattedBankValues.maintLiabWeight}`}
proposedValue={
(suggestedFields.maintAssetWeight ||
@ -476,7 +476,7 @@ const Dashboard: NextPage = () => {
`${
suggestedFields.maintAssetWeight ||
formattedBankValues.maintAssetWeight
}/
} /
${
suggestedFields.maintLiabWeight ||
formattedBankValues.maintLiabWeight
@ -485,7 +485,7 @@ const Dashboard: NextPage = () => {
/>
<KeyValuePair
label="Init Asset/Liab Weight"
value={`${formattedBankValues.initAssetWeight}/
value={`${formattedBankValues.initAssetWeight} /
${formattedBankValues.initLiabWeight}`}
proposedValue={
(suggestedFields.initAssetWeight ||
@ -493,13 +493,17 @@ const Dashboard: NextPage = () => {
`${
suggestedFields.initAssetWeight ||
formattedBankValues.initAssetWeight
}/
} /
${
suggestedFields.initLiabWeight ||
formattedBankValues.initLiabWeight
}`
}
/>
<KeyValuePair
label="Scaled Init Asset/Liab Weight"
value={`${formattedBankValues.scaledInitAssetWeight} / ${formattedBankValues.scaledInitLiabWeight}`}
/>
<KeyValuePair
label="Deposit weight scale start quote"
value={`$${formattedBankValues.depositWeightScale}`}

View File

@ -495,6 +495,8 @@ export const getFormattedBankValues = (group: Group, bank: Bank) => {
maintLiabWeight: bank.maintLiabWeight.toFixed(2),
initAssetWeight: bank.initAssetWeight.toFixed(2),
initLiabWeight: bank.initLiabWeight.toFixed(2),
scaledInitAssetWeight: bank.scaledInitAssetWeight(bank.price).toFixed(2),
scaledInitLiabWeight: bank.scaledInitLiabWeight(bank.price).toFixed(2),
depositWeightScale: toUiDecimalsForQuote(bank.depositWeightScaleStartQuote),
borrowWeightScale: toUiDecimalsForQuote(bank.borrowWeightScaleStartQuote),
rate0: (100 * bank.rate0.toNumber()).toFixed(2),