# Presentazione

Lending DApp è una applicazione distribuita composta da una interfaccia utente realizzata attraverso uno sito Internet (website) ed uno Smart Contract realizzato con il linguaggio Scrypto ed eseguito all'interno della rete distribuita (DLT) di Radix.


# Obiettivi

Gli obiettivi sono ben precisi:

* Produrre un protocollo che sia potenzialmente profittevole&#x20;
* Verificare quante persone (wallet) utilizzeranno i servizi offerti da questa DApp&#x20;
* Verificare il full-stack tecnologico di Radix inteso come:
  * il linguaggio di programmazione (Scrypto)
  * gli strumenti di testing (Resim e Scrypto Test)
  * i badge di autenticazione e la gestione degli NFT
  * gli strumenti di deploy e gestione dei blueprint
  * gli strumenti per il calcolo finanziario
  * l'esperienza utente con la Mobile App


# Smart Contract

Il funzionamento del servizio è il seguente.

Lo Smart Contract gestisce quattro contenitori, un contenitore di XRD, un contenitore di token, un contenitore per le commissioni ed un contenitore per le donazioni

Ogni wallet può usufruire dei servizi dello Smart Contract dopo una registrazione tramite la quale otterrà un NFT con 6 informazioni:&#x20;

* epoca in cui è iniziato il prestito fornito/ricevuto
* epoca in cui è finito il prestito fornito/ricevuto
* importo del prestito fornito/ricevuto al/dal contratto


# Fornitura Tokens

Ogni wallet può fornire liquidità sotto forma di token XRD (il limite massimo è configurabile) ed ottenere in cambio lo stesso numero di token LND ed il NFT aggiornato con l'epoca di inizio del prestito ed il numero di XRD.

Ogni wallet può recuperare la liquidità fornita in una o più volte, ogni recupero di liquidità farà sì che venga aggiornato il numero di XRD, nel caso venga recuperata tutta la liquidità verrà anche aggiornata l'epoca di fine del prestito.

Per ogni recupero di liquidità viene assegnata la ricompensa maturata durante il periodo in cui i token sono stati impiegati in funzione delle percentuali in vigore che si sono succedute durante tutto il periodo.

Non è possibile fornire nuova liquidità se non avendo chiuso in anticipo l'operazione in corso.&#x20;

Dopo che tutta la liquidità è stata ritirata sarà possibile rifornila di nuovo.&#x20;

Attualmente il contratto è configurato per remunerare la liquidità solo in base al tempo pertanto non è più necessario attendere che sia trascorso un predeterminato numero di epoche prima di immettere nuovamente liquidità.


# Prestito Tokens

Ogni wallet può prelevare liquidità sotto forma di token XRD (massimo 3% del totale del contenitore XRD) senza fornire alcune genere di collaterale fino ad un massimo del 50% del totale della liquidità disponibile.

Ogni wallet può restituire la liquidità prelevata in una o più volte, ogni restituzione di liquidità farà sì che venga aggiornato il numero di XRD, nel caso venga restituita tutta la liquidità verrà anche aggiornata l'epoca di fine del prestito.

Per ogni restituzione di liquidità viene detratta la commissione maturata durante il periodo in cui i token sono stati nella propria disponibilità in funzione delle percentuali in vigore che si sono succedute durante tutto il periodo.

Non è possibile richiedere nuova liquidità se non avendo chiuso in anticipo l'operazione in corso.&#x20;

Ogni richiesta di prelevamento deve indicare il numero di epoche per le quali si intende mantenere la liquidità, dopodichè è necessario procedere al rimborso.


# Richieste di Rimborso

Ogni wallet che abbia richiesto un prelevamento viene monitorato ed in caso il rimborso non venga effettuato entro il numero di epoche previsto allora saranno inviati dei solleciti sotto forma di NFT.&#x20;

I solleciti saranno eliminati non appena il wallet provvederà al rimborso degli importi dovuti.

Gli NFT di sollecito sono visibili a qualunque altro contratto e costituiscono un incentivo al rimborso della liquidità prelevata senza versamento di alcun genere di collaterale.&#x20;


