A yield automating stablecoin on the Arbitrum network
USDs is a stablecoin which generates auto-yield natively. Currently, USDs is live on Arbitrum, the largest Layer-2 Ecosystem of Ethereum. It has achieved $20M TVL in the first 2 months since launch. Eventually, Sperax will build a system of interoperability so that USDs will be natively deployed to all major blockchain platforms.
The highlights of this protocol:
Auto-yield - Users holding USDs in their wallets automatically earn organic yield. No staking is required by the end user. Users do not need to spend gas calling the smart contract to claim their yield.
Layer 2 native — Cheaper transaction fees on Arbitrum make this protocol retail investor-friendly
Fully Backed Model - USDs is 100% backed by a diversified basket of whitelisted crypto assets (stablecoins)
The growth of the decentralized finance (DeFi) space has spearheaded the adoption of stablecoins. However, existing stablecoins like fiat-backed stablecoins (USDT, USDC) are centralized, CDP based stablecoins (DAI) have a difficult time scaling and algo-stablecoins (like Basis, Terra) only maintain stability during bull markets. USDs has combined the best of existing stablecoin designs by featuring a 100% backed model like the CDP stablecoins, but adds the scalability benefits of fiat backed stablecoins. An on-chain, redemption based design makes USDs highly scalable, trustless and decentralized.
USDs automates the process of earning yield on stablecoins. Yield is generated organically by sending collateral to audited decentralized finance protocols. 50% of yield generated on collateral is used to pay USDs holders Auto-Yield. USDs Auto-yield rate is adjustable and depends on the actual yield generated by the collaterals. Any yield generated beyond the max Auto-yield rate will be stored in Auto-yield reserves. This novel passive income strategy does not require any action from the user. Users can just hold USDs and see wallet balance grow, auto-compounding the yield in the process.
SPA is the governance and value accrual token of the Sperax ecosystem. SPA holders can stake SPA tokens to receive veSPA. veSPA holders are decision makers of the protocol. They will earn staking rewards and manage the protocol revenue via voting power in Sperax governance. Off-chain governance is live and community (veSPA holders) can control parameters of USDs protocol, yield strategies, eligible collateral, new product features, etc. On-chain governance will be launched soon making veSPA holders true owners of the Sperax ecosystem.
To mint new USDs, minters only need eligible collateral. Currently, the protocol is accepting USDC.e, USDC, USDC.e, Frax, DAI, USDT and LUSD as collateral and more tokens might be added to this list in the future. However, USDs tokens are fungible and redeemable in the same way, independent of their underlying minting collateral. It acts as an IOU on the pooled collateral.
The protocol will mint 1 USDs by collecting 1 USD worth of collateral.
Collateral tokens required = No. of USDs tokens minted/Min (Price of collateral in USD, 1 USD)
When a collateral token is worth less than 1 dollar, it will be treated with its actual market price. However, when it is worth more than 1 dollar, it will be treated as 1 dollar. Hence, USDs will always be fully collateralized or over-collateralized.
Mint fees are subject to Sperax DAO approval.
Redeeming 1 USDs at the protocol level gives the user back any one unit of collateral (maximum 1 unit of collateral) after deducting the redemption fee. Redeemers can choose from the list of eligible collaterals that they want to receive. A portion of USDs redeemed is collected as a redemption fee by the protocol.
The protocol will redeem 1 USDs following this simple equation:
Fee = x% of USDs amount redeemed. 'x' depends on the selected collateral.
Collateral tokens redeemed = (1-x)% * (No. of USDs redeemed)
When a collateral token is worth more than 1 dollar, it will be treated with its actual market price. However, when it is worth less than 1 dollar, it will be treated as 1 dollar. Hence, USDs will always be fully collateralized or over-collateralized.
The aggregate collateral ratio (or CR = Total Value Locked/USDs Circulating Supply) should be close to 100% as USDs are backed by stablecoins and collateral is expected to hold their price even in situations of market volatility. However, in an extreme situation if the value of locked collateral changes and the collateral ratio drops by more than 10%, the protocol will be paused manually. Redemptions will begin based on governance or if the collateral ratio increases. To cover any gaps in collateralization SPA reserves from Treasury may be used by the protocol.
Redemption fees are subject to Sperax DAO approval.
While minting USDs, if the price of the collateral token is more than 1 USD, then USDs will treat the price of the collateral as 1 USD and will only mint 1 USDs per collateral token deposited. But if the price of the collateral is less than 1 USD then more units of the collateral will be required to mint a unit of USDs. In that case minters would need to provide 1 USD worth of collateral to mint 1 USDs. If the price of the collateral has dropped below 0.97 cents then users would not be able to use that collateral to mint USDs. While redeeming users would always receive one unit of any collateral token of their choice for one unit of USDs.
Fees will be calculated and configurable based on the current state of the protocol’s collateral composition. Anyone would be able to call a function that updates the fee parameters. When a collateral would exceed the desired collateral composition the fee for that collateral would increase and its redemption fee would decrease. Similarly when the amount of collateral in the protocol is less than the desired amount, the mint fee for that collateral will decrease and the redemption fee would increase. Initially all collaterals except for USDC will be set to have a desired collateral composition of 20% and the base fee will be set to 0.05%. Any collateral having a composition of greater than the desired collateral composition cap will have a mint fee of greater than the base fee. The exact applicable fee on a collateral will vary and can be queried via a view function in the contract.
x: Current collateral value in number of tokens
Ca: (Desired collateral composition in % x Total Collateral in the Vault)
Total collateral in vault = Total USDs supply
Base mint and redeem fee (f base): Base fee for mint and redemption which will be discounted/increased dynamically based on the collaterals composition.
Now users can redeem their choice of collateral from any yield strategy, instead of relying on a preset default mechanism. Strategies are a set of smart contracts that control the depositing and withdrawal of collaterals from various other DeFi protocols like Aave, Compound, Curve etc.. The slippage that occurs is still transferred back to the redeemers but since redeemers have a choice, they could calculate and manage their own slippage. Withdrawing from single sided strategies like Aave and compound could have significantly less slippage as compared to withdrawing from complex liquidity pool strategies like Curve.
Auto-yield is distributed after a user redeems and before a user mints. So minters and redeemers should check if there’s an eligible auto-yield.
USDs earns organic yield for holders and the yield is paid out in USDs approx. every 7 days
USDs stands out from other stablecoins thanks to its inflation fighting Auto-Yield feature. USDs is novel in the stablecoin ecosystem, because it requires no action by the user. Users do not need to stake USDs nor spend gas to claim their yield. One simply holds USDs, and their wallet balance will grow.
The collateral received for minting USDs is deployed in other audited, defi projects to generate organic yield. USDs collateral earns yield in the form of reward tokens and swapping fees from the pools. This yield is shared between USDs holders and SPA stakers (The split is 50% for Auto-Yield and 50% for SPA buyback and burns. This share can be changed through governance).
Gas free yield: 50% of yield generated on USDs collateral is used to mint USDs. This USDs is distributed to anyone who holds USDs in their wallet.
The actual yield generated depends on the yield rate of the strategies where collateral is deployed. However, the protocol will try to maintain a target yield of 11% APY (maximum) so that USDs holders get stable returns irrespective of market conditions. Any yield generated over 11% is stored in the protocol to help fund the APY for lean periods when actual yield generated is less than 11%.
Different yield generation strategies are proposed by the community/team and evaluated by the community based on their yield generation potential, risk profile etc. Community then votes to choose pools/farms where collateral will be deployed. Following strategies are being used for yield generation. We will keep updating this list to include newer strategies approved by the community.
Strategy list as per SIP-55:
USDC:
Compound (USDC)
Aave (USDC)
Maximum cap of 75% of total USDC collateral for each strategy.
USDC.e:
Compound (USDC.e)
Stargate (Stargate-LP USDC.e)
Aave (USDC.e)
Curve (FRAX-USDC.E)
Maximum cap of 50% of total USDC.e collateral for each strategy.
DAI:
Aave (DAI)
Radiant V2 (DAI)
Maximum cap of 75% of total DAI collateral for each strategy.
USDT:
Aave (USDT)
Stargate (Stargate-LP USDT)
Maximum cap of 75% of total USDT collateral for each strategy.
FRAX:
Frax (Curve-LP FRAX/VST)
Curve (FRAX-USDC.E)
Maximum cap of 75% of total FRAX collateral for each strategy.
LUSD:
Camelot (LUSD-USDC V2 Pool)
Aave (LUSD).
Maximum cap of 75% of total LUSD collateral for each strategy.
Old strategies that are not in use / deprecated:
Curve | Curve-LP USDC/USDT [Not in use]
Saddle | Saddle-LP FRAX/USDC [Saddle sunset] Frax | Curve-LP FRAX/VST [Vesta sunset]
USDs held in EOA wallets, i.e. non-contract addresses, will receive auto-yield on a regular basis. For now, USDs that are deployed by users to yield-earning strategies within the Sperax suite of yield farms will not receive auto-yield.
By default, smart contracts holding USDs are not included in the yield distribution process and do not earn any yield. A smart contract’s USDs balance remains the same after an auto-yield distribution event. However, based on community’s feedback and once approved by veSPA holders via Snapshot voting, the Sperax team can whitelist specific smart contracts to be part of auto-yield, and provide technical support to determine whether a protocol is compatible with the auto-yield feature of USDs.
USDs follows the ERC20 token standard. A wallet holding USDs should expect its USDs balance to increase automatically over time. This increase is triggered by a distribution event that happens on average every 7 days. The earned USDs are not explicitly transferred into the user’s wallet, instead a global parameter is changed to update the holder's balance.
Unlike most ERC20, where the token contract directly stores the amount of tokens each wallet holds, USDs’ token contract has a shared state variable creditPerToken, and the contract stores each wallet’s credit. A wallet’s balance = credit / creditPerToken.
When yield is generated:
The yield is swapped for USDs in the open market
The USDs from step (1) is burned
The value of creditPerToken is *decreased globally and therefore every wallet’s balance increases (since every wallet’s credit is unchanged during this process)
*: creditPerToken is decreased according to the amount of USDs burnt in step (2) such that total supply of USDs remains unchanged after steps (2) and (3)
The circulating supply of USDs remains unchanged through this process as the USDs that are bought from the market are burnt and then the USDs balance of the holders increase proportionally. As a result, a user can expect its USDs balance to increase automatically over time without any additional USDs explicitly being transferred to the user’s wallet.
Yield is distributed approximately every 7 days. The exact distribution time is determined in a quasi-random way. We have decided on this randomised distribution time to prevent users from timing their USDs minting and redeeming with yield distribution events. Huge spike in minting or redeeming around the time of yield distribution can put strain on the peg and this randomisation works as a defence mechanism for maintaining peg.
Externally owned accounts (EOAs) holding USDs were always eligible for the Auto-yield feature, but smart contract / smart wallets were not.
Sperax has introduced a new function: now smart accounts (or smart wallets) can call to opt in for auto rebase in USDs contract and to get Auto-yield.
An owners of a smart contract / smart wallet can opt in for rebase in USDs contract. The users will not need to claim (or send out any transactions to claim) the interest earned.
This is how to opt in your smart contract / smart wallet for rebase in USDs:
Go to Arbiscan and search for USDs. Verify the correct USDs contract address: 0xD74f5255D557944cf7Dd0E45FF521520002D5748
Go to the Token contract. ensure it is Sperax USD (USDs) deployed by Sperax Deployer 0x42d2f9f84EeB86574aA4E9FCccfD74066d809600
Click on the contract and make sure your account is connected (Metamask, Gnosis Safe, or any other smart account).
Go to “Write as Proxy”.
Connect your wallet (choose WalletConnect, Coinbase Wallet, or any other wallet).
Once connected, you will see two functions with the same name: rebaseOptIn
You don’t have to call the first function because it’s an owner-only function (can be called only by the USDs owner).
Instead, click the second function rebaseOptIn
. This allows you to opt in for rebase for your own account (your smart contract account).
Confirm the transaction, and your smart account will be opted in for auto rebase.
That’s it. Your smart account / smart wallet is eligible for auto-yield!
How does USDs keep the peg?
Minting 1 USDs - If a collateral token is worth less than $1, it will be treated with its actual market price. However, if it is worth more than 1 dollar, it will be treated as $1.
Redeeming 1 USDs - If a collateral token is worth more than $1, it will be treated with its actual market price. However, if it is worth less than 1 dollar, it will be treated as 1 units of collateral at its market price.
Hence, USDs will always be fully collateralized or over-collateralized. For more information on how mint and redeem functions work check outMinting and Redeeming
The protocol collects a redemption fee whenever USDs is redeemed. This fee is passed on to the SPA stakers. Redemption fee is levied so that protocol does not work like a free token swap instrument. The fee is static for each collateral token but can be upgraded through governance by the community. It is a percentage of the transaction value.
Mint Fee = 0
Redemption Fee = x% of the amount of USDs redeemed.
x depends on the selected collateral. Check the current redemption fee for the USDs in app.sperax.io
If the collateral being used to mint USDs has de-pegged by 2% or more to the downside then protocol will stop minting USDs using that collateral.
As more people use USDs, the yield rate will serve as a second-layer protection from a high selling pressure, further empowering a mass adoption in various use cases including payment, derivatives, and portfolio construction. For more information on how auto-yield works check out Auto Yield
When sufficient collateral is not available, USDs redeemers would get $1 worth of collateral in the form of SPA tokens. This would be the collateral of last resort.
Collateral types to mint/ redeem USDs.
Desired collateral composition, oracle used for price feed of the collateral, base Mint Fee, base Redemption Fee and price floor for each collateral type. Updating the price floor for collateral used to mint USDs. Setting the price floors for each collateral will allow the protocol to remain solvent when collaterals depeg. The protocol will not mint USDs with the collateral when the price of the collateral falls below the price floor.
Yield generation strategies for each collateral type. For example, adding new delta-neutral yield farming strategies based on other decentralized exchanges.
Harvesting incentive.
The USDs dripping rate from the dripper contract.
Minimum and maximum APR for distribution of Auto-Yield.
Harvesting or claiming all kinds of yield tokens from the yield generation strategies. The harvester will be incentivized with a portion of the yield-farmed tokens.
Purchase harvested yield tokens for market price. We will use the respective oracles for the yield tokens to determine the market price. This experience will be similar to the currently implemented buyback contract.
Distributing the auto-yield to all addresses eligible to collect it. Rebase will also be triggered when someone Mints or Redeems.
This technical document is about the upgrade to USDs-v2. It details the changes made to enhance the protocol's decentralization, transparency, security, and scalability. The document covers new features and functionalities.
High level documentation of smart contracts
Loading...
ERC20 contract
USDs is a stable coin which generates auto-yield natively.
USDs is a rebasing token with two modes of accounting for users:
Rebasing wallets
Users holding tokens in their EOA are by default in this category and are eligible for auto-yield via a rebasing mechanism.
Any contract opted-in for rebase also comes in this category.
Balance for this category is tracked via a credit system, as described below :
creditsPerToken is tracked at a global level and is updated when doing a rebase.
creditBalance is tracked at an account level and is updated via token transfer, mint, redemption of USDs
Non-Rebasing wallets
For Non-Rebasing wallets this token acts as a normal ERC20 token and tracks the balance of the wallet as usual.
Rebasing Mechanism
Users mint USDs using approved list of collaterals
These collaterals accumulated in the USDs vault are then deployed to various yield on-chain earning opportunities.
Yield is harvested periodically and is used to buyback USDs from the market of which 50% is used as revenue for veSPA holders and rest of it goes for USDs auto yield.
While doing a rebase the x amount of USDs is partially burnt (without changing the overall total supply) and the creditsPerToken
value is adjusted such that the burnt amount is proportionally distributed across all rebasing wallets.
Inherits: ERC20PermitUpgradeable, OwnableUpgradeable, ReentrancyGuardUpgradeable, IUSDs
Author: Sperax Foundation
ERC20 compatible contract for USDs supporting the rebase feature. This ERC20 token represents USDs on the Arbitrum (L2) network. Note that the invariant holds that the sum of balanceOf(x) for all x is not greater than totalSupply(). This is a consequence of the rebasing design. Integrations with USDs should be aware of this feature.
Inspired by OUSD: https://github.com/OriginProtocol/origindollar/blob/master/contracts/contracts/token/OUSD.sol
Verifies that the caller is the Savings Manager contract.
Initializes the contract with the provided name, symbol, and vault address.
Parameters
_nameArg
string
The name of the USDs token.
_symbolArg
string
The symbol of the USDs token.
_vaultAddress
address
The address where collaterals of USDs protocol reside, and major actions like USDs minting are initiated.
Mints new USDs tokens, increasing totalSupply.
Parameters
_account
address
The account address to which the newly minted USDs will be attributed.
_amount
uint256
The amount of USDs to be minted.
Burns tokens, decreasing totalSupply.
Parameters
_amount
uint256
The amount to burn.
Voluntary opt-in for rebase.
Useful for smart-contract wallets.
Voluntary opt-out from rebase.
Adds _account
to the rebasing account list.
Parameters
_account
address
Address of the desired account.
Adds _account
to the non-rebasing account list.
Parameters
_account
address
Address of the desired account.
The rebase function. Modifies the supply without minting new tokens. This uses a change in the exchange rate between "credits" and USDs tokens to change balances.
Parameters
_rebaseAmt
uint256
The amount of USDs to rebase with.
Change the vault address.
Parameters
_newVault
address
The new vault address.
Called by the owner to pause or unpause the contract.
Parameters
_pause
bool
The state of the pause switch.
Transfer tokens to a specified address.
Parameters
_to
address
The address to transfer to.
_value
uint256
The amount to be transferred.
Returns
bool
True on success.
Transfer tokens from one address to another.
Parameters
_from
address
The address from which you want to send tokens.
_to
address
The address to which the tokens will be transferred.
_value
uint256
The amount of tokens to be transferred.
Returns
bool
true on success.
Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. This method is included for ERC20 compatibility.
increaseAllowance and decreaseAllowance should be used instead. Changing an allowance with this method brings the risk that someone may transfer both the old and the new allowance - if they are both greater than zero - if a transfer transaction is mined before the later approve() call is mined.
Parameters
_spender
address
The address that will spend the funds.
_value
uint256
The amount of tokens to be spent.
Returns
bool
true on success.
Increase the amount of tokens that an owner has allowed a _spender
to spend. This method should be used instead of approve() to avoid the double approval vulnerability described above.
Parameters
_spender
address
The address that will spend the funds.
_addedValue
uint256
The amount of tokens to increase the allowance by.
Returns
bool
true on success.
Decrease the amount of tokens that an owner has allowed a _spender
to spend.
Parameters
_spender
address
The address that will spend the funds.
_subtractedValue
uint256
The amount of tokens to decrease the allowance by.
Returns
bool
true on success.
Check the current total supply of USDs.
Returns
uint256
The total supply of USDs.
Gets the USDs balance of the specified address.
Parameters
_account
address
The address to query the balance of.
Returns
uint256
A uint256 representing the amount of base units owned by the specified address.
Gets the credits balance of the specified address.
Parameters
_account
address
The address to query the balance of.
Returns
uint256
(uint256, uint256) Credit balance and credits per token of the address.
uint256
Function to check the amount of tokens that an owner has allowed a spender.
Parameters
_owner
address
The address that owns the funds.
_spender
address
The address that will spend the funds.
Returns
uint256
The number of tokens still available for the spender.
Creates _amount
tokens and assigns them to _account
, increasing the total supply.
Emits a {Transfer} event with from
set to the zero address.
Requirements - to
cannot be the zero address.
Parameters
_account
address
The account address to which the newly minted USDs will be attributed.
_amount
uint256
The amount of USDs that will be minted.
Destroys _amount
tokens from _account
, reducing the total supply.
Emits a {Transfer} event with to
set to the zero address.
Requirements:
_account
cannot be the zero address.
_account
must have at least _amount
tokens.*
Parameters
_account
address
The account address from which the USDs will be burnt.
_amount
uint256
The amount of USDs that will be burnt.
For non-rebasing accounts credit amount = _amount
Update the count of non-rebasing credits in response to a transfer
Parameters
_from
address
The address from which you want to send tokens.
_to
address
The address to which the tokens will be transferred.
_value
uint256
Amount of USDs to transfer
Add a contract address to the non-rebasing exception list. I.e., the address's balance will be part of rebases so the account will be exposed to upside and downside.
Parameters
_account
address
address of the account opting in for rebase.
Remove a contract address from the non-rebasing exception list.
Is an account using rebasing accounting or non-rebasing accounting? Also, ensure contracts are non-rebasing if they have not opted in.
Parameters
_account
address
Address of the account.
Ensures internal account for rebasing and non-rebasing credits and supply is updated following the deployment of frozen yield change.
Parameters
_account
address
Address of the account.
Calculates the balance of the account.
Function assumes the _account is already upgraded.
Parameters
_account
address
Address of the account.
Get the credits per token for an account. Returns a fixed amount if the account is non-rebasing.
Parameters
_account
address
Address of the account.
Validates if the contract is not paused.
Loading...
Inherits: Initializable, OwnableUpgradeable, ReentrancyGuardUpgradeable
Author: Sperax Foundation
This contract allows users to exchange SPA tokens for USDs tokens.
Users can provide SPA tokens and receive USDs tokens in return based on the current exchange rate.
A percentage of the provided SPA tokens are distributed as rewards, and the rest are burned.
Contract initializer
Parameters
Emergency withdrawal function for unexpected situations
Can only be called by the owner
Parameters
Changes the reward percentage
Example value for _newRewardPercentage = 5000 for 50%
Parameters
Update veSpaRewarder address
Parameters
Update oracle address
Parameters
Function to buy USDs for SPA for frontend
Parameters
Calculates and returns SPA amount required for _usdsAmount
Parameters
Returns
Buy USDs for SPA if you want a different receiver
Parameters
Sends available SPA in this contract to rewarder based on rewardPercentage and burns the rest
Returns the amount of USDS for SPA amount in
Parameters
Returns
Returns the amount of USDS for SPA amount in
Parameters
Returns
Retrieves price data from the oracle contract for SPA and USDS tokens.
Returns
Checks if the provided reward percentage is valid.
The reward percentage must be a non-zero value and should not exceed the maximum percentage value.
Parameters
Inherits: Ownable, IOracle
Author: Sperax Foundation
Communicates with different price feeds to get the price
Store price feed data for tokens.
Add/Update price feed for _token
Have to be extra cautious while updating the price feed.
Parameters
Remove an existing price feed for _token
.
Parameters
Gets the price feed for _token
.
Function reverts if the price feed does not exists.
Parameters
Returns
Validates if price feed exists for a _token
Function reverts if price feed not set.
Parameters
Returns
Gets the price feed for a _token
given the feed data.
Parameters
Returns
Loading...
Inherits: IFeeCalculator
Author: Sperax Foundation
A contract that calculates fees for minting and redeeming USDs.
Calibrates fee for a particular collateral
Parameters
Calculates fee to be collected for minting
Parameters
Returns
Calculates fee to be collected for redeeming
Parameters
Returns
Calibrates fee for all the collaterals registered
Helper function for calibrating fee for a collateral
Parameters
Loading...
Loading...
Loading...
Loading...