description |
---|
Mechanism for additional value capture of Dai & stables locked in bridges |
Updated October 25, 2021
The latest TokenBridge upgrades include the ability to allocate Dai locked in the TokenBridge contract to the Compound interest rate market and Stable Coins (USDC & USDT) locked in the OmniBridge contract to the Aave interest market. Locked funds will accumulate interest as well as COMP and AAVE tokens. These funds can then be used to support bridge operations.
-> Compounding Analytics now available on on Dune
The following describes the process for the xDai bridge. At the end of the document are caveats related to the OmniBridge, where parameters differ slightly.
- As a part of the bridge upgrade, an amount of locked Dai (
Current Amount Locked(~22M)
_-
1,000,000 Dai
_) is transferred to Compound. - 1,000,000 Dai remains in the bridge contract as a reserve supporting daily operations.
- Dai bridged from Ethereum to xDai: Following the upgrade, any amount of Dai bridged from Ethereum to xDai **** is added to the bridge reserve. It is not automatically transferred to Compound.
- xDai bridged from xDai to Ethereum: Bridge requests from xDai to Ethereum use the Dai in the reserve. If a request is initiated that exceeds the available reserve amount, the requested amount exceeding the reserve + 1,000,000 Dai (required reserve) is withdrawn immediately from Compound. The 1,000,000 Dai replenishes the reserve.
if current_reserve < requested
withdraw requested - current_reserve + required_reserve
- Interest on the Dai supplied to Compound and COMP tokens will be collected periodically (approximately monthly) and transferred to an EOA through a manual method call. Funds will be used to support bridge operations such as gas refunds for users or other tbd mechanisms which can be discussed and decided on by the bridge governors.
- Once the reserve reaches a significantly higher amount than what is required for daily operations, bridge governors can decide to send this excess amount to Compound.
- Bridge governors can vote to turn off the compounding mechanism at any time. If turned off, all Dai tokens will be returned to the bridge contract.
- Bridge governors can vote to change the interest receiving address if required (currently must be an EOA or a contract supporting the
onInterestReceived
method).
- An unlikely scenario can arise where the amount of Dai requested for withdrawal is not available on Compound (due to high borrowing demand). In this case, a user will need to wait until Compound liquidity is available to execute the request.
- Compound protocol is a trusted entity. If compromised the protocol could attack the contracts in various ways, e.g., through reentrancy or by simply stealing funds.
{% hint style="info" %} Note: TVL metrics displayed in sources such as DeFiLama and DeFiPulse may reflect different values once Dai is sent to Compound.
Compound metrics are available in the xDai Bridge Dune Analytics Dashboard to reflect current invested amount as well as locked reserve amount. {% endhint %}
The OmniBridge upgrade utilizes similar mechanics as above to earn interest on USDC and USDT locked in the OmniBridge. The primary difference is the utilization of Aave rather than Compound for interest accumulation. Additional protocol differences correspond to the initial amount allocated to the reserves (USDC 2.5M reserve, USDT 750K reserve).
- USDC: (
Current Amount Locked(~46M)
_-
2,500,000 USDC
_) transferred to Aave. 2.5M for initial reserve. - USDT: (
Current Amount Locked(~5.6M)
_-
750,000 USDT
_) transferred to Aave. 750K for initial reserve.
To complete this update, any tokens locked in the Omnibridge were automatically released back to Ethereum and paid for by the team. This is the 2nd prior pending claims amnesty conducted by the team, the first is described here.
In addition, USDT & USDC can now be bridged from xDai -> Eth with 0 additional fees (previously there was a 1% fee). Users must still pay for gas prices on Ethereum to process the transaction, but there are no fees beyond paying for gas.
Compounding functionality recently underwent a thorough security audit from ChainSecurity.
- TokenBridge contracts: https://github.com/poanetwork/tokenbridge-contracts/tree/master/contracts/upgradeable_contracts
- OmniBridge contracts: https://github.com/omni/omnibridge/tree/master/contracts/upgradeable_contracts