Only this pageAll pages
Powered by GitBook
1 of 23

Xend Finance Docs

Loading...

Loading...

Loading...

Xend Finance Functions

Loading...

Loading...

Loading...

Loading...

Xend Finance SDK & API

Loading...

Loading...

Loading...

Contracts

Loading...

Loading...

Hiring

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Esusu

Esusu is a traditional form of cooperation in African societies where groups of individuals contribute to informal savings and credit associations for their mutual benefit.

On Xend Finance, a group of two(2) individuals and more can be part of an Esusu cycle. An Esusu cycle has a fixed amount every contributor in that cycle has to deposit to be part of the cycle. The Esusu cycles have a payout interval for each member/contributor of the cycle. This payout interval is the time a particular member/contributor in the Esusu cycle can withdraw their Return-on-Investment of the fixed amount deposited at the start of the cycle.

After the payout time of every member of the Esusu cycle has reached, members of the cycle can withdraw the initial deposit made at the start of the cycle.

Esusu Features

An Esusu cycle has to be created as part of a group. Here is how to create a group.

Create Esusu cycle

Below the group created click Open

When a particular group is open, click the Create New Cycle button, and fill in the form for the details of the Esusu cycle. The details needed to create an Esusu cycle are the deposit amount, the duration of the cycle (which represents the duration for payment intervals for the members of the cycle), the start time, and the maximum number of individuals that can contribute/join the cycle.

If the process is successfully completed, a notification pops down with the success message.

How to join an Esusu cycle

Go back to the Esusu Cycle page and choose a group to join

When the Esusu details page opens up, you should see the Join Esusu button if you are yet to join the cycle. There are other conditions that affect the visibility of some of the buttons.

Esusu Contributions

You can easily view all the Esusu cycles you have contributed to. This page shows tabs for Esusu cycles created by you, pending cycles (cycles you have joined but are yet to start), cycles in progress, and completed cycles.

How to withdraw from an Esusu cycle

  • Click “View” on the chosen cycle

Withdraw ROI

  • Click “Withdraw ROI”

Notification “You just withdrew your ROI from this cycle” pops up

After withdrawing ROI, you can now withdraw your capital by clicking “Withdraw capital” as seen in the image below:

Withdraw Capital

  • Click “Withdraw Capital”

  • Click “Confirm” on metamask notification page

Notification; “You just withdrew your capital from this cycle” pops up.

Groups

Using MetaMask

What is MetaMask

From the MetaMask website, MetaMask is a crypto wallet and gateway to blockchain apps. It is available as a browser extension and as a mobile app, Metamask equips you with a key vault, secure login, token wallet, and token exchange - everything you need to manage your digital assets. MetaMask was created out of the need of creating more secure and usable Ethereum-based websites. In particular, it handles account management and connecting the user to the blockchain.

To use Xend finance, which is a decentralized application (dApp), the Xend finance website needs to be connected to MetaMask, and since MetaMask is also a web browser extension this connection is quite straightforward to accomplish.

Set-up MetaMask

Mobile Device

To use Xend Finance from your mobile phone, you need to download the MetaMask mobile app. Go to Play Store or Apple Store and search for the MetaMask and download.

Next, follow the steps on the app to set up your wallet. You can import your already existing address using your address seed phrases, you can sync your MetaMask wallet if you already set up MetaMask on your computer, or you can just create a new wallet. Choose one of these options and complete the remaining steps to finish the setup of MetaMask on your device.

You should have a similar screen to the screenshot above.

Add Binance Smart Chain Network

By default, MetaMask does not usually come with the Binance Smart Chain network, and to make use of Xend Finance we have to run it on the Binance Smart Chain network.

Click the menu icon on the top left of the app, the side drawer opens and looks similar to the screenshot below.

Click the "Settings" options, and choose the Network options from the list of options that shows up.

Click the Add Network button at the bottom of the page and input the values for the Binance Smart Chain network.

Once you save the network, you will be able to open Xend Finance on the MetaMask mobile app.

Web Browser

When downloading and installation complete, a welcome page similar to the image below should open. Click the Get Started button

Next, you can choose to import an already existing wallet or you can set up a new wallet. If this is your first time using MetaMask, you can just create a wallet. I am continuing with the assumption that you are creating a new wallet. Click the Create a Wallet button to continue.

You can go through the route of import your already existing wallet.

Create a new wallet

Type your password and create a wallet

Follow the steps that come after and save the secret seed phrase that will help in retrieving your account whenever you need it. If everything goes successfully you should see the congratulations page like the screenshot below.

If all went well with the processes above, you should see your new wallet on MetaMask like the screenshot below.

You are now set to start using Xend Finance with MetaMask :)

Adding a Network

Network Details

Binance Smart Chain (BSC) is best described as a blockchain that runs in parallel to the Binance Chain. Because BSC is EVM-compatible, it launched with support for the rich universe of Ethereum tools and DApps. This version of Xend Finance is running on the Binance Smart Chain network because of its interoperability, fast throughput, high security, and its on-chain governance.

Field

Value

Network Name

Binance Smart Chain

New RPC URL

Chain ID

56

Symbol

BNB

Block Explorer URL

https://bscscan.com

Binance Smart Chain (BSC) is best described as a blockchain that runs in parallel to the Binance Chain. Because BSC is EVM-compatible, it launched with support for the rich universe of Ethereum tools and DApps. This version of Xend Finance is running on the Binance Smart Chain network because of its interoperability, fast throughput, high security, and its on-chain governance.

Field

Value

Network Name

BSC Testnet

New RPC URL

https://data-seed-prebsc-1-s1.binance.org:8545/

Chain ID

97

Symbol

BNB

Block Explorer URL

https://testnet.bscscan.com

Add a network

Go to the settings page, click on Networks, and click on the "Add Network" button on options that opens up. These same steps apply to all other networks Xend Finance is deployed on like the Binance Smart Chain Mainnet.

Fill the form that opens up with the following details and click the save button.

Connect Xend Finance with MetaMask

If you have successfully saved the network, it should be among the list of networks on MetaMask, make sure Binance Smart Chain is the selected network from the list.

After connecting to MetaMask, there could be situations where MetaMask brings up the connection modal that will look similar to the screenshot below. Select your account and proceed.

You can learn more about MetaMask from the official website metamask.io and from this

Click the menu icon at the top left of the screen, and select the browser option and search from the search bar.

Open the MetaMask download page and install the browser extension/plugin if your browser is a supported browser. MetaMask works on browsers like Google Chrome, Firefox, Brave, Microsoft Edge, etc.

Now to connect the Xend Finance website with MetaMask, while you are on the Xend Finance home page or , depending on the network you want to invest with, then, click on the MetaMask extension

