forked from sushiswap/sushiswap-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7741ee0
commit ebc49f4
Showing
2 changed files
with
67 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
import { BigNumber } from "@ethersproject/bignumber"; | ||
|
||
// Functions that need accrue to be called | ||
export const ACTION_ADD_ASSET = 1; | ||
export const ACTION_REPAY = 2; | ||
export const ACTION_REMOVE_ASSET = 3; | ||
export const ACTION_REMOVE_COLLATERAL = 4; | ||
export const ACTION_BORROW = 5; | ||
export const ACTION_GET_REPAY_SHARE = 6; | ||
export const ACTION_GET_REPAY_PART = 7; | ||
export const ACTION_ACCRUE = 8; | ||
|
||
// Functions that don't need accrue to be called | ||
export const ACTION_ADD_COLLATERAL = 10; | ||
export const ACTION_UPDATE_EXCHANGE_RATE = 11; | ||
|
||
// Function on BentoBox | ||
export const ACTION_BENTO_DEPOSIT = 20; | ||
export const ACTION_BENTO_WITHDRAW = 21; | ||
export const ACTION_BENTO_TRANSFER = 22; | ||
export const ACTION_BENTO_TRANSFER_MULTIPLE = 23; | ||
export const ACTION_BENTO_SETAPPROVAL = 24; | ||
|
||
// Any external call (except to BentoBox) | ||
export const ACTION_CALL = 30; | ||
|
||
export const MINIMUM_TARGET_UTILIZATION = BigNumber.from("700000000000000000"); // 70% | ||
|
||
export const MAXIMUM_TARGET_UTILIZATION = BigNumber.from("800000000000000000"); // 80% | ||
|
||
export const UTILIZATION_PRECISION = BigNumber.from("1000000000000000000"); | ||
|
||
export const FULL_UTILIZATION = BigNumber.from("1000000000000000000"); | ||
|
||
export const FULL_UTILIZATION_MINUS_MAX = FULL_UTILIZATION.sub( | ||
MAXIMUM_TARGET_UTILIZATION | ||
); | ||
|
||
export const STARTING_INTEREST_PER_YEAR = BigNumber.from(317097920) | ||
.mul(BigNumber.from(60)) | ||
.mul(BigNumber.from(60)) | ||
.mul(BigNumber.from(24)) | ||
.mul(BigNumber.from(365)); // approx 1% APR | ||
|
||
export const MINIMUM_INTEREST_PER_YEAR = BigNumber.from(79274480) | ||
.mul(BigNumber.from(60)) | ||
.mul(BigNumber.from(60)) | ||
.mul(BigNumber.from(24)) | ||
.mul(BigNumber.from(365)); // approx 0.25% APR | ||
|
||
export const MAXIMUM_INTEREST_PER_YEAR = BigNumber.from(317097920000) | ||
.mul(BigNumber.from(60)) | ||
.mul(BigNumber.from(60)) | ||
.mul(BigNumber.from(24)) | ||
.mul(BigNumber.from(365)); // approx 1000% APR | ||
|
||
export const INTEREST_ELASTICITY = BigNumber.from( | ||
"28800000000000000000000000000000000000000" | ||
); // Half or double in 28800 seconds (8 hours) if linear | ||
|
||
export const FACTOR_PRECISION = BigNumber.from("1000000000000000000"); | ||
|
||
export const PROTOCOL_FEE = BigNumber.from("10000"); // 10% | ||
|
||
export const PROTOCOL_FEE_DIVISOR = BigNumber.from("100000"); |