# Registry

## Binance Smart Chain Mainnet

{% tabs %}
{% tab title="xVault (High Yield)" %}

| Contract Name                | Contract Address V2 (Recommended)                                                                                         | Contract Addresses V1                                                                                                     | Some Functions Used                                                         |
| ---------------------------- | ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------- |
| xvUSDT                       | [0x454d6F10B18f391adD499cE39aCD5bFCD424B601](https://bscscan.com/address/0x454d6F10B18f391adD499cE39aCD5bFCD424B601#code) | [0xcF2E6928EeD4399Ac6664b84D068050cBF24B475](https://bscscan.com/address/0xcF2E6928EeD4399Ac6664b84D068050cBF24B475#code) | <p>deposit,</p><p>withdraw,</p><p>totalAssets (TVL)</p><p>pricePerShare</p> |
| xvUSDC                       | [0x50c9fBf77CBC8FF1b23a8ED61725C325bedC3C86](https://bscscan.com/address/0x50c9fBf77CBC8FF1b23a8ED61725C325bedC3C86#code) | [0x1973C8D13B02934c13593590940F9BEDbbECc41f](https://bscscan.com/address/0x1973C8D13B02934c13593590940F9BEDbbECc41f#code) | <p>deposit,</p><p>withdraw,</p><p>totalAssets (TVL)</p><p>pricePerShare</p> |
| xvBUSD                       | [0x3de1Fe0039EC99773DBEE5608823FECDeFB8D9D0](https://bscscan.com/address/0x3de1Fe0039EC99773DBEE5608823FECDeFB8D9D0#code) | [0x0b20d359204221DC850f2Af7fc88A38812eA8Fd5](https://bscscan.com/address/0x0b20d359204221DC850f2Af7fc88A38812eA8Fd5#code) | <p>deposit,</p><p>withdraw,</p><p>totalAssets (TVL)</p><p>pricePerShare</p> |
| StrategyUgoHawkVenusUSDTFarm | [0x0D87591801E26F516000a659aCc5417D6772a85D](https://bscscan.com/address/0x0D87591801E26F516000a659aCc5417D6772a85D#code) | [0x4bA58C32b994164218BC6a8A76107dcE6d374e07](https://bscscan.com/address/0x4bA58C32b994164218BC6a8A76107dcE6d374e07#code) |                                                                             |
| StrategyUgoHawkVenusUSDCFarm | [0xDA2969621B5c8bcEa32712455051AEf4f066F6a1](https://bscscan.com/address/0xDA2969621B5c8bcEa32712455051AEf4f066F6a1#code) | [0x16911E3d5354725349C355EA0d24Fc6845Aa13Eb](https://bscscan.com/address/0x16911E3d5354725349C355EA0d24Fc6845Aa13Eb#code) |                                                                             |
| StrategyUgoHawkVenusBUSDFarm | [0x6B6209192443221FE137Fb30E4363FC737D3C4d6](https://bscscan.com/address/0x6B6209192443221FE137Fb30E4363FC737D3C4d6#code) | [0x964407337aA2b8D2aB96B596651Ba9F5F53c4035](https://bscscan.com/address/0x964407337aA2b8D2aB96B596651Ba9F5F53c4035#code) |                                                                             |
| {% endtab %}                 |                                                                                                                           |                                                                                                                           |                                                                             |

{% tab title="xAuto (High Yield)" %}

| Contract Name     | Contract Address V2 (Recommended)                                                                                         | Contract Addresses V1                                                                                                     | Some Functions Used                              |
| ----------------- | ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------ |
| xBUSD             | [0x0f28698FD6A0771CB099482305BeEd0EeCB458D5](https://bscscan.com/address/0x0f28698FD6A0771CB099482305BeEd0EeCB458D5#code) | [0xa25dec88B81a94Ca951f3a4ff4AAbC32B3759E6C](https://bscscan.com/address/0xa25dec88B81a94Ca951f3a4ff4AAbC32B3759E6C#code) | approve, deposit, withdraw, getPricePerFullShare |
| xUSDC             | [0xa3003c67C0C8fF2280b282F0A821e95fEBA47293](https://bscscan.com/address/0xa3003c67C0C8fF2280b282F0A821e95fEBA47293#code) | [0x3058d344C8F845754F0C356881772788c128eA22](https://bscscan.com/address/0x3058d344C8F845754F0C356881772788c128eA22#code) | deposit, withdraw                                |
| xUSDT             | [0x9607be08acFeB47Ea7e66b494Dd5dAb88Dda59cf](https://bscscan.com/address/0x9607be08acFeB47Ea7e66b494Dd5dAb88Dda59cf#code) | [0xCfD45F5Fc42aFc63Fa9fcBfc21E640A00c5B7Ba3](https://bscscan.com/address/0xCfD45F5Fc42aFc63Fa9fcBfc21E640A00c5B7Ba3#code) | deposit, withdraw, getPricePerFullShare          |
| xBNB              | [0x8C709c792700d73e37D8B0A4CD3bcc995d03f084](https://bscscan.com/address/0x8C709c792700d73e37D8B0A4CD3bcc995d03f084#code) | [0x2dABAeB84cACFEF30e95896301CEF65cb24b3176](https://bscscan.com/address/0x2dABAeB84cACFEF30e95896301CEF65cb24b3176#code) | approve, deposit, withdraw                       |
| APRWithPoolOracle | [0xecA930d61675E59Dd7B7650C608F1723Bd30A29E](https://bscscan.com/address/0xecA930d61675E59Dd7B7650C608F1723Bd30A29E#code) | [0xB08018D77D4ec4087AA0A807967eb19dDb649429](https://bscscan.com/address/0xB08018D77D4ec4087AA0A807967eb19dDb649429#code) |                                                  |
| EarnAPRWithPool   | [0x262AFa4F360f1432FB98a0579dc266e3FaDab1D1](https://bscscan.com/address/0x262AFa4F360f1432FB98a0579dc266e3FaDab1D1#code) | [0x21026da06d8979982D325Fd3321bdcf439cC3bD8](https://bscscan.com/address/0x21026da06d8979982D325Fd3321bdcf439cC3bD8#code) |                                                  |

{% endtab %}

{% tab title="Venus Lending Protocol" %}
<https://venus.io>

| Contract Name                              |              Contract Address              | Some Functions Used                                                                                                                                     |
| ------------------------------------------ | :----------------------------------------: | ------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Protocol Adapter                           | 0x655ca90baa0936A056eFC5E389Baf97026DfFdA3 |                                                                                                                                                         |
| Protocol Service                           | 0xd99d68d7d01Af99F3089d0EFBB12C1A02658d436 |                                                                                                                                                         |
| Group                                      | 0x41E95e88c0dCEaCe4159f4118217B67038aaE6F0 | <p>getGroupById</p><p>createGroup</p>                                                                                                                   |
| Cycles (Cooperatives)                      | 0x0884d96d51dDF544865af8eE3fF5a354e815CC32 | <p>getCycles</p><p>getCycleInfoById</p>                                                                                                                 |
| Esusu Service                              | 0x5a32A13770Db90Da7DEA78005Ce110BBBdA8Aac3 | <p>CreateEsusu</p><p>JoinEsusu</p><p>StartEsusuCycle</p><p>WithdrawCapitalFromEsusuCycle</p><p>WithdrawROIFromEsusuCycle</p>                            |
| Esusu Storage                              | 0x2603ba3426aA62d708dbEcf138E04B91e1548A74 | <p>GetEsusuCycles</p><p>GetEsusuCycle</p>                                                                                                               |
| Esusu Adapter                              | 0xC1C39c7086D1FAFA8a2ffd49d0eA5ECBD37Bf3d1 | GetGroupInformationById                                                                                                                                 |
| Client Record                              | 0x715Adf500E2a5d2a823eec12c9e34b6093Ea7272 | <p>getClientRecordByAddress</p><p>GetRecords</p>                                                                                                        |
| Xend Finance Individual (Personal Savings) | 0x1349236eFfA145CbE2Ad80A20fFee192e35131fa | <p>FixedDeposit</p><p>deposit</p><p>withdraw</p><p>WithdrawFromFixedDeposit</p>                                                                         |
| Xend Finance Group (Cooperative Savings)   | 0x52e343f0E797717195df7858CE8A1080504c4B6d | <p>createGroup</p><p>createCycle</p><p>endCycle</p><p>joinCycle</p><p>activateCycle</p><p>withdrawFromCycle</p><p>withdrawFromCycleWhileItIsOngoing</p> |
| Xend Token                                 | 0x4a080377f83D669D7bB83B3184a8A5E61B500608 |                                                                                                                                                         |
| BUSD Token                                 | 0xe9e7CEA3DedcA5984780Bafc599bD69ADd087D56 | approve                                                                                                                                                 |

### Deprecated Contracts

| Contract Name                              | Contract Address                                                                                                                                                                                                                                                                                                                      |
| ------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Xend Finance Group (Cooperative Savings)   | <p>0x902b9E4eCa35A5f504401f713AE14448C948Ca7c<br>0xB7c715dca5133e88A29c086bEddb2A6075829BE3<br>0xe9306300b2a685151c03D5b966F8D5Ca143de7B8<br>0x82B03319887Cf1Ea980637A36b657Aac21620259 0x497899aBed0F5Bdb8A8Dfa15eCA102aEa1933172<br>0x03e86B21acF54A3d1abbFE600F78B60384C8211f</p><p>0x21d635b36F54E70b578eAd19448BFa2bB73F96E2</p> |
| Xend Finance Individual (Personal Savings) | <p>0xB44367EABfEf9b1BDbF38a56503E0E5E3105B1A4<br>0xaE8C4E2B9c4A88DfD2aBFEc55fC938Af1bda96d4</p><p>0x8776C093CE3a3E0ee6a7C1FE957F666B8084C448</p><p>0xe4AA46a344043bBA9cee7172ecc07f861ebe21B2</p>                                                                                                                                     |
| {% endtab %}                               |                                                                                                                                                                                                                                                                                                                                       |

{% tab title="Fortube" %}
<https://for.tube>

| Contract Name                 | Address                                    | Some Functions Used |
| ----------------------------- | ------------------------------------------ | ------------------- |
| Protocol Adapter              | 0x5F82328648b4c5dd0fe895CaC650e9bfCcC07844 |                     |
| Protocol Service              | 0x84801368510d1cfc2A194E118d1FA74e1B8C1472 |                     |
| Groups                        | 0xa6566293CEC8023A5151D785b30695E4Aa58ec41 |                     |
| Cycles                        | 0x405B46E2E9A339F8BBd4520AcD4254E02713E684 |                     |
| Esusu Service                 | 0x181B0A426bf8c71bf0702324d58EB9Ce7314faB6 |                     |
| Esusu Storage                 | 0xf1BF6F94170EEa855eB273F361D1B7A32C2Ea4f5 |                     |
| Esusu Adapter                 | 0x68C9727d1B6df57a9C59901465f458f162E5C58E |                     |
| Client Record                 | 0xCF666D971E080412b1457846066422CB74De8d14 |                     |
| Individual (Personal Savings) | 0x1E24e573bce2A6b6d74231327f20dF511225B931 |                     |
| Cooperative Savings           | 0xe9B087aA3A4AFA1d7f56BC2d6f59D51155479dcd |                     |
| BUSD Token                    | 0xe9e7CEA3DedcA5984780Bafc599bD69ADd087D56 |                     |

### Deprecated Contracts

| Contract Name                 | Address                                    |
| ----------------------------- | ------------------------------------------ |
| Individual (Personal Savings) | 0x21eb8fcfAADDaa2eF664810a63A1720EaF6FD6B8 |
| {% endtab %}                  |                                            |

{% tab title="DefiDollar" %}
<https://dusd.finance/>

| Contract Name                 | Address                                                                                                       |
| ----------------------------- | ------------------------------------------------------------------------------------------------------------- |
| Protocol Adapter              | 0xa455edD32a72Ae1A1dc0699C2ED45C25a568d3c0                                                                    |
| Protocol Service              | 0x02a08332Efce731590AbF03e0bC93B39f007a043                                                                    |
| Groups                        | 0x2d2cf772b00EEDF1A59549BF4D3C33B7Cf39866c                                                                    |
| Cycles                        | 0x3C984F5435f4EA69dCBC6D64cefF794E55916b2f                                                                    |
| Esusu Service                 | 0x48Cc703ce6CE9c061F5dC924fB2106953728006E                                                                    |
| Esusu Storage                 | 0xC732D07eeC622BAE85A4Fbbd2fac2f4375C21cA6                                                                    |
| Esusu Adapter                 | 0xF17f4587D414625Fe51e6543b3d103000e0Fff75                                                                    |
| Client Record                 | 0xaa2B817DAb535839AA83991421928599e7df6ffF                                                                    |
| Individual (Personal Savings) | <p><del>0x53bA300b24db88580384aE69C84d0Bf566a894D6</del></p><p>0x538e522ea3d8017a4aBDeC3f3091bD0fB1B3d92c</p> |
| Cooperative Savings           | <p><del>0xDCC47fE454B17378ff09AA15DA0c6B9D90230fA0</del></p><p>0xeB3177D9b320639D4b09BAd71795103b5ad3D426</p> |
| BUSD Token                    | 0xe9e7CEA3DedcA5984780Bafc599bD69ADd087D56                                                                    |

### Deprecated Contracts

| Contract Name                 | Address                                    |
| ----------------------------- | ------------------------------------------ |
| Individual (Personal Savings) | 0xE2130e88487Edf3a0fd1d715090fB8A8cFeD5F6D |
| {% endtab %}                  |                                            |
| {% endtabs %}                 |                                            |

## Polygon Mainnet

{% tabs %}
{% tab title="xAuto (High Yield)" %}

| Contract Name     | Contract Address V2 (Recommended)                                                                                             | Contract Addresses V1                                                                                                         | Some Functions Used                                                    |
| ----------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------- |
| xUSDT             | [0x143afc138978Ad681f7C7571858FAAA9D426CecE](https://polygonscan.com/address/0x143afc138978Ad681f7C7571858FAAA9D426CecE#code) | [0x6842E453ad9e7847a566876B8A2967FE9d155485](https://polygonscan.com/address/0x6842E453ad9e7847a566876B8A2967FE9d155485#code) | <p>deposit</p><p>withdraw</p><p>balance</p><p>getPricePerFullShare</p> |
| xUSDC             | [0xd01a0971F03D0ddC8D621048d92A1632b2dB7356](https://polygonscan.com/address/0xd01a0971F03D0ddC8D621048d92A1632b2dB7356#code) | [0x418b8D697e72B90cBdF5Cb58015384b9016794F9](https://polygonscan.com/address/0x418b8D697e72B90cBdF5Cb58015384b9016794F9#code) | <p>deposit</p><p>withdraw</p><p>balance</p><p>getPricePerFullShare</p> |
| xAAVE             | [0xDD3afc5D5476FC327812B84ae2ccf66C011e6d67](https://polygonscan.com/address/0xDD3afc5D5476FC327812B84ae2ccf66C011e6d67#code) | [0x0B12E60084816ed83c519a1fFd01022d5A50fcaC](https://polygonscan.com/address/0x0B12E60084816ed83c519a1fFd01022d5A50fcaC#code) | <p>deposit</p><p>withdraw</p><p>balance</p><p>getPricePerFullShare</p> |
| xWBTC             | [0x0b26E76D8617b20Ec9fe0811BE2dCbF3438cc27F](https://polygonscan.com/address/0x0b26E76D8617b20Ec9fe0811BE2dCbF3438cc27F#code) | [0x5b208c6Ed9c95907DC7E1Ef34F0Cac52dd22b9dc](https://polygonscan.com/address/0x5b208c6Ed9c95907DC7E1Ef34F0Cac52dd22b9dc#code) | <p>deposit</p><p>withdraw</p><p>balance</p><p>getPricePerFullShare</p> |
| EarnAPRWithPool   | [0xb9e2346462553e8ab2ef5c298b20e0ef1c7a05b5](https://polygonscan.com/address/0xb9e2346462553e8ab2ef5c298b20e0ef1c7a05b5#code) | [0xD991924B2b01f07C2e2491D7a61E0d1E9633d852](https://polygonscan.com/address/0xd991924b2b01f07c2e2491d7a61e0d1e9633d852#code) |                                                                        |
| APRWithPoolOracle | [0x680f2d603DB851664CAB439d4aA1f633b6f7077F](https://polygonscan.com/address/0x680f2d603DB851664CAB439d4aA1f633b6f7077F#code) | [0xc07d830229C34a3BD97dd95C9BB079117197B548](https://polygonscan.com/address/0xc07d830229C34a3BD97dd95C9BB079117197B548#code) |                                                                        |
|                   |                                                                                                                               |                                                                                                                               |                                                                        |
| {% endtab %}      |                                                                                                                               |                                                                                                                               |                                                                        |
| {% endtabs %}     |                                                                                                                               |                                                                                                                               |                                                                        |

## Ethereum Mainnet

{% tabs %}
{% tab title="Yearn Finance" %}
[yearn.finance](https://yearn.finance/)

| Contract Name                 | Address                                    |
| ----------------------------- | ------------------------------------------ |
| Protocol Adapter              | 0x083313c94D2ff5756E7c49E8516d813E19bB04B0 |
| Protocol Service              |                                            |
| Groups                        | 0x90d26bf93607666ff2beb99556dbf6a379ced9bf |
| Cycles                        | 0x755322b498d9A007055587760BE2cC8465A3BC2A |
| Esusu Service                 | 0xc0163F657b48Cd5058b256334c002e4D02Fdc3C4 |
| Esusu Storage                 | 0xD08eA81B20252228329D5EC8Ca1393c86894442c |
| Esusu Adapter                 | 0x671D3B4cC56C29E3409736a913ba96B4473F15c5 |
| Client Record                 | 0x1c1f9af4d32562c3666930d3988c75ba6a4f9645 |
| Individual (Personal Savings) | 0x552260A8F6686430632a5BA6FeAcd066E34b33A2 |
| Cooperative Savings           | 0xE519545539E35f2704D571a476464d037Bcd32cc |
| DAI Token                     | 0x6b175474e89094c44da98b954eedeac495271d0f |
| {% endtab %}                  |                                            |
| {% endtabs %}                 |                                            |

## Function Description

### Deposit in xAuto or xVault

To deposit in the xAuto or xVault Protocol, Call the *deposit* function from the **Xend Finance xAuto or xVault  Protocols(Layer 2 Aggregator )** contracts.

| Parameters   | Description          |
| ------------ | -------------------- |
| Token Ticker | "BUSD","USDT","USDC" |
| Amount       | Amount to Deposit    |

```
const { Personal, xAuto, xVault } = await setupSdk(privateKey, chainId, protocolName);

	if (protocolName === 'xAuto') {

			const receipt = await xAuto.deposit("BUSD", String(amount))
			if (receipt.status) {
				return {
					block: receipt.blockNumber,
					gasUsed: receipt.gasUsed,
					tnxHash: receipt.transactionHash
				}
			}
			throw 'failed'
		}
		else if (protocolName === 'xVault') {
			const receipt = await xVault.deposit("BUSD", String(amount))
			if (receipt.status) {
				return {
					block: receipt.blockNumber,
					gasUsed: receipt.gasUsed,
					tnxHash: receipt.transactionHash
				}
			}
			throw 'failed'
		}
```

### Withdraw in xAuto or xVault

To withdraw in the xAuto or xVault Protocol, Call the withdraw function from the **Xend Finance xAuto or xVault  Protocols(Layer 2 Aggregator )** contracts.

| Parameters   | Description          |
| ------------ | -------------------- |
| Token Ticker | "BUSD","USDT","USDC" |
| Amount       | Amount to Withdraw   |

```
const { Personal, xAuto, xVault } = await setupSdk(privateKey, chainId, protocolName);

		if (protocolName === 'xAuto') {

			const receipt = await xAuto.withdraw("BUSD", totalBUSDAdmount)
			if (receipt.status) {
				return {
					block: receipt.blockNumber,
					gasUsed: receipt.gasUsed,
					tnxHash: receipt.transactionHash
				}
			}

		}

		if (protocolName === 'xVault') {
			const receipt = await xVault.withdraw("BUSD", totalBUSDAdmount)
			if (receipt.status) {
				return {
					block: receipt.blockNumber,
					gasUsed: receipt.gasUsed,
					tnxHash: receipt.transactionHash
				}
			}
		}
```

### Deposit in Flexible Personal Savings

To deposit in the flexible savings, we'll first call the approve function to allow the Xend Finance contract to take the approved amount. Call the *approve* function from the **BUSD Token** contract, and the *deposit* function from the **Xend Finance Individual (Personal Savings)** contract.

| Parameters | **Description** |
| ---------- | --------------- |
| amount     |                 |

```
//1. first approve contract to spend amount
await contract.methods.approve(conractAddress, amount).send({from: clientAddress})

//2. call deposit
await contract.methods.deposit().send({from: clientAddress})
```

### Withdraw from Flexible Personal Savings

Call *withdraw* function from **Xend Finance Individual (Personal Savings)** contract

| Parameters | Description |
| ---------- | ----------- |
| amount     |             |

```
await contract.methods.withdraw(amount).send({from: clientAddress})
```

### Deposit in Fixed Personal Savings

To deposit in the flexible savings, we'll first call the approve function to allow the Xend Finance contract to take the approved amount. Call the *approve* function from the **BUSD Token** contract, and the *FixedDeposit* function from the **Xend Finance Individual (Personal Savings)** contract.

| Parameters | Description |
| ---------- | ----------- |
| amount     |             |
| lockPeriod |             |

```
//1. first approve contract to spend amount
await contract.methods.approve(conractAddress, amount).send({from: clientAddress})

// 2. call FixedDeposit with lock period
await contract.methods.FixedDeposit(lockPeriod).send({from: clientAddress})
```

### Withdraw from Fixed Personal Savings

Call the *WithdrawFromFixedDeposit* function from **Xend Finance Individual (Personal Savings)** contract

| Parameters | Description |
| ---------- | ----------- |
| recordId   |             |

```
await contract.methods.WithdrawFromFixedDeposit(recordId).send({from: clientAddress})
```

### Create a Group

A group needs to be created to be able to create an Esusu or Cooperative cycle.

Contract: **Group**

| Parameters | Type   | Description                   |
| ---------- | ------ | ----------------------------- |
| name       | string | every group has a unique name |
| symbol     | string |                               |

```
await contract.methods.createGroup(name, symbol).send({from:clientAddress})
```

### Get Group using ID

Retrieves the details of a group using its id.

Contract: **Group**

```
await contract.methods.getGroupById(groupId).call()
```

### Create Esusu Cycle

Create an Esusu cycle to enable potential members to join and start saving.

Contract: **Esusu Service**

| Parameters              | Type | Description                                                       |
| ----------------------- | ---- | ----------------------------------------------------------------- |
| groupId                 |      |                                                                   |
| depositAmount           |      | the deposit amount should be a big number                         |
| payoutIntervalInSeconds |      |                                                                   |
| startTimeInSeconds      |      |                                                                   |
| maxMembers              |      | maximum number of addresses that would be able to join this cycle |

```
await contract.methods.CreateEsusu(groupId, depositAmount, payoutIntervalInSeconds, startTimeInSeconds, maxMembers).send({from:clientAddress})
```

### &#x20;Join Esusu Cycle

Adds an address as a member of an Esusu cycle if the address has sufficient balance.

Contract: **Esusu Service**

| Parameter | Type | Description |
| --------- | ---- | ----------- |
| cycleId   |      |             |

```
await contract.methods.JoinEsusu(cycleId).send({from:clientAddress})
```

### Start Esusu

Contract: **Esusu Service**

| Parameters | Description |
| ---------- | ----------- |
| cycleId    |             |

```
await contract.methods.StartEsusuCycle(cycleId).send({from: clientAddress})
```

### Withdraw Esusu ROI

Call this function to withdraw gained ROI from being part of an Esusu cycle.

Contract: **Esusu Service**

| Parameters | Description |
| ---------- | ----------- |
| cycleId    |             |

```
await contract.methods.WithdrawROIFromEsusuCycle(cycleId).send({from: clientAddress})
```

### Withdraw Esusu Capital

Withdraw the deposit amount used to join the cycle.

Contract: **Esusu Service**

| Parameters | Description |
| ---------- | ----------- |
| cycleId    |             |

```
await contract.methods.WithdrawROIFromEsusuCycle(cycleId).send({from: clientAddress})
```

### Create Cooperative Cycle

Contract: **Xend Finance Group (Cooperative Savings)**

| Parameters              | Description |
| ----------------------- | ----------- |
| groupId                 |             |
| startTimeInSeconds      |             |
| payoutIntervalInSeconds |             |
| maxMembers              |             |
| hasMaximumSlots         | boolean     |
| stakeAmount             |             |

```
await contract.methods.createCycle(groupId, startTimeInSeconds, payoutIntervalInSeconds, maxMembers, hasMaximumSlots, stakeAmount).send({from: clientAddress})
```

### Join Cooperative Cycle

Contract: **Xend Finance Group (Cooperative Savings)**

| Parameters    | Description                                                |
| ------------- | ---------------------------------------------------------- |
| cycleId       |                                                            |
| numberOfStake | members can have one or more stakes in a cooperative cycle |

```
await contract.methods.joinCycle(cycleId, numberOfStake).send({from: clientAddress})
```

### Start Cycles

Contract: **Xend Finance Group (Cooperative Savings)**

| Parameters | Description |
| ---------- | ----------- |
| cycleId    |             |

```
await contract.methods.activateCycle(cycleId).send({from: clientAddress})
```

### Withdraw From Cooperative Cycle

In the cooperative cycles, there's a provision to withdraw from the cycle before the end date and time and also to withdraw when the cycle duration ends. Withdrawing while the cycle is ongoing incurs a severance fee on the member that withdraws.

Contract: **Xend Finance Group (Cooperative Savings)**

| Parameters | Description |
| ---------- | ----------- |
| cycleId    |             |

```
// withdrawing while cycle is ongoing
await contracts.methods.withdrawFromCycleWhileItIsOngoing(cycleId).send({from: clientAddress})

// withdrawing after cycle is completed
await contracts.methods.withdrawFromCycle(cycleId).send({from: clientAddress})
```
