- 1.Trading Dapp that allows you to leverage your spot position up to 5x.
- 2.A low risk way to provide liquidity and get a good provider rate.
In order to trade first, traders have to deposit funds to a global credit pool of capital, which is essentially a smart contract that tracks who is holding what asset.
This smart contract also contains the funds provided by liquidity providers, as shown in this diagram below.
There is also a "Borrow Fee" that is deducted at the start of every hour. This is the fee paid to the counter-party of your trade. The fee per hour will vary based on utilization, it is calculated as (assets borrowed) / (total assets in pool) * 0.01%. The "Borrow Fee" for longing or shorting is shown below the swap box.
The 0x protocol has its own order book API that allows for limit order execution. This allows us to also create stop losses and take profit orders based on the order book API.
- Build from ground up based on Gearbox liquidity pools.
- Pool interactions
- Mint(address minter, uint mintAmount, uint mintTokens)
- Redeem(address redeemer, uint redeemAmount, uint redeemTokens)
- Borrow(address borrower, uint borrowAmount, uint accountBorrows, uint totalBorrows)
- RepayBorrow(address payer, address borrower, uint repayAmount, uint accountBorrows, uint totalBorrows)
- LiquidateBorrow(address liquidator, address borrower, uint repayAmount, address mTokenCollateral, uint seizeTokens)
- Pools can have only 4 types of assets (WETH, WBTC, USDT, USDC)
- MVP is with only one pair ETH - USDC
- Possible interest rate curve solutions
- Interest rates for each market update on any block in which the ratio of borrowed assets to supplied assets in the market has changed. The amount interest rates are changed depends on the interest rate model smart contract implemented for the market, and the amount of change in the ratio of borrowed assets to supplied assets in the market.
- Liquidity providers have to be whitelisted
- Liquidity providers have a limit on how much liquidity they can provide
- Is setup in order to mitigate unexpected situations, like liquidations not working, high gas prices etc.
- Should be setup with a initial deposit
- Similar to Fuse's Reserve Factor function reserveFactorMantissa() returns (uint)
- Uses 1bps of every trade - this needs to be adjustable
- Traders should be able to see at what price they are going to get liquidated