Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/avour/raydiance-core
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
https://github.com/avour/raydiance-core
anchor anchor-lang rust solana solana-program
Last synced: 27 days ago
JSON representation
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
- Host: GitHub
- URL: https://github.com/avour/raydiance-core
- Owner: avour
- Created: 2023-01-30T09:18:49.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2023-02-07T19:01:33.000Z (almost 2 years ago)
- Last Synced: 2024-10-14T06:36:20.708Z (2 months ago)
- Topics: anchor, anchor-lang, rust, solana, solana-program
- Language: Rust
- Homepage: https://radaince-protocol.web.app/#/pools
- Size: 22.7 MB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## Radiance
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/
## Why Radiance
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.
## Features
- Use LP tokens as collateral to borrow other tokens
[![Product Name Screen Shot][screenshot1]](https://example.com)
- Earn yield by lending tokens to borrowers
[![Product Name Screen Shot][screenshot3]](https://example.com)
- Reduce risk of impermanent loss
[![Product Name Screen Shot][screenshot4]](https://example.com)
- Borrowers can leverage their LP tokens to lock up assets and increase their yield
[![Product Name Screen Shot][screenshot5]](https://example.com)
## Vision
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.
## Rust API Reference
### Create a pool
`create_pool(ctx: Context, input: CreatePoolInput) -> Result<()>`This function allows the caller to create a new pool in the Radiance lending market.
### Deposit collateral
`deposit_collateral(ctx: Context, input: DepositCollateralInput) -> Result<()>`This function allows the caller to deposit collateral to an existing pool in the Radiance lending market.
### Withdraw collateral
`withdraw_collateral(ctx: Context, input: WithdrawCollateralInput) -> Result<()>`This function allows the caller to withdraw collateral from an existing pool in the Radiance lending market.
### Borrow tokens
`borrow(ctx: Context, input: BorrowInput) -> Result<()>`This function allows the caller to borrow tokens from an existing pool in the Radiance lending market.
### Repay loan
`repay_loan(ctx: Context, 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 tokens
`supply_borrowable(ctx: Context, 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 tokens
`withdraw_borrowable(ctx: Context, input: WithdrawBorrowableInput) -> Result<()>`This function allows the caller to withdraw borrowable tokens from an existing pool in the Radiance lending market.
# Calculation of Collateral Needed
Given:
- `amount0, amount1`: number of Token0 and Token1 borrowed
- `price0, price1`: how many LP Tokens are worth one Token0 and one Token1We 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.
[contributors-shield]: https://img.shields.io/github/contributors/othneildrew/Best-README-Template.svg?style=for-the-badge
[contributors-url]: https://github.com/othneildrew/Best-README-Template/graphs/contributors
[forks-shield]: https://img.shields.io/github/forks/othneildrew/Best-README-Template.svg?style=for-the-badge
[forks-url]: https://github.com/othneildrew/Best-README-Template/network/members
[stars-shield]: https://img.shields.io/github/stars/othneildrew/Best-README-Template.svg?style=for-the-badge
[stars-url]: https://github.com/othneildrew/Best-README-Template/stargazers
[issues-shield]: https://img.shields.io/github/issues/othneildrew/Best-README-Template.svg?style=for-the-badge
[issues-url]: https://github.com/othneildrew/Best-README-Template/issues
[license-shield]: https://img.shields.io/github/license/othneildrew/Best-README-Template.svg?style=for-the-badge
[license-url]: https://github.com/othneildrew/Best-README-Template/blob/master/LICENSE.txt
[linkedin-shield]: https://img.shields.io/badge/-LinkedIn-black.svg?style=for-the-badge&logo=linkedin&colorB=555
[linkedin-url]: https://linkedin.com/in/othneildrew
[product-screenshot]: images/screenshot.png
[screenshot1]: images/screenshot1.png
[screenshot2]: images/screenshot2.png
[screenshot3]: images/screenshot3.png
[screenshot4]: images/screenshot4.png
[screenshot5]: images/screenshot5.png
[screenshot6]: images/screenshot6.png
[Next.js]: https://img.shields.io/badge/next.js-000000?style=for-the-badge&logo=nextdotjs&logoColor=white
[Next-url]: https://nextjs.org/
[React.js]: https://img.shields.io/badge/React-20232A?style=for-the-badge&logo=react&logoColor=61DAFB
[React-url]: https://reactjs.org/
[Vue.js]: https://img.shields.io/badge/Vue.js-35495E?style=for-the-badge&logo=vuedotjs&logoColor=4FC08D
[Vue-url]: https://vuejs.org/
[Angular.io]: https://img.shields.io/badge/Angular-DD0031?style=for-the-badge&logo=angular&logoColor=white
[Angular-url]: https://angular.io/
[Svelte.dev]: https://img.shields.io/badge/Svelte-4A4A55?style=for-the-badge&logo=svelte&logoColor=FF3E00
[Svelte-url]: https://svelte.dev/
[Laravel.com]: https://img.shields.io/badge/Laravel-FF2D20?style=for-the-badge&logo=laravel&logoColor=white
[Laravel-url]: https://laravel.com
[Bootstrap.com]: https://img.shields.io/badge/Bootstrap-563D7C?style=for-the-badge&logo=bootstrap&logoColor=white
[Bootstrap-url]: https://getbootstrap.com
[JQuery.com]: https://img.shields.io/badge/jQuery-0769AD?style=for-the-badge&logo=jquery&logoColor=white
[JQuery-url]: https://jquery.com