# Risultati

La ricompensa per lo Smart Contract è costituita dalla differenza tra le percentuali riconosciute ai fornitori di liquidità rispetto a quelle addebitate a coloro che effettuano prelevamenti.

Lo Smart Contract attualmente offre prestiti senza nessuna richiesta di collaterale su importi limitati e questo comporta che il calcolo delle percentuali rispecchierà e si modificherà in base alle percentuali di insolvenze che si verificheranno durante la vita del contratto stesso.


# Sviluppi Futuri

Stiamo valutando quali saranno i prossimi interventi, le ipotesi sono:

* Richiedere una forma garanzia prima della concessione dei prestiti come già fanno altre piattaforme&#x20;
* Introdurre un meccanismo di valutazione per l'account che effettua la richiesta (punteggio di credito valutato da qualche previsione AI)&#x20;
* Stringere accordi con altre piattaforme per bloccare l'operatività degli account che hanno ricevuto un NFT "Bad Payer".&#x20;
* Introdurre la possibilità di rimborsare il prestito in rate mensili


# Lavori in corso

Le attività in corso sono:

* Gestione delle transazioni automatiche con protezione della seed phrase in rete Mainnet
* Estrazione e visualizzazione in Home Page degli account che hanno il 'BadPayer' NFT&#x20;
* Gestione della problematica relativa agli aggiornamenti dello smart contract
* Introduzione del pattern 'Access Controller' per il contenitore della liquidità principale


# Configurazione

Lo Smart Contract dispone di 3 tipi di badge:

* Proprietario (Owner)
* Amministratore (Admin)
* Staff&#x20;

Ognuno di questi badge consente l'accesso alle funzioni

* Impostare la percentuale della ricompensa per i prestiti forniti/ricevuti (Admin, Owner)
* Impostare il numero di epoche dopo le quali si può nuovamente utilizzare lo SC (Admin, Owner)
* Estendere il pool per accettare più prestiti (Staff, Admin, Owner)
* Creare nuovi NFT da assegnare allo staff (Admin, Owner)
* Ritirare fondi per lo sviluppo del progetto (Owner)
* Ritirare le commissioni per lo sviluppo del progetto (Owner)
* Depositare nuovi token nel contenitore XRD principale (Admin, Owner)


# Disclaimer

### Transazioni automatizzate dalle regole dello Smart Contract[​](https://docs.weft.finance/term-condition#automated-transactions-via-smart-contracts) <a href="#automated-transactions-via-smart-contracts" id="automated-transactions-via-smart-contracts"></a>

Le transazioni sono automaticamente gestite dallo Smart Contract.

### Diritto d'uso[​](https://docs.weft.finance/term-condition#right-to-restrict-access) <a href="#right-to-restrict-access" id="right-to-restrict-access"></a>

Il possessore del badge di proprietario si riserva il diritto di restringere l'accesso in caso di violazione dei servizi, inclusa la sospetta attività illegale o le violazioni dei termini d'uso.

### Nessuna garanzia sulla qualità del servizio[​](https://docs.weft.finance/term-condition#no-guarantee-of-service-quality-or-accessibility) <a href="#no-guarantee-of-service-quality-or-accessibility" id="no-guarantee-of-service-quality-or-accessibility"></a>

Il servizio può essere temporaneamente inaccessibile o non funzionante.

### Responsabilità degli utenti[​](https://docs.weft.finance/term-condition#user-responsibility-for-due-diligence) <a href="#user-responsibility-for-due-diligence" id="user-responsibility-for-due-diligence"></a>

Gli utenti sono invitati a verificare e controllare il rischio di esecuzione delle transazioni e dello smart contract.

### Tassazione <a href="#tax-responsibilities" id="tax-responsibilities"></a>

Gli utenti sono responsabili di eventuali tasse o quant'altro fosse richiesto dalla legislazione corrente per l'uso dei servizi offerti dallo Smart Contract.

