# Introduction to DexPay

On-Chain P2P Marketplace for Buying & Selling of Crypto (On-ramp & Off-ramp)

## DexPay: A decentralized peer-to-peer market

DexPay is a Web3 solution focused on providing a peer-to-peer protocol layer for crypto on-ramp/off-ramp that enable users to easily buy and sell cryptocurrency with fiat currency using their self-custody wallets. Our platform utilizes a decentralized peer-to-peer transaction model that is secured by smart contracts, providing users with a high level of security and transparency.

Our goal at DexPay is to make it simple and intuitive for anyone to enter and exit the cryptocurrency world, regardless of their technical expertise. We believe crypto should be accessible to everyone via their self-custody wallets and we are committed to making this a reality through our platform.

At DexPay, we envision a future where financial empowerment is in the hands of the user. Our protocol is founded on the principles of user self-custody, ensuring a secure and accessible means of financial transactions. Our goal extends beyond borders – we aim to empower both web3 and web2 users in developing countries, bridging the gap between technology and real-world financial needs.


# Why DexPay

## Why DexPay?

**Transparency**: DexPay is built on public blockchains. It is open and transparent, meaning anyone can see how transactions are executed and verify their authenticity on the blockchain.

**User Control:** Decentralization is at the heart of what we are building. We have built DexPay to be a standard web3 product that gives users full control and responsibility over their interactions with the DexPay protocol.  This is in line with our goal to build a product that is in line with web3 ethos and raises the bar of what is possible in DeFi.&#x20;

**Ease of transaction:** At DexPay, we have made it very easy for web3 users to get connected to liquidity. Why transfer your funds to a centralized exchange for off-ramp when you can sell directly to fiat from your self-custody wallet in just a few minutes? Buying or Selling on DexPay is easy, secure, and smooth.&#x20;


# How DexPay Works

In essence, DexPay lets two parties trade securely with each other. This is how it is achieved using a hypothetical scenario involving two DexPay users, Ana and John.&#x20;

* Ana and John are looking to buy and sell crypto respectively.&#x20;
* Ana puts up an ad on DexPay, looking to buy 1000 usdt with fiat dollars.&#x20;
* John logs into DexPay with their wallet and decides to sell 1000 usdt to Ana.&#x20;
* John escrows 1000 usdt and Ana is notified of an active trade of 1000 usdt.
* Ana makes payment into John’s bank details.&#x20;
* John confirms payments and releases assets.&#x20;
* Assets are deposited into Ana’s non-custodial wallets.&#x20;

<figure><img src="/files/lFqEqX1N8FqkDKIluaYh" alt=""><figcaption></figcaption></figure>


# Quick Steps

#### To get started with trading on DexPay you need to go through the following simple steps:

* [x] Download/install your self-custody wallet on your device or browser
* [x] Add the network to your wallet. (DexPay is available on the ApeChain and Bsc network for now)
* [x] Connect your wallet to DexPay
* [x] Create your account profile
* [x] Update your account profile with your username and full name.

### 🥳 viola!! you are set to begin trading on Dexpay.


# Self-Custody Wallet Setup

## Self-custody wallets

DexPay is a dApp, hence you will need a self-custody wallet to access trading activities. DexPay has support for a wide range of self-custody wallets which includes the following:

* **Mobile: Trust wallet, Metamak, Coinbase, Kiwi, Mises wallet, etc**
* **Web: Metamask extension, Trust wallet extension, or Rabby wallet extension**

To get started on DexPay, download/install any of your preferred self-custody wallets, and ensure you back up the private keys securely.

* On a desktop, you can install the wallets by visiting the web extension store.
* On mobile, you can download the wallets by visiting the App Store (google playstore or iOS appstore).

#### To add the Metamask extension on Chrome,&#x20;