video
bsc.xend.finance
https://metamask.io/download.html
https://bsc.xend.finance/
https://testnet.xend.finance/
https://bsc-dataseed.binance.org/

Groups

In Xend Finance, a group is an entity that holds one or more Esusu and Cooperative cycles. An Esusu cycle has to be created as a part of a group, also a Cooperative savings cycle has to be created as part of a group.

If you intend to create an Esusu or Cooperative savings cycle for others to join, will have to create a group. You can create a group from the Esusu section or the Cooperative savings section. If you want to create Esusu cycles in a group, create that group from the Esusu section, and the same thing for the Cooperative savings cycles.

Whichever section you create a group from, the need details are the same.

Cooperative Savings

Cooperative savings are groups owned and operated by and for their members/contributors, using pooled funds for the interest and benefits of its member. On Xend Finance, you can be part of a cooperative savings cycle by depositing the amount for one or more stakes. In cooperative savings, one stake might be worth $10, so to contribute in that particular cooperative cycle, you can get a stake for $10, two stakes for $20, and so on. This differs from the Esusu cycle where there is a fixed deposit amount every member/contributor in the cycle has to deposit.

Cooperative Savings Features

Just as in Esusu cycles, a Cooperative savings cycle has to be created as part of a group. Here is how to create a group.

Create a Cooperative Savings cycle

Click “Open”

Click “Create Cooperative Savings Cycle”

Enter required predefined rules

Click “Create Cooperative”

MetaMask notification pops up

Click “Confirm”

The notification “you have joined cycle successfully” pops up

Join a Cooperative Savings cycle

Below the Cooperative group created;

  • Click “Open”

  • Click “Join Cooperative Cycle”

MetaMask notification page pops up.

  • Click “Confirm”

Notification; “You have joined cooperative cycle successfully” pops up.

Groups
Creating Group
Open Group
Create Esusu cycle
Click Join
Join Esusu cycle
Click on Contributions
Esusu contributions
MetaMask welcome screen
MetaMask wallet home screen
MetaMask side drawer
List of Networks on MetaMask
Adding Binance Smart Chain network values
Xend Finance
Welcome to MetaMask
Create a new wallet
Type in password and create wallet
Wallet successfully created
New wallet created
Add network option
Fill new network form
Added Binance Network
Connect Xend Finance to MetaMask
MetaMask connect notification modal
MetaMask connect notification modal

Get Started

Xend Finance is a DeFi Platform for Credit Unions and Cooperatives.

Credit Unions and Cooperatives anywhere in the world can now channel capital into savings and earn higher interest in stable currencies.

This document seeks to help you understand and use the Xend Finance dashboard

Personal Savings

The Personal Savings feature on Xend Finance allows you to deposit any amount BUSD from your wallet balance, and after some time, the amount you deposit gains interest, and you can then withdraw the resulting amount. Your withdrawable amount is your share balance.

Deposit in Personal Savings

To deposit on your personal savings, select the personal card from the Xend Finance app.

Click on the drop-down card with the BUSD logo, from the drop-down menu, select the percentage of your personal wallet balance you will like to save, the app will calculate the amount and populate the amount field (you can also input the amount you want to save by typing in the amount).

Click on Save, click on Confirm on the MetaMask modals, to first authorize the transaction and secondly to perform the saving.

If the deposit was successful, a notification pops out from the top center of your screen "Deposit Successful".

Withdraw from Personal Savings

The amount withdrawable from your personal savings is the Share Balance.

To withdraw from your share balance, click on the drop-down card, select the percentage of your share balance, and click Withdraw.

Confirm the transaction from the MetaMask pop-up modal that comes out after clicking the Withdraw button.

If the withdrawal was successful, a "Successful Withdrawal" notification pops out.

Get BNB & BUSD

Binance Smart Chain Mainnet

BNB is short for Binance Coin, a cryptocurrency created by Binance, the largest cryptocurrency exchange (by volume) in the world. BNB is used by traders to get discounts on their trading fees and it has other benefits.

On Xend Finance, BNB is used as the currency for paying gas fees. The gas fee is the fee or pricing value that is required to successfully conduct a transaction or execute a contract on the blockchain platform.

Get BNB & BUSD

Create an account

If you successfully created your account, you should see something resembling the screenshot above.

From this screen you can directly go ahead to buy BNB or / BUSD from the options available, using the accepted payment methods for your country. This could be either Card, Bank Transfer, Mobile Money, or P2P transfers.

Transfer to Metamask Wallet address

Copy your wallet address from Metamask, and fill in the withdrawal form.

Choose the Coin to transfer to your Metamask wallet, which will be BNB, BUSD. Choose Binance Smart Chain (BSC) as the network, and enter the amount to transfer to your wallet.

If the transfer is successful, the amounts will be reflected in your Metamask wallet, and you can go on using Xend Finance to save your funds.

Binance Smart Chain Testnet

BNB is short for Binance Coin, a cryptocurrency created by Binance, the largest cryptocurrency exchange (by volume) in the world. BNB is used by traders to get discounts on their trading fees and it has other benefits.

On Xend Finance, BNB is used as the currency for paying gas fees. The gas fee is the fee or pricing value that is required to successfully conduct a transaction or execute a contract on the blockchain platform.

Get BNB

To get BNB, click on “Get BNB” on the top right of the website, it will open the Binance Smart Chain Faucet on a different tab on your browser.

Go to the tab where Xend Finance is opened, click on the MetaMask extension icon on the browser and copy your connected wallet address from the MetaMask modal.

Back to the browser tab where Binance Smart Chain Faucet is opened, paste the wallet address you just copied in the input and click the Give me BNB select button to choose the amount to be sent to the wallet address you pasted. If it is successfully done, the amount should reflect on your MetaMask wallet balance.

Get BUSD

BUSD is a U.S.-regulated stablecoin, fully backed by the U.S dollars. 1 BUSD is equal to 1 USD. BUSD offers a faster way to fund trades and it is acceptable as a medium of exchange, store of value, and method of payment across the global crypto ecosystem.

You need BUSD to be able to make use of the features and functions on Xend Finance.

NB: Please make sure you have some BNB in your wallet before you can receive BUSD

You should have received some BUSD in your wallet but, you might not see it yet if you have not added the BUSD token to your wallet on MetaMask.

How to see BUSD token balance on MetaMask

To see the BUSD token balance you going to add the token to your wallet.

Copy this address 0x3b1F033dD955f3BE8649Cc9825A2e3E194765a3F (Please note that this address is just for the testnet) this is the Token Contract address. You'll be pasting it in the Token Contract Address input field.

Next, open the MetaMask modal click on Add Token, and click on the Custom Token tabs, then paste the address you copied earlier in the 'Token Contract Address' field.

