A decentralized stablecoin system on Solana using SPL tokens and SOL as collateral. Powered by Anchor and Pyth price feeds.
Initializes the config and mint accounts (PDA).
-
Signer: Authority
-
Accounts:
config_account[PDA, "config"]mint_account[PDA, "mint"]
-
Programs:
token_program,system_program
Deposit SOL and mint stablecoins.
-
Signer: Depositor
-
Accounts:
collateral_account[PDA, "collateral", depositor]sol_account[PDA, "sol", depositor]token_account[ATA for stablecoin]config_account,mint_account,price_update
-
Programs:
token_program,associated_token_program,system_program
Burn stablecoins and redeem SOL.
- Signer: Depositor
- Accounts: Same as deposit
- Programs:
token_program,system_program
Liquidate undercollateralized positions. Burn tokens to receive SOL + bonus.
-
Signer: Liquidator
-
Accounts:
collateral_account,sol_account(target user)token_account(liquidator)config_account,mint_account,price_update
-
Programs:
token_program,associated_token_program,system_program
Update system parameters (admin only).
- Signer: Authority
- Accounts:
config_account
authority,mint_accountliquidation_threshold,liquidation_bonusmin_health_factor,bumps
depositor,sol_account,token_accountlamports_balance,amount_mintedis_initialized,bumps
Used for SOL/USD price via FEED_ID:
7UVimffxr9ow1uXYxsr4LHAcV58mLzhmwaeKvJ1pjLiE
6000Invalid Price6001Below Min Health Factor6002Cannot Liquidate Healthy Account