Skip to content

Commit

Permalink
review changes
Browse files Browse the repository at this point in the history
  • Loading branch information
barrasso committed Jul 16, 2024
1 parent b127c49 commit d637385
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions content/sips/sip-399.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Deploy a Flash Loan utility contract to enable users to close their Perps V3 pos

## Abstract

This SIP proposes to deploy a new contract, `PerpsFlashLoanUtil`, which will allow users to close their Perps V3 positions by utilizing flash loans. This contract interacts with the Synthetix proxies and Uniswap's SwapRouter to facilitate the necessary operations. The contract also includes a utility function to set Uniswap pool fees dynamically based on the collateral or margin type.
This SIP proposes to deploy a new contract, `PerpsFlashLoanUtil`, which will allow users to close their Perps V3 positions by utilizing flash loans. This contract interacts with the Synthetix proxies and Uniswap's SwapRouter to facilitate the necessary operations. The contract also includes a utility function to set Uniswap pool addresses dynamically based on the collateral or margin type.

## Motivation

Expand All @@ -28,7 +28,7 @@ The `PerpsFlashLoanUtil` contract will allow users to close their Perps position

### Rationale

The proposed solution leverages existing Synthetix and Uniswap contracts to facilitate the flash loan process. By using a flash loan, users can close their Perps positions without needing to front the necessary collateral. The contract allows for dynamic setting of Uniswap pool fees and supporting various collateral types.
The proposed solution leverages existing Synthetix and Uniswap contracts to facilitate the flash loan process. By using a flash loan, users can close their Perps positions without needing to front the necessary collateral. The contract allows for dynamic setting of Uniswap pool addresses and supporting various collateral types.

### Technical Specification

Expand Down Expand Up @@ -72,25 +72,25 @@ interface IPerpsFlashLoanUtil {
) external returns (bool success);
/**
* @notice Sets the Uniswap pool fee for a given collateral type.
* @notice Sets the Uniswap pool address for a given collateral type.
* @param _collateralType The address of the collateral type.
* @param _poolFee The pool fee to be set for the collateral type.
* @param _poolAddress The pool address to be set for the collateral type.
*/
function setPoolFee(address _collateralType, uint24 _poolFee) external;
function setPoolAddress(address _collateralType, address _poolAddress) external;
}
```

#### Contract Summary

- `setPoolFee`: Allows the contract owner to set the Uniswap pool fee for different collateral types.
- `setPoolAddress`: Allows the contract owner to set the Uniswap pool address for different collateral types.
- `requestFlashLoan`: Requests a flash loan and encodes the necessary parameters for closing a Perps position.
- `executeOperation`: Handles the flash loan callback, performing the necessary operations to close the Perps position and repay the flash loan.

### Test Cases

#### Initial State Tests

- Verify the contract owner can set pool fees using `setPoolFee`.
- Verify the contract owner can set pool addresses using `setPoolAddress`.

#### Flash Loan Util Tests

Expand Down

0 comments on commit d637385

Please sign in to comment.