Binance Smart Chain Mainnet:

Testnet:

Select Personal
How to deposit personal savings

You can easily get BNB and BUSD to use on Xend Finance by buying them from platforms like .

Create an account on Binance and complete the verification steps. Open or open , directly to create an account or to login. If you already have an account with Binance, this process of getting BNB and BUSD will be familiar to you.

After you have successfully bought BNB and BUSD on Binance, you can transfer BNB or BUSD to your Metamask wallet address for use on Xend Finance. Open the page on Binance and fill in the withdrawal form.

To start making transactions on Xend Finance , you need to have some BNB in your wallet for gas fees.

To get some for use on , make sure you have sent BNB to your wallet, then click the Get BUSD button on the top right corner of the header of the application.

https://bsc.xend.finance
https://testnet.xend.finance/
Binance
https://binance.com/
https://accounts.binance.com/
withdraw
Testnet
testnet.xend.finance
Binance Welcome Screen
Select cypto to buy, BNB or BUSD
Enter Amount
Binance withdrawal form
Get BNB
https://testnet.binance.org/faucet-smart
Send BNB to wallet address
BNB in wallet address
Add Custom Token
BUSD token

Registry

Binance Smart Chain Mainnet

Polygon Mainnet

Contract Name
Contract Address V2 (Recommended)
Contract Addresses V1
Some Functions Used

xUSDT

deposit

withdraw

balance

getPricePerFullShare

xUSDC

deposit

withdraw

balance

getPricePerFullShare

xAAVE

deposit

withdraw

balance

getPricePerFullShare

xWBTC

deposit

withdraw

balance

getPricePerFullShare

EarnAPRWithPool

APRWithPoolOracle

Ethereum Mainnet

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

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})

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})

Nodejs

Build applications on top of the Xend Finance smart contracts.

Installation

Using npm:

Using yarn:

Xend Finance has different saving strategies that help you save your money in stable currencies;

  • Personal Savings

  • Esusu

  • Cooperative Savings

You can make use of one or all of these strategies

Example

What you need to setup SDK

1. Chain ID

The SDK has support for the chain id's below

  • 1 - Ethereum Mainnet

  • 56 - Binance Smart Chain Mainnet

  • 97 - Binance Smart Chain Testnet

  • 0 - Local Instance of Ganache

2. Private Key

The SDK needs the private key of your blockchain wallet to help you sign and send transactions when you call different methods of the SDK. You can get this from your wallet, like Metamask by opening Account Details and exporting your private key.

Please note this is supposed to be a secret. It is advised you put it in an environment file that you don't make public anywhere.

3. Options

This is the third requirement for setting up the SDK. It is optional and if no options argument is passed in for initializing the SDK, the testnet environment is used. This option is an object with 3 properties, env, protocols and protocolName.

Note: whenever you use the options argument you have to provide value for the env property even if it is "testnet".

Scenario

You can use Xend Finance in as many scenario's you can come up with, but there are 2 examples

  1. Use one general address for all your transactions (like a custodial wallet)

  2. Create a new address for each of your users and use it for their transactions

Protocol Type

This is the structure of a protocol to be used by the SDK and will be helpful when using the SDK on your local machine with an instance of tools like ganache. Below is a structure with venus lending protocol.

Setting up a development environment

The setup example above works right off the bat with real funds. So you will have to have BNB for gas fees and BUSD for the actual savings on Xend Finance, but for testing purposes, we won't be using real funds.

Step 1

The tool we need to set up this development environment is Ganache. Straight from Ganache's website

With Ganache we have a copy of a blockchain running locally on our machine.

Assuming you already have NodeJS installed on your machine, you can install Ganache globally with npm, which makes it accessible from anywhere on your computer's terminal.

Running the ganache-cli starts a local blockchain on your machine. It will be similar to the screenshot below.

At the end of the output after running ganache-cli you should see the Listening on 127.0.0.1:8545 which is your localhost port 8545. This is an indication you have Ganache CLI installed correctly. You can stop it by typing Ctrl + C on your terminal.

Step 2

Moving on with setting up our local environment, we would be making use of a powerful feature that Ganache has, which is the option to start Ganache with a fork of a blockchain. What this means is that you can start Ganache as if it is the current state of the Ethereum Mainnet or Binance Smart Chain running locally on your machine.

Running the code above would make your machine to be running the current state of the Binance Smart Chain. That's cool for development.

To us now, why this is important is because Xend Finance Smart Contracts are already deployed and running on the Binance Smart Chain. So you can immediately start using functions in the Xend Finance Smart Contracts for your own applications in this local test environment we have set up with Ganache.

Step 3

The final thing we need for this setup to be complete is to make sure we have BUSD which is used for savings and BNB which is used for paying gas fees.

So if you currently own an account that has BNB and BUSD on Binance Smart Chain, when you run Ganache CLI with the fork of the Binance Smart Chain like we did above, that your account will still have the funds available to you on your local blockchain running on your machine and you can go ahead to start making use of the Xend Finance SDK. You can jump to the next section to make your first deposit. But if you don't have or you prefer not to use your account, there is a way to have both BNB and BUSD in a fresh account.

For getting BNB, that's easy, whenever your run ganache-cli 10 accounts are generated for you with 100 BNB in them. Please note that when you run ganache-cli with the fork of Binance Smart Chain, whenever you see ETH, it represents BNB. Just like the screenshot above on running ganache-cli, we have accounts and their corresponding private keys printed on your terminal and you can choose any one of them for your tests.

We now have BNB from the account we choose from the Ganache output when we run it. But those addresses don't have BUSD, just BNB. So we need to find an account that has lots of BUSD to transfer from it to our own account (that we get from the Ganache output).

Remember at the time of running ganache with the fork of the Binance Smart Chain, we have the current state of the blockchain at that time and there are addresses that have lots of BUSD in them, so we need to get one of those addresses and use it to run our ganache-cli fork again so that we can be able to locally transfer BUSD from that account that has lots of BUSD to your own account, which is one of those you choose from the Ganache output when we run Ganache.

So we can start Ganache by running the fork of the Binance Smart Chain and unlock that address we just got to enable us to send BUSD from that address.

Transfer Funds & Make Your First Deposit and Withdrawal

Some available functions

General

Personal Savings

Esusu

Cooperative Savings

Contract Name
Contract Address V2 (Recommended)
Contract Addresses V1
Some Functions Used

xvUSDT

deposit,

withdraw,

totalAssets (TVL)

pricePerShare

xvUSDC

deposit,

withdraw,

totalAssets (TVL)

pricePerShare

xvBUSD

deposit,

withdraw,

totalAssets (TVL)

pricePerShare