### Limitazione di responsabilità[​](https://docs.weft.finance/term-condition#disclaimers-and-limitations-of-liability) <a href="#disclaimers-and-limitations-of-liability" id="disclaimers-and-limitations-of-liability"></a>

Il servizio è fornito così com'è e quando disponibile senz'altro tipo di garanzie.

### Rinuncia a provvedimenti ingiuntivi <a href="#waiver-of-injunctive-or-other-equitable-relief" id="waiver-of-injunctive-or-other-equitable-relief"></a>

Gli utenti rinunciano al diritto di ottenere ingiunzioni.

### Termine del servizio[​](https://docs.weft.finance/term-condition#termination-and-cancellation) <a href="#termination-and-cancellation" id="termination-and-cancellation"></a>

Il presente accordo può essere terminata da entrambe le parti, ed il proprietario del badge del contratto si riserva il diritto di interrompere il servizio in ogni momento.

### Modifica degli accordi di servizio[​](https://docs.weft.finance/term-condition#future-modifications-by-weft-finance) <a href="#future-modifications-by-weft-finance" id="future-modifications-by-weft-finance"></a>

Gli accordi di servizio possono essere modificati.

### Contatti[​](https://docs.weft.finance/term-condition#how-to-contact-us) <a href="#how-to-contact-us" id="how-to-contact-us"></a>

In merito alle questioni della Privacy Policy, potete contattarci a <info@zerocollateral.eu>


# Overview

Lending DApp is a distributed application composed of a website and a Smart Contract created with the Scrypto language and executed within the Radix distributed network (DLT).


# Mission & Vision

The objectives are very specific:&#x20;

* Produce a protocol that is potentially profitable&#x20;
* Check the Radix technological full-stack understood as:&#x20;
  * the programming language (Scrypto)
  * testing tools (Resim and Scrypto Test)
  * authentication badges
  * deployment and blueprint management tools&#x20;
  * financial calculation tools&#x20;
  * the user experience with the Mobile App&#x20;
* Check how many people (wallets) will use the services offered by this DApp


# Smart Contract

The operation of the service is as follows.&#x20;

The Smart Contract manages four containers, an XRD container, a token container, a commission container and a donation container&#x20;

Each wallet can use the Smart Contract services after registration through which they will obtain an NFT with 6 pieces of information:&#x20;

time in which the loan provided/received began&#x20;

period in which the loan provided/received ended&#x20;

loan amount provided/received to/from the contract


# Lend Tokens

Each wallet can provide liquidity in the form of XRD tokens (limit is configurable) and obtain in exchange the same number of LND tokens and the NFT updated with the start date of the loan and the number of XRDs.&#x20;

Each wallet can recover the liquidity provided in one or more times, each liquidity recovery will cause the number of XRDs to be updated, if all the liquidity is recovered the loan end period will also be updated.&#x20;

For each liquidity recovery, the reward accrued during the period in which the tokens were used is assigned. It is not possible to provide new liquidity without closing the current operation in advance.&#x20;

After all the liquidity has been withdrawn it will be possible to replenish it again.&#x20;

Currently the contract is configured to remunerate liquidity only based on time, therefore it is no longer necessary to wait for a predetermined number of epochs to pass before injecting liquidity again.


# Borrow Tokens

Each wallet can withdraw liquidity in the form of XRD tokens (maximum 3% of the total XRD container) without providing any type of collateral up to a maximum of 50% of the total available liquidity.&#x20;

Each wallet can return the liquidity withdrawn in one or more times, each return of liquidity will ensure that the number of XRDs is updated, if all the liquidity is returned, the end date of the loan will also be updated.&#x20;

For each return of liquidity, the commission accrued during the period in which the tokens were available is deducted. It is not possible to request new liquidity unless the current operation has been closed in advance.&#x20;

Each withdrawal request must indicate the number of periods for which it intends to maintain liquidity, after which it is necessary to proceed with the reimbursement.


# Refund request

Each wallet that has requested a withdrawal is monitored and if the refund is not made within the expected number of periods then reminders will be sent in the form of NFT.&#x20;

The reminders will be eliminated as soon as the wallet reimburses the amounts due.&#x20;

