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.
Merge branch 'canary' of https://github.com/sushiswap/sushiswap-sdk i…
…nto multirouting
- Loading branch information
Showing
84 changed files
with
4,244 additions
and
5,278 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
module.exports = { | ||
...require("@sushiswap/prettier-config") | ||
...require("@sushiswap/prettier-config").default | ||
}; |
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
Large diffs are not rendered by default.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,29 +1,25 @@ | ||
import JSBI from "jsbi"; | ||
import JSBI from 'jsbi' | ||
|
||
export * from "./addresses"; | ||
export * from "./natives"; | ||
export * from "./tokens"; | ||
export * from "./numbers"; | ||
export * from './addresses' | ||
export * from './kashi' | ||
export * from './natives' | ||
export * from './numbers' | ||
export * from './tokens' | ||
|
||
export const INIT_CODE_HASH: string = | ||
"0xe18a34eb0e04b04f7a0ac29a6e80748dca96319b42c54d679cb821dca90c6303"; | ||
export const INIT_CODE_HASH: string = '0xe18a34eb0e04b04f7a0ac29a6e80748dca96319b42c54d679cb821dca90c6303' | ||
|
||
export const MINIMUM_LIQUIDITY = JSBI.BigInt(1000); | ||
export const MINIMUM_LIQUIDITY = JSBI.BigInt(1000) | ||
|
||
export enum SolidityType { | ||
uint8 = "uint8", | ||
uint256 = "uint256" | ||
uint8 = 'uint8', | ||
uint256 = 'uint256' | ||
} | ||
|
||
export const SOLIDITY_TYPE_MAXIMA = { | ||
[SolidityType.uint8]: JSBI.BigInt("0xff"), | ||
[SolidityType.uint256]: JSBI.BigInt( | ||
"0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff" | ||
) | ||
}; | ||
[SolidityType.uint8]: JSBI.BigInt('0xff'), | ||
[SolidityType.uint256]: JSBI.BigInt('0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff') | ||
} | ||
|
||
export const LAMBDA_URL = | ||
"https://9epjsvomc4.execute-api.us-east-1.amazonaws.com/dev"; | ||
export const LAMBDA_URL = 'https://9epjsvomc4.execute-api.us-east-1.amazonaws.com/dev' | ||
|
||
export const SOCKET_URL = | ||
"wss://hfimt374ge.execute-api.us-east-1.amazonaws.com/dev"; | ||
export const SOCKET_URL = 'wss://hfimt374ge.execute-api.us-east-1.amazonaws.com/dev' |
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,61 @@ | ||
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') |
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 |
---|---|---|
@@ -1,16 +1,14 @@ | ||
import JSBI from "jsbi"; | ||
import JSBI from 'jsbi' | ||
|
||
export const MaxUint256 = JSBI.BigInt( | ||
"0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff" | ||
); | ||
export const MaxUint256 = JSBI.BigInt('0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff') | ||
|
||
// exports for internal consumption | ||
export const ZERO = JSBI.BigInt(0); | ||
export const ONE = JSBI.BigInt(1); | ||
export const TWO = JSBI.BigInt(2); | ||
export const THREE = JSBI.BigInt(3); | ||
export const FIVE = JSBI.BigInt(5); | ||
export const TEN = JSBI.BigInt(10); | ||
export const _100 = JSBI.BigInt(100); | ||
export const _997 = JSBI.BigInt(997); | ||
export const _1000 = JSBI.BigInt(1000); | ||
export const ZERO = JSBI.BigInt(0) | ||
export const ONE = JSBI.BigInt(1) | ||
export const TWO = JSBI.BigInt(2) | ||
export const THREE = JSBI.BigInt(3) | ||
export const FIVE = JSBI.BigInt(5) | ||
export const TEN = JSBI.BigInt(10) | ||
export const _100 = JSBI.BigInt(100) | ||
export const _997 = JSBI.BigInt(997) | ||
export const _1000 = JSBI.BigInt(1000) |
Oops, something went wrong.