StrategyUgoHawkVenusUSDTFarm

StrategyUgoHawkVenusUSDCFarm

StrategyUgoHawkVenusBUSDFarm

Contract Name
Contract Address V2 (Recommended)
Contract Addresses V1
Some Functions Used

xBUSD

approve, deposit, withdraw, getPricePerFullShare

xUSDC

deposit, withdraw

xUSDT

deposit, withdraw, getPricePerFullShare

xBNB

approve, deposit, withdraw

APRWithPoolOracle

EarnAPRWithPool

Contract Name

Contract Address

Some Functions Used

Protocol Adapter

0x655ca90baa0936A056eFC5E389Baf97026DfFdA3

Protocol Service

0xd99d68d7d01Af99F3089d0EFBB12C1A02658d436

Group

0x41E95e88c0dCEaCe4159f4118217B67038aaE6F0

getGroupById

createGroup

Cycles (Cooperatives)

0x0884d96d51dDF544865af8eE3fF5a354e815CC32

getCycles

getCycleInfoById

Esusu Service

0x5a32A13770Db90Da7DEA78005Ce110BBBdA8Aac3

CreateEsusu

JoinEsusu

StartEsusuCycle

WithdrawCapitalFromEsusuCycle

WithdrawROIFromEsusuCycle

Esusu Storage

0x2603ba3426aA62d708dbEcf138E04B91e1548A74

GetEsusuCycles

GetEsusuCycle

Esusu Adapter

0xC1C39c7086D1FAFA8a2ffd49d0eA5ECBD37Bf3d1

GetGroupInformationById

Client Record

0x715Adf500E2a5d2a823eec12c9e34b6093Ea7272

getClientRecordByAddress

GetRecords

Xend Finance Individual (Personal Savings)

0x1349236eFfA145CbE2Ad80A20fFee192e35131fa

FixedDeposit

deposit

withdraw

WithdrawFromFixedDeposit

Xend Finance Group (Cooperative Savings)

0x52e343f0E797717195df7858CE8A1080504c4B6d

createGroup

createCycle

endCycle

joinCycle

activateCycle

withdrawFromCycle

withdrawFromCycleWhileItIsOngoing

Xend Token

0x4a080377f83D669D7bB83B3184a8A5E61B500608

BUSD Token

0xe9e7CEA3DedcA5984780Bafc599bD69ADd087D56

approve

Deprecated Contracts

Contract Name

Contract Address

Xend Finance Group (Cooperative Savings)

0x902b9E4eCa35A5f504401f713AE14448C948Ca7c 0xB7c715dca5133e88A29c086bEddb2A6075829BE3 0xe9306300b2a685151c03D5b966F8D5Ca143de7B8 0x82B03319887Cf1Ea980637A36b657Aac21620259 0x497899aBed0F5Bdb8A8Dfa15eCA102aEa1933172 0x03e86B21acF54A3d1abbFE600F78B60384C8211f

0x21d635b36F54E70b578eAd19448BFa2bB73F96E2

Xend Finance Individual (Personal Savings)

0xB44367EABfEf9b1BDbF38a56503E0E5E3105B1A4 0xaE8C4E2B9c4A88DfD2aBFEc55fC938Af1bda96d4

0x8776C093CE3a3E0ee6a7C1FE957F666B8084C448

0xe4AA46a344043bBA9cee7172ecc07f861ebe21B2

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

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)

0x53bA300b24db88580384aE69C84d0Bf566a894D6

0x538e522ea3d8017a4aBDeC3f3091bD0fB1B3d92c

Cooperative Savings

0xDCC47fE454B17378ff09AA15DA0c6B9D90230fA0

0xeB3177D9b320639D4b09BAd71795103b5ad3D426

BUSD Token

0xe9e7CEA3DedcA5984780Bafc599bD69ADd087D56

Deprecated Contracts

Contract Name

Address

Individual (Personal Savings)

0xE2130e88487Edf3a0fd1d715090fB8A8cFeD5F6D

is a personal blockchain for rapid Ethereum and Corda distributed application development. You can use Ganache across the entire development cycle; enabling you to develop, deploy, and test your dApps in a safe and deterministic environment

We can find that account by going to and searching for BUSD in the search bar and clicking on the Holders tab. We are interested in addresses in the Holders table that don't have the paper icon beside it, which indicates that those addresses are not smart contract addresses.

You can confirm that the account has BUSD and BNB also by copying the address and pasting the address in the search bar on the website to see the funds available in the account. If it has both BNB and BUSD, then we a good to go.

You can quickly pull this and go through the README file. The code has already been set up for you, you will just need to create an env file and add the PRIVATE_KEY you get from ganache-cli output. The scripts in the repository will transfer funds from the unlocked address to your own address, and you can begin to call functions from the SDK.

If you have questions you can always ask them on the on Telegram.

https://venus.io
https://for.tube
https://dusd.finance/
yearn.finance
npm install @xend-finance/web-sdk
yarn add @xend-finance/web-sdk
require('dotenv').config(); // this helps you read from your env file

import XF from '@xend-finance/web-sdk'; // using the import format
//// OR ////
const { default: XF } = require('@xend-finance/web-sdk'); // using the require module


const chainId = 56; // Binance Smart Chain Mainnet
const privateKey = process.env.PRIVATE_KEY; // saved in your env file


const setup = async () => {
  const instance = await XF(chainId, privateKey, { env:"mainnet" });
  return instance;
}

const makeDeposit = async () => {
  const { Personal } = await setup();

  const depositAmount = "100";
  const response = await Personal.flexibleDeposit(depositAmount);
  return response;
}

Properties

Values

Description

env

local, testnet, mainnet

Required

protocols

Array of protocols objects

This can only be used when the env is local.

protocolName

Used in the case of multiple protocols available. This is optional if you don't know the protocol available. After setting up the SDK without the protocolName. You can call a method to return the available protocol names.