Reminder NFTs are visible to any other contract and constitute an incentive to repay the liquidity withdrawn without paying any kind of collateral.


# Earnings

The reward for the Smart Contract is made up of the difference between the percentages paid to liquidity providers compared to those charged to those who make withdrawals.&#x20;

The Smart Contract currently offers loans without any request for collateral on limited amounts and this means that the calculation of the percentages will reflect and change based on the percentages of insolvencies that will occur during the life of the contract itself.


# Future Developments

We are evaluating what the next interventions will be, the hypotheses are:&#x20;

* Request a form of guarantee before granting loans as other platforms already do&#x20;
* Introduce a rating mechanism for the requesting account (credit score assessed by some AI prediction)&#x20;
* Make deals with other platforms to block accounts that have received a “Bad Payer” NFT from operating.&#x20;
* Introduce the possibility of repaying the loan in monthly installments


# Work in progress

The ongoing activities are:&#x20;

* Managing of multi resource
* Management of issues relating to smart contract updates&#x20;
* Introduction of the 'Access Controller' pattern for the main liquidity vault

Completed Activities:&#x20;

* Management of automatic transactions with seed phrase protection on the Mainnet network (Ready)
* Extraction and display on the Home Page of accounts that have the 'BadPayer' NFT (Available)


# Configuration

The Smart Contract has 3 types of badges:&#x20;

* Owner (Owner)&#x20;
* Administrator (Admin)&#x20;
* Staff&#x20;

Each of these badges provides access to features

* Set reward percentage for loans provided/received (Admin, Owner)&#x20;
* Set the number of epochs after which the SC can be used again (Admin, Owner)&#x20;
* Extend the pool to accept more loans (Staff, Admin, Owner)&#x20;
* Create new NFTs to assign to staff (Admin, Owner)&#x20;
* Withdraw funds for project development (Owner)&#x20;
* Collect commissions for project development (Owner)&#x20;
* Deposit new tokens into the main XRD container (Admin, Owner)


# Staff

Staff account can use their badge to modify the Smart Contract configuration.

These are the available parameters to configure:

```
        1. Reward level for account providing liquidity (default=5) 
                -> This changes the level of interest (API) on the provision of liquidity
        2. Interest level for account borrowing liquidity (default=10) 
                -> This changes the level of interest (API) on loans
        3. Maximum length of loans/tokenize period expressed in epochs (default=8000=1 month)
        4. Maximum percentage that an account can withdraw from the total available (default=3)
        5. Maximum number of tokens that can be borrowed (default=3000)
        6. Maximum number of tokens that can be deposited in liquidity (default=10000)
        7. Maximum ratio between loans received and loans granted (default=30) 
                -> Maximum percentage of supplied liquidity that can be used for loans

```

Reward/Interest level will be valid from the next epoch, that is, in the next five minutes

The other parameters become active immediately.


# Disclaimer

**Transactions automated by Smart Contract rules**​&#x20;

Transactions are automatically managed by the Smart Contract.&#x20;

**Right of use**​&#x20;

The owner badge holder reserves the right to restrict access in the event of violations of the Services, including suspected illegal activity or violations of the Terms of Use. No guarantee on the quality of the service The service may be temporarily inaccessible or not working.&#x20;

**Users' responsibility**&#x20;

Users are encouraged to verify and control the risk of executing transactions and the smart contract.&#x20;

**Taxation**&#x20;

Users are responsible for any taxes or anything else required by current legislation for the use of the services offered by the Smart Contract.&#x20;

**Limitation of Liability**​&#x20;

The service is provided as is and when available without any other type of guarantees. Waiver of injunctive relief Users waive the right to obtain injunctions.&#x20;

**End of service**​&#x20;

This agreement may be terminated by either party, and the contract badge owner reserves the right to terminate the service at any time.&#x20;

**Modification of service agreements**​&#x20;

Service agreements may be modified.&#x20;

**Contacts​**&#x20;

Regarding Privacy Policy issues, you can contact us at <info@zerocollateral.eu>


