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

View File

@ -495,6 +495,8 @@ export const getFormattedBankValues = (group: Group, bank: Bank) => {
maintLiabWeight: bank.maintLiabWeight.toFixed(2), maintLiabWeight: bank.maintLiabWeight.toFixed(2),
initAssetWeight: bank.initAssetWeight.toFixed(2), initAssetWeight: bank.initAssetWeight.toFixed(2),
initLiabWeight: bank.initLiabWeight.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), depositWeightScale: toUiDecimalsForQuote(bank.depositWeightScaleStartQuote),
borrowWeightScale: toUiDecimalsForQuote(bank.borrowWeightScaleStartQuote), borrowWeightScale: toUiDecimalsForQuote(bank.borrowWeightScaleStartQuote),
rate0: (100 * bank.rate0.toNumber()).toFixed(2), rate0: (100 * bank.rate0.toNumber()).toFixed(2),