Giter VIP home page Giter VIP logo

xycloans's Introduction


Logo

XycLoans Protocol

Flash loans and liquidity protocol on the Soroban VM.

Brought to the Soroban ecosystem by xyclooLabs.

XycLoans is a flash loans protocol implemented for the Soroban Virtual Machine. The protocol, besides offering an efficient and cheap way of borrowing flash loans, also offers investors to safely provide liquidity and earn yield.

How to use

To get started trying out xycLoans, check out the examples.

Why choose xycLoans

Below are some reasons why you might want to choose xycLoans, both as a trader/developer and as an investor.

Efficiency

Our team has been working with soroban since its first early release, and we've optimized the contracts and logics for Soroban release adapting to Soroban's principles and strength.

Security

XycLoans is designed with the sole purpose of being a flash loans protocol. That is because it is built with lenders funds' security in mind, and wants to offer lenders the possibility to put liquidity in a simple and audited (we're working on this) protocol.

The fact that xycLoans doesn't depend on price oracles, doesn't have complex rewards schemas, doesn't implement a governance system (while still keeping the product decentralized), and is developed by trusted members among the Soroban community makes it a good option for more cautious investors that seek to provide liquidity in DeFi systems that are less prone to security risk.

0 fees

xycLoans has no community token treasurery and no protocol fees (which in some DeFi projects go to developers and initial investors), which means that when you use xycLoans both as a borrower you are only paying the fees to lenders, and that lenders are receiving every single cent of the fees borrowers pay. This effictively makes for a protocol that has 0 fees.

How the xyclooLabs team maintains xycLoans

If xyclooLabs does not take any fees from xycLoans, how do we maintain the product?

We have two main sources to keep the protocol running:

  • Pro subscription to analytics and additional features in the UI.
  • Sponsored protocol updates. The factory contract is controlled by us in that when a new version of xycLoans pools is developed, that will be the new reference pool for our users. However, there is no way us updating the factory contract's hashes has impact on the pools' state, thus on the lenders' liquidity. We will just offer the possibility to migrate to new versions of the contract. All the work we do for protocol updates and migration interfaces is sponsored by donations.

Links

xycloans's People

Contributors

heytdep avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

friend413

xycloans's Issues

Ditch flash loan contract balance in shares calculation

The current design relies on the flash loan's vault balance as an input source for the minting shares calculations. In a standard vault design where the yield is stored along with the liquidity, this is the correct approach, but it isn't for xycloans' vaults where the yield is stored separately. In the current implementation, one can tamper with the LP shares minting function by transferring funds to the flash loan without depositing them (i.e without also increasing the shares total supply). This is not expected, for the minting function, we should rely on a contract's own storage slot with the total amount of deposits. The withdraw function doesn't necessarily need to use this data and can directly use the flash loan's balance.

remove unneded shares calculation

After we updated the rewards mechanism it makes no sense to calculate the shares with $$\frac{deposited \cdot totalsupply}{balance}$$

While it could simply be shares = deposited.

Keep ambiguity in available borrowable supply and matured fees?

Yield in a pool is not compound and generated yield for a user does not affect the user's balance in a pool, i.e won't affect the % of the total yield that should go to the user, and this is by design. However, currently, it is permitted to borrow an amount that is the total balance of the pool, which includes also the not-yet-withdrawn fees. Since the borrow occurs in-tx, there is no security risk in leaving this option, but given it is capital that can generate yield without effectively being a user balance/share it might be an ambiguous definition.

merge flash loan and vault contracts

We've currently always kept the flash loan and vault contracts separated for a variety of reasons:

  • modularity
  • code structure
  • parallelism (modifying just the flash loan balance not also the vault's balance (eg for fees withdrawals))

But parallelism is not possible anyways in this situation as the flash loan deposits the fees into the vault, zeroing the whole concept of splitting the two contracts.

Also, the cost of instantiating an additional VM should be much larger than the cost for reading a larger WASM module every time:

  • for flash loan borrows -> VM instantiated to deposit into vault using Vault::deposit_fees()
  • for vault withdrawals -> VM instantiated to call FlashLoan::withdraw()

These two methods should be common enough (especially the flash loan borrows) to make up for the cost of a larger wasm size.

feature: add vec of token ids to proxy #1

There is a single vault + flash loan pair for every token id. We should add a vector of the existing tokens and extern a function that returns them to make them accessible to other contracts.

Keep the proxy design or switch to factory?

We rely on our proxy to forward the calls to other contracts. However, since some vault functions are opened (I can also be accessed without the proxy) for security reasons (users should be able to withdraw from a pool even if the pool was removed from the proxy contract), and most functions would be used by directly calling the specific pool to pay smaller fees.

We could switch to a factory contract design for our proxy, i.e allows to safely deploy and plug pools but won't forward calls. The biggest downside is that this will allow to deposit in pools that aren't connected to the proxy (potentially dangerous).

Overall, I think it might be a good decision, also considering where we're heading for contract upgradeability, but it surely needs further discussion.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.