Market Architecture
Market Creation
Markets are created in pairs via a public contract call, enabling the caller to create a set of corresponding markets. When a market pair is created, the market creator must pass values for the required markets parameters. These parameters are immutable, with the exception of the fee parameters, and dictate the characteristics/terms of each market.
The required parameters are:
collateralPriceOracle: unused at this time.
referenceRateOracle: the oracle address for the reference rate of the market.
baseSwapRateOracle: unused at this time.
swapToken: the collateral token for the market.
liquidationThreshold: the liquidation threshold for the token.
swapTerm: the length of the swaps for the market (in seconds).
paymentTerm: unused at this time.
feeSpread: the fee added to each swap and paid to the counterparty LPs.
maxAdjustmentImpliedBaseRate: the max the implied base rate can be adjusted.
minUtilFee: the min utilization fee.
maxUtilFee: the max utilization fee.
earlyExitDiscountFactor: the discount factor when exiting a swap early.
earlyExitFee: the convenience fee for exiting a swap early.
rateType: the swap rate type that buyers are allowed to purchase in the market (i.e. fixed or floating).
liquidationIncentive: an incentive paid to the party that successfully calls liquidation.
These parameters are the same for each pair of corresponding markets, except that one of the markets will have a rateType of 0 (buyers purchase fixed-rate swaps) and the other 1 (buyers purchase floating-rate swaps). This makes the markets single sided, meaning that only fixed-rate swaps can be purchased in one market and floating-rate swaps in the other market. LPs serve as counterparties in each market and receive the other type of rate obligation when the swap is purchased. For example, if a buyer purchases a fixed-rate swap in market.rateType = 0, the LP will receive the floating end of the swap. This split market design allows LPs to more effectively manage interest rate risk as they can reallocate liquidity to markets as needed.
While anyone will be able to permissionlessly create markets in the future, only authorized users can do so at this time.
Market Liquidity
LPs provide liquidity to a market through supplying the collateral token. The amount of liquidity allocated by an LP is determined by the total value of collateral supplied to the market, multiplied by the liquidation threshold, and then divided by the product of the base swap rate and the swap term. The calculated value represents the amount of payments the supplied collateral could cover based on the current rate, and discounted by the collateral's liquidation threshold. Because each market only allows one type of swap to be sold (i.e. fixed rate for floating rate), LPs allocate liquidity for the specific swap direction rather than an equal amount of both sides. This structure enables LPs to more effectively manage their own interest rate risk.
Fee Structure - Fixed-Rate Swaps
Buyers pay the swap rate for each swap they purchase. The swap rate for fixed-rate swaps is the sum of the base swap rate, utilization fee, and fee spread for the markets. This swap rate is fixed for the term of the swap.
Base Swap Rate: The expected future rate at swap termination based on the liquidity imbalance between corresponding markets.
Utilization Fee: The purpose of the utilization fee is to calculate how much of the market's available liquidity will be consumed by the proposed trade and return a fee that accounts for the impact. This fee serves to incentivize LPs to supply additional liquidity to markets with low available liquidity.
Fee Spread: This fee is set during market creation and is a static fee added to every swap. This incentive LPs to supply liquidity regardless of available liquidity or market conditions.
Fee Structure - Floating-Rate Swaps
Buyers pay the swap rate for each swap they purchase. The swap rate for floating-rate swaps is the sum of the reference rate, utilization fee, and fee spread for the markets. This swap rate is fixed for the term of the swap.
Reference Rate: The current reference rate derived from the market's oracle. Since the reference rate can change over the course of a swap term, the final rate reference rate used in the swap rate is calculated as the average floating rate over the course of the swap as derived from the market's reference rate index.
Utilization Fee: The purpose of the utilization fee is to calculate how much of the market's available liquidity will be consumed by the proposed trade and return a fee that accounts for the impact. This fee serves to incentivize LPs to supply additional liquidity to markets with low available liquidity.
Fee Spread: This fee is set during market creation and is a static fee added to every swap. This incentive LPs to supply liquidity regardless of available liquidity or market conditions.
Last updated