Developers Forum for XinFin XDC Network

Cover image for XDUSD

Posted on



A stable coin based on XRC20 standard and backed by collateralized XDCl.


  • A collateral backed stable coin that helps people take loan by putting XDC token as collateral. We have seen an increase in demand for the stable coin as the market is currently experiencing a downturn people are looking for stable alternatives. while centralized stable coin are present but they are still a single point of failure with the ongoing CeFI fiasco it is getting harder to trust centralize entities


  • In the recent times we have seen that the trust to centralized authority is at a all time low and people are trying to adopt to decentralize solutions so it is a builders job to provide alternative decentralize options to the users. Keeping this in mind we built XDUSD. It is a stable coin that is backed by XDC. With inbuilt automated liquidations in the smart-contract itself. XDUSD is a collateral backed stable coin that has GoPLI oracle integrations to keep itself up to date regarding the pricing


XDC : We have used XDC currency itself as a collateral as well as we have also used XDC platform's smart contract capabilities to manage automatic liquidation and book-keeping
GoPlugin : We have utilized the oracle capabilities provided by the PLI nodes to get the latest price to the smart-contract so the smart-contract can decide on liquidations and loan assignments
XSwap : Inorder to facilitate liquidations from smartcontract we have integrated XSwap's router in out smart-contract so that the smartcontract can itself liquidate user if needed

How does this works ?

It works in a very simple way,

1) A user submits XDC has collateral and recieves 70% of the token value in a stable coin called XDUSD. now the stable coin is backed by debt and is over collaterized.

2) Now the interest is calculated on an hourly basis and using PLI oracles and the collateral ratio is calculated, but the contract itself cannot liquidate user assets

3) If a users collateral ratio falls below a certain point the liquidators can submit liquidation request and earn some amount of profit

4) On being called by liquidators the contract verifies the collateral ratio and if it is below a certain threshold it liquidates it on the XSwap DEX

Challenges we ran into

  • Testing the oracle integration on testnet
  • Setting up oracle node on testnet
  • Designing the Economics of the contract

Future Improvements

  • Add reward for liquidators
  • Allowing users to stake in there XDUSD to earn rewards from the interest given by borrowers
  • Introducing more liquidation methods, while small amount of loans can be directly be liquidated on DEX, for big loans a auction based method is needed
  • Allowing XDUSD to become cross chain and also using assets other than XDC as collateral

Try out :
Code :
Devpost :

Discussion (1)

garretts_rig profile image
Garrett Cantrell

USD will soon crater. Physical Asset backed, only please!