Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion packages/poller/src/rebalance/solanaUsdc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,19 @@ export async function rebalanceSolanaUsdc(context: ProcessingContext): Promise<R
}

// Calculate how much USDC to bridge based on ptUSDe deficit and available Solana USDC
const ptUsdeShortfall = ptUsdeThreshold - solanaPtUsdeBalance;
const ptUsdeShortfall = ptUsdeTarget - solanaPtUsdeBalance;

// If balance is already at or above target, no bridging needed
if (ptUsdeShortfall <= 0n) {
logger.info('ptUSDe balance is at or above target, no bridging needed', {
requestId,
solanaPtUsdeBalance: solanaPtUsdeBalance.toString(),
solanaPtUsdeBalanceFormatted: (Number(solanaPtUsdeBalance) / 10 ** PTUSDE_SOLANA_DECIMALS).toFixed(6),
ptUsdeTarget: ptUsdeTarget.toString(),
ptUsdeTargetFormatted: (Number(ptUsdeTarget) / 10 ** PTUSDE_SOLANA_DECIMALS).toFixed(6),
});
return rebalanceOperations;
}

// Approximate 1:1 ratio between USDC and ptUSDe for initial calculation
const usdcNeeded = ptUsdeShortfall / PTUSDE_TO_USDC_DIVISOR;
Expand Down