From de59001573df805b2147125a25e3c184b2406e75 Mon Sep 17 00:00:00 2001 From: toteki <63419657+toteki@users.noreply.github.com> Date: Tue, 7 Nov 2023 08:00:14 -0700 Subject: [PATCH] ++ --- x/leverage/types/position.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/x/leverage/types/position.go b/x/leverage/types/position.go index ea55500b0a..20e3b3ab55 100644 --- a/x/leverage/types/position.go +++ b/x/leverage/types/position.go @@ -186,7 +186,9 @@ func (ap *AccountPosition) MaxBorrow(denom string) sdk.Dec { ), ) + // // TODO: improve for cases where new special assets can be paired + // // Prevent over-limit accounts from returning negative max borrow return sdk.MaxDec(sdk.ZeroDec(), maxNormalBorrow) @@ -204,7 +206,9 @@ func (ap *AccountPosition) MaxWithdraw(denom string) sdk.Dec { usage := ap.totalCollateralUsage() // collateral usage after special pairs owned := ap.collateralValue.AmountOf(denom) + // // TODO: withdraw first from normal, then from special pairs, one at a time. + // // - for borrow limit, subtracting [collat * weight] from borrow limit // - TODO: for special pairs, subtracting additional [collateral * delta weight]