{
  "name":"Venus",
  "code":"venus",
  "addresses": {
    "PROTOCOL_ADAPTER": "0x655ca90baa0936A056eFC5E389Baf97026DfFdA3",
    "PROTOCOL_SERVICE": "0xd99d68d7d01Af99F3089d0EFBB12C1A02658d436",
    "GROUPS": "0x41E95e88c0dCEaCe4159f4118217B67038aaE6F0",
    "CYCLES": "0x0884d96d51dDF544865af8eE3fF5a354e815CC32",
    "ESUSU_SERVICE": "0x5a32A13770Db90Da7DEA78005Ce110BBBdA8Aac3",
    "ESUSU_STORAGE": "0x2603ba3426aA62d708dbEcf138E04B91e1548A74",
    "ESUSU_ADAPTER": "0xC1C39c7086D1FAFA8a2ffd49d0eA5ECBD37Bf3d1",
    "COOPERATIVE": "0x52e343f0E797717195df7858CE8A1080504c4B6d",
    "PERSONAL": "0x1349236eFfA145CbE2Ad80A20fFee192e35131fa",
    "CLIENT_RECORD": "0x715Adf500E2a5d2a823eec12c9e34b6093Ea7272",
    "XEND_TOKEN": "0x4a080377f83D669D7bB83B3184a8A5E61B500608",
    "TOKEN": "0xe9e7CEA3DedcA5984780Bafc599bD69ADd087D56",
    "PROTOCOL_CURRENCY": "VBUSD"
  }
}
npm i -g ganache-cli
ganache-cli --fork https://bsc-dataseed.binance.org/
ganache-cli --fork https://bsc-dataseed.binance.org/ --unlock 0xd6faf697504075a358524996b132b532cc5D0F14
// Example Script to send BUSD
const web3 = require('web3')
const busdAbi = require('./busd-abi.json')

const w3 = new web3("http://localhost:8545")
const busdAddress = "0xe9e7cea3dedca5984780bafc599bd69add087d56"
const busd = new w3.eth.Contract(busdAbi, busdAddress);

const receiver = "0x.....";
const unlockedAddress = "0xd6faf697504075a358524996b132b532cc5D0F14";

const sendFunds = async () => {
		const amountToFund = 1000;
		const amount = BigInt(amountToFund) * BigInt(Math.pow(10, 18))
		await busd.methods.transfer(receiver, amount).send({ from: unlockedAddress })
		console.log('* sent *\n')
}

sendFunds(); // run the function

Name

Parameters

Description

retrieveWallet()

address of the account used to initialize SDK. Returns an object with the wallet address of the account.

apys()

will only return values if you are on mainnet

Name

Parameters

Description

flexibleDeposit

depositAmount

fixedDeposit

fixedInfo

flexibleInfo

withdrawFixed

recordId

withdrawFlexible

amount

This should be the amount in share balance and not in the stablecoin like BUSD. You can get the share balance from the returned values in the flexibleInfo function.

walletBalance

Name

Parameters

Description

create

walletBalance

Name

Parameters

Description

create

walletBalance

0x454d6F10B18f391adD499cE39aCD5bFCD424B601
0xcF2E6928EeD4399Ac6664b84D068050cBF24B475
0x50c9fBf77CBC8FF1b23a8ED61725C325bedC3C86
0x1973C8D13B02934c13593590940F9BEDbbECc41f
0x3de1Fe0039EC99773DBEE5608823FECDeFB8D9D0
0x0b20d359204221DC850f2Af7fc88A38812eA8Fd5
0x0D87591801E26F516000a659aCc5417D6772a85D
0x4bA58C32b994164218BC6a8A76107dcE6d374e07
0xDA2969621B5c8bcEa32712455051AEf4f066F6a1
0x16911E3d5354725349C355EA0d24Fc6845Aa13Eb
0x6B6209192443221FE137Fb30E4363FC737D3C4d6
0x964407337aA2b8D2aB96B596651Ba9F5F53c4035
0x0f28698FD6A0771CB099482305BeEd0EeCB458D5
0xa25dec88B81a94Ca951f3a4ff4AAbC32B3759E6C
0xa3003c67C0C8fF2280b282F0A821e95fEBA47293
0x3058d344C8F845754F0C356881772788c128eA22
0x9607be08acFeB47Ea7e66b494Dd5dAb88Dda59cf
0xCfD45F5Fc42aFc63Fa9fcBfc21E640A00c5B7Ba3
0x8C709c792700d73e37D8B0A4CD3bcc995d03f084
0x2dABAeB84cACFEF30e95896301CEF65cb24b3176
0xecA930d61675E59Dd7B7650C608F1723Bd30A29E
0xB08018D77D4ec4087AA0A807967eb19dDb649429
0x262AFa4F360f1432FB98a0579dc266e3FaDab1D1
0x21026da06d8979982D325Fd3321bdcf439cC3bD8
0x143afc138978Ad681f7C7571858FAAA9D426CecE
0x6842E453ad9e7847a566876B8A2967FE9d155485
0xd01a0971F03D0ddC8D621048d92A1632b2dB7356
0x418b8D697e72B90cBdF5Cb58015384b9016794F9
0xDD3afc5D5476FC327812B84ae2ccf66C011e6d67
0x0B12E60084816ed83c519a1fFd01022d5A50fcaC
0x0b26E76D8617b20Ec9fe0811BE2dCbF3438cc27F
0x5b208c6Ed9c95907DC7E1Ef34F0Cac52dd22b9dc
0xb9e2346462553e8ab2ef5c298b20e0ef1c7a05b5
0xD991924B2b01f07C2e2491D7a61E0d1E9633d852
0x680f2d603DB851664CAB439d4aA1f633b6f7077F
0xc07d830229C34a3BD97dd95C9BB079117197B548
Ganache
https://bscscan.com/
bscscan.com
repository
Developers Community

Contribution

Contributing to the Xend Finance ecosystem

Thank you for taking the time to contribute to the Xend Finance SDK and creating more tools for other developers and users to be able to harness the benefits of the Xend Finance Layer2 smart contracts.

Please fill the form in the link below with the corresponding details as your entry to this call for developers.

Thank you.

Become a Xend Warrior

Do you want to join the fastest-growing blockchain company out in Africa? Xend Finance has quickly become the face of Africa in the blockchain, cryptocurrency, and DeFi (Decentralized Finance) world, having received international press attention from TechCrunch, Coindesk, Decrypt, and many others.

As the world’s first DeFi Credit Union platform, Xend Finance allows users and Credit Unions to swap their local currency to stable cryptocurrencies and access DeFi investment opportunities to earn higher interest than anywhere else. The company is backed by numerous investors, including Google Launchpad and Binance.

Available Roles

About Xend Finance

Xend Finance provides the tools and platform for a decentralized financial credit union, regardless of geographic location and the home country currency. Members can earn multiple levels of interest on their savings by seamlessly swapping their crypto or fiat currency to stable cryptocurrencies and staking – the process of locking up crypto assets to earn yields – on lending platforms so members can earn compound interest on their money. The Xend Finance platform is the first decentralized finance (DeFi) credit union.

The team is made up of experienced professionals with backgrounds in mathematics, finance, cryptography, and blockchain development, working for some of Africa’s largest employers, including KPMG, Chevron, and Stanbic Bank. Xend Finance is headquartered in Enugu, Nigeria.

Audit

CertiK

