Skip to content

Commit

Permalink
POOL: removed usdc oracle call & some TODO's
Browse files Browse the repository at this point in the history
  • Loading branch information
markuspluna committed Mar 26, 2024
1 parent fbd4bc1 commit 7069237
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 13 deletions.
5 changes: 1 addition & 4 deletions pool/src/auctions/auction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -130,10 +130,7 @@ pub fn delete_liquidation(e: &Env, user: &Address) {
storage::del_auction(e, &(AuctionType::UserLiquidation as u32), user);
}

/// Fills the auction from the invoker. The filler is expected to maintain allowances to both
/// the pool and the backstop module.
///
/// TODO: Use auth-next to avoid required allowances
/// Fills the auction from the invoker.
///
/// ### Arguments
/// * `pool` - The pool
Expand Down
7 changes: 1 addition & 6 deletions pool/src/auctions/bad_debt_auction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,7 @@ pub fn create_bad_debt_auction_data(e: &Env, backstop: &Address) -> AuctionData
// TODO: Remove backstop_token getter call if WASM cache is not implemented
let backstop_token = backstop_client.backstop_token();
let pool_backstop_data = backstop_client.pool_data(&e.current_contract_address());
let usdc_token = storage::get_usdc_token(e);
let usdc_to_base = pool.load_price(e, &usdc_token);
let backstop_value_base = usdc_to_base
.fixed_mul_floor(pool_backstop_data.usdc, SCALAR_7)
.unwrap_optimized()
* 5; // Since the backstop LP token is an 80/20 split of USDC/BLND, we multiply by 5 to get the value of the BLND portion
let backstop_value_base = pool_backstop_data.usdc * 5; // Since the backstop LP token is an 80/20 split of USDC/BLND, we multiply by 5 to get the value of the BLND portion
let backstop_token_to_base = backstop_value_base
.fixed_div_floor(pool_backstop_data.tokens, SCALAR_7)
.unwrap_optimized();
Expand Down
1 change: 0 additions & 1 deletion pool/src/auctions/user_liquidation_auction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ use crate::{errors::PoolError, storage};

use super::AuctionType;

// TODO: Revalidate math with alternative decimal reserve
pub fn create_user_liq_auction_data(
e: &Env,
user: &Address,
Expand Down
2 changes: 1 addition & 1 deletion test-suites/src/test_fixture.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ impl TestFixture<'_> {
let (blnd_id, blnd_client) = create_stellar_token(&e, &bombadil);
let (eth_id, eth_client) = create_token(&e, &bombadil, 9, "wETH");
let (usdc_id, usdc_client) = create_stellar_token(&e, &bombadil);
let (xlm_id, xlm_client) = create_stellar_token(&e, &bombadil); // TODO: make native
let (xlm_id, xlm_client) = create_stellar_token(&e, &bombadil);
let (stable_id, stable_client) = create_token(&e, &bombadil, 6, "STABLE");

// deploy Blend Protocol contracts
Expand Down
2 changes: 1 addition & 1 deletion test-suites/tests/test_liquidation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ fn test_liquidations() {
frodo_stable_balance - usdc_bid_amount
+ stable_interest_lot_amount
.fixed_div_floor(2 * 10i128.pow(6), 10i128.pow(6))
.unwrap(), // - usdc_donate_bid_amount TODO: add donate diff when donating is implemented
.unwrap(),
10i128.pow(6),
);
assert_approx_eq_abs(
Expand Down

0 comments on commit 7069237

Please sign in to comment.