Operation - Deposit

The Stability Pool in the Satoshi Protocol SDK offers critical functions for managing liquidity and stability within the decentralized finance environment. It allows users to deposit and withdraw SAT stablecoins, contributing to the pool's ability to offset bad debts and providing a mechanism for earning rewards.

Key Steps:

  1. Convert Deposit Amount:

    • Use parseUnits to convert the desired amount of SAT stablecoins to the correct unit.

  2. Execute Deposit Transaction:

    • Call the doDeposit method to process the deposit into the Stability Pool. This transaction updates the pool's balance and adjusts the user's position.

Example

import { parseUnits } from '@ethersproject/units';
import { satoshiClient, DEBT_TOKEN_DECIMALS } from 'satoshi-sdk';

async function depositToStabilityPool() {
  // Step 1: Define the deposit amount in SAT stablecoins
  const depositAmt = parseUnits('5', DEBT_TOKEN_DECIMALS);  // Depositing 5 SAT

  // Step 2: Execute the deposit transaction
  const receipt = await satoshiClient.StabilityPool.doDeposit(depositAmt);

  // Output the transaction receipt
  console.log('Deposit Receipt:', receipt);
}

depositToStabilityPool();

Last updated