CertiK is a leading blockchain based security platform which analyzes and monitors blockchain protocols and DeFi projects for bugs and weaknesses. CertiK combines its patented Formal Verification technology with best-in-class cybersecurity experts to deliver end-to-end security services. CertiK has given our smart contracts the green flag when it comes to platform security.

3MB
Certik Audit Reports.zip
archive
Download Certik Audit Reports

Omniscia

Tech Rate

Techrate is an analytical and engineering agency focused on blockchain technology solutions and audits.

886KB
Tech Rate Audit - Xend Finance.zip
archive
Download Techrate Audit Reports
255KB
Xend Finance - xVault by Tech Rate.pdf
pdf
Download Techrate Audit Report on xVault
230KB
Xend Finance_xAuto_BSC.pdf
pdf
Download Techrate Audit Report on xAuto on Binance Smart Chain
230KB
Xend Finance - Polygon Earn Audit by Tech Rate.pdf
pdf
Download Techrate Audit Report

Bug Bounties

Applicature (VIDMA)

7MB
Xend Finance SC Audit (Applicature).pdf
pdf
Applicature (Vidma)
13MB
Xend Finance Audit-1(VIDMA).pdf
pdf
VIDMA Audit
9MB
Xend Finance Audit-2 (VIDMA).pdf
pdf
VIDMA Audit
7MB
Xend Finance Ellipsis Alpaca.pdf
pdf
VIDMA Audit

Blockchain Engineer

Description

We are looking for a Blockchain Engineer with excellent technical abilities, as you will be responsible for creating online solutions. Blockchain engineers should have effective analytical abilities in order to evaluate an organization's needs and implement solutions. These engineers should also have strong attention to detail, as they often work with multiple system components at once.

The skills and job requirements we’ll need from you:

  • Collaborating with managers to determine blockchain technology needs and envisaged functionalities.

  • Creating application features and interfaces by using programming languages and writing multithreaded codes.

  • Applying the latest cryptology techniques to protect digital transaction data against cyberattacks and information hacks.

  • Advanced proficiency in programming languages, such as Solidity and JavaScript as well as Reactjs.

  • Extensive experience in back-end development, algorithms, and data structures.

  • Knowledge of cryptography and blockchain protocols.

  • In-depth knowledge of best practices in blockchain management and data protection.

  • Advanced analytical and problem-solving skills.

  • Superb organizational skills and keen attention to detail.

  • Excellent communication and collaboration abilities.

How to apply:

Mobile Developer

Description

As the desktop version of our product has gone live, we have seen a tremendous amount of new users and are now in the process of making our product available to those on mobile as well.

We are looking for a task-oriented mobile developer who can work well on their own and in group settings. Our headquarters is based in Nigeria, but we have team members around the world and this person needs to be able to communicate with different people in different time zones.

The skills and job requirements we’ll need from you:

  • Develop application programming interfaces (APIs) to support mobile functionality.

  • Work closely with colleagues to constantly innovate app functionality and design.

  • Write unit and UI tests to identify malfunctions.

  • Demonstrable portfolio of released applications on the App Store or the Android market.

  • Experience with third-party libraries and APIs.

  • Superior analytical skills with a good problem-solving attitude.

  • Ability to perform in a team environment.

  • Strong oral and written communication skills.

  • Ability to interpret and follow technical plans.

  • Proficient in programming languages like Java, Swift, and JavaScript and frameworks such as React Native.

How to apply:

Merchant API

Take the Xend Finance services to your customers via a RESTful API and webhooks.

Who is a merchant

A merchant is a registered business that performs savings operations on behalf of their customers. Basically, your account is referred to as a merchant account and you can create your customers’ accounts as sub accounts. Each sub account has access to a personal wallet address and you can perform transactions (transfer, deposit, save, withdraw, and more) on each account.

What is this?

This API is intended for Finance Applications that wish to leverage the Xend Finance savings service and offer it to their end users. You can, via the API, create an account for each of your customers and manage their accounts just the same way a normal user would inside the Xend Finance mobile application to save, earn interest, transfer money, and much more.

Becoming a merchant

Staging/sandbox environment

Production environment

The steps below are for setting up a merchant account in a production environment.

  1. Register and verify your account using the mobile app with your company email address.

  2. Follow the steps in the mobile app and complete your user profile.

  3. Next, on the mobile app, proceed to the profile section. Then, under Account Security, enable your 2-Factor Authentication.

  4. Next, complete the KYC Verification still in the profile section of the mobile app using CEO profile.

  5. Verify all your provided data for accuracy and authenticity

The return data of the /public/create/sandbox/account and /public/register API will have information on apiKey and apiSecret which you will use to access the rest of the API endpoints for merchants. You can keep them in a safe place where you can easily use them for subsequent merchant API calls.

API Access

To access any authenticated endpoints from the Merchant API you have to add the following properties to the request headers.

  1. authentication: JWT key that is returned to you after logging in.

  2. timestamp: this should be the current timestamp in milliseconds UTC

  3. memberemail: email of the sub-user of the merchant's platform.

  4. merchantcode: merchant user id generated after creating your account.

  5. authorization: serves as the API captcha. For the test environment, the value is Basic parole.

API Signature Calculation

Merchant API endpoints make use of HMAC SHA256 signatures for authenticating API requests. Hash-based message authentication code (HMAC) is used to verify that a request to our endpoint is coming from a trusted source and that the request has not been tampered with on transit from the source of the request to our servers.

The parameters needed to calculate the API signature include timestamp, clientToken, clientSecret, and the payload of the request. All these values are concatenated in URL encoded format and the hash is calculated with the SHA256 hashing algorithm.

// Example code for calculating API signature
import cryptoJS from 'crypto-js';

const timestamp = '';
const token = '';
const accessSecret = '';

const payload = {
  username: 'bob',
  email: 'bobgas@email.com'
};

const signaturePayload = 'username=bob&email=bobgas@email.com';
const signatureText = `${signaturePayload}&timestamp=${timestamp}&api-key=${token}&api-secret=${accessSecret}`;

const signature = cryptojs.HmacSHA256(signatureText, accessSecret).toString(cryptojs.enc.Hex);

HMAC with Postman

JSON Response

Every response body is expected to be JSON data but the API gateway could return unrecognized HTML content with Gateway errors when something goes wrong.

{
    "data": {},
    "status": "success",
    "status_code": 200,
    "message": "action completed",
    "error_code": "",
    "action": null,
    "message_language_code": "",
    "error_details": null
}
  • data: the data returned by the response can be user profile and token, for example, in the login endpoint. The data can be an empty object {}, empty array [], or null.

  • status: The action status enum (success, failed). E.g. if login fail, status will be failed status_code: this is the request header status code. A failed request can have any error code based on section 1 A.

  • message: this is the error message that is shown to the user. This can be, e.g., “wrong username and password”. It is returned for every request.

  • response_details: here comes the debug message and log for the developer; this should never be shown to the user, as the developer can easily discover what he is doing wrong here. E.g., if you pass the user phone number as a string instead of number and the API rejects it, the ‘message’ will say: “something is wrong, try again later.”, but the ‘response_details’ will say, “Please phone number must be set as number,”. The response detail actually comes with error logs.

Language filter is passed thus:

User.profile.userlanguage = eng (user must have set language in his profile)

Post.Header.userlanguage = eg (Pass language in header in each request to return error messages in that language.) NB: language in header overrides user language in profile.

Request Body and Query

Every POST/PUT/PATCH/DELETE Requests will reject Query Strings.

Pass Query Strings to GET Request only.

Also, POST/PUT/PATCH/DELETE Requests do not want to expect URL params or query strings.

NB: what is query string, query param, body param?

Here: https:website.com/url/{query_param}/?query_string=id

Date in body param must be posted in this format: eg expiry_time: "2022-04-09 06:05:05"

Limits and quotas on API requests

  • 50,000 requests per project per day, which can be increased

  • 10 queries per second (QPS) per IP address. (And 100 requests per 100 seconds per member) — when your request limit is reached, header status can be 503

API request is limited/hr you are advised to manage how you query the API to avoid exhausting the limits.

Response header status

The response header status codes are described in the table below.

Status code
Type
Description
Details

200

Ok

The status code 200 does not always mean that your action is complete. Check the doc for JSON Response object describing actions

It means your http request is complete and ok.

417

Expectation Failed

Seen when a user posts the data that is beyond the validation. E.g. if you post amount 20,000 when max amount is stated to be 10,000

The JSON Response sample exist in APP_INFO section of swagger doc.

400

Bad Request

Not usually caused by the user. Basically, if this is seen, the programmer did not read documentation. I advise you to read them. They don’t bite

This can happen for example if you make a request to an endpoint without providing all the required params in header or body.

404

Not Found

The 404 response code does not means the data you request is not found. It's basically the route not found and this status code can come with json object or even HTML data; don't be surprised

500

Internal Server Error

Can be returned if something is wrong on the server or you, the programmer, has configured and posted unwanted data that attempt to confuse us. This status code can come with JSON OBJECT or even HTML data; dont be taken unawares.

522

Timeout

As we use cloudflare DNS, this header error code can be seen. It can return HTML, or any other sophisticated data types that you have not seen before

401

Not Authorized

When the Member authentication keys are not set or have expired

403

Forbidden

When you do what you are not supposed to do.

If you try to do 2fa login when the user has not enabled 2fa, you can get this code

503

Service Unavailable

Sometimes while we are installing updates on the server, or your request limit is exhausted, this could happen

Wait for a second to continue.

429

Too Many Requests

When bots or users are sending too many requests to the API endpoint.

Response data can be mixed format. Follow standard and identify Retry Time in header

Pagination

Every endpoint with pagination will have data, thus:

DATA."itemsList[]"
// Here, array of the items returned and their content field are self-explanatory
 DATA."paginator": {
        "itemCount": 9,
        "perPage": 2,
        "pageCount": 5,
        "currentPage": 1,
        "pagingCounter": 1,
        "hasPrevPage": false,
        "hasNextPage": true,
        "prev": null,
        "next": 2
      }
 // Here, 
 // itemCount = total number of items. Others are self-explanatory.
 // prev = previous page number

Switching page in pagination

Set query params:

  1. pageId | INT (the page you wish to load: default is 1)

  2. perPage | INT (number of items you want to return on each page.. Default is 18, or 20)

  3. sort | String (ENUM >> desc,asc) (sort order for the items) default = desc

NB: Please check swagger swagger/doc/index.html/#/APP_INFO for sample pagination data (GET/info/app/pagination/sample THANKS)

Auto Save (Flexible & Fixed)

Auto save means the user sets his auto save configuration such that once funds enter the wallet we can auto save it to the savings plan either flexible or fixed.

NB: auto fixed savings overrides flexibles savings (should the user enable both on any wallet)

Globally, we can enable or disable auto saving in the entire system.

On each Currency we can enable / disable auto save too.

How autosave works

User sets auto save config in his wallets. Any time the fund enters the user wallet we create a job to auto save the fund in 12 hrs. If in 12 hrs time we try to auto save the fund and the fund is no longer there, we drop the job process. *Fixed savings require the user to select the savings profile that the auto save will top up the fund or leave it empty for a new one to be created.

*users are not allowed to select fixed saving profile yet

Auto save config settings

Field
Type
Description

autoSaveFixed

boolean

Whether to save to fixed when money enter the wallet

This when set to true overrides autoSaveFlexible config

autoSaveFlexible

boolean

autoSaveReInvestFixed

boolean

Whether to reinvest the income from fixed savings when it matures.

autoSaveFormatAllFunds

boolean

Whether to save all the funds in the wallet or the amount received when the trigger happen

Default = true

autoSavDurationDays

number

Should the auto save be for fixed savings, we need duration to use

Multiple of 30

Call back & Webhooks

Edit profile and set your webhook URL. We enable only one URL with module filters. What we offer here is an Unauthenticated POST RESTful webhook over HTTPS only.

NB: callbacks are not guaranteed.

Webhook parameters

Parameter
Module / Service
Description
Available Examples

service

All

The service module. You can get a webhook when a user account is funded with

  1. wallet

secret

All

We will pass the secret you provided in all callback

All module means all the callback we give you must have this param passed which is “secret” same with “service” all webhook will have “service”

amount

wallet

Amount funded in wallet when deposit is received in the blockchain.

currencySymbol

wallet

could be BUSD etc

publicKey

wallet

Could be the crypto address that got the credit.

userEmail

All

Associated user Email

If it’s wallet, then it could be the user that received the funding

WhatsApp Integration Community

Notes

  1. The database time zone is UTC.

Community Manager

Description

We are looking for a seasoned Community Manager who will help manage, grow, and develop our large community across several different social networks and several languages in various parts of the world. The Community Manager will also work with our partners and help craft blogs and execute the distribution of our Marketing and PR campaigns. This person will work directly with our Executive Team, which is based out of Nigeria and California.

Who should you be? You should be passionate, driven, creative, and task-oriented. You must be able to work with a diverse group of people – as blockchain and cryptocurrency know no boundaries – across many different time zones.

The skills we’ll need from you:

  • Proficient in English.

  • Excellent writing skills.

  • Experience with most of these social networks (and willingness to learn the others): Telegram, Twitter, WeChat, Facebook, Instagram, LinkedIn, Reddit, and Discord.

  • Experience with Medium and Substack is a plus.

  • Ability to adapt and take direction.

  • Able to drive initiatives and create new campaigns.

  • Ability to work in a fast-paced environment.

  • Ability to monitor, keep track, and analyze relevant community KPIs.

How to apply:

Content Marketing Manager

Description

As a blockchain company that caters to tech-savvy crypto enthusiasts, as well as millions of unbanked across the world, the Content Marketing Manager for Xend Finance will need to be able to create and distribute a diverse array of content campaigns across numbers of social media and email campaigns. This candidate will also need to be able to handle campaigns in several different languages across several different countries and continents.

The skills and job requirements we'll need from you:

  • Data-driven and highly analytical.

  • Proficiency with Google Analytics.

  • Proficiency with social media analytics.

  • Time management skills.

  • Excellent interpersonal skills.

  • Orchestrating digital content strategies across all online platforms.

  • Driving traffic and engagement that translates to sales and brand promotion.

  • Managing a content marketing budget.

  • Measuring the results of marketing activity to inform future marketing campaigns.

  • Managing a team of writers, illustrators, and data analysts.

  • Implementing SEO best practices.

How to apply:

Account details on Metamask
Export Private Key
Run ganache-cli
Select BUSD from list
Interested in non-contract addresses that have BNB also
Selected address
Call for contributors

If you are interested, please send us your resume and fill out our application !

If you are interested, please send us your resume and fill out our application !

Link to Merchant Swagger doc: Sample nodeJs application:

Create a merchant account for the sandbox environment by calling the merchant auth endpoint /public/create/sandbox/account with the required email and password. Please check out the for more clarity on the API endpoint.

Download the Xend Finance Mobile .

Complete the KYB and business documentation: A link will be provided where you complete our KYB process by uploading your business profile and documents. Ref:

apisignature: Api signature calculation from the data used to make the HTTP request. An example of how it is calculated can be found in the section ""

userlanguage: the language that the responses from the API should be. Use the as the value of the field.

Postman has a feature to add a pre-request script for every request it makes. We have an of the script to calculate the API signature and add it to your request headers. Remember to add the following variables to Postman, hmac, timestamp, token, accessSecret.

error_code: Error code based on error documentation, each error for example if during registration we discover a user trying to use a temporary email address, the error code is documented such that even the public can read our error documentation and know what it means. So, invalid email address can be error code 0001. Ref:

action: this defines an action that could be taken after an error is returned. E.g. load_2fa_login REF: . Secondly, it can return the field, causing the error. E.g. if you are doing authentication and providing email and password. The action can be =”password” meaning that the error is caused by param “password”.

message_language_code: every response comes with language code which is the response.message (front-end can use the language code to switch the message shown to the user based on language preference of the user). The API may return only English ‘message’ for the user – with this code corresponding to the so the code can be used for translation.

Translation: for languages, users can pass language code in every request and the API will return the message in their language (see language code documentation). Also, the language code is returned in the response. Front-end can use the language code to make translations on the app. REF:

Join now! You can get instant answers and also get a test BUSD on SANDBOX.

Here's the link to the .

A node.js app of the Merchant API integration.

.

If you are interested, please send us your resume and fill out our application !

If you are interested, please send us your resume and fill out our application !

https://forms.gle/LoC4XqZqyDY7YrKS9
Blockchain Engineer
Mobile Developer
Blockchain QA Engineer
Director of Business Development
Content Marketing Manager
Community Manager
form
https://forms.gle/chpM6pzMo8wPW2JT7
form
https://forms.gle/chpM6pzMo8wPW2JT7
https://apiprostaging.xend.finance/swagger/merchant/index.html/
https://github.com/xendfinance/merchant-api-sample
swagger documentation
app
https://xend.finance/mobileapp.html
ISO language name
example
https://gist.github.com/nCally/508d449fb5ae8bfee62cde290850d112
Error Code Documentation
Response Action Documentation
language code doc
language code doc
https://chat.whatsapp.com/KH7sK3082GP4igCqySC81F
swagger documentation
sample
Pagination endpoint data sample
API Signature Calculation
form
https://forms.gle/chpM6pzMo8wPW2JT7
form
https://forms.gle/chpM6pzMo8wPW2JT7

Director of Business Development

Description

We are looking for a Director of Business Development who is ready to join a high-growth company at the forefront of a technological revolution. This position requires a unique skill set, as we are forming partnerships with credit unions, banks, and financial institutions, as we onboard traditionally underserved people and regions. Our Director of Business Development will need to know how to work and communicate with traditional institutions who might not necessarily know much about blockchain or cryptocurrency. Our perfect candidate will also need to be able to convey the needs and product requirements to our developers and product managers.

The skills and job requirements we’ll need from you:

  • Building solid relationships with customers, vendors, and distributors, as well as sales and marketing teams.

  • Developing in-depth knowledge of company offerings to identify profitable business opportunities.

  • Direct marketing efforts by presenting market research to marketing directors and suggesting strategies to expand market research.

  • Developing and managing strategic partnerships to grow business.

  • Presenting business or marketing opportunities to company executives and management.

  • Excellent analytical, problem-solving, and decision-making skills.

  • Exceptional leadership and management skills.

  • Effective communication and negotiation skills.

How to apply:

Blockchain QA Engineer

Description

The Xend Finance Blockchain QA Engineer is responsible for leading the end-to-end quality of projects within the company’s Web and forthcoming Mobile Application portfolios. The QA Test Engineer creates, tests, and plans for both manual and automated testing of complex blockchain and mobile applications. The right candidate will deliver creative and innovative solutions to support the development team through planning and prioritization of test design, test development, and test automation activities.

The skills and job requirements we’ll need from you:

  • Reviewing quality specifications and technical design documents to provide timely and meaningful feedback.

  • Creating detailed, comprehensive, and well-structured test plans and test cases.

  • Estimating, prioritizing, planning, and coordinating quality testing activities.

  • Identify, record, document thoroughly, and track bugs.

  • Perform thorough regression testing when bugs are resolved.

  • Develop and apply testing processes for new and existing products to meet client needs.

  • Liaise with internal teams (e.g. developers and product managers) to identify system requirements.

  • Monitor debugging process results.

How to apply:

Static Analysis by Omniscia
Static Analysis by Omniscia
Bug Bounties

If you are interested, please send us your resume and fill out our application !

If you are interested, please send us your resume and fill out our application !

form
https://forms.gle/chpM6pzMo8wPW2JT7
https://omniscia.io/xend-finance-x-vault/static-analysisomniscia.io
https://omniscia.io/xend-finance-polygon-xtokens/static-analysisomniscia.io
form
https://forms.gle/chpM6pzMo8wPW2JT7
Xend Finance Bug Bounties | ImmunefiImmunefi
Logo