Skip to content

Commit

Permalink
++
Browse files Browse the repository at this point in the history
  • Loading branch information
toteki committed Nov 7, 2023
1 parent 64384ca commit de59001
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions x/leverage/types/position.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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]
Expand Down

0 comments on commit de59001

Please sign in to comment.