---
# System prepended metadata

title: Size v2 (Permissionless)

---


Design Concepts
- Modular
    - Separate credit creation & swaps? with erc bond standard for minted credit
- Keep the core accounting as small as possible
- 


## Market Factory

* Whitelisted market creators
* Boolean to disable whitelist to enable permissionless market creation
* Market creators earn a percent of fees collected from that market in perpetuity
    * This is tradeable as a market NFT
    * The fee is Size governance variable bounded by the range 0.01-0.15%, initially set to 0.05%
    * Squatting (some pros, some cons) - could also pre-mint/reserve popular markets

## Markets

Markets may be created by submitting the following parameters:
* loanToken
* collateralToken
* oracle
* lltv (liquidation LTV)
    * In 5% steps (or on some more intelligent curve, see Ajna price bucket increment math?)
* look into why Euler added an openingLTV back into their code after audit

### Token Support

**loanToken** - non-rebasing only (lenders must select markets with wrapped yield bearing tokens to earn passively)

**collateralToken** - rebasing (yield accrues to borrower)

### Oracle

Oracle endpoints will be whitelisted, at least initially. [I assume there's a way to do this so that you could whitelist "any asset on Chainlink" and eventually "any asset on Uniswap, with some adapter that looks at TVL and figures out a TWAP"?] [Morpho requires a single endpoint for every market]

### LLTV

The liquidation LTV is the only LTV, meaning there is no separate opening LTV, and positions may become immediately liquidatable. It will be up to frontends to convey the risks, or prevent loans, with low starting LTVs.

## Deposits

Deposits of any loanToken to Size v2 can be used to make offers on any number of markets with that loanToken.

For example, I might deposit USDC and create offers to lend on 10 markets where USDC is the loanToken.

### Passive Interest

~~Users may elect to earn interest on qualifying unmatched deposits. For example, users may choose to have all USDC earn the Aave variable rate while unmatched. When borrowed, these funds are withdrawn from Aave and sent to the borrower.~~

~~Technical question here about balancing/rebalancing if user has deposits in multiple places, and how to track where to pull funds from.~~

In order to earn passive interest, lenders must deposit to a market where the loanToken is yield-bearing. Only wrapped assets will be supported initially for loanToken.

## Fees

#### Swap Fee

Charged in quoteToken?

#### Fragmentation Fee

Fee for fragmenting liquidity.

#### Wrap Fee

See tokenized credit section.

## Tokenized Credit

ERC-1155? Non-fungible on maturity dimension.

Leverage provider? (Therefore enabling leveraged interest rate speculation)

## Leverage Provider Markets

80%ConversionRate (time component??) on ETH-USDC_LLTV50 (conversion rate vs interest rate vs time?)


## Collateral

**Option A)** Collateral is shared across an asset-oracle pair (collateralToken, quoteToken, oracle), but not shared elsewhere


~~Option B)** Each debt position is tokenized and associated with collateral (CDP-type model)~~

**Cross-compensate:** Credits with lower LLTV may be used to compensate debt positions of the same asset and oracle with higher LLTV. *Hard to know whether this is worth including since we don't know if people like to use compensate().*



## Liquidations

Overdue loans may be liquidated.

Loans where LTV > LLTV can be liquidated.

Loans where LTV > 100 can be dissolved by taking collateral.

## Passive Interest

Push lender deposits into Aave, Morpho, or other variable rate pools while unmatched.

Lender should also be able to choose "no variable rate".

Would require adapters for every protocol supported (or more? on a token basis in some cases?)

Question: how do we track where the money is if multiple are supported? (does user need to specify from off-chain source? or do we maintain some sort of on-chain registry of where the money is deposited)


## Arbitrary Price Hooks

Do we want to take the Uniswap approach and allow arbitrary interest rate pricing? Is this significantly more work for our FE/BE if individual user pricing is pointing at external contract endpoints?

## Symmetrical Splits [perhaps we don't need]

Both debt and credit able to be split.

## Partial Repays

Allow partial repay of debt. 

### Partial Liquidations

Also allow partial liquidations.

## Delegating Pricing

“delegate the pricing/appoint a manager” -> USDC and ETH, and gauntlet has offers on USDC, ETH, WBTC, LINK, etc
- Small fee to delegate
- unexplored details here, like offers to sell credit

## Delegating Other Things?
collateral management

---
## POTENTIALLY IN SCOPE

### Flash loans


---
## QUESTIONS

Vaults?

Collateral management?

Do we support yield bearing tokens? And if so, does debt to lender grow with yield/rebase?
- Borrow token: Yes, debt remains constant
- Collateral token: Yes, i.e. wstETH


Signature support?

---

## NOT CURRENTLY IN SCOPE

### RFQs
Not in scope now, but perhaps if we have an extra dev we can handle also having RFQs.

Can we design it in a way where the protocol can add new order book modules? For example, can we design v2 in a way where we could later plug in an RFQ module and specify/call it when a user submits a txn?

### Coupons
Not in scope. Sablier/Superfluid-type streaming.