Radiance Protocol is a permissionless lending market that offers a unique solution to the problems of impermanent loss and lost collateral opportunity in the DeFi space. Radiance supports markets available on OpenBook https://www.openbook-solana.com/
Impermanent loss is a major concern in the DeFi lending market, deterring many risk-averse investors from entering the market.
Lending markets do not generally accept LP tokens to be used as collateral, even if they are backed by acceptable assets. Tokenized asset loans can serve various purposes such as boosting leverage, reducing risk through hedging, and deferring capital gains. As a result, holding funds in LP tokens incurs an opportunity cost.
Radiance solves this problem by offering a platform where LP tokens can be used as collateral to borrow other tokens, reducing the risk of impermanent loss and earning yield in the process. Borrowers can also leverage their LP tokens to lock up assets and increase their yield.
- Use LP tokens as collateral to borrow other tokens
- Earn yield by lending tokens to borrowers
- Reduce risk of impermanent loss
- Borrowers can leverage their LP tokens to lock up assets and increase their yield
Radiance aims to become the world's top lending marketplace based on LP tokens, solving the problems of lost collateral opportunity and impermanent loss in the current LP market. Join us on our mission to revolutionize the DeFi lending market.
create_pool(ctx: Context<CreatePool>, input: CreatePoolInput) -> Result<()>
This function allows the caller to create a new pool in the Radiance lending market.
deposit_collateral(ctx: Context<DepositCollateral>, input: DepositCollateralInput) -> Result<()>
This function allows the caller to deposit collateral to an existing pool in the Radiance lending market.
withdraw_collateral(ctx: Context<WithdrawCollateral>, input: WithdrawCollateralInput) -> Result<()>
This function allows the caller to withdraw collateral from an existing pool in the Radiance lending market.
borrow(ctx: Context<Borrow>, input: BorrowInput) -> Result<()>
This function allows the caller to borrow tokens from an existing pool in the Radiance lending market.
repay_loan(ctx: Context<RepayLoan>, input: RepayLoanInput) -> Result<()>
This function allows the caller to repay a loan that was previously taken from an existing pool in the Radiance lending market.
supply_borrowable(ctx: Context<SupplyBorrowable>, input: SupplyBorrowableInput) -> Result<()>
This function allows the caller to add to the supply of borrowable tokens in an existing pool in the Radiance lending market.
withdraw_borrowable(ctx: Context<WithdrawBorrowable>, input: WithdrawBorrowableInput) -> Result<()>
This function allows the caller to withdraw borrowable tokens from an existing pool in the Radiance lending market.
Given:
amount0, amount1
: number of Token0 and Token1 borrowedprice0, price1
: how many LP Tokens are worth one Token0 and one Token1
We can calculate the value of the loan in LP Tokens:
value0 = amount0 * price0
value1 = amount1 * price1
And finally, calculate the amount of Collateral needed:
if value0 >= value1
counterAllNeeded = (value0 * sqrt(safetyMargin) + value1 * sqrt(safetyMargin)) * liquidityIncrease
if value0 < value1
counterAllNeeded = (value0 * sqrt(safetyMargin) + value1 * sqrt(safetyMargin)) * liquidityIncrease
where safetyMargin and liquidationIncentive are constants in the system.