generate_debt(amount) in stablecoin/src/:
- Assert the position account is already initialized
- Accrue any outstanding stability fees on the position first
- Check that minting
amount stablecoins keeps the collateralization ratio above the minimum (requires price feed and redemption price)
- Issue a chained
Mint call to the token program to mint amount stablecoins to the user's stablecoin holding account
- Increase
Position.debt_amount, initialize the per-position stability fee accumulator index
Also extend open_position with an optional debt_amount parameter: if non-zero, run the same collateralization check and mint after depositing collateral.
Depends on: feedback controller / redemption price, stability fees and price feed
generate_debt(amount)instablecoin/src/:amountstablecoins keeps the collateralization ratio above the minimum (requires price feed and redemption price)Mintcall to the token program to mintamountstablecoins to the user's stablecoin holding accountPosition.debt_amount, initialize the per-position stability fee accumulator indexAlso extend
open_positionwith an optionaldebt_amountparameter: if non-zero, run the same collateralization check and mint after depositing collateral.Depends on: feedback controller / redemption price, stability fees and price feed