Visit the [chrome web store](https://chromewebstore.google.com/category/extensions?utm_source=ext_sidebar\&hl=en-GB) , Search Metamask, and click "Add to Chrome"

<figure><img src="/files/ishh49BY3VmldqXGcldZ" alt=""><figcaption></figcaption></figure>

#### To access DexPay dApp on mobile, open the in-wallet browser and navigate to [https://app.dexpay.io ](https://app.dexpay.io/)


# Adding Network to Your Wallet

## Supported Blockchain Network

DexPay currently supports **ApeChain** and **Binance Smart Chain** for on-chain P2P trading. Users will need to make sure ApeChain or Bsc network is added to their wallet in order to initiate transactions on DexPay protocol.

### To Add ApeChain Network

Click on the network drop-down at the top right corner and select ApeChain, It will be automatically added to your wallet

<figure><img src="/files/Itis9KPIrbsbqJ3dWitX" alt=""><figcaption></figcaption></figure>

### To Add Bsc Network

Select the network drop-down at the top right corner and select ApeChain, It will be automatically added to your wallet

<figure><img src="/files/KC4Aqy0WgRZ7NZlqI7dF" alt=""><figcaption></figcaption></figure>


# Creating Account Profile

## Creating Account Profile

Visit <https://app.dexpay.io> on your web browser or wallet browser(mobile)

**Connect Wallet :** Connect your wallet using the ‘Connect wallet’ button located top right corner. (ensure your wallets’ network is set to the Bsc network)

<figure><img src="https://lh7-us.googleusercontent.com/90YfS_UqptMv2Jt8iKV3w3qB5c7FzJzJR_30A_woI_Kfqy8GgnYEj4M8u1AZl_TwYVdBBwR-krQPlFL0TstvfRSxTkg49gY3jyhJW8T-7YN7vmEVWGAFmn0goQxUyz_Pb1FQVsA-iJAcrwzAXaPTHGo" alt="" width="375"><figcaption></figcaption></figure>

**Verify email:** Input your email, accept the wallet sign-in request and input the OTP sent to your email for verification.

<figure><img src="https://lh7-us.googleusercontent.com/A2Kvm-TkK-W4nFQmIe6Y4H2NmRb9ib8JuEUFzG__kVwfpsiH7lAxWaX14ByoutAzuLj5inGMwtOg-aCunZoAD6gDUaIG588Tg7ges9I_zrmr-PGWY-t6d3r9XFQ_FbtAuZUQ380bdfRH8VVAeE6UygI" alt="" width="375"><figcaption></figcaption></figure>

### Viola!! you are officially a Dexter :smile:


# Updating Account Profile

### Updating User Profile

From the trade overview page, click your wallet address indicator located top right corner, then proceed to click on **“My Profile”**

<figure><img src="/files/DcsFuA8xEItJskfp4wOA" alt="" width="329"><figcaption></figcaption></figure>

**Update Profile:** Update your profile with your preferred username, first and last names as shown on your bank details.

<figure><img src="https://lh7-us.googleusercontent.com/eebRK8kfEPBStWFIOUO362W6vzCsTOozholyC1QFtjeW-n_DpjxGfJIGBvlwRBqLkgjqAyZ5CuonkJE2Z75xluLDcs-9fCsSmUZRo8wRtAA4OOcLtMthDsQcA0F4eS3CuVB7COeUuT3W13f_sj-hfSY" alt="" width="375"><figcaption></figcaption></figure>

### Yeah 🤩... you're good to go and start trading!


# What is Allowance

**Smart Contract Allowance** is granting the smart contract the right to access and transfer the tokens in your wallet on your behalf.

Since the token approval is conducted on-chain, you will need gas fees to approve the transaction.


# Ad Allowance

While creating an Ad, it is essential to grant allowance in order to permit the smart contracts to access and transfer tokens on your behalf.

Typically, you only need to do this once till you exhaust the spending cap limit for the coin you've granted allowance on the smart contract.

### How to grant Ad allowance

To grant Ad allowance, click on "Post Ad" on the Ad overview page.

<figure><img src="/files/Sh2jTGZo2XYyuuaKqvJd" alt=""><figcaption></figcaption></figure>

Click "Approve Token" and sign the wallet signature that pops up.

<figure><img src="/files/0czI4q2mX4grmm6vnlD8" alt="" width="375"><figcaption></figcaption></figure>

Wait for the transaction to confirm, then you are good to go.


# Trade Allowance

In order to trade on DexPay, you will need to grant allowance for the smart contract to access the tokens, more specifically when you are selling crypto.

### How to grant allowance for a Sell Trade

From your Sell Overview page click on "Sell"

<figure><img src="/files/EpUwh7J4wuWaHG2F0UrJ" alt="" width="375"><figcaption></figcaption></figure>

A pop up comes up to grant allowance, click "Approve Token" and approve the transaction in your wallet

<figure><img src="/files/0czI4q2mX4grmm6vnlD8" alt="" width="375"><figcaption></figcaption></figure>

**You have successfully granted approval for your token.**

***Please note that you do not need to grant approval for a buy trade.***


# Buy Crypto&#x20;

Buy Crypto in few simple steps

**Select Asset:** From the Trade Overview page, select the asset you want to trade.

<figure><img src="https://lh7-us.googleusercontent.com/M-Ke5-F7bTODjYZAwDwdp_yBQfmB1C399CNQ6Ziyc3Vuwwwyl2O66ZCfB0GGHc5RIKG8vyJVV0Lcf0PB2UuKG4J-TLdTL8iu69vXLE-aUAbPmAJ-_TWhUcKQ3qFK9QOKwxw4PMGIOltDnOKRAHbe1-A" alt="" width="563"><figcaption></figcaption></figure>

**Click Buy:** Select a suitable buy Ad that fits your trading range (you can use the filter)

<figure><img src="/files/w4XviCdFokYwSgnEa7iL" alt="" width="563"><figcaption></figcaption></figure>

**Input amount and click on "Buy":** Input the amount you wish to buy, go through the trade terms and agree. Click on the Buy button and approve the transaction in your wallet (Note that you do not need gas fees to buy.)

<figure><img src="/files/LeaFZUvmN4PaB8DP45He" alt="" width="563"><figcaption></figcaption></figure>

**Make Payment:** Login to your payment platform and proceed to make payment to the account details shown on the order details

<figure><img src="/files/CjfuqSAhVkZaNYuy983d" alt="" width="563"><figcaption></figcaption></figure>

**Confirm Payment:** After making payment, click on “Transferred” to confirm you have sent the money and approve the wallet prompt<br>

**Wait for seller to release assets**

### **Viola! You’ve completed your first buy trade** :tada:


# Sell Crypto

Sell Crypto in few simple steps

**Select Asset:** From the Trade Overview page, select the asset you want to trade.

<figure><img src="https://lh7-us.googleusercontent.com/M-Ke5-F7bTODjYZAwDwdp_yBQfmB1C399CNQ6Ziyc3Vuwwwyl2O66ZCfB0GGHc5RIKG8vyJVV0Lcf0PB2UuKG4J-TLdTL8iu69vXLE-aUAbPmAJ-_TWhUcKQ3qFK9QOKwxw4PMGIOltDnOKRAHbe1-A" alt="" width="563"><figcaption></figcaption></figure>

**Click Sell:** Select a suitable sell Ad that fits your trading range (you can use the filter)

<figure><img src="/files/dF8jUrhEkVTCS0ReOihI" alt="" width="563"><figcaption></figcaption></figure>

**Input amount and add payment details:** Input the amount you wish to sell, add your bank details to receive payment, go through the trade terms and click on agree.

***please note: the names on your bank details must correspond to the names on your profile***

**Click Sell and grant allowance:**  Interacting with the smart contract for the first time will prompt you to grant allowance to specify the spending cap limit for your coin on DexPay. (you only need to do this once till you exhaust your spending limit. You will need gas fees to approve)

**Click on ‘Sell’** : After allowance has been successfully granted, click on "Sell" and confirm the transaction in your wallet.&#x20;

<br>

<figure><img src="/files/1hFhbtWFCPYvdbnGsfE1" alt=""><figcaption></figcaption></figure>

**Confirm Payment :** wait for the buyer to make payment, after payment has been made, login to your payment platform to confirm the payment.

<figure><img src="/files/EgvrJNd0NZ8D9f92Nb4n" alt="" width="375"><figcaption></figcaption></figure>

**Release assets:** Click on "Received, Release Asset" and confirm that you have received full payment to release assests to the buyer.

<figure><img src="/files/jXPDp7lfUHzXXvg6JQ8u" alt="" width="375"><figcaption></figcaption></figure>

### **Viola! You’ve just completed your first sell trade.** :tada:


# P2P Express

P2P Express provides the fastest route for users to swiftly buy or sell crypto by connecting them directly with verified merchants. P2P Express allows users to place orders directly by entering the desired fiat amount for buying or crypto amount when selling.  A smart contract matches your order automatically with a suitable ad without  having to manually select an Ad.&#x20;

### To get started with P2P Express you will need to:

* Connect your wallet&#x20;
* Select ‘P2P Express’ from the Navigation bar,&#x20;

<figure><img src="/files/yNug6ZgOvQAaqWrIsIQq" alt=""><figcaption></figcaption></figure>

### **Buy crypto on P2P Express**

**To Buy:**  Switch the toggle to Buy, input amount to buy, select the asset you want to receive. Your trade will be automatically matched with the best Ad for your trade volume.&#x20;

<figure><img src="/files/wET7xEDDHOsvitRu5ncE" alt="" width="375"><figcaption></figcaption></figure>

**Review Trade:** Go through the trade details, agree to the terms of service and click "Yes, Proceed to Buy"

<figure><img src="/files/61M8n1aFYTSxvuJaWfAE" alt="" width="375"><figcaption></figcaption></figure>

**Make Payment:** Proceed to make payment if you are buying. Assets will be released once seller confirms payment.

**Confirm Payment:** After making payment, click on “Transferred” to confirm you have sent the money and approve the wallet prompt

**Wait for seller to release assets** :thumbsup:

### **Sell Crypto on P2P Express**

**To Sell:** Switch the toggle to sell, select the asset you intend to sell, input amount to sell. Your trade will be automatically matched with the best Ad for your trading volume.&#x20;

<figure><img src="/files/o1Bt9Dnipks9lptQk9g6" alt="" width="375"><figcaption></figcaption></figure>

**Review  Trade and add payment details:** Review the trade details and add your bank details to receive payment.

**Sell:** Click "Yes, Proceed to Sell" and approve the transaction in your wallet to escrow the funds.

<figure><img src="/files/a7r0YvAEzGVIRpsKVQn5" alt="" width="375"><figcaption></figcaption></figure>

**Confirm Payment :** wait for the buyer to make payment and release asset once buyer confirms payment. :thumbsup:


# Post Buy Ads

Create Ads to Buy Crypto on DexPay

To get started with creating Ads,  select '**Post Ad'** from the navigation bar.

<figure><img src="/files/YyscfjTeL1rhUVvqbA6f" alt="" width="536"><figcaption></figcaption></figure>

Select **'Create A Buy AD'**

<figure><img src="/files/AIdsBFHR8XIPMrDSiXXK" alt="" width="563"><figcaption></figcaption></figure>

Select **token** and input the **trade rate**

<figure><img src="https://lh7-us.googleusercontent.com/m_KCq_p2lZUy7mP3PhlMzNvFZBuQYZhcQULF2rt2Avp-5OyRebU6U9QCRSK4G6FxaYMjqORxNW1hKtoIhC02pcpygr3TuOCdDehw03AjkxytqYCUE82bVib1VbxWn59AnKdHMeOavTYUU7aqHJRa9g0" alt="" width="563"><figcaption></figcaption></figure>

**Input Trade details:** Input the amount you want to trade, including other necessary details such as trade limits, trade instructions, etc.

<figure><img src="/files/FZ6QBmgxcXLV7q9xM2mF" alt="" width="563"><figcaption></figcaption></figure>

**Review Ads details:** Confirm the details as displayed on the Ad Overview, if satisfied, agree to the trade terms, and click on **‘Post Ad’**.&#x20;

<figure><img src="/files/Fj2Tq6ZqDA7mfFvzxhby" alt="" width="563"><figcaption></figcaption></figure>

Approve the **Post ad prompt** in your wallet

### viola!! Your Buy Ad is now live for trading. :tada:


# Post Sell Ads

To get started with creating Ads,  select '**Post Ad'** from the navigation bar.

<figure><img src="/files/YyscfjTeL1rhUVvqbA6f" alt="" width="357"><figcaption></figcaption></figure>

&#x20;Select **'Create A Sell Ad',**&#x20;

<figure><img src="/files/1ouqLgkYyK01jtlfL3MJ" alt="" width="563"><figcaption></figcaption></figure>

Select **token** and input the **trade rate**

<figure><img src="/files/CYL3lsBdsh2NOGHmthoG" alt="" width="375"><figcaption></figcaption></figure>

**Input Trade details:** input the amount you want to sell with your Ad, add your payment details, trade limits, and trade terms/ instructions.<br>

<figure><img src="/files/sU8cqA8FPjx0dT1igiHi" alt="" width="563"><figcaption></figcaption></figure>

**Review Ads details:** Confirm the details as displayed on the Ad Overview, if satisfied, agree to the trade terms, and click on **‘Post Ad’**.&#x20;

<figure><img src="/files/Fj2Tq6ZqDA7mfFvzxhby" alt="" width="563"><figcaption></figcaption></figure>

Approve the **Post ad prompt** in your wallet

### viola!! Your Sell Ad is now live for trading. :thumbsup:


# How Merchants Are Incentivized

Merchants are allowed to create both buy and sell ads simultaneously. This allows them to buy assets at a price and simultaneously sell back at a slightly higher price. This is beneficial to both the users and merchants of DexPay.&#x20;

Users get instant trading liquidity while merchants make profit off the difference in their buy and sell rates. An example of this is illustrated below.

Ana is a merchant on DexPay and creates two ads to buy and sell 10000 usdt respectively

Ana  buys 10000 usdt from Chris (A seller on DexP2P) at $0.99 per usdt, and sells 10000 usdt to Bob (A buyer on DexP2P) at $1.01 per usdt.&#x20;

Ana makes $200 profit while persons B and C enjoy the instant liquidity that is crucial to a seamless trading experience.

<br>

<figure><img src="/files/t8C7luPyM6oNH0Bp5l23" alt=""><figcaption></figcaption></figure>


# What is Trade Dispute?

#### Trade Dispute occurs when a trade is unable to be completed due to conflicts arising from payment.&#x20;

We consider the trade, payment evidence and trade terms to resolve the dispute, making sure that malicious activities are prevented and users are protected.

#### Trade dispute can be initiated on any of the following scenarios:

* Seller not receiving funds from the buyer after the trade has been marked as paid.
* Incomplete payment from the buyer
* Seller not releasing coin after the buyer has indicated payment.


# How To Dispute A Trade

### To Dispute a Trade:

&#x20;Click the **“Dispute Trade**” Button on the trade page of the trade you intend to dispute and proceed to fill in the reason for your dispute.

* You can review the status of the disputed trade under the pending tab.
* The “Dispute Trade” button is only available after the timer on your trade page counts down to zero.
* You can only dispute a trade 30 minutes after payment confirmation has been made.

<figure><img src="/files/qq1STNOrQBZAsk6RyZ2b" alt="" width="563"><figcaption></figcaption></figure>

**Note: You cannot dispute a trade after the trade has been completed**


# Resolving A Dispute

### How Dispute is resolved:

The first step is to directly contact the person you are trading with to see if the issue can be resolved without involving DexPay Admin as an intermediary.  This is the fastest way to resolve a dispute. You can contact them by pressing the message Buyer/Seller button on your trade page or directly contacting the other party via the phone number provided.

<figure><img src="/files/BCUDqjVMsO5JNYR4Pbq3" alt="" width="563"><figcaption><p>message counterparty</p></figcaption></figure>

If after messaging the buyer/seller, you weren't able to reach a reasonable conclusion you can proceed to **dispute the trade**. After Disputing a trade, you will be able to access the dispute room from your “Pending” tab.&#x20;

<figure><img src="/files/Nd16vpIzFzvAU1I0jqIN" alt="" width="563"><figcaption><p>enter dispute room</p></figcaption></figure>

**Select ‘Enter dispute room’ :** This will  take you to the dispute resolution channel on Telegram where our representative will come in to mediate the resolution process

**Note :** If a user is found to have engaged in fraudulent activity, resulting in a dispute, their wallets may be flagged, suspended or blacklisted. This dispute resolution process is conducted via Telegram hence users are advised to have Telegram Messenger installed on their devices.


# Roadmap

This provides a brief overview and the development focus of DexPay team.

DexPay is committed to building a peer-to-peer trading experience that gives users the convenience and safety they want while trading.

## Q1 2024

* Project Rebrand&#x20;
* Testnet Release
* Internal Auditing & Product Testing

## Q2 2024

* Beta-Release
* Referral & Point System
* Auto-Rate System

## Q3 2024

* Solana & EVMs support
* DID integration (KYC/AML)
* DexPay v1.5 (improve user experience)
* Product Expansion

## Q4 2024

* Incentivization of Liquidity Runners (LR)
* Expansion of OTC/LR Service
* Auto-payment settlement (Auto-ramp)
* Instant Buy/Sell&#x20;

*DexPay roadmap is subject to change*&#x20;


# DexPay Contract

This documentation is to explain the smart-contract functions of DexPay on-chain P2P trading events that users execute to Post Ads, Buy $ Sell crypto (Native & Erc20), Close Ads, Cancel Trade & Dispute Trade.

## Implementation Contract

<table><thead><tr><th width="169" align="center">Network</th><th width="395" align="center">Address</th><th align="center">Contract</th></tr></thead><tbody><tr><td align="center">Binance Smart Chain</td><td align="center">0x42c9982A319102b0B29439d7Fa62F7f0145E4560</td><td align="center">Proxy</td></tr><tr><td align="center">Binance Smart Chain</td><td align="center">0x31635276CeCd8a859dc39Cc15202dC97DEB44590</td><td align="center">Implementation</td></tr><tr><td align="center">ApeChain</td><td align="center">0xb916289f9e23043616990fe004744794f672f33e</td><td align="center">Proxy</td></tr><tr><td align="center">ApeChain</td><td align="center">0x1d148c4ef725cd07af099b652e16ae7d2655bdaa</td><td align="center">Implementation</td></tr></tbody></table>


# State Functions & Variables

### **Multi-Sig (DeFault-Admin)**&#x20;

This is the master wallet for the smart contract which has the defaultAdmin role and is responsible for granting and revoking other roles in the smart contract, as well as pausing and unpausing the smart contract. This is a multi-sig wallet.

`GrantRole:` This function is used to set roles. Only the `DaFault_Admin_Role` can call this function.

`RevokeRole:` This function is used to revoke roles. Only the `DaFault_Admin_Role` can call this function.

### Verified Request&#x20;

This struct represents a verified request, which is used for signature generation and verification.

* `from`: The address from which the request originates. This would always be considered as the verifiedSigner in the wallet
* `to`: The address to which the request is being sent.
* `nonce`: A unique nonce value for each request.
* `validUntil`: A timestamp indicating the validity of the request.

**Nonce:** This returns the nonce of a user in the smart contract which is used in the signature generation process. This value increments for every user after executing authorized transactions.

### **Verified\_Signer**

The role grants permission to the user to sign smart contract signatures generated for the user's wallet transaction request. For the following methods: `sellEscrowLockNative`, `sellNative`, `buyEscrowLockNative`. This method returns a unique bytes32 representing the key of verified signers in the protocol.

### Executor(s)

This is a delegated wallet address that executes transactions on behalf of the user's signed request on the smart contract.&#x20;

The executor role grants permission to trigger smart-contract transactions on the following methods: `sellEscrowLock`, `sellEscrowCancel`, `sellEscrowApprove`, `sell`, `buyEscrowLock`, `buyEscrowApprove`, and `buyEscrowCancel`.&#x20;

The executor can be multiple wallets assigned by the multi-sig (DeFaultAdmin). Currently, we use one executor wallet which serves as the trade moderator during disputes. In the future, we intend to make this function to more moderators who can serve as the executors.

### Whitelisted

This returns `yes` or `no` if `token` is whitelisted or not. Only whitelisted tokens can be bought/sold

### Whitelist

This function is used to whitelist or remove addresses from the whitelist. Only the `DeFault_Admin_Role` can call this function

* `addrs`: To get the list of token addresses to be whitelisted or removed from the whitelist
* `_whitelist`: indicating whether to whitelist (`true`/`false`)

emits `whitelist` event

### Pauser

**Pauser (Admin):** This is a delegated wallet address that can initiate the pause function on the smart-contract and it can only be set by the `DeFault_Admin_Role`&#x20;

### Payment

**Payment Wallet (Fee Wallet):** This is a delegated wallet for collecting fees and can only be set by the `DeFault_Admin_Role`

**Claimable Fees:** This returns the available fees claimable in the contract. Get's claimed during trade approvals executed by the Payment Wallet.

**ClaimFee:** This function is used to claim the accumulated fees for a specific token. Only the ADMIN can call this function. It takes the address of the token for which the fees will be claimed. See claimableFees.

emits `ClaimFee` event.

**Gas Estimation:**  `(const gasToPay = gasUnit * gasPrice)` This is the gas fee needed to execute a transaction on the network.

\
\
\ <br>


# Escrow & Trade Contract

### Escrow Vault()

This returns the `EscrowVaultEntry` data of the `escrowCount` ID passed in as a parameter. The return value stores the details of escrow vault entries.

**Buy Lock Vaults**: This returns the amount intended by a merchant to buy in a token address. This value gets updated as the merchant keeps buying.

**Sell Lock Vaults**: This returns the amount available for a merchant to sell in a token address. This value gets updated as the merchant keeps selling.

### EscrowVaultEntry

This is used to store the details of an escrow vault entry, representing a trade between a user and a merchant.

* `user`: The address of the user initiating the trade.
* `merchant`: The address of the merchant involved in the trade.
* `completed`: A boolean indicating whether the trade is completed or not.
* `tokenAddress`: The address of the token being traded.
* `outcome`: A boolean indicating the outcome of the trade (true for successful, false for unsuccessful).
* `isbuy`: A boolean indicating whether the trade is a buy trade (true) or a sell trade (false).
* `amount`: The amount of tokens involved in the trade.

### Escrow Count()

This method returns the id count of all the buys and sells in the contract that have been created in the smart contract. The current value shows the latest id that was created.

### Sell Escrow Lock

This function is used to lock tokens from a merchant's balance for selling. It requires a signature from the merchant and is executed by the executor. Upon execution, it updates the value of sellLockVaults(tokenAddress, verifiedRequest.to). It takes the following parameters:

* `verifiedRequest`: A struct containing the verified request information.
* `signature`: The signature provided by the merchant for the verified request.
* `tokenAddress`: The address of the token to be escrowed.
* `amount`: The amount of tokens to be locked.
* `feeAmount`: The fee amount calculated off-chain is to be deducted from the amount as a fee.

emits `LockVaultEntryUpdate` event.

### Sell Escrow Lock Native

This function is used to lock native assets (ETH) from a merchant's balance for selling. It requires a verified request and signature from the verifiedSigner for the merchant. Upon execution, it updates the value of sellLockVaults(zero address, verifiedRequest.to). It takes the following parameters:

* `verifiedRequest`: A struct containing the verified request information.
* `signature`: The signature provided by the verifiedSigner to the merchant for the verified request.
* `feeAmount`: The fee amount calculated off-chain is to be deducted from the amount as a fee.
* `amount`: The amount of native asset value to be locked. (payable).

emits `LockVaultEntryUpdate` event.

### Sell Escrow Cancel

This function is used to cancel asellEscrowLock and release the locked tokens back to the merchant's balance. It requires a signature by the merchant, and it can only be executed by the executor. Upon execution, it updates the value of sellLockVaults(tokenAddress, verifiedRequest.to). It takes the following parameters:

* `verifiedRequest`: A struct containing the verified request information.
* `signature`: The signature provided by the merchant for the verified request.
* `merchant`: address of merchant to cancel for
* `tokenAddress`: The address of the token for which the sell lock will be canceled.
* `amount`: The amount to cancel.

emits `LockVaultEntryUpdate` event.

### Buy Escrow Lock

This function is used to indicate the amount of tokens that a buyer wishes to buy. It locks the fee amount from a merchant's balance for buying. It requires a signature by the merchant and is executed by an executor. It updates the values of merchantToTokenFees(verifiedRequest.to, tokenAddress) and buyLockVaults(tokenAddress, verifiedRequest.to). It takes the following parameters:

* `verifiedRequest`: A struct containing the verified request information.
* `signature`: The signature provided by the merchant for the verified request.
* `tokenAddress`: The address of the token for which the sell lock will be canceled.
* `amount`: The amount of tokens to be bought by the merchant.
* `feeAmount`: The fee amount calculated off-chain is to be deducted from the amount as a fee.

emits `LockVaultEntryUpdate` event.

### Buy Escrow Lock Native

This function is used to indicate the amount of native assets that a buyer wishes to buy. It locks the fee amount from a merchant's balance for buying. It requires a verified request and signature from the merchant. It updates the values of merchantToTokenFees(verifiedRequest.to, tokenAddress) and buyLockVaults(tokenAddress, verifiedRequest.to). It takes the following parameters:

* `verifiedRequest`: A struct containing the verified request information.
* `signature`: The signature provided by the merchant for the verified request.
* `amount`: The amount of tokens to be bought by the merchant.
* `feeAmount`: The fee amount calculated off-chain is to be deducted from the amount as a fee.(payable)

emits `LockVaultEntryUpdate` event.

### Buy Escrow Cancel

This function is used to cancel a buyEscrowLock and release the locked fees back to the merchant's balance. It requires a signature by the merchant, and it can only be executed by the executor. Upon execution, it updates the values of merchantToTokenFees(verifiedRequest.to, tokenAddress) and buyLockVaults(tokenAddress, verifiedRequest.to). It takes the following parameters:

* `verifiedRequest`: A struct containing the verified request information.
* `signature`: The signature provided by the merchant for the verified request.
* `merchant`: address of merchant to cancel for
* `tokenAddress`: The address of the token for which the buy lock will be canceled.
* `amount`: The amount to cancel.

emits `LockVaultEntryUpdate` event.

### Buy Escrow Approve

This method is used by the executor to approve buy trades if the Fiat was received by the merchant or not. If received, then verifiedRequest.to must be the user's address and a signature must be generated for the user whether the function is being called by the executor.

On the other hand, if FIAT was not sent, if the signature used would be from the merchant, then verifiedRequest.to must be the user's address. Since the executor triggers the action with either of the signatures, the system maintains its 2/3 quorum.

This call potentially updates `claimableFees(token)`, `merchantToTokenFees(merchant, tokenAddress)`\*\*, and \*\*`sellLockVaults(tokenAddress, merchant)`\*\*. It takes the following parameters:

* `verifiedRequest`: A struct containing the verified request information.
* `signature`: The signature provided by the user for the verified request.
* `id`: The escrowCount id of the trade.
* `tokenAddress`: The address of the token for which the buy is intended.
* `merchant`: The wallet address of the merchant who created the ad.
* `user`: The wallet address of the trader
* `amount`: The amount of tokens to be bought by the user.
* `fee`: The fee amount to cover for gas.

emits `EscrowVaultEntryUpdate` event.

### Sell

This function is triggered by the executor. used to indicate interest by a user in the buy ad of the merchant. It locks the amount that the user wants to sell, awaiting fiat payment by the buyer. It updates the values of buyLockVaults(tokenAddress, merchant). It increments the escrowCount and updates the EscrowVaultEntry data of this id. It takes the following parameters:

* `verifiedRequest`: A struct containing the verified request information.
* `signature`: The signature provided by the verified signer for the verified request.
* `tokenAddress`: The address of the token for which the buy is intended.
* `merchant`: The wallet address of the merchant who created the ad.
* `amount`: The amount of tokens to be sold by the user.
* `id`: unique id from the backend
* `fee`: The fee amount to cover for approval/disapproval gas.

emits `LockVaultEntryUpdate` and `EscrowVaultEntryUpdate` events.

### Sell Native

This function is used to indicate interest by a user in the buy ad of the merchant involving a native asset (eg ETH on Ethereum Network). It locks the amount that the user wants to sell, awaiting fiat payment by the buyer. It updates the values of buyLockVaults(tokenAddress, merchant). It increments the escrowCount and updates the EscrowVaultEntry data of this id. It takes the following parameters:

* `verifiedRequest`: A struct containing the verified request information.
* `signature`: The signature provided by the user for the verified request.
* `merchant`: The wallet address of the merchant who created the ad.
* `amount`: The amount of tokens to be sold by the user. (payable).
* `id`: unique id from the backend
* `fee`: The fee amount to cover for approval/disapproval gas.

emits `LockVaultEntryUpdate` and `EscrowVaultEntryUpdate` events.

### Sell Escrow Approve/Disapprove

This method is used by the executor to approve or disapprove sell trades if the Fiat was received by the user or not respectively. If received, then verifiedRequest.to must be the merchant's address and signature must be generated for the merchant whether the function is being called by the user or owner.

On the other hand, if FIAT was not sent, if the execution would be done by the user, then verifiedRequest.to must be the owner's address and a signature must be generated for the owner, else if a disapproval should be executed by the admin, it means that verifiedRequest.to must be the user's address and signature must be generated for the user. This is how the system maintains its 2/3 quorum.

This call potentially updates `claimableFees(token)`, `merchantToTokenFees(merchant, tokenAddress)`\*\*, and \*\*`buyLockVaults(tokenAddress, merchant)`\*\*. It takes the following parameters:

* `verifiedRequest`: A struct containing the verified request information.
* `signature`: The signature provided by the user for the verified request.
* `id`: The escrowCount id of the trade.
* `approve`: true if approved, and false if disapproved.
* `merchant`: the address of the merchant to deal with if the current merchant fails to comply. If this value is equal to the zero address, it will just close the trade without re-matching

emits `EscrowVaultEntryUpdate` event.


# Dispute Resolution

Dispute resolution is done off-chain but requires users to approve trade or cancel trade on-chain via the executor signer who assigns the approval or cancellation function to the right user to sign after trade arbitration is completed.

### To Approve Sell Trade

This method is used by the executor to assign the approval signature for the buyer to approve the sell trade if the FIAT was received by the seller. If received, then verifiedRequest.to must be the merchant's address and a signature must be generated for the merchant whether the function is being called by the executor.

### To Cancel Sell Trade

On the other hand, if FIAT was not sent, if the execution would be done by the user, then verifiedRequest.to must be the owner's address and a signature must be generated for the owner, else if a disapproval should be executed by a moderator, who assign cancel signature to the seller, it means that verifiedRequest.to must be the user's address and signature must be generated for the user. This is how the system maintains its 2/3 quorum.

### To Approve Buy Trade

This method is used by the executor to assign the approval signature for the buyer to approve buy trades if the FIAT was received by the merchant. If received, then verifiedRequest.to must be the user's address and a signature must be generated for the user whether the function is being called by the executor.

### To Cancel Buy Trade

On the other hand, if FIAT was not sent, if the signature used would be from the merchant, which the executor would assign a signature, then verifiedRequest.to must be the user's address. Since the executor triggers the action with either of the signatures, the system maintains its 2/3 quorum.

Based on the outcome of dispute resolution, the executor generates an off-chain signature which is assigned to either the buyer or the seller to sign. The verifiedSigner is been used to sign the request by the user which the executor now executes on-chain to either approve the token transfer or cancel the trade transaction.

<br>


# DexPay Terms of Service

DexPay Terms of Service

### Disclaimer of Warranties and Limitation of Liability

The DexPay protocol operates on a decentralized and trustless basis, providing services in a manner reflective of the principles of Web3. Users acknowledge and accept that the services provided by the DexPay protocol are offered "as-is" and "as-available," without any warranties, express or implied.

Users bear full responsibility and assume full risk associated with their accounts, addresses, and tokens on DexPay protocol, ensuring that their usage complies with these Terms. It is the user's sole responsibility to safeguard the integrity and confidentiality of their account credentials or private keys for the Site or any wallet applications or devices used in conjunction with the Site.

The compatibility of the Site with any wallet applications and devices, or other third-party applications or devices, is not to be interpreted as an endorsement, recommendation, warranty, guarantee, promise, or assurance regarding their fitness or security. Users acknowledge and agree not to construe such compatibility as such.

DexPay protocol does not provide any representations or endorsements regarding the services or the platform, including but not limited to, implied warranties of fitness for a particular purpose or non-infringement, or any implied warranty arising from course of dealing or usage.

DexPay protocol is not associated with or endorsed by any payment methods, services, or companies that may appear on the Online Payment method lists or advertisement details. Additionally, the services provided by DexPay protocol are not authorized, approved, endorsed, or sponsored by any of the payment methods listed on the platform or their respective trademark owners.

User-generated content, such as messages, feedback, or advertisements, on the platform is not the responsibility of DexPay protocol, and we reserve the right to remove said content/feature without notice or liability in our sole discretion, unless required by applicable law. We also reserve the right to modify or discontinue any part of the platform and/or any services without notice and to establish general guidelines and limitations on their use.

The liability of DexPay protocol, and its affiliates, directors, and employees, is limited to the maximum extent permitted by applicable law. We are not liable for indirect damages. However, nothing in this Agreement shall exclude or limit DexPay’s liability based on willful misconduct or gross negligence. Users assume the full risks associated with interacting with the DexPay protocol.

Finally, users' rights under mandatory provisions of applicable consumer protection legislation are not limited by this Agreement.

## Terms of Service

Please carefully review the following agreement before using the DexPay services. DexPay is an online trading platform for buying and selling cryptocurrencies. We also provide assistance in resolving disputes between buyers and sellers but do not become a party to any transaction.&#x20;

#### Acceptance of the Terms

Agree to DexPay’s Terms of Service and Privacy Policy before using its Services. By accessing or using its Services, you confirm that you agree to these terms.&#x20;

Minors are not allowed to use DexPay Services. You must be at least eighteen (18) years of age or the age of legal majority in your jurisdiction. You affirm that you have the lawful right, power, capacity, and authority to enter into this Agreement.

#### Definitions:

1. DexPay:  ([https://www.dexpay.io](https://www.dexpay.io/)) and other related applications.
2. Whitelisted wallets: wallets that are used for accessing DexPay Services and recording transactions.
3. Users: individuals, institutions, or organizations that use DexPay services and meet the criteria and conditions. Other agreements for these entities must be followed.
4. DexPay services: refers to various services offered by DexPay based on Internet and/or blockchain technologies. These services are accessible through DexPay websites, mobile applications, clients, and other forms, and may include future technological developments.
5. DexPay platform rules: refers to all regulations, implementation rules, product process descriptions, announcements, and other content released by DexPay. These platform rules are published in the Help Center or within products or service processes, and include rules, interpretations, statements, and letters of consent.
6. Digital Assets: encompasses Digital Currencies, digitalized assets with a certain value, and their derivatives.
7. Fiat Partners: are third-party service providers with which DexPay may collaborate in connection with any Fiat Services.

#### Change of Terms

We may modify this Agreement at our discretion to reflect changes in technology, legislation, or business practices. We will notify you of any modifications at least 30 days before they take effect. If you continue to use the Service, you accept the changes. If you disagree, you can terminate this Agreement by concluding any outstanding trades and closing your account. We may also modify the Services and Agreement for security, compliance, or suspected fraudulent activity, and will promptly notify you of any such changes.

#### About DexPay

DexPay strives to provide accurate information through its services, but cannot guarantee its accuracy, reliability, or suitability. DexPay is not liable for any loss or damage resulting from the use of this information. Information about DexPay services is subject to change without notice and is provided solely to assist users in making independent decisions. DexPay does not offer investment or consulting advice, nor is responsible for the interpretation or use of information on its site or other communication channels. Users of DexPay services are responsible for understanding the risks of digital asset trading and are advised to trade responsibly and within their capabilities.

#### Whitelisting Wallets

To use DexPay Services, you must log in with your wallet and and verify your email. You are responsible for the security and control of your wallets and any access codes or credentials used to access the Service or complete trades. You may terminate your access to DexPay at any time, but remain responsible for all prior obligations. By using DexPay Services, you represent and warrant compliance with all applicable federal and state laws and regulations governing Crypto asset Businesses or similar applicable regulation of your jurisdiction.

#### P2P Trading

When using DexPay to buy or sell crypto, you can create or respond to advertisements on the platform, but we may restrict the number of advertisements you can create for security reasons. By responding to an advertisement, you are making a legally binding offer and must comply with the terms and conditions set out by the advertiser, which must be in accordance with this Agreement. When selling crypto, it is your responsibility to ensure that you have received payment for the full amount and that the payment is made by the buyer as per your instructions. Once you release the crypto to the buyer, it is not possible to cancel, reverse, dispute, or recover the crypto. Payments must be made by the same person or entity unless authorized by the payee in writing. All communication relevant to the trade must happen through the DexPay platform and is not considered private. Disputes will be resolved based on communication that occurs on the DexPay platform and is accessible to DexPay’s support staff.

#### Creating Ads

1. You can create advertisements to buy or sell cryptos, and other users can send trade requests to you.
2. Advertisements for buying with or selling against cash are not allowed.
3. When you have advertisements enabled, you must be active and available to reply to trades started from these advertisements.
4. Information and payment details provided in advertisements and trades must be correct and up to date.
5. The price defined in the advertisement details must include all fees required by the advertiser.
6. Once a trade is initiated, the price is locked and cannot be changed or have additional fees added without consent from both parties.
7. Multiple advertisements that fully overlap are not allowed.

When creating advertisements to buy or sell cryptos, other users can send trade requests to you, and a crypto trade is automatically started. However, advertisements for buying or selling cryptos with cash are not allowed.

When you have advertisements enabled, you must remain active and available to respond to trades started from these advertisements. If a dispute is initiated against you and you are deemed unresponsive, the dispute may be resolved against you.&#x20;

It is important to ensure that the information and payment details you provide in advertisements and trades are correct and up to date. If you include out-of-date payment details and a buyer completes payment accordingly, disputes may be resolved against you. Refusal to complete trades or provide payment details for trades opened from your advertisements is considered a violation of this agreement.

The price defined in the advertisement details must include any and all fees that the advertiser requires the buyer to pay. Once a trade is initiated, the price is locked, and no changes or additional fees can be made without consent from both parties.

Multiple advertisements that fully overlap, such as using the same trade limits with the same price in the same payment method category in the same country, are not allowed.

#### Fees and Pricing

When you create a trade advertisement, you will be charged a fee, which you must agree to pay as it represents the charges for using DexPay Services. Unless specified otherwise, you accept that fees will be automatically deducted from the escrowed balance once the trade is completed. We reserve the right to change the fees or pricing principles at any time in accordance with the terms of this Agreement.

#### Merchants

Merchants are dedicated users that facilitate trades on DexPay by providing instant liquidity and acting as counterparties to both buyers and sellers on the platform.&#x20;

They offer accessible and convenient payment options to users and ensure that there is always someone to sell to/ buy from on the platform.

Merchants are distinguished on DexPay through a verified merchant badge. The first 100 merchants on DexPay in each region will be manually selected and undergo verification.&#x20;

Merchants/Users who misuse the platform or are involved in fraudulent trading activities may lose their badge either temporarily or permanently.  Should a merchant be proven to have violated the platform’s terms of service multiple times, they may be blacklisted from using DexPay altogether.

#### Disputing crypto Trades

It is important to understand that while DexPay provides a dispute resolution process, it is not responsible for guaranteeing the performance of any trade. As a user of the Services, you assume the risk that your counterparty may fail to perform according to your agreement with them. In the event of a dispute, either the buyer or the seller can initiate a mediation process on the crypto held in the smart-contract, and the DexPay support staff will review and resolve the dispute. However, trades that have been completed, released by the seller, or already disputed and resolved cannot be disputed, reversed or altered.&#x20;

A dispute can be initiated in any of these three scenarios

i. Buyer has marked the trade as paid but seller did not receive funds

ii. Buyer has paid in full, but seller has refused to release tokens

iii. Buyer did not pay the full amount displayed in the trade.&#x20;

DexPay’s dispute resolution process is off-chain and is community inclusive.&#x20;

#### Unresponsiveness

It is important to note that failure to remain active and responsive during a disputed trade can result in negative consequences for both parties involved. If you are deemed unresponsive, the dispute may be resolved against you, and you may lose access to your account or face other penalties as determined by DexPay. Additionally, if you are the buyer in a disputed trade and you fail to respond to DexPay support, the trade may be cancelled. On the other hand, if you are the seller and you fail to respond, the cryptos in the trade may be released to the buyer. Therefore, it is crucial to remain active and responsive during disputed trades to ensure a fair and efficient resolution.

**Dispute review**

&#x20;As part of the dispute resolution process, DexPay support may request that you provide certain information or documentation to help resolve the dispute. It is important to follow any instructions given by DexPay support and provide the requested information or documentation in a timely and accurate manner. Failure to do so may result in the dispute being resolved against you.

**Dispute resolution criteria**

DexPay can resolve a disputed trade in the favor of a crypto buyer if they have provided sufficient proof that payment was made according to the instructions provided by the seller, advertisement terms of trade, or advertisement payment details. Additionally, if the seller becomes unresponsive and the buyer has paid, the dispute may be resolved in favor of the buyer.

DexPay can resolve a disputed trade in the favor of a crypto seller if the buyer has not provided payment or not provided payment in full, the payment made by the buyer has been held/frozen/stopped by the payment provider, the buyer has not provided payment according to the instructions provided by the seller in the trade chat, advertisement terms of trade, or advertisement payment details, the payment is made by an unauthorized third party to the trade, or if the buyer is not responding.

If either the buyer or the seller provides fraudulent information or documents, makes false claims, or otherwise tries to force a certain outcome of a disputed trade, the dispute may be resolved against the user for this reason.

**Limitation of Liability regarding dispute resolution**

1. You acknowledge that dispute resolution is a service provided by DexPay, and it will be carried out in accordance with the terms of this agreement.
2. You agree that DexPay assumes no responsibility for the outcome of the dispute resolution process.
3. DexPay's liability for dispute resolution is limited to the amount of the fee paid to them.
4. In the event of an incorrect dispute resolution, DexPay assumes no liability for any damage, loss, cost, or inconvenience.

#### Rates

DexPay allows users to determine their rates when creating ads, this means that the prevailing market rate is always subject to volatility and users may incur losses while trading. DexPay is not responsible for any losses incurred due to changes in currency rate.&#x20;

The rate of an existing ad can be updated, however once an ad has been matched with a user, the rate has been locked in and cannot be changed for that trade.&#x20;

#### Flagging, Suspension, and Blacklisting of Your Wallet Address

1. DexPay has the right to flag, suspend or blacklist your wallet address for violating the terms of service or applicable laws, engaging in fraudulent activity or financial crime, providing false or misleading information, or behaving in an offensive or disruptive manner.
2. DexPay may also flag, suspend, or blacklist your address if it is necessary to protect the security of the platform or its users.
3. DexPay may flag your address if you have cancelled a matched order three times in 24 hours.
4. DexPay may suspend your address if you have been flagged twice in 24 hours.
5. Notice will be given before any flagging, suspension, or blacklisting, but in certain circumstances, DexPay may take action without prior notice.
6. DexPay may base its decision on confidential criteria for risk management and security protocols, and is not obligated to disclose these details to you.
7. If your address is suspended, DexPay will lift the suspension as soon as possible once the reasons for the action no longer exist.

#### Data

The data we process can be divided into the following categories:

* personal data (email and bank details)
* Platform use data, including trade and transaction data;
* technical data  (logs, search queries, site statistics, IP addresses etc.).

DexPay stores trade data of users in order to gauge their trade activities on the platform. This data informs other users of an account's trading behavior and helps them make trading decisions.

The data processed for this purpose is primarily collected from the users themselves, either when submitting new trades or making transactions on the services. Some data is collected from the use of the services, including logs and some trade data (such as timestamps). Some data is provided by other users, such as feedback after a transaction. These data cannot be reversed, changed or deleted by DexPay.&#x20;

Please also note that you have the option to post some data publicly when using DexPay’s services. This may be for example through optional fields on your profile or interactions on public boards. You have control over which data you choose to include and remove, but please note that you should not post any data you consider private.

Trade data may be shared with the two parties who enter into a trade. Once a trade has been completed, the data is deleted within 30-60 days after trade completion.

#### Notifications

DexPay utilizes users' email addresses to notify them about pending actions on their trades. By providing your email address and using the platform, you consent to receiving notifications and updates regarding your trades via email.

Please note that email notifications are provided solely for informational purposes and should not be considered as the sole means of communication regarding your trades. While we make reasonable efforts to ensure the timely delivery and accuracy of email notifications, we cannot guarantee the timely delivery or receipt of emails due to factors beyond our control, including but not limited to technical issues, network failures, or spam filters.

Users are responsible for regularly monitoring their trades and taking necessary actions promptly, regardless of email notifications. DexPay shall not be held liable for any losses, damages, or liabilities arising from missed or delayed email notifications.

#### Intellectual Property Rights

All copyrights, trademarks, and other intellectual property rights related to the platform and services provided by DexPay are owned exclusively by DexPay. However, DexPay grants you a limited license to access and use their site, services, and related content solely for approved purposes, subject to the terms of the agreement. Any other use of the content is prohibited, and you agree not to copy, transmit, distribute, sell, license, reverse engineer, modify, publish, or participate in the transfer or sale of the content, or create derivative works from it, in whole or in part.

#### Wallets

Users are advised to exercise caution and implement appropriate security measures to safeguard their self-custodial wallets. Additionally, users should be wary of phishing attempts, unauthorized access attempts, or any other malicious activities targeting their wallets.

By using DexPay, users acknowledge and agree that DexPay shall not be liable for any direct or indirect losses, damages, or liabilities arising from the compromise of their self-custodial wallets due to external factors beyond DexPay’s control.

It is the user's responsibility to ensure the security of their self-custodial wallet and to take necessary precautions to mitigate any potential risks associated with its use.

#### General

DexPay reserves the right to transfer or assign any of its rights and obligations under this Agreement to any party at any time, without affecting your rights or its obligations under this Agreement. However, you may not transfer or assign any of your rights or obligations under this Agreement to any other party.

This Agreement, along with any documents referred to expressly in it, constitutes the entire agreement and understanding between you and us regarding all matters referred to herein, and supersedes any prior written or oral agreements relating to such matters. No oral explanation or information given by either of us shall alter the interpretation of this Agreement. By agreeing to this Agreement, you confirm that you have not relied on any representation that is not expressly included herein. However, nothing in this Agreement excludes liability for any fraudulent statement or act.

This Terms of Service has been written in English. If these terms are translated into another language, the English version shall prevail. If any part or provision of this Agreement is deemed unlawful, void, or unenforceable for any reason, that provision shall be deemed severable from this Agreement and shall not affect the validity and enforceability of any remaining provisions.

DexPay’s failure to enforce any right or provision in this Agreement will not constitute a waiver of such right or provision, unless we acknowledge and agree to it in writing. Any remedies exercised by either party under this Agreement will be without prejudice to other remedies available under this Agreement or permitted by law.

\
\
\
\ <br>

\ <br>

\
\
\
\
\
\ <br>

\
\
\
\
\
\
\ <br>


# DexPay Privacy Policy

DexPay Privacy Policy

## Introduction

This Privacy Policy explains how and why DexPay processes personal data in relation to its services and outlines the measures taken to protect the privacy and security of users. Personal data refers to any data that relates to an identifiable individual, such as wallet addresses, contact information, and trade history on the platform. This policy applies to personal data processed by DexPay as a controller. The policy may be updated from time to time, and any significant changes will be communicated through the website. Customers and users of DexPay services are subject to this Privacy Policy, along with any relevant product agreements. Non-users who access the website are also subject to this Privacy Policy and the Cookie Notice, which provides further information on the use of cookies.

### 2. Your personal data and why we use it

2.1 The specific purposes and legal bases for processing personal data are as follows:

* Providing and improving our services: We process personal data to provide, develop, and improve our services to our users. This processing is necessary for the performance of our product obligations to our users, and our legitimate interests in ensuring the quality and security of our services.
* Verification and authorization of users: We process personal data to verify and authorize our users in order to provide access to their user accounts. This processing is necessary for the performance of our product obligations to our users, and our legitimate interests in preventing fraud and ensuring the security of our services.
* Order processing and communication: We use personal data to process user orders and communicate with users about orders and services. This processing is necessary for the performance of our product obligations to our users.
* Compliance with legal obligations: We process personal data to comply with our legal obligations, such as anti-money laundering legislation. This processing is necessary for compliance with a legal obligation to which we are subject.
* Support services: We process personal data to provide support services to our users. This processing is necessary for the performance of our product obligations to our users.
* Fraud prevention and enforcement of terms of service: We process personal data to prevent fraud, unauthorized or illegal activity, or any activity that violates our Terms of Service. This processing is based on our legitimate interests in protecting our business and our users.

2.2 The data we process can be divided into the following categories:

* Personal identification data and contact data includes information such as your name, address, email address, phone number, date of birth, and government-issued identification number. This information is necessary for us to verify your identity and comply with regulatory requirements.
* Platform use data includes information about how you use our services, such as your trading and transaction history on the platform, as well as information about how you interact with our website and applications.

2.3 We process your personal data based on the following legal bases:

1. Performance of a contract: When we provide you with products or services, we process your data to handle orders and process payments.
2. Legal obligation: We process your data to comply with applicable laws and regulations, including Anti-Money Laundering laws. We may be required to share Personal Information in response to a valid court order, subpoena, government investigation, or as otherwise required by law. We believe that doing so is reasonably necessary to protect the rights, property and safety of our company and/or others.
3. Your consent: We ask for your consent to process your data for a specific purpose, and you may withdraw your consent at any time.
4. Our legitimate interests: We process your data to protect the security of our users, ourselves, or others by detecting and preventing fraud and abuse.

More detailed information about the purposes is available below.

2.4 Providing DexPay’s services

We process personal data to provide our cryptocurrency trading services, including core functionalities and escrow protection, as well as to develop the service through statistical analysis of user activity. The data is primarily collected from users when submitting trades or transactions, with some information collected from service usage and other users' feedback. The personal data processed includes trade and transaction data. The legal basis for processing are contract performance and legitimate interests in service security and fraud prevention. Users have the option to post some data publicly, but should not include any private information.

\
2.5 Complying with our legal obligations

2.5.1 DexPay is required to comply with legal obligations, including identifying customers and preventing money laundering and financing of terrorism. We may be required to share Personal Information in response to a valid court order, subpoena, government investigation, or as otherwise required by law. We believe that doing so is reasonably necessary to protect the rights, property and safety of our company and/or others.

2.5.2 Formal Identification of users is done through a KYC process conducted outside of DexPay(Galxe). &#x20;

2.5.3 Personal data collected or stored by Galxe during the KYC process is governed by Galxe’s privacy policy and Terms of service.

2.5.4 DexPay’s request for a Galxe’s passport is on the basis of legal obligations.

2.6 Facilitating Trades

2.6.1 We use user data to facilitate trades through notifications about order status and dispute resolution.&#x20;

2.6.2 The data used for these purposes includes:

* communication data (messages, customer support tickets, etc.);
* notification data (notifications for trade execution);

2.6.3 The legal basis for this processing are legitimate interests of DexPay, the performance of a contract (notifications regarding trades and other use of the service), and consent.

### 3. ARE MY INFORMATION SHARED WITH THIRD-PARTIES?

3.1 In this section, we will outline which third parties have access to your personal data. We may also disclose your personal data to regulatory bodies and tax authorities based on our regulatory obligations and legal requirements.

3.2 We use Galxe’s identity verification service providers to verify the identity of our customers and adhere to KYC requirements as mandated by applicable law. Galxe uses formal identification proof, such as a passport, to verify identity, and the data is stored by them until needed to meet legal requirements when accessed by DexPay.

3.3 In addition, we may be required to share or disclose trade information(amount transacted, user address and bank account details) to authorities when we have a regulatory obligation to do so. The content and recipient of these disclosures vary depending on the situation, but they are always based on a regulatory obligation or binding order by the authorities.

### 4. How long is your data processed?

4.1 Your personal data which are names, emails, bank account details, trade data are encrypted & stored on DexPay using your wallet address. With the encryption, you decrypt your personal details anytime you sign a wallet signature to access DexPay or to process a trade transaction. DexPay have access to this data by decrypting the data using your wallet address signature provided during login or when initiating a transaction and only accesses this data when necessary for providing our services. The length of time that this data is accessed and processed depends on various factors, including the nature of the data, the purposes for which it is processed. You can remove some data from your user account yourself, but in some cases, data may need to be accessed longer for customer support or legal reasons.

4.2 Please note that all data included in the blockchain is publicly available and cannot be controlled by DexPay. This is due to the nature of blockchain technology.

**4.3 Account and transaction data**

4.3.1 We log transaction records against your wallet addresses and email address verified, which are encrypted, logged and stored on DexPay. These records are accessible to DexPay using your wallet signature provided when signing in or initiating a transaction which is then use to decrypt your data.

### 5. Security Of Information

We prioritize the security and privacy of your data by implementing appropriate measures to prevent unauthorized access, alteration, loss, or disclosure. Your personal data is encrypted and stored on DexPay and we work to ensure its security during temporary access. We restrict access to your information to employees, agents, and contractors with a business need to know. Our security procedures also require you to protect access to your personal wallets and use our platform only on personal computers.

### **6. Your Rights**

You have a number of rights in relation to the privacy and protection of your personal information, subject to applicable law. You can object or ask us to restrict the processing of your personal information in certain instances. You may also withdraw your consent for processing at any time. If you want to exercise any of your rights, please contact us at <hello@dexpay.io>  However, please note that these rights may be limited in some situations, such as where we have a legal requirement to process your personal data. If you have any concerns, you can also lodge a complaint with the relevant data protection authority. For any questions or objections, please contact us at [hello@dexpay.io](mailto:hello@dexp2p.com)\
\
\ <br>


# Intro- Integration Guide

Welcome to the DexPay B2B API integration guide.

This document provides everything you need to connect your business to our automated stablecoin settlement layer, enabling you to programmatically handle conversions between stablecoins and local fiat currencies for your users.

### Why Integrate DexPay?

We provide a secure, instant, and low-cost settlement layer that empowers your business to:

* **Accept Stablecoin Payments:** Allow your customers to pay for goods and services using stablecoins and receive the settled amount directly in your local fiat bank account.
* **Facilitate Fiat-to-Crypto On-ramping & Off-ramping:** Enable your users to easily purchase stablecoins using their local currency and to also convert stablecoin to fiat instantly.
* **Automate Your Workflow:** Leverage our smart-contract-powered system for instant, 24/7 transaction processing without manual intervention.
* **Ensure Security and Trust:** Our non-custodial approach means users never lose control of their funds, and our automated P2P liquidity pools, operated by trusted merchants, ensure deep liquidity and competitive rates.

This guide will walk you through the entire integration process, from getting your API keys to creating your first transaction and more.

<br>


# Register Business

#### 1.1. The Integration Flow

The DexPay API workflow is designed to be simple and logical. At a high level, every transaction follows these steps:

1. **Authentication:** Register your business to get your unique API credentials. All subsequent requests must be authenticated.
2. **Get a Quote:** Request a real-time exchange rate for the specific transaction you want to perform. This quote is locked in for a short period.
3. **Execute the quote/order:** Use the quoteId from the previous step to create a formal transaction order. DexPay provides the necessary payment details (either a crypto deposit address or a bank account).
4. **Confirmation:** DexPay's automated system detects the payment and completes the settlement, sending the funds to the specified destination.

#### 1.2. Authentication

First, you need to register your business to obtain your API Key and API Secret. These credentials must be included in the headers of all subsequent API requests to authenticate your access.

**Business Registration:** To register a business, fill out this **Business Registration** Form by clicking [**Here**](https://forms.gle/isi4N8RJmusmSTAK8)

After completing your registration, you will receive a document consisting of your **apiKey** and **apiSecret**

**IMPORTANT:**

Store your apiKey and apiSecret securely. You will need to pass them as headers in all future API calls.

* <sub>`X-API-KEY: Your apiKey`</sub>
* <sub>`X-API-SECRET: Your apiSecret`</sub>


# Get Business Info and Wallet Address

Before you can process transactions, you will be provided wallet address where you will prefund or receive stablecoin payments if you are facilitating crypto-to-fiat & fiat-to-crypto services respect.

**Get Business Info**

To get the business information provided for registration, and also the list of crypto wallet addresses for your business profile. This is where you will receive funds.

**Endpoint: Get /info**

* address: The public address of your wallet.
* chain: The blockchain for the address (e.g., BSC, TRON, SOLANA, BASE).

**`Success Response (200):`**

The response provides the information about the business and the list of wallet addresses

&#x20;and chains supported for the business.

`{`\
&#x20;   `"data": {`\
&#x20;       `"name": "Your Business Name",`\
&#x20;       `"emailaddress": "mybusiness@name.com",`\
&#x20;       `"walletAddresses": [`\
&#x20;           `{`\
&#x20;               `"_id": "7fe13ba7-4780-49d8-a494-21c952e43d44",`\
&#x20;               `"address": "0xF09847df0Cba63A6f5dAcF115b3FC2bf0df1D832",`\
&#x20;               `"chain": "BSC"`\
&#x20;           `}`\
&#x20;       `]`\
&#x20;   `},`\
&#x20;   `"message": "success",`\
&#x20;   `"error": null,`\
&#x20;   `"statusCode": 201`\
`}`<br>


# Core Transaction Workflows

This section details the two primary use cases for the DexPay API.

The type parameter in the quote request is crucial and is defined from the perspective of your end user:

**SELL: Your user wants to sell stablecoins to receive fiat currency.**

**BUY: Your user wants to buy stablecoins by paying with fiat currency.**


# On-ramp Request- Fiat to Stablecoins

In this scenario, your customer pays with fiat currency, and the equivalent stablecoin amount is sent to their crypto wallet.

**Step 1: Get a Quote**

Request a quote for a "BUY" transaction.

**Endpoint: POST /quote**

`Request Body:`

`{`\
`"fiatAmount": 20000,`\
`"asset": "DUSD",`\
`"chain": "BSC",`\
`"type": "SELL",`\
`"bankCode": "0201",`\
`"accountName": "Taiwo Daniel",`\
`"accountNumber": "3133233059"`\
`}`<br>

**Success Response (201):**

`{`\
`"data": {`\
`"id": "68bc5c8b52070a14acfeed8a",`\
`"status": "INACTIVE",`\
`"fiatAmount": 20000,`\
`"tokenAmount": 19.9,`\
`"price": 1000,`\
`"fee": 0.2,`\
`"createdAt": "2025-09-06T16:08:43.957Z",`\
`"type": "BUY",`\
`"address": "0x037d782373058981C3dfa06A4DdF6E7D921Db37e",`\
`"paymentAccount": {`\
`"accountName": "Praise Chukwuka",`\
`"accountNumber": "5003397590",`\
`"bankName": "VFD MICROFINANCE BANK"`\
`}`\
`},`\
`"message": "success",`\
`"error": null,`\
`"statusCode": 201`\
`}`

**Step 2: Execute the quote/order**

Create the order using the quoteID and provide the user's destination crypto wallet address.

**Endpoint: POST /quote/{quoteID}**

`Request Body:`

`quoteid string (query)`<br>

**Success Response:**

The API response will provide the bank account details where your user needs to send their fiat payment.

`{`\
`"data": {`\
`"id": "68bc5d3c52070a14acfeedf2",`\
`"status": "PENDING",`\
`"fiatAmount": 20200,`\
`"tokenAmount": 20,`\
`"price": 1000,`\
`"fee": 0.2,`\
`"createdAt": "2025-09-06T16:11:40.604Z",`\
`"type": "BUY",`\
`"address": "0x037d782373058981C3dfa06A4DdF6E7D921Db37e",`\
`"paymentAccount": {`\
`"accountName": "Praise Chukwuka",`\
`"accountNumber": "5003397590",`\
`"bankName": "VFD MICROFINANCE BANK"`\
`}`\
`},`\
`"message": "success",`\
`"error": null,`\
`"statusCode": 201`\
`}`<br>

**Step 3: Await Confirmation**

Your application must display the paymentDetails to your user. Once DexPay's system confirms receipt of the fiat payment with the correct reference, the stablecoins will be automatically sent to the user's recipientWallet. You can track the order status via webhooks or by polling the GET /orders endpoint.

<br>


# Off-ramp Request- Stablecoins to Fiat

In this scenario, your customer pays with a stablecoin (e.g., USDT, DUSD), and the equivalent fiat amount is settled to their local bank account.

**Step 1: Get a Quote**

First, get a real-time quote for the transaction. You can request a quote based on either the amount of stablecoin the user wants to sell or the amount of fiat they wish to receive.

\
**Endpoint: POST /quote**

Request Body (by tokenAmount):

{\
"tokenAmount": 20,\
"asset": "DUSD",\
"chain": "BSC",\
"type": "SELL",\
"bankCode": "0201",\
"accountName": "Taiwo Daniel",\
"accountNumber": "3133233059"\
}\ <br>

**Request Body (by fiatAmount):**

{\
"fiatAmount": 20000,\
"asset": "DUSD",\
"chain": "BSC",\
"type": "SELL",\
"bankCode": "0201",\
"accountName": "Taiwo Daniel",\
"accountNumber": "3133233059"\
}\ <br>

**Success Response (201):**

The response contains the exchange rate and a unique quoteId that is valid for a short time.

`{`\
`"data": {`\
`"id": "68bc5a2c40bcf4c1c1625b05",`\
`"status": "INACTIVE",`\
`"fiatAmount": 20200,`\
`"tokenAmount": 20,`\
`"price": 1000,`\
`"fee": 0.2,`\
`"createdAt": "2025-09-06T15:58:36.179Z",`\
`"type": "BUY",`\
`"address": "0x037d782373058981C3dfa06A4DdF6E7D921Db37e",`\
`"paymentAccount": {`\
`"accountName": "Praise Chukwuka",`\
`"accountNumber": "5003397590",`\
`"bankName": "VFD MICROFINANCE BANK"`\
`}`\
`},`\
`"message": "success",`\
`"error": null,`\
`"statusCode": 201`\
`}`

**Step 2: Get Bank Information (Optional)**

If you need to present your user with a list of supported banks, you can fetch them with this endpoint.

**Endpoint: GET /banks**

**Success Response (200):**

`[`\
&#x20;   `{`\
&#x20;       `"name": "Kuda Bank",`\
&#x20;       `"code": "090267",`\
&#x20;       `"currency": "NGN"`\
&#x20;   `},`\
&#x20;   `{`\
&#x20;       `"name": "9 Payment Service Bank",`\
&#x20;       `"code": "120001",`\
&#x20;       `"currency": "NGN"`\
&#x20;   `}`\
&#x20;   `// ... and more`\
`]`\
&#x20;

**Step 3: Create the Order**

Using the quoteId, create the order and provide the user's bank account details for settlement.

**Endpoint: POST /quote/{quoteID}**

Request Body:

`quoteid string (query)`

**Success Response:**

The API response will provide a unique orderId and, most importantly, a deposit address. Your application must display this address to the user and instruct them to send the exact tokenAmount from the quote to it.

`{`\
`"data": {`\
`"id": "68bc5d3c52070a14acfeedf2",`\
`"status": "PENDING",`\
`"fiatAmount": 20200,`\
`"tokenAmount": 20,`\
`"price": 1000,`\
`"fee": 0.2,`\
`"createdAt": "2025-09-06T16:11:40.604Z",`\
`"type": "BUY",`\
`"address": "0x037d782373058981C3dfa06A4DdF6E7D921Db37e",`\
`"paymentAccount": {`\
`"accountName": "Praise Chukwuka",`\
`"accountNumber": "5003397590",`\
`"bankName": "VFD MICROFINANCE BANK"`\
`}`\
`},`\
`"message": "success",`\
`"error": null,`\
`"statusCode": 201`\
`}`<br>

**Step 4: Await Confirmation**

DexPay's system will automatically monitor the deposit address. Once the correct amount of stablecoin is received, the order status will update, and the fiat settlement will be processed instantly. You can use webhooks (contact us for setup) or poll the GET /orders endpoint to track the status.

<br>


# API Reference Summary

### API Summary Table

<table data-header-hidden><thead><tr><th width="186.9998779296875"></th><th></th><th></th><th></th></tr></thead><tbody><tr><td>Function</td><td>Endpoint</td><td>Method</td><td>Description</td></tr><tr><td>Business</td><td><br></td><td><br></td><td><br></td></tr><tr><td>Register Business</td><td>No endpoint<br><br>Register via this form <a href="https://forms.gle/isi4N8RJmusmSTAK8">Here</a></td><td>Fill Registration form</td><td>A business profile get created for with the API Key &#x26; Secret Key</td></tr><tr><td>Get Business Info</td><td>/info</td><td>GET</td><td>Retrieves the name , business details, and wallet addresses per chain for the authenticated business.</td></tr><tr><td>Transactions</td><td><br></td><td><br></td><td><br></td></tr><tr><td>Get Supported Banks</td><td>/banks</td><td>GET</td><td>Returns a list of supported fiat banks for settlement.</td></tr><tr><td>Get Quote</td><td>/quote</td><td>POST</td><td>Provides a real-time exchange rate for a buy or sell transaction.</td></tr><tr><td>Execute quote/Order</td><td>/quote/{quoteID}</td><td>POST</td><td>Creates a formal transaction based on a quoteId.</td></tr><tr><td>Get Order Status</td><td>/order/{id}</td><td>GET</td><td>Retrieves the current status and details of a specific order.</td></tr><tr><td>Get All Orders</td><td>/orders</td><td>GET</td><td>Retrieves all the current order list</td></tr></tbody></table>

<br>


