# \[PROPOSAL\] Initial Letter Of Credit Related Configurations

**URL:** <https://forum.anvil.xyz/t/proposal-initial-letter-of-credit-related-configurations/85>\
**Category:** Proposals\
**Created:** [September 23, 2024, 6:07pm UTC](https://forum.anvil.xyz/t/proposal-initial-letter-of-credit-related-configurations/85 "2024-09-23T18:07:19Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![anvil](https://yyz2.discourse-cdn.com/flex004/user_avatar/forum.anvil.xyz/anvil/32/11_2.png) [@anvil](https://forum.anvil.xyz/u/anvil)\
**Post date:** [September 23, 2024, 6:07pm UTC](https://forum.anvil.xyz/t/proposal-initial-letter-of-credit-related-configurations/85/1 "2024-09-23T18:07:19Z")

</div>

# Proposal Date

2024-09-26

# Background

The `LetterOfCredit` contract requires both internal and external configurations. Internally, supported credited tokens must be configured as well as asset pair collateral factors, the latter of which only pertains to unconverted LOCs (uLOCs). uLOCs back the credited token with a different collateral token and therefore are subject to liquidation under certain market conditions. Adding token support requires an ERC-20 address, setting corresponding minimum and maximum credited amounts for individual LOC creation, and setting a protocol-wide maximum credited amount. In addition, asset pair combinations for uLOCs need their own configurations:

- the maximum collateral factor for creation (creation collateral factor)
- the collateral factor at which a LOC is subject to liquidation (collateral factor)
- the liquidation incentive that ensures incentivized actors will liquidate LOCs if the collateral factor is reached

Due to market complexities, separate configuration entries are necessary for each asset in a pair, both as the collateral asset and credited asset respectively. Lastly, the maximum duration for all LOCs needs to be set. Though there is no limit to the number of times the Creator may extend a LOC, at any given time, the duration of a LOC may not exceed this maximum.

Externally, the `LetterOfCredit` contract needs to be approved as a Collateralizable Contract in the `CollateralVault`. In addition, the `PythPriceOracle` that informs the `LetterOfCredit` contract needs to be configured with the relevant [Pyth price feed ids](https://www.pyth.network/developers/price-feed-ids) for each supported token.

## Relevant Contracts

**LetterOfCredit:** [0x1A3251d83B4ed97d8E1d8451613D7DD9B4f42961](https://etherscan.io/address/0x1a3251d83b4ed97d8e1d8451613d7dd9b4f42961)  
**CollateralVault:** [0x5d2725fdE4d7Aa3388DA4519ac0449Cc031d675f](https://etherscan.io/address/0x5d2725fde4d7aa3388da4519ac0449cc031d675f)  
**PythPriceOracle:** [0xC6f3405c861Fa0dca04EC4BA59Bc189D1d56Ee05](https://etherscan.io/address/0xC6f3405c861Fa0dca04EC4BA59Bc189D1d56Ee05)

# Executed Changes

## Description

Adds `LetterOfCredit` as an approved `collateralizableContract` in `CollateralVault`.

Configures `LetterOfCredit` with credited token support: `tokenAddress`, `minPerLOC`, `maxPerLOC`, `globalMaxInUse`.

Configures `LetterOfCredit` with asset pair collateral factors: `collateralTokenAddress`, `creditedTokenAddress`, `creationCollateralFactorBasisPoints`, `collateralFactorBasisPoints`, `liquidatorIncentiveBasisPoints`.

Configures `maxLocDurationSeconds` to 43,200,000 (500 days).

Configures `PythPriceOracle` with `LetterOfCredit` supported token addresses and their respective `priceFeedId`.

## Data Values

### LetterOfCredit

#### Token attributes

| Token | Min Per LOC (whole token units) | Max Per LOC (whole token units) | Global Max In Use (whole token units) |
| --- | --- | --- | --- |
| USDC | 100 | 100,000 | 10,000,000 |
| USDT | 100 | 100,000 | 10,000,000 |
| WETH | 0.028 | 30 | 3,000 |

#### Collateral factors

| Collateral Token | Credited Token | Creation Collateral Factor | Collateral Factor (Liquidation) | Liquidator Incentive |
| --- | --- | --- | --- | --- |
| USDC | USDT | 7500 (75%) | 8500 (85%) | 800 (8%) |
| USDC | wETH | 6500 (65%) | 7800 (78%) | 800 (8%) |
| USDT | USDC | 7500 (75%) | 8500 (85%) | 800 (8%) |
| USDT | wETH | 6500 (65%) | 7800 (78%) | 800 (8%) |
| wETH | USDC | 6500 (65%) | 7800 (78%) | 800 (8%) |
| wETH | USDT | 6500 (65%) | 7800 (78%) | 800 (8%) |

### PythPriceOracle

| Token | Address | Price Feed Id |
| --- | --- | --- |
| USDC | 0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48 | 0xeaa020c61cc479712813461ce153894a96a6c00b21ed0cfc2798d1f9a9e9c94a |
| USDT | 0xdac17f958d2ee523a2206206994597c13d831ec7 | 0x2b89b9dc8fdf9f34709a5b106b472f0f39bb6ca9ce04b0fd7f2e971688e2e53b |
| WETH | 0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2 | 0x9d4294bbcd1174d6f2003ec365831e64cc31d9f6f15a2b85399db8d5000960f6 |
