@defisaver/positions-sdk 1.0.13 → 1.0.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/config/contracts.d.ts +61 -21
- package/cjs/config/contracts.js +9 -1
- package/cjs/contracts.d.ts +1 -0
- package/cjs/contracts.js +2 -1
- package/cjs/liquityV2/index.js +32 -16
- package/cjs/markets/liquityV2/index.d.ts +6 -0
- package/cjs/markets/liquityV2/index.js +51 -4
- package/cjs/types/contracts/generated/LiquityV2LegacyView.d.ts +386 -0
- package/cjs/types/contracts/generated/LiquityV2LegacyView.js +5 -0
- package/cjs/types/contracts/generated/LiquityV2View.d.ts +4 -0
- package/cjs/types/contracts/generated/index.d.ts +1 -0
- package/cjs/types/liquityV2.d.ts +7 -1
- package/cjs/types/liquityV2.js +4 -0
- package/esm/config/contracts.d.ts +61 -21
- package/esm/config/contracts.js +9 -1
- package/esm/contracts.d.ts +1 -0
- package/esm/contracts.js +1 -0
- package/esm/liquityV2/index.js +34 -18
- package/esm/markets/liquityV2/index.d.ts +6 -0
- package/esm/markets/liquityV2/index.js +46 -2
- package/esm/types/contracts/generated/LiquityV2LegacyView.d.ts +386 -0
- package/esm/types/contracts/generated/LiquityV2LegacyView.js +4 -0
- package/esm/types/contracts/generated/LiquityV2View.d.ts +4 -0
- package/esm/types/contracts/generated/index.d.ts +1 -0
- package/esm/types/liquityV2.d.ts +7 -1
- package/esm/types/liquityV2.js +4 -0
- package/package.json +2 -2
- package/src/config/contracts.js +9 -1
- package/src/contracts.ts +2 -0
- package/src/liquityV2/index.ts +35 -16
- package/src/markets/liquityV2/index.ts +50 -2
- package/src/types/contracts/generated/LiquityV2LegacyView.ts +486 -0
- package/src/types/contracts/generated/LiquityV2View.ts +4 -0
- package/src/types/contracts/generated/index.ts +1 -0
- package/src/types/liquityV2.ts +7 -0
|
@@ -7618,7 +7618,7 @@ export namespace LlamaLendControllerAbi {
|
|
|
7618
7618
|
let networks_80: {};
|
|
7619
7619
|
export { networks_80 as networks };
|
|
7620
7620
|
}
|
|
7621
|
-
export namespace
|
|
7621
|
+
export namespace LiquityV2LegacyView {
|
|
7622
7622
|
let abi_81: ({
|
|
7623
7623
|
inputs: never[];
|
|
7624
7624
|
name: string;
|
|
@@ -7689,8 +7689,48 @@ export namespace LiquityV2View {
|
|
|
7689
7689
|
};
|
|
7690
7690
|
export { networks_81 as networks };
|
|
7691
7691
|
}
|
|
7692
|
-
export namespace
|
|
7692
|
+
export namespace LiquityV2View {
|
|
7693
7693
|
let abi_82: ({
|
|
7694
|
+
inputs: never[];
|
|
7695
|
+
name: string;
|
|
7696
|
+
type: string;
|
|
7697
|
+
outputs?: undefined;
|
|
7698
|
+
stateMutability?: undefined;
|
|
7699
|
+
} | {
|
|
7700
|
+
inputs: {
|
|
7701
|
+
internalType: string;
|
|
7702
|
+
name: string;
|
|
7703
|
+
type: string;
|
|
7704
|
+
}[];
|
|
7705
|
+
name: string;
|
|
7706
|
+
outputs: ({
|
|
7707
|
+
components: {
|
|
7708
|
+
internalType: string;
|
|
7709
|
+
name: string;
|
|
7710
|
+
type: string;
|
|
7711
|
+
}[];
|
|
7712
|
+
internalType: string;
|
|
7713
|
+
name: string;
|
|
7714
|
+
type: string;
|
|
7715
|
+
} | {
|
|
7716
|
+
internalType: string;
|
|
7717
|
+
name: string;
|
|
7718
|
+
type: string;
|
|
7719
|
+
components?: undefined;
|
|
7720
|
+
})[];
|
|
7721
|
+
stateMutability: string;
|
|
7722
|
+
type: string;
|
|
7723
|
+
})[];
|
|
7724
|
+
export { abi_82 as abi };
|
|
7725
|
+
let networks_82: {
|
|
7726
|
+
"1": {
|
|
7727
|
+
address: string;
|
|
7728
|
+
};
|
|
7729
|
+
};
|
|
7730
|
+
export { networks_82 as networks };
|
|
7731
|
+
}
|
|
7732
|
+
export namespace LiquityV2CollSurplusPool {
|
|
7733
|
+
let abi_83: ({
|
|
7694
7734
|
inputs: {
|
|
7695
7735
|
internalType: string;
|
|
7696
7736
|
name: string;
|
|
@@ -7729,12 +7769,12 @@ export namespace LiquityV2CollSurplusPool {
|
|
|
7729
7769
|
type: string;
|
|
7730
7770
|
anonymous?: undefined;
|
|
7731
7771
|
})[];
|
|
7732
|
-
export {
|
|
7733
|
-
let
|
|
7734
|
-
export {
|
|
7772
|
+
export { abi_83 as abi };
|
|
7773
|
+
let networks_83: {};
|
|
7774
|
+
export { networks_83 as networks };
|
|
7735
7775
|
}
|
|
7736
7776
|
export namespace LiquityV2TroveNFT {
|
|
7737
|
-
let
|
|
7777
|
+
let abi_84: ({
|
|
7738
7778
|
inputs: {
|
|
7739
7779
|
internalType: string;
|
|
7740
7780
|
name: string;
|
|
@@ -7773,12 +7813,12 @@ export namespace LiquityV2TroveNFT {
|
|
|
7773
7813
|
type: string;
|
|
7774
7814
|
anonymous?: undefined;
|
|
7775
7815
|
})[];
|
|
7776
|
-
export {
|
|
7777
|
-
let
|
|
7778
|
-
export {
|
|
7816
|
+
export { abi_84 as abi };
|
|
7817
|
+
let networks_84: {};
|
|
7818
|
+
export { networks_84 as networks };
|
|
7779
7819
|
}
|
|
7780
7820
|
export namespace EulerV2View {
|
|
7781
|
-
let
|
|
7821
|
+
let abi_85: ({
|
|
7782
7822
|
inputs: {
|
|
7783
7823
|
internalType: string;
|
|
7784
7824
|
name: string;
|
|
@@ -7841,16 +7881,16 @@ export namespace EulerV2View {
|
|
|
7841
7881
|
stateMutability: string;
|
|
7842
7882
|
type: string;
|
|
7843
7883
|
})[];
|
|
7844
|
-
export {
|
|
7845
|
-
let
|
|
7884
|
+
export { abi_85 as abi };
|
|
7885
|
+
let networks_85: {
|
|
7846
7886
|
"1": {
|
|
7847
7887
|
address: string;
|
|
7848
7888
|
};
|
|
7849
7889
|
};
|
|
7850
|
-
export {
|
|
7890
|
+
export { networks_85 as networks };
|
|
7851
7891
|
}
|
|
7852
7892
|
export namespace LiquityV2StabilityPool {
|
|
7853
|
-
let
|
|
7893
|
+
let abi_86: ({
|
|
7854
7894
|
inputs: {
|
|
7855
7895
|
internalType: string;
|
|
7856
7896
|
name: string;
|
|
@@ -7889,12 +7929,12 @@ export namespace LiquityV2StabilityPool {
|
|
|
7889
7929
|
type: string;
|
|
7890
7930
|
anonymous?: undefined;
|
|
7891
7931
|
})[];
|
|
7892
|
-
export {
|
|
7893
|
-
let
|
|
7894
|
-
export {
|
|
7932
|
+
export { abi_86 as abi };
|
|
7933
|
+
let networks_86: {};
|
|
7934
|
+
export { networks_86 as networks };
|
|
7895
7935
|
}
|
|
7896
7936
|
export namespace FluidView {
|
|
7897
|
-
let
|
|
7937
|
+
let abi_87: ({
|
|
7898
7938
|
inputs: {
|
|
7899
7939
|
internalType: string;
|
|
7900
7940
|
name: string;
|
|
@@ -7928,8 +7968,8 @@ export namespace FluidView {
|
|
|
7928
7968
|
stateMutability: string;
|
|
7929
7969
|
type: string;
|
|
7930
7970
|
})[];
|
|
7931
|
-
export {
|
|
7932
|
-
let
|
|
7971
|
+
export { abi_87 as abi };
|
|
7972
|
+
let networks_87: {
|
|
7933
7973
|
"1": {
|
|
7934
7974
|
address: string;
|
|
7935
7975
|
};
|
|
@@ -7940,5 +7980,5 @@ export namespace FluidView {
|
|
|
7940
7980
|
address: string;
|
|
7941
7981
|
};
|
|
7942
7982
|
};
|
|
7943
|
-
export {
|
|
7983
|
+
export { networks_87 as networks };
|
|
7944
7984
|
}
|
package/cjs/config/contracts.js
CHANGED
|
@@ -1103,7 +1103,7 @@ module.exports = {
|
|
|
1103
1103
|
"abi": [{ "name": "UserState", "inputs": [{ "name": "user", "type": "address", "indexed": true }, { "name": "collateral", "type": "uint256", "indexed": false }, { "name": "debt", "type": "uint256", "indexed": false }, { "name": "n1", "type": "int256", "indexed": false }, { "name": "n2", "type": "int256", "indexed": false }, { "name": "liquidation_discount", "type": "uint256", "indexed": false }], "anonymous": false, "type": "event" }, { "name": "Borrow", "inputs": [{ "name": "user", "type": "address", "indexed": true }, { "name": "collateral_increase", "type": "uint256", "indexed": false }, { "name": "loan_increase", "type": "uint256", "indexed": false }], "anonymous": false, "type": "event" }, { "name": "Repay", "inputs": [{ "name": "user", "type": "address", "indexed": true }, { "name": "collateral_decrease", "type": "uint256", "indexed": false }, { "name": "loan_decrease", "type": "uint256", "indexed": false }], "anonymous": false, "type": "event" }, { "name": "RemoveCollateral", "inputs": [{ "name": "user", "type": "address", "indexed": true }, { "name": "collateral_decrease", "type": "uint256", "indexed": false }], "anonymous": false, "type": "event" }, { "name": "Liquidate", "inputs": [{ "name": "liquidator", "type": "address", "indexed": true }, { "name": "user", "type": "address", "indexed": true }, { "name": "collateral_received", "type": "uint256", "indexed": false }, { "name": "stablecoin_received", "type": "uint256", "indexed": false }, { "name": "debt", "type": "uint256", "indexed": false }], "anonymous": false, "type": "event" }, { "name": "SetMonetaryPolicy", "inputs": [{ "name": "monetary_policy", "type": "address", "indexed": false }], "anonymous": false, "type": "event" }, { "name": "SetBorrowingDiscounts", "inputs": [{ "name": "loan_discount", "type": "uint256", "indexed": false }, { "name": "liquidation_discount", "type": "uint256", "indexed": false }], "anonymous": false, "type": "event" }, { "name": "CollectFees", "inputs": [{ "name": "amount", "type": "uint256", "indexed": false }, { "name": "new_supply", "type": "uint256", "indexed": false }], "anonymous": false, "type": "event" }, { "stateMutability": "nonpayable", "type": "constructor", "inputs": [{ "name": "collateral_token", "type": "address" }, { "name": "monetary_policy", "type": "address" }, { "name": "loan_discount", "type": "uint256" }, { "name": "liquidation_discount", "type": "uint256" }, { "name": "amm", "type": "address" }], "outputs": [] }, { "stateMutability": "pure", "type": "function", "name": "factory", "inputs": [], "outputs": [{ "name": "", "type": "address" }] }, { "stateMutability": "pure", "type": "function", "name": "amm", "inputs": [], "outputs": [{ "name": "", "type": "address" }] }, { "stateMutability": "pure", "type": "function", "name": "collateral_token", "inputs": [], "outputs": [{ "name": "", "type": "address" }] }, { "stateMutability": "pure", "type": "function", "name": "borrowed_token", "inputs": [], "outputs": [{ "name": "", "type": "address" }] }, { "stateMutability": "nonpayable", "type": "function", "name": "save_rate", "inputs": [], "outputs": [] }, { "stateMutability": "view", "type": "function", "name": "debt", "inputs": [{ "name": "user", "type": "address" }], "outputs": [{ "name": "", "type": "uint256" }] }, { "stateMutability": "view", "type": "function", "name": "loan_exists", "inputs": [{ "name": "user", "type": "address" }], "outputs": [{ "name": "", "type": "bool" }] }, { "stateMutability": "view", "type": "function", "name": "total_debt", "inputs": [], "outputs": [{ "name": "", "type": "uint256" }] }, { "stateMutability": "view", "type": "function", "name": "max_borrowable", "inputs": [{ "name": "collateral", "type": "uint256" }, { "name": "N", "type": "uint256" }], "outputs": [{ "name": "", "type": "uint256" }] }, { "stateMutability": "view", "type": "function", "name": "max_borrowable", "inputs": [{ "name": "collateral", "type": "uint256" }, { "name": "N", "type": "uint256" }, { "name": "current_debt", "type": "uint256" }], "outputs": [{ "name": "", "type": "uint256" }] }, { "stateMutability": "view", "type": "function", "name": "min_collateral", "inputs": [{ "name": "debt", "type": "uint256" }, { "name": "N", "type": "uint256" }], "outputs": [{ "name": "", "type": "uint256" }] }, { "stateMutability": "view", "type": "function", "name": "calculate_debt_n1", "inputs": [{ "name": "collateral", "type": "uint256" }, { "name": "debt", "type": "uint256" }, { "name": "N", "type": "uint256" }], "outputs": [{ "name": "", "type": "int256" }] }, { "stateMutability": "nonpayable", "type": "function", "name": "create_loan", "inputs": [{ "name": "collateral", "type": "uint256" }, { "name": "debt", "type": "uint256" }, { "name": "N", "type": "uint256" }], "outputs": [] }, { "stateMutability": "nonpayable", "type": "function", "name": "create_loan_extended", "inputs": [{ "name": "collateral", "type": "uint256" }, { "name": "debt", "type": "uint256" }, { "name": "N", "type": "uint256" }, { "name": "callbacker", "type": "address" }, { "name": "callback_args", "type": "uint256[]" }], "outputs": [] }, { "stateMutability": "nonpayable", "type": "function", "name": "add_collateral", "inputs": [{ "name": "collateral", "type": "uint256" }], "outputs": [] }, { "stateMutability": "nonpayable", "type": "function", "name": "add_collateral", "inputs": [{ "name": "collateral", "type": "uint256" }, { "name": "_for", "type": "address" }], "outputs": [] }, { "stateMutability": "nonpayable", "type": "function", "name": "remove_collateral", "inputs": [{ "name": "collateral", "type": "uint256" }], "outputs": [] }, { "stateMutability": "nonpayable", "type": "function", "name": "remove_collateral", "inputs": [{ "name": "collateral", "type": "uint256" }, { "name": "use_eth", "type": "bool" }], "outputs": [] }, { "stateMutability": "nonpayable", "type": "function", "name": "borrow_more", "inputs": [{ "name": "collateral", "type": "uint256" }, { "name": "debt", "type": "uint256" }], "outputs": [] }, { "stateMutability": "nonpayable", "type": "function", "name": "borrow_more_extended", "inputs": [{ "name": "collateral", "type": "uint256" }, { "name": "debt", "type": "uint256" }, { "name": "callbacker", "type": "address" }, { "name": "callback_args", "type": "uint256[]" }], "outputs": [] }, { "stateMutability": "nonpayable", "type": "function", "name": "repay", "inputs": [{ "name": "_d_debt", "type": "uint256" }], "outputs": [] }, { "stateMutability": "nonpayable", "type": "function", "name": "repay", "inputs": [{ "name": "_d_debt", "type": "uint256" }, { "name": "_for", "type": "address" }], "outputs": [] }, { "stateMutability": "nonpayable", "type": "function", "name": "repay", "inputs": [{ "name": "_d_debt", "type": "uint256" }, { "name": "_for", "type": "address" }, { "name": "max_active_band", "type": "int256" }], "outputs": [] }, { "stateMutability": "nonpayable", "type": "function", "name": "repay", "inputs": [{ "name": "_d_debt", "type": "uint256" }, { "name": "_for", "type": "address" }, { "name": "max_active_band", "type": "int256" }, { "name": "use_eth", "type": "bool" }], "outputs": [] }, { "stateMutability": "nonpayable", "type": "function", "name": "repay_extended", "inputs": [{ "name": "callbacker", "type": "address" }, { "name": "callback_args", "type": "uint256[]" }], "outputs": [] }, { "stateMutability": "view", "type": "function", "name": "health_calculator", "inputs": [{ "name": "user", "type": "address" }, { "name": "d_collateral", "type": "int256" }, { "name": "d_debt", "type": "int256" }, { "name": "full", "type": "bool" }], "outputs": [{ "name": "", "type": "int256" }] }, { "stateMutability": "view", "type": "function", "name": "health_calculator", "inputs": [{ "name": "user", "type": "address" }, { "name": "d_collateral", "type": "int256" }, { "name": "d_debt", "type": "int256" }, { "name": "full", "type": "bool" }, { "name": "N", "type": "uint256" }], "outputs": [{ "name": "", "type": "int256" }] }, { "stateMutability": "nonpayable", "type": "function", "name": "liquidate", "inputs": [{ "name": "user", "type": "address" }, { "name": "min_x", "type": "uint256" }], "outputs": [] }, { "stateMutability": "nonpayable", "type": "function", "name": "liquidate", "inputs": [{ "name": "user", "type": "address" }, { "name": "min_x", "type": "uint256" }, { "name": "use_eth", "type": "bool" }], "outputs": [] }, { "stateMutability": "nonpayable", "type": "function", "name": "liquidate_extended", "inputs": [{ "name": "user", "type": "address" }, { "name": "min_x", "type": "uint256" }, { "name": "frac", "type": "uint256" }, { "name": "use_eth", "type": "bool" }, { "name": "callbacker", "type": "address" }, { "name": "callback_args", "type": "uint256[]" }], "outputs": [] }, { "stateMutability": "view", "type": "function", "name": "tokens_to_liquidate", "inputs": [{ "name": "user", "type": "address" }], "outputs": [{ "name": "", "type": "uint256" }] }, { "stateMutability": "view", "type": "function", "name": "tokens_to_liquidate", "inputs": [{ "name": "user", "type": "address" }, { "name": "frac", "type": "uint256" }], "outputs": [{ "name": "", "type": "uint256" }] }, { "stateMutability": "view", "type": "function", "name": "health", "inputs": [{ "name": "user", "type": "address" }], "outputs": [{ "name": "", "type": "int256" }] }, { "stateMutability": "view", "type": "function", "name": "health", "inputs": [{ "name": "user", "type": "address" }, { "name": "full", "type": "bool" }], "outputs": [{ "name": "", "type": "int256" }] }, { "stateMutability": "view", "type": "function", "name": "users_to_liquidate", "inputs": [], "outputs": [{ "name": "", "type": "tuple[]", "components": [{ "name": "user", "type": "address" }, { "name": "x", "type": "uint256" }, { "name": "y", "type": "uint256" }, { "name": "debt", "type": "uint256" }, { "name": "health", "type": "int256" }] }] }, { "stateMutability": "view", "type": "function", "name": "users_to_liquidate", "inputs": [{ "name": "_from", "type": "uint256" }], "outputs": [{ "name": "", "type": "tuple[]", "components": [{ "name": "user", "type": "address" }, { "name": "x", "type": "uint256" }, { "name": "y", "type": "uint256" }, { "name": "debt", "type": "uint256" }, { "name": "health", "type": "int256" }] }] }, { "stateMutability": "view", "type": "function", "name": "users_to_liquidate", "inputs": [{ "name": "_from", "type": "uint256" }, { "name": "_limit", "type": "uint256" }], "outputs": [{ "name": "", "type": "tuple[]", "components": [{ "name": "user", "type": "address" }, { "name": "x", "type": "uint256" }, { "name": "y", "type": "uint256" }, { "name": "debt", "type": "uint256" }, { "name": "health", "type": "int256" }] }] }, { "stateMutability": "view", "type": "function", "name": "amm_price", "inputs": [], "outputs": [{ "name": "", "type": "uint256" }] }, { "stateMutability": "view", "type": "function", "name": "user_prices", "inputs": [{ "name": "user", "type": "address" }], "outputs": [{ "name": "", "type": "uint256[2]" }] }, { "stateMutability": "view", "type": "function", "name": "user_state", "inputs": [{ "name": "user", "type": "address" }], "outputs": [{ "name": "", "type": "uint256[4]" }] }, { "stateMutability": "nonpayable", "type": "function", "name": "set_amm_fee", "inputs": [{ "name": "fee", "type": "uint256" }], "outputs": [] }, { "stateMutability": "nonpayable", "type": "function", "name": "set_amm_admin_fee", "inputs": [{ "name": "fee", "type": "uint256" }], "outputs": [] }, { "stateMutability": "nonpayable", "type": "function", "name": "set_monetary_policy", "inputs": [{ "name": "monetary_policy", "type": "address" }], "outputs": [] }, { "stateMutability": "nonpayable", "type": "function", "name": "set_borrowing_discounts", "inputs": [{ "name": "loan_discount", "type": "uint256" }, { "name": "liquidation_discount", "type": "uint256" }], "outputs": [] }, { "stateMutability": "nonpayable", "type": "function", "name": "set_callback", "inputs": [{ "name": "cb", "type": "address" }], "outputs": [] }, { "stateMutability": "view", "type": "function", "name": "admin_fees", "inputs": [], "outputs": [{ "name": "", "type": "uint256" }] }, { "stateMutability": "nonpayable", "type": "function", "name": "collect_fees", "inputs": [], "outputs": [{ "name": "", "type": "uint256" }] }, { "stateMutability": "view", "type": "function", "name": "check_lock", "inputs": [], "outputs": [{ "name": "", "type": "bool" }] }, { "stateMutability": "view", "type": "function", "name": "liquidation_discounts", "inputs": [{ "name": "arg0", "type": "address" }], "outputs": [{ "name": "", "type": "uint256" }] }, { "stateMutability": "view", "type": "function", "name": "loans", "inputs": [{ "name": "arg0", "type": "uint256" }], "outputs": [{ "name": "", "type": "address" }] }, { "stateMutability": "view", "type": "function", "name": "loan_ix", "inputs": [{ "name": "arg0", "type": "address" }], "outputs": [{ "name": "", "type": "uint256" }] }, { "stateMutability": "view", "type": "function", "name": "n_loans", "inputs": [], "outputs": [{ "name": "", "type": "uint256" }] }, { "stateMutability": "view", "type": "function", "name": "minted", "inputs": [], "outputs": [{ "name": "", "type": "uint256" }] }, { "stateMutability": "view", "type": "function", "name": "redeemed", "inputs": [], "outputs": [{ "name": "", "type": "uint256" }] }, { "stateMutability": "view", "type": "function", "name": "monetary_policy", "inputs": [], "outputs": [{ "name": "", "type": "address" }] }, { "stateMutability": "view", "type": "function", "name": "liquidation_discount", "inputs": [], "outputs": [{ "name": "", "type": "uint256" }] }, { "stateMutability": "view", "type": "function", "name": "loan_discount", "inputs": [], "outputs": [{ "name": "", "type": "uint256" }] }],
|
|
1104
1104
|
"networks": {}
|
|
1105
1105
|
},
|
|
1106
|
-
"
|
|
1106
|
+
"LiquityV2LegacyView": {
|
|
1107
1107
|
"abi": [{ "inputs": [], "name": "InvalidMarketAddress", "type": "error" }, { "inputs": [{ "internalType": "address", "name": "_market", "type": "address" }, { "internalType": "uint256", "name": "_interestRate", "type": "uint256" }, { "internalType": "uint256", "name": "_prevId", "type": "uint256" }, { "internalType": "uint256", "name": "_nextId", "type": "uint256" }], "name": "findInsertPosition", "outputs": [{ "internalType": "uint256", "name": "prevId", "type": "uint256" }, { "internalType": "uint256", "name": "nextId", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_market", "type": "address" }, { "internalType": "uint256", "name": "_collIndex", "type": "uint256" }, { "internalType": "uint256", "name": "_interestRate", "type": "uint256" }, { "internalType": "uint256", "name": "_numTrials", "type": "uint256" }, { "internalType": "uint256", "name": "_inputRandomSeed", "type": "uint256" }], "name": "getApproxHint", "outputs": [{ "internalType": "uint256", "name": "hintId", "type": "uint256" }, { "internalType": "uint256", "name": "diff", "type": "uint256" }, { "internalType": "uint256", "name": "latestRandomSeed", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_market", "type": "address" }, { "internalType": "address", "name": "_manager", "type": "address" }], "name": "getBatchManagerInfo", "outputs": [{ "components": [{ "internalType": "uint128", "name": "minInterestRate", "type": "uint128" }, { "internalType": "uint128", "name": "maxInterestRate", "type": "uint128" }, { "internalType": "uint256", "name": "minInterestRateChangePeriod", "type": "uint256" }], "internalType": "struct IBorrowerOperations.InterestBatchManager", "name": "managerData", "type": "tuple" }, { "components": [{ "internalType": "uint256", "name": "entireDebtWithoutRedistribution", "type": "uint256" }, { "internalType": "uint256", "name": "entireCollWithoutRedistribution", "type": "uint256" }, { "internalType": "uint256", "name": "accruedInterest", "type": "uint256" }, { "internalType": "uint256", "name": "recordedDebt", "type": "uint256" }, { "internalType": "uint256", "name": "annualInterestRate", "type": "uint256" }, { "internalType": "uint256", "name": "weightedRecordedDebt", "type": "uint256" }, { "internalType": "uint256", "name": "annualManagementFee", "type": "uint256" }, { "internalType": "uint256", "name": "accruedManagementFee", "type": "uint256" }, { "internalType": "uint256", "name": "weightedRecordedBatchManagementFee", "type": "uint256" }, { "internalType": "uint256", "name": "lastDebtUpdateTime", "type": "uint256" }, { "internalType": "uint256", "name": "lastInterestRateAdjTime", "type": "uint256" }], "internalType": "struct ITroveManager.LatestBatchData", "name": "batchData", "type": "tuple" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_market", "type": "address" }, { "internalType": "uint256", "name": "_troveId", "type": "uint256" }, { "internalType": "uint256", "name": "_acc", "type": "uint256" }, { "internalType": "uint256", "name": "_iterations", "type": "uint256" }], "name": "getDebtInFront", "outputs": [{ "internalType": "uint256", "name": "next", "type": "uint256" }, { "internalType": "uint256", "name": "debt", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_market", "type": "address" }, { "internalType": "uint256", "name": "_troveId", "type": "uint256" }, { "internalType": "uint256", "name": "_acc", "type": "uint256" }, { "internalType": "uint256", "name": "_iterations", "type": "uint256" }, { "internalType": "uint256", "name": "_targetIR", "type": "uint256" }], "name": "getDebtInFrontByInterestRate", "outputs": [{ "internalType": "uint256", "name": "next", "type": "uint256" }, { "internalType": "uint256", "name": "debt", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_market", "type": "address" }, { "internalType": "uint256", "name": "_numTroves", "type": "uint256" }], "name": "getDebtInFrontByTroveNum", "outputs": [{ "internalType": "uint256", "name": "debt", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_market", "type": "address" }, { "internalType": "address", "name": "_depositor", "type": "address" }], "name": "getDepositorInfo", "outputs": [{ "internalType": "uint256", "name": "compoundedBOLD", "type": "uint256" }, { "internalType": "uint256", "name": "collGain", "type": "uint256" }, { "internalType": "uint256", "name": "boldGain", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_market", "type": "address" }, { "internalType": "uint256", "name": "_collIndex", "type": "uint256" }, { "internalType": "uint256", "name": "_interestRate", "type": "uint256" }, { "internalType": "uint256", "name": "_numTrials", "type": "uint256" }, { "internalType": "uint256", "name": "_inputRandomSeed", "type": "uint256" }], "name": "getInsertPosition", "outputs": [{ "internalType": "uint256", "name": "prevId", "type": "uint256" }, { "internalType": "uint256", "name": "nextId", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_market", "type": "address" }], "name": "getMarketData", "outputs": [{ "components": [{ "internalType": "address", "name": "market", "type": "address" }, { "internalType": "uint256", "name": "CCR", "type": "uint256" }, { "internalType": "uint256", "name": "MCR", "type": "uint256" }, { "internalType": "uint256", "name": "SCR", "type": "uint256" }, { "internalType": "uint256", "name": "LIQUIDATION_PENALTY_SP", "type": "uint256" }, { "internalType": "uint256", "name": "LIQUIDATION_PENALTY_REDISTRIBUTION", "type": "uint256" }, { "internalType": "uint256", "name": "entireSystemColl", "type": "uint256" }, { "internalType": "uint256", "name": "entireSystemDebt", "type": "uint256" }, { "internalType": "address", "name": "collToken", "type": "address" }, { "internalType": "address", "name": "troveNFT", "type": "address" }, { "internalType": "address", "name": "borrowerOperations", "type": "address" }, { "internalType": "address", "name": "troveManager", "type": "address" }, { "internalType": "address", "name": "stabilityPool", "type": "address" }, { "internalType": "address", "name": "sortedTroves", "type": "address" }, { "internalType": "address", "name": "collSurplusPool", "type": "address" }, { "internalType": "address", "name": "activePool", "type": "address" }, { "internalType": "address", "name": "hintHelpers", "type": "address" }, { "internalType": "address", "name": "priceFeed", "type": "address" }, { "internalType": "uint256", "name": "collPrice", "type": "uint256" }, { "internalType": "bool", "name": "isShutDown", "type": "bool" }, { "internalType": "uint256", "name": "boldDepositInSp", "type": "uint256" }], "internalType": "struct LiquityV2View.MarketData", "name": "data", "type": "tuple" }], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_market", "type": "address" }, { "internalType": "int256", "name": "_startIdx", "type": "int256" }, { "internalType": "uint256", "name": "_count", "type": "uint256" }], "name": "getMultipleSortedTroves", "outputs": [{ "components": [{ "internalType": "uint256", "name": "id", "type": "uint256" }, { "internalType": "uint256", "name": "debt", "type": "uint256" }, { "internalType": "uint256", "name": "coll", "type": "uint256" }, { "internalType": "uint256", "name": "stake", "type": "uint256" }, { "internalType": "uint256", "name": "annualInterestRate", "type": "uint256" }, { "internalType": "uint256", "name": "lastDebtUpdateTime", "type": "uint256" }, { "internalType": "uint256", "name": "lastInterestRateAdjTime", "type": "uint256" }, { "internalType": "address", "name": "interestBatchManager", "type": "address" }, { "internalType": "uint256", "name": "batchDebtShares", "type": "uint256" }, { "internalType": "uint256", "name": "batchCollShares", "type": "uint256" }, { "internalType": "uint256", "name": "snapshotETH", "type": "uint256" }, { "internalType": "uint256", "name": "snapshotBoldDebt", "type": "uint256" }], "internalType": "struct IMultiTroveGetter.CombinedTroveData[]", "name": "", "type": "tuple[]" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_market", "type": "address" }, { "internalType": "uint256", "name": "_troveId", "type": "uint256" }, { "internalType": "uint256", "name": "_iterations", "type": "uint256" }], "name": "getNumOfTrovesInFrontOfTrove", "outputs": [{ "internalType": "uint256", "name": "next", "type": "uint256" }, { "internalType": "uint256", "name": "numTroves", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_market", "type": "address" }, { "internalType": "uint256", "name": "_troveId", "type": "uint256" }], "name": "getTroveInfo", "outputs": [{ "components": [{ "internalType": "uint256", "name": "troveId", "type": "uint256" }, { "internalType": "address", "name": "owner", "type": "address" }, { "internalType": "address", "name": "collToken", "type": "address" }, { "internalType": "enum ITroveManager.Status", "name": "status", "type": "uint8" }, { "internalType": "uint256", "name": "collAmount", "type": "uint256" }, { "internalType": "uint256", "name": "debtAmount", "type": "uint256" }, { "internalType": "uint256", "name": "collPrice", "type": "uint256" }, { "internalType": "uint256", "name": "TCRatio", "type": "uint256" }, { "internalType": "uint256", "name": "annualInterestRate", "type": "uint256" }, { "internalType": "address", "name": "interestBatchManager", "type": "address" }, { "internalType": "uint256", "name": "batchDebtShares", "type": "uint256" }, { "internalType": "uint256", "name": "lastInterestRateAdjTime", "type": "uint256" }], "internalType": "struct LiquityV2View.TroveData", "name": "trove", "type": "tuple" }], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_market", "type": "address" }, { "internalType": "uint256", "name": "_collIndex", "type": "uint256" }, { "internalType": "uint256", "name": "_troveId", "type": "uint256" }, { "internalType": "uint256", "name": "_numTrials", "type": "uint256" }, { "internalType": "uint256", "name": "_inputRandomSeed", "type": "uint256" }], "name": "getTrovePosition", "outputs": [{ "internalType": "uint256", "name": "prevId", "type": "uint256" }, { "internalType": "uint256", "name": "nextId", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_user", "type": "address" }, { "internalType": "address", "name": "_market", "type": "address" }, { "internalType": "uint256", "name": "_startIndex", "type": "uint256" }, { "internalType": "uint256", "name": "_endIndex", "type": "uint256" }], "name": "getUserTroves", "outputs": [{ "components": [{ "internalType": "uint256", "name": "troveId", "type": "uint256" }, { "internalType": "bool", "name": "ownedByUser", "type": "bool" }], "internalType": "struct LiquityV2View.ExistingTrove[]", "name": "troves", "type": "tuple[]" }, { "internalType": "int256", "name": "nextFreeTroveIndex", "type": "int256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_market", "type": "address" }], "name": "isShutDown", "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_market", "type": "address" }, { "internalType": "uint256", "name": "_collIndex", "type": "uint256" }, { "internalType": "uint256", "name": "_troveId", "type": "uint256" }, { "internalType": "uint256", "name": "_debtIncrease", "type": "uint256" }], "name": "predictAdjustTroveUpfrontFee", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }],
|
|
1108
1108
|
"networks": {
|
|
1109
1109
|
"1": {
|
|
@@ -1118,6 +1118,14 @@ module.exports = {
|
|
|
1118
1118
|
},
|
|
1119
1119
|
},
|
|
1120
1120
|
},
|
|
1121
|
+
"LiquityV2View": {
|
|
1122
|
+
"abi": [{ "inputs": [], "name": "InvalidMarketAddress", "type": "error" }, { "inputs": [{ "internalType": "address", "name": "_market", "type": "address" }, { "internalType": "uint256", "name": "_interestRate", "type": "uint256" }, { "internalType": "uint256", "name": "_prevId", "type": "uint256" }, { "internalType": "uint256", "name": "_nextId", "type": "uint256" }], "name": "findInsertPosition", "outputs": [{ "internalType": "uint256", "name": "prevId", "type": "uint256" }, { "internalType": "uint256", "name": "nextId", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_market", "type": "address" }, { "internalType": "uint256", "name": "_collIndex", "type": "uint256" }, { "internalType": "uint256", "name": "_interestRate", "type": "uint256" }, { "internalType": "uint256", "name": "_numTrials", "type": "uint256" }, { "internalType": "uint256", "name": "_inputRandomSeed", "type": "uint256" }], "name": "getApproxHint", "outputs": [{ "internalType": "uint256", "name": "hintId", "type": "uint256" }, { "internalType": "uint256", "name": "diff", "type": "uint256" }, { "internalType": "uint256", "name": "latestRandomSeed", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_market", "type": "address" }, { "internalType": "address", "name": "_manager", "type": "address" }], "name": "getBatchManagerInfo", "outputs": [{ "components": [{ "internalType": "uint128", "name": "minInterestRate", "type": "uint128" }, { "internalType": "uint128", "name": "maxInterestRate", "type": "uint128" }, { "internalType": "uint256", "name": "minInterestRateChangePeriod", "type": "uint256" }], "internalType": "struct IBorrowerOperations.InterestBatchManager", "name": "managerData", "type": "tuple" }, { "components": [{ "internalType": "uint256", "name": "entireDebtWithoutRedistribution", "type": "uint256" }, { "internalType": "uint256", "name": "entireCollWithoutRedistribution", "type": "uint256" }, { "internalType": "uint256", "name": "accruedInterest", "type": "uint256" }, { "internalType": "uint256", "name": "recordedDebt", "type": "uint256" }, { "internalType": "uint256", "name": "annualInterestRate", "type": "uint256" }, { "internalType": "uint256", "name": "weightedRecordedDebt", "type": "uint256" }, { "internalType": "uint256", "name": "annualManagementFee", "type": "uint256" }, { "internalType": "uint256", "name": "accruedManagementFee", "type": "uint256" }, { "internalType": "uint256", "name": "weightedRecordedBatchManagementFee", "type": "uint256" }, { "internalType": "uint256", "name": "lastDebtUpdateTime", "type": "uint256" }, { "internalType": "uint256", "name": "lastInterestRateAdjTime", "type": "uint256" }], "internalType": "struct ITroveManager.LatestBatchData", "name": "batchData", "type": "tuple" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_market", "type": "address" }, { "internalType": "uint256", "name": "_troveId", "type": "uint256" }, { "internalType": "uint256", "name": "_acc", "type": "uint256" }, { "internalType": "uint256", "name": "_iterations", "type": "uint256" }], "name": "getDebtInFront", "outputs": [{ "internalType": "uint256", "name": "next", "type": "uint256" }, { "internalType": "uint256", "name": "debt", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_market", "type": "address" }, { "internalType": "uint256", "name": "_troveId", "type": "uint256" }, { "internalType": "uint256", "name": "_acc", "type": "uint256" }, { "internalType": "uint256", "name": "_iterations", "type": "uint256" }, { "internalType": "uint256", "name": "_targetIR", "type": "uint256" }], "name": "getDebtInFrontByInterestRate", "outputs": [{ "internalType": "uint256", "name": "next", "type": "uint256" }, { "internalType": "uint256", "name": "debt", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_market", "type": "address" }, { "internalType": "uint256", "name": "_numTroves", "type": "uint256" }], "name": "getDebtInFrontByTroveNum", "outputs": [{ "internalType": "uint256", "name": "debt", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_market", "type": "address" }, { "internalType": "address", "name": "_depositor", "type": "address" }], "name": "getDepositorInfo", "outputs": [{ "internalType": "uint256", "name": "compoundedBOLD", "type": "uint256" }, { "internalType": "uint256", "name": "collGain", "type": "uint256" }, { "internalType": "uint256", "name": "boldGain", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_market", "type": "address" }, { "internalType": "uint256", "name": "_collIndex", "type": "uint256" }, { "internalType": "uint256", "name": "_interestRate", "type": "uint256" }, { "internalType": "uint256", "name": "_numTrials", "type": "uint256" }, { "internalType": "uint256", "name": "_inputRandomSeed", "type": "uint256" }], "name": "getInsertPosition", "outputs": [{ "internalType": "uint256", "name": "prevId", "type": "uint256" }, { "internalType": "uint256", "name": "nextId", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_market", "type": "address" }], "name": "getMarketData", "outputs": [{ "components": [{ "internalType": "address", "name": "market", "type": "address" }, { "internalType": "uint256", "name": "CCR", "type": "uint256" }, { "internalType": "uint256", "name": "MCR", "type": "uint256" }, { "internalType": "uint256", "name": "SCR", "type": "uint256" }, { "internalType": "uint256", "name": "BCR", "type": "uint256" }, { "internalType": "uint256", "name": "LIQUIDATION_PENALTY_SP", "type": "uint256" }, { "internalType": "uint256", "name": "LIQUIDATION_PENALTY_REDISTRIBUTION", "type": "uint256" }, { "internalType": "uint256", "name": "entireSystemColl", "type": "uint256" }, { "internalType": "uint256", "name": "entireSystemDebt", "type": "uint256" }, { "internalType": "address", "name": "collToken", "type": "address" }, { "internalType": "address", "name": "troveNFT", "type": "address" }, { "internalType": "address", "name": "borrowerOperations", "type": "address" }, { "internalType": "address", "name": "troveManager", "type": "address" }, { "internalType": "address", "name": "stabilityPool", "type": "address" }, { "internalType": "address", "name": "sortedTroves", "type": "address" }, { "internalType": "address", "name": "collSurplusPool", "type": "address" }, { "internalType": "address", "name": "activePool", "type": "address" }, { "internalType": "address", "name": "hintHelpers", "type": "address" }, { "internalType": "address", "name": "priceFeed", "type": "address" }, { "internalType": "uint256", "name": "collPrice", "type": "uint256" }, { "internalType": "bool", "name": "isShutDown", "type": "bool" }, { "internalType": "uint256", "name": "boldDepositInSp", "type": "uint256" }], "internalType": "struct LiquityV2View.MarketData", "name": "data", "type": "tuple" }], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_market", "type": "address" }, { "internalType": "int256", "name": "_startIdx", "type": "int256" }, { "internalType": "uint256", "name": "_count", "type": "uint256" }], "name": "getMultipleSortedTroves", "outputs": [{ "components": [{ "internalType": "uint256", "name": "id", "type": "uint256" }, { "internalType": "uint256", "name": "debt", "type": "uint256" }, { "internalType": "uint256", "name": "coll", "type": "uint256" }, { "internalType": "uint256", "name": "stake", "type": "uint256" }, { "internalType": "uint256", "name": "annualInterestRate", "type": "uint256" }, { "internalType": "uint256", "name": "lastDebtUpdateTime", "type": "uint256" }, { "internalType": "uint256", "name": "lastInterestRateAdjTime", "type": "uint256" }, { "internalType": "address", "name": "interestBatchManager", "type": "address" }, { "internalType": "uint256", "name": "batchDebtShares", "type": "uint256" }, { "internalType": "uint256", "name": "batchCollShares", "type": "uint256" }, { "internalType": "uint256", "name": "snapshotETH", "type": "uint256" }, { "internalType": "uint256", "name": "snapshotBoldDebt", "type": "uint256" }], "internalType": "struct IMultiTroveGetter.CombinedTroveData[]", "name": "", "type": "tuple[]" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_market", "type": "address" }, { "internalType": "uint256", "name": "_troveId", "type": "uint256" }, { "internalType": "uint256", "name": "_iterations", "type": "uint256" }], "name": "getNumOfTrovesInFrontOfTrove", "outputs": [{ "internalType": "uint256", "name": "next", "type": "uint256" }, { "internalType": "uint256", "name": "numTroves", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_market", "type": "address" }, { "internalType": "uint256", "name": "_troveId", "type": "uint256" }], "name": "getTroveInfo", "outputs": [{ "components": [{ "internalType": "uint256", "name": "troveId", "type": "uint256" }, { "internalType": "address", "name": "owner", "type": "address" }, { "internalType": "address", "name": "collToken", "type": "address" }, { "internalType": "enum ITroveManager.Status", "name": "status", "type": "uint8" }, { "internalType": "uint256", "name": "collAmount", "type": "uint256" }, { "internalType": "uint256", "name": "debtAmount", "type": "uint256" }, { "internalType": "uint256", "name": "collPrice", "type": "uint256" }, { "internalType": "uint256", "name": "TCRatio", "type": "uint256" }, { "internalType": "uint256", "name": "annualInterestRate", "type": "uint256" }, { "internalType": "address", "name": "interestBatchManager", "type": "address" }, { "internalType": "uint256", "name": "batchDebtShares", "type": "uint256" }, { "internalType": "uint256", "name": "lastInterestRateAdjTime", "type": "uint256" }], "internalType": "struct LiquityV2View.TroveData", "name": "trove", "type": "tuple" }], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_market", "type": "address" }, { "internalType": "uint256", "name": "_collIndex", "type": "uint256" }, { "internalType": "uint256", "name": "_troveId", "type": "uint256" }, { "internalType": "uint256", "name": "_numTrials", "type": "uint256" }, { "internalType": "uint256", "name": "_inputRandomSeed", "type": "uint256" }], "name": "getTrovePosition", "outputs": [{ "internalType": "uint256", "name": "prevId", "type": "uint256" }, { "internalType": "uint256", "name": "nextId", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_user", "type": "address" }, { "internalType": "address", "name": "_market", "type": "address" }, { "internalType": "uint256", "name": "_startIndex", "type": "uint256" }, { "internalType": "uint256", "name": "_endIndex", "type": "uint256" }], "name": "getUserTroves", "outputs": [{ "components": [{ "internalType": "uint256", "name": "troveId", "type": "uint256" }, { "internalType": "bool", "name": "ownedByUser", "type": "bool" }], "internalType": "struct LiquityV2View.ExistingTrove[]", "name": "troves", "type": "tuple[]" }, { "internalType": "int256", "name": "nextFreeTroveIndex", "type": "int256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_market", "type": "address" }], "name": "isShutDown", "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_market", "type": "address" }, { "internalType": "uint256", "name": "_collIndex", "type": "uint256" }, { "internalType": "uint256", "name": "_troveId", "type": "uint256" }, { "internalType": "uint256", "name": "_debtIncrease", "type": "uint256" }], "name": "predictAdjustTroveUpfrontFee", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }],
|
|
1123
|
+
"networks": {
|
|
1124
|
+
"1": {
|
|
1125
|
+
"address": "0xF1f3D940392ddAD78A5e2dE1b595aB529f63c365",
|
|
1126
|
+
}
|
|
1127
|
+
}
|
|
1128
|
+
},
|
|
1121
1129
|
"LiquityV2CollSurplusPool": {
|
|
1122
1130
|
"abi": [{ "inputs": [{ "internalType": "contract IAddressesRegistry", "name": "_addressesRegistry", "type": "address" }], "stateMutability": "nonpayable", "type": "constructor" }, { "anonymous": false, "inputs": [{ "indexed": false, "internalType": "address", "name": "_newBorrowerOperationsAddress", "type": "address" }], "name": "BorrowerOperationsAddressChanged", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "address", "name": "_account", "type": "address" }, { "indexed": false, "internalType": "uint256", "name": "_newBalance", "type": "uint256" }], "name": "CollBalanceUpdated", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "address", "name": "_to", "type": "address" }, { "indexed": false, "internalType": "uint256", "name": "_amount", "type": "uint256" }], "name": "CollSent", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": false, "internalType": "address", "name": "_newTroveManagerAddress", "type": "address" }], "name": "TroveManagerAddressChanged", "type": "event" }, { "inputs": [], "name": "NAME", "outputs": [{ "internalType": "string", "name": "", "type": "string" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_account", "type": "address" }, { "internalType": "uint256", "name": "_amount", "type": "uint256" }], "name": "accountSurplus", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "borrowerOperationsAddress", "outputs": [{ "internalType": "address", "name": "", "type": "address" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_account", "type": "address" }], "name": "claimColl", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "collToken", "outputs": [{ "internalType": "contract IERC20", "name": "", "type": "address" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "getCollBalance", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_account", "type": "address" }], "name": "getCollateral", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "troveManagerAddress", "outputs": [{ "internalType": "address", "name": "", "type": "address" }], "stateMutability": "view", "type": "function" }],
|
|
1123
1131
|
"networks": {}
|
package/cjs/contracts.d.ts
CHANGED
|
@@ -48,5 +48,6 @@ export declare const DFSFeedRegistryContract: (web3: Web3, network: NetworkNumbe
|
|
|
48
48
|
export declare const MorphoBlueViewContract: (web3: Web3, network: NetworkNumber, block?: Blockish) => ContractTypes.MorphoBlueView;
|
|
49
49
|
export declare const LlamaLendViewContract: (web3: Web3, network: NetworkNumber, block?: Blockish) => ContractTypes.LlamaLendView;
|
|
50
50
|
export declare const LiquityV2ViewContract: (web3: Web3, network: NetworkNumber, block?: Blockish) => ContractTypes.LiquityV2View;
|
|
51
|
+
export declare const LiquityV2LegacyViewContract: (web3: Web3, network: NetworkNumber, block?: Blockish) => ContractTypes.LiquityV2LegacyView;
|
|
51
52
|
export declare const EulerV2ViewContract: (web3: Web3, network: NetworkNumber, block?: Blockish) => ContractTypes.EulerV2View;
|
|
52
53
|
export declare const FluidViewContract: (web3: Web3, network: NetworkNumber, block?: Blockish) => ContractTypes.FluidView;
|
package/cjs/contracts.js
CHANGED
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.FluidViewContract = exports.EulerV2ViewContract = exports.LiquityV2ViewContract = exports.LlamaLendViewContract = exports.MorphoBlueViewContract = exports.DFSFeedRegistryContract = exports.FeedRegistryContract = exports.WstETHPriceFeedContract = exports.USDCPriceFeedContract = exports.COMPPriceFeedContract = exports.ETHPriceFeedContract = exports.ChickenBondsManagerContract = exports.ChickenBondsViewContract = exports.McdVatContract = exports.McdJugContract = exports.McdDogContract = exports.McdSpotterContract = exports.McdViewContract = exports.LiquityActivePoolContract = exports.LiquityPriceFeedContract = exports.LiquityTroveManagerContract = exports.LiquityCollSurplusPoolContract = exports.LiquityViewContract = exports.CrvUSDFactoryContract = exports.CrvUSDViewContract = exports.SparkViewContract = exports.SparkIncentiveDataProviderContract = exports.MorphoAaveV2ViewContract = exports.PotContract = exports.ComptrollerContract = exports.CompoundLoanInfoContract = exports.AaveLoanInfoV2Contract = exports.wstETHContract = exports.CompV3ViewContract = exports.BalanceScannerContract = exports.REthContract = exports.CbEthContract = exports.LidoContract = exports.GhoTokenContract = exports.AaveIncentiveDataProviderV3Contract = exports.AaveV3ViewContract = exports.UniMulticallContract = exports.createContractWrapper = exports.getErc20Contract = exports.getConfigContractAbi = exports.getConfigContractAddress = void 0;
|
|
6
|
+
exports.FluidViewContract = exports.EulerV2ViewContract = exports.LiquityV2LegacyViewContract = exports.LiquityV2ViewContract = exports.LlamaLendViewContract = exports.MorphoBlueViewContract = exports.DFSFeedRegistryContract = exports.FeedRegistryContract = exports.WstETHPriceFeedContract = exports.USDCPriceFeedContract = exports.COMPPriceFeedContract = exports.ETHPriceFeedContract = exports.ChickenBondsManagerContract = exports.ChickenBondsViewContract = exports.McdVatContract = exports.McdJugContract = exports.McdDogContract = exports.McdSpotterContract = exports.McdViewContract = exports.LiquityActivePoolContract = exports.LiquityPriceFeedContract = exports.LiquityTroveManagerContract = exports.LiquityCollSurplusPoolContract = exports.LiquityViewContract = exports.CrvUSDFactoryContract = exports.CrvUSDViewContract = exports.SparkViewContract = exports.SparkIncentiveDataProviderContract = exports.MorphoAaveV2ViewContract = exports.PotContract = exports.ComptrollerContract = exports.CompoundLoanInfoContract = exports.AaveLoanInfoV2Contract = exports.wstETHContract = exports.CompV3ViewContract = exports.BalanceScannerContract = exports.REthContract = exports.CbEthContract = exports.LidoContract = exports.GhoTokenContract = exports.AaveIncentiveDataProviderV3Contract = exports.AaveV3ViewContract = exports.UniMulticallContract = exports.createContractWrapper = exports.getErc20Contract = exports.getConfigContractAbi = exports.getConfigContractAddress = void 0;
|
|
7
7
|
const contracts_1 = __importDefault(require("./config/contracts"));
|
|
8
8
|
const contractConfig = contracts_1.default;
|
|
9
9
|
const getConfigContractAddress = (name, network, block) => {
|
|
@@ -90,5 +90,6 @@ exports.DFSFeedRegistryContract = createContractFromConfigFunc('DFSFeedRegistry'
|
|
|
90
90
|
exports.MorphoBlueViewContract = createContractFromConfigFunc('MorphoBlueView');
|
|
91
91
|
exports.LlamaLendViewContract = createContractFromConfigFunc('LlamaLendView');
|
|
92
92
|
exports.LiquityV2ViewContract = createContractFromConfigFunc('LiquityV2View');
|
|
93
|
+
exports.LiquityV2LegacyViewContract = createContractFromConfigFunc('LiquityV2LegacyView');
|
|
93
94
|
exports.EulerV2ViewContract = createContractFromConfigFunc('EulerV2View');
|
|
94
95
|
exports.FluidViewContract = createContractFromConfigFunc('FluidView');
|
package/cjs/liquityV2/index.js
CHANGED
|
@@ -16,15 +16,21 @@ exports.getLiquityV2ClaimableCollateral = exports.getLiquityV2TroveData = export
|
|
|
16
16
|
const decimal_js_1 = __importDefault(require("decimal.js"));
|
|
17
17
|
const tokens_1 = require("@defisaver/tokens");
|
|
18
18
|
const contracts_1 = require("../contracts");
|
|
19
|
+
const common_1 = require("../types/common");
|
|
19
20
|
const types_1 = require("../types");
|
|
20
21
|
const staking_1 = require("../staking");
|
|
21
22
|
const liquityV2Helpers_1 = require("../helpers/liquityV2Helpers");
|
|
22
23
|
const utils_1 = require("../services/utils");
|
|
23
24
|
const constants_1 = require("../constants");
|
|
24
25
|
const markets_1 = require("../markets");
|
|
26
|
+
const getLiquityV2ViewContract = (web3, network, isLegacy) => {
|
|
27
|
+
if (isLegacy)
|
|
28
|
+
return (0, contracts_1.LiquityV2LegacyViewContract)(web3, network);
|
|
29
|
+
return (0, contracts_1.LiquityV2ViewContract)(web3, network);
|
|
30
|
+
};
|
|
25
31
|
const getLiquityV2MarketData = (web3, network, selectedMarket, mainnetWeb3) => __awaiter(void 0, void 0, void 0, function* () {
|
|
26
|
-
const
|
|
27
|
-
const
|
|
32
|
+
const { marketAddress, debtToken, collateralToken, isLegacy, } = selectedMarket;
|
|
33
|
+
const viewContract = getLiquityV2ViewContract(web3, network, isLegacy);
|
|
28
34
|
const data = yield viewContract.methods.getMarketData(marketAddress).call();
|
|
29
35
|
const hintHelperAddress = data.hintHelpers;
|
|
30
36
|
const troveNFTAddress = data.troveNFT;
|
|
@@ -35,6 +41,7 @@ const getLiquityV2MarketData = (web3, network, selectedMarket, mainnetWeb3) => _
|
|
|
35
41
|
const activePoolAddress = data.activePool;
|
|
36
42
|
const minCollRatio = new decimal_js_1.default(data.MCR).div(1e16).toString();
|
|
37
43
|
const criticalCollRatio = new decimal_js_1.default(data.CCR).div(1e18).toString();
|
|
44
|
+
const batchCollRatio = new decimal_js_1.default(data.BCR || '0').div(1e16).toString();
|
|
38
45
|
const totalMarketBorrow = (0, tokens_1.assetAmountInEth)(data.entireSystemDebt);
|
|
39
46
|
const totalMarketSupply = (0, tokens_1.assetAmountInEth)(data.entireSystemColl);
|
|
40
47
|
const collPrice = (0, tokens_1.assetAmountInEth)(data.collPrice);
|
|
@@ -76,6 +83,7 @@ const getLiquityV2MarketData = (web3, network, selectedMarket, mainnetWeb3) => _
|
|
|
76
83
|
minCollRatio,
|
|
77
84
|
totalCollRatio: new decimal_js_1.default(totalCollRatio).mul(100).toString(),
|
|
78
85
|
criticalCollRatio: new decimal_js_1.default(criticalCollRatio).mul(100).toString(),
|
|
86
|
+
batchCollRatio,
|
|
79
87
|
isUnderCollateralized: new decimal_js_1.default(totalCollRatio).lt(criticalCollRatio),
|
|
80
88
|
hintHelperAddress,
|
|
81
89
|
troveNFTAddress,
|
|
@@ -100,14 +108,17 @@ const getUserTroves = (viewContract, account, marketAddress, startIndex = 0, end
|
|
|
100
108
|
});
|
|
101
109
|
const TransferEventSig = '0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef';
|
|
102
110
|
const nftContractCreationBlockMapping = {
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
111
|
+
[types_1.LiquityV2Versions.LiquityV2Eth]: 22516079,
|
|
112
|
+
[types_1.LiquityV2Versions.LiquityV2WstEth]: 22516099,
|
|
113
|
+
[types_1.LiquityV2Versions.LiquityV2REth]: 22516118,
|
|
114
|
+
// legacy
|
|
115
|
+
[types_1.LiquityV2Versions.LiquityV2EthLegacy]: 21686215,
|
|
116
|
+
[types_1.LiquityV2Versions.LiquityV2WstEthLegacy]: 21686238,
|
|
117
|
+
[types_1.LiquityV2Versions.LiquityV2REthLegacy]: 21686257,
|
|
106
118
|
};
|
|
107
|
-
const getTransferredTroves = (web3, network, troveNFTAddress, limitBlocksForEventFetching,
|
|
119
|
+
const getTransferredTroves = (web3, network, troveNFTAddress, limitBlocksForEventFetching, market, account) => __awaiter(void 0, void 0, void 0, function* () {
|
|
108
120
|
const nftContract = (0, contracts_1.createContractWrapper)(web3, network, 'LiquityV2TroveNFT', troveNFTAddress);
|
|
109
|
-
|
|
110
|
-
const nftContractCreationBlock = nftContractCreationBlockMapping[collAsset];
|
|
121
|
+
const nftContractCreationBlock = nftContractCreationBlockMapping[market];
|
|
111
122
|
const currentBlock = yield web3.eth.getBlockNumber();
|
|
112
123
|
const events = yield nftContract.getPastEvents(TransferEventSig, {
|
|
113
124
|
filter: { to: account },
|
|
@@ -124,10 +135,10 @@ const getTransferredTroves = (web3, network, troveNFTAddress, limitBlocksForEven
|
|
|
124
135
|
return userTransferredTroves.filter((event) => !event.invalid).map((event) => ({ troveId: event.returnValues.tokenId }));
|
|
125
136
|
});
|
|
126
137
|
const getLiquityV2UserTroveIds = (web3, network, selectedMarket, troveNFTAddress, limitBlocksForEventFetching, account) => __awaiter(void 0, void 0, void 0, function* () {
|
|
127
|
-
const viewContract = (
|
|
138
|
+
const viewContract = getLiquityV2ViewContract(web3, network, selectedMarket.isLegacy);
|
|
128
139
|
const [{ troves: userTroves, nextFreeTroveIndex }, userTransferredTroves] = yield Promise.all([
|
|
129
140
|
getUserTroves(viewContract, account, selectedMarket.marketAddress),
|
|
130
|
-
getTransferredTroves(web3, network, troveNFTAddress, limitBlocksForEventFetching, selectedMarket.
|
|
141
|
+
getTransferredTroves(web3, network, troveNFTAddress, limitBlocksForEventFetching, selectedMarket.value, account),
|
|
131
142
|
]);
|
|
132
143
|
const troves = [...userTroves.map(({ troveId }) => ({ troveId })), ...userTransferredTroves];
|
|
133
144
|
const filteredTroves = troves.filter((value, index, self) => index === self.findIndex((t) => (t.troveId === value.troveId)));
|
|
@@ -163,7 +174,8 @@ const getUnbackedDebtForSingleMarket = (totalBorrowed, web3, network, stabilityP
|
|
|
163
174
|
const getAllMarketsUnbackedDebts = (markets, web3, network) => __awaiter(void 0, void 0, void 0, function* () {
|
|
164
175
|
const allMarketsUnbackedDebt = yield Promise.all(Object.entries(markets).map(([version, market]) => __awaiter(void 0, void 0, void 0, function* () {
|
|
165
176
|
const { assetsData, marketData } = market;
|
|
166
|
-
const
|
|
177
|
+
const { debtToken } = (0, markets_1.LiquityV2Markets)(network)[version];
|
|
178
|
+
const unbackedDebt = yield getUnbackedDebtForSingleMarket(assetsData[debtToken].totalBorrow, web3, network, marketData.stabilityPoolAddress);
|
|
167
179
|
return [version, unbackedDebt];
|
|
168
180
|
})));
|
|
169
181
|
return Object.fromEntries(allMarketsUnbackedDebt);
|
|
@@ -177,8 +189,9 @@ const calculateDebtInFrontLiquityV2 = (markets, selectedMarket, allMarketsUnback
|
|
|
177
189
|
if (version === selectedMarket)
|
|
178
190
|
return new decimal_js_1.default(interestRateDebtInFront);
|
|
179
191
|
const { assetsData } = market;
|
|
192
|
+
const { debtToken } = (0, markets_1.LiquityV2Markets)(common_1.NetworkNumber.Eth)[version];
|
|
180
193
|
const unbackedDebt = new decimal_js_1.default(allMarketsUnbackedDebts[version]);
|
|
181
|
-
const totalBorrow = new decimal_js_1.default(assetsData.
|
|
194
|
+
const totalBorrow = new decimal_js_1.default(assetsData[debtToken].totalBorrow);
|
|
182
195
|
const amountToReedem = new decimal_js_1.default(interestRateDebtInFront).mul(unbackedDebt).div(selectedMarketUnbackedDebt);
|
|
183
196
|
return decimal_js_1.default.min(amountToReedem, totalBorrow);
|
|
184
197
|
});
|
|
@@ -198,8 +211,8 @@ const getDebtInFrontForInterestRateLiquityV2 = (markets, selectedMarket, web3, n
|
|
|
198
211
|
});
|
|
199
212
|
exports.getDebtInFrontForInterestRateLiquityV2 = getDebtInFrontForInterestRateLiquityV2;
|
|
200
213
|
const getLiquityV2TroveData = (web3, network, { selectedMarket, assetsData, troveId, allMarketsData, }) => __awaiter(void 0, void 0, void 0, function* () {
|
|
201
|
-
const viewContract = (
|
|
202
|
-
const { minCollRatio } = allMarketsData[selectedMarket.value].marketData;
|
|
214
|
+
const viewContract = getLiquityV2ViewContract(web3, network, selectedMarket.isLegacy);
|
|
215
|
+
const { minCollRatio, batchCollRatio } = allMarketsData[selectedMarket.value].marketData;
|
|
203
216
|
const { collateralToken, marketAddress, debtToken } = selectedMarket;
|
|
204
217
|
const [_data, debtInFront] = yield Promise.all([
|
|
205
218
|
viewContract.methods.getTroveInfo(marketAddress, troveId).call(),
|
|
@@ -234,13 +247,16 @@ const getLiquityV2TroveData = (web3, network, { selectedMarket, assetsData, trov
|
|
|
234
247
|
const interestRate = new decimal_js_1.default(data.annualInterestRate).div(1e16).toString();
|
|
235
248
|
const interestBatchManager = data.interestBatchManager;
|
|
236
249
|
const lastInterestRateAdjTime = data.lastInterestRateAdjTime;
|
|
250
|
+
const hasInterestBatchManager = !(0, utils_1.compareAddresses)(interestBatchManager, constants_1.ZERO_ADDRESS);
|
|
251
|
+
const liqRatio = hasInterestBatchManager ? new decimal_js_1.default(minCollRatio).add(batchCollRatio).toString() : minCollRatio;
|
|
237
252
|
const payload = Object.assign(Object.assign({ usedAssets,
|
|
238
253
|
troveId,
|
|
239
254
|
interestRate,
|
|
240
255
|
interestBatchManager,
|
|
241
256
|
debtInFront,
|
|
242
|
-
lastInterestRateAdjTime,
|
|
243
|
-
|
|
257
|
+
lastInterestRateAdjTime,
|
|
258
|
+
liqRatio, troveStatus: types_1.LIQUITY_V2_TROVE_STATUS_ENUM[parseInt(data.status, 10)] }, (0, liquityV2Helpers_1.getLiquityV2AggregatedPositionData)({
|
|
259
|
+
usedAssets, assetsData, minCollRatio: liqRatio, interestRate,
|
|
244
260
|
})), { collRatio });
|
|
245
261
|
return payload;
|
|
246
262
|
});
|
|
@@ -3,9 +3,15 @@ import { LiquityV2MarketInfo } from '../../types/liquityV2';
|
|
|
3
3
|
export declare const LIQUITY_V2_ETH_MARKET: (networkId?: NetworkNumber) => LiquityV2MarketInfo;
|
|
4
4
|
export declare const LIQUITY_V2_WSTETH_MARKET: (networkId?: NetworkNumber) => LiquityV2MarketInfo;
|
|
5
5
|
export declare const LIQUITY_V2_RETH_MARKET: (networkId?: NetworkNumber) => LiquityV2MarketInfo;
|
|
6
|
+
export declare const LIQUITY_V2_ETH_LEGACY_MARKET: (networkId?: NetworkNumber) => LiquityV2MarketInfo;
|
|
7
|
+
export declare const LIQUITY_V2_WSTETH_LEGACY_MARKET: (networkId?: NetworkNumber) => LiquityV2MarketInfo;
|
|
8
|
+
export declare const LIQUITY_V2_RETH_LEGACY_MARKET: (networkId?: NetworkNumber) => LiquityV2MarketInfo;
|
|
6
9
|
export declare const LiquityV2Markets: (networkId: NetworkNumber) => {
|
|
7
10
|
readonly liquityv2eth: LiquityV2MarketInfo;
|
|
8
11
|
readonly liquityv2wsteth: LiquityV2MarketInfo;
|
|
9
12
|
readonly liquityv2reth: LiquityV2MarketInfo;
|
|
13
|
+
readonly liquityv2ethlegacy: LiquityV2MarketInfo;
|
|
14
|
+
readonly liquityv2wstethlegacy: LiquityV2MarketInfo;
|
|
15
|
+
readonly liquityv2rethlegacy: LiquityV2MarketInfo;
|
|
10
16
|
};
|
|
11
17
|
export declare const findLiquityV2MarketByAddress: (marketAddress: EthAddress) => LiquityV2MarketInfo | null;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.findLiquityV2MarketByAddress = exports.LiquityV2Markets = exports.LIQUITY_V2_RETH_MARKET = exports.LIQUITY_V2_WSTETH_MARKET = exports.LIQUITY_V2_ETH_MARKET = void 0;
|
|
3
|
+
exports.findLiquityV2MarketByAddress = exports.LiquityV2Markets = exports.LIQUITY_V2_RETH_LEGACY_MARKET = exports.LIQUITY_V2_WSTETH_LEGACY_MARKET = exports.LIQUITY_V2_ETH_LEGACY_MARKET = exports.LIQUITY_V2_RETH_MARKET = exports.LIQUITY_V2_WSTETH_MARKET = exports.LIQUITY_V2_ETH_MARKET = void 0;
|
|
4
4
|
const utils_1 = require("../../services/utils");
|
|
5
5
|
const common_1 = require("../../types/common");
|
|
6
6
|
const liquityV2_1 = require("../../types/liquityV2");
|
|
@@ -12,8 +12,9 @@ const LIQUITY_V2_ETH_MARKET = (networkId = common_1.NetworkNumber.Eth) => ({
|
|
|
12
12
|
url: 'eth',
|
|
13
13
|
debtToken: 'BOLD',
|
|
14
14
|
collateralToken: 'ETH',
|
|
15
|
-
marketAddress: '
|
|
15
|
+
marketAddress: '0x20f7c9ad66983f6523a0881d0f82406541417526',
|
|
16
16
|
protocolName: 'liquity-v2',
|
|
17
|
+
isLegacy: false,
|
|
17
18
|
});
|
|
18
19
|
exports.LIQUITY_V2_ETH_MARKET = LIQUITY_V2_ETH_MARKET;
|
|
19
20
|
const LIQUITY_V2_WSTETH_MARKET = (networkId = common_1.NetworkNumber.Eth) => ({
|
|
@@ -24,8 +25,9 @@ const LIQUITY_V2_WSTETH_MARKET = (networkId = common_1.NetworkNumber.Eth) => ({
|
|
|
24
25
|
url: 'wsteth',
|
|
25
26
|
debtToken: 'BOLD',
|
|
26
27
|
collateralToken: 'wstETH',
|
|
27
|
-
marketAddress: '
|
|
28
|
+
marketAddress: '0x8d733f7ea7c23cbea7c613b6ebd845d46d3aac54',
|
|
28
29
|
protocolName: 'liquity-v2',
|
|
30
|
+
isLegacy: false,
|
|
29
31
|
});
|
|
30
32
|
exports.LIQUITY_V2_WSTETH_MARKET = LIQUITY_V2_WSTETH_MARKET;
|
|
31
33
|
const LIQUITY_V2_RETH_MARKET = (networkId = common_1.NetworkNumber.Eth) => ({
|
|
@@ -36,14 +38,59 @@ const LIQUITY_V2_RETH_MARKET = (networkId = common_1.NetworkNumber.Eth) => ({
|
|
|
36
38
|
url: 'reth',
|
|
37
39
|
debtToken: 'BOLD',
|
|
38
40
|
collateralToken: 'rETH',
|
|
39
|
-
marketAddress: '
|
|
41
|
+
marketAddress: '0x6106046f031a22713697e04c08b330ddaf3e8789',
|
|
40
42
|
protocolName: 'liquity-v2',
|
|
43
|
+
isLegacy: false,
|
|
41
44
|
});
|
|
42
45
|
exports.LIQUITY_V2_RETH_MARKET = LIQUITY_V2_RETH_MARKET;
|
|
46
|
+
// Legacy markets
|
|
47
|
+
const LIQUITY_V2_ETH_LEGACY_MARKET = (networkId = common_1.NetworkNumber.Eth) => ({
|
|
48
|
+
chainIds: [common_1.NetworkNumber.Eth],
|
|
49
|
+
label: 'Liquity V2 ETH Legacy',
|
|
50
|
+
shortLabel: 'ETH Legacy',
|
|
51
|
+
value: liquityV2_1.LiquityV2Versions.LiquityV2EthLegacy,
|
|
52
|
+
url: 'eth-legacy',
|
|
53
|
+
debtToken: 'BOLD Legacy',
|
|
54
|
+
collateralToken: 'ETH',
|
|
55
|
+
marketAddress: '0x38e1f07b954cfab7239d7acab49997fbaad96476',
|
|
56
|
+
protocolName: 'liquity-v2',
|
|
57
|
+
isLegacy: true,
|
|
58
|
+
});
|
|
59
|
+
exports.LIQUITY_V2_ETH_LEGACY_MARKET = LIQUITY_V2_ETH_LEGACY_MARKET;
|
|
60
|
+
const LIQUITY_V2_WSTETH_LEGACY_MARKET = (networkId = common_1.NetworkNumber.Eth) => ({
|
|
61
|
+
chainIds: [common_1.NetworkNumber.Eth],
|
|
62
|
+
label: 'Liquity V2 wstETH Legacy',
|
|
63
|
+
shortLabel: 'wstETH Legacy',
|
|
64
|
+
value: liquityV2_1.LiquityV2Versions.LiquityV2WstEthLegacy,
|
|
65
|
+
url: 'wsteth-legacy',
|
|
66
|
+
debtToken: 'BOLD Legacy',
|
|
67
|
+
collateralToken: 'wstETH',
|
|
68
|
+
marketAddress: '0x2d4ef56cb626e9a4c90c156018ba9ce269573c61',
|
|
69
|
+
protocolName: 'liquity-v2',
|
|
70
|
+
isLegacy: true,
|
|
71
|
+
});
|
|
72
|
+
exports.LIQUITY_V2_WSTETH_LEGACY_MARKET = LIQUITY_V2_WSTETH_LEGACY_MARKET;
|
|
73
|
+
const LIQUITY_V2_RETH_LEGACY_MARKET = (networkId = common_1.NetworkNumber.Eth) => ({
|
|
74
|
+
chainIds: [common_1.NetworkNumber.Eth],
|
|
75
|
+
label: 'Liquity V2 rETH Legacy',
|
|
76
|
+
shortLabel: 'rETH Legacy',
|
|
77
|
+
value: liquityV2_1.LiquityV2Versions.LiquityV2REthLegacy,
|
|
78
|
+
url: 'reth-legacy',
|
|
79
|
+
debtToken: 'BOLD Legacy',
|
|
80
|
+
collateralToken: 'rETH',
|
|
81
|
+
marketAddress: '0x3b48169809dd827f22c9e0f2d71ff12ea7a94a2f',
|
|
82
|
+
protocolName: 'liquity-v2',
|
|
83
|
+
isLegacy: true,
|
|
84
|
+
});
|
|
85
|
+
exports.LIQUITY_V2_RETH_LEGACY_MARKET = LIQUITY_V2_RETH_LEGACY_MARKET;
|
|
43
86
|
const LiquityV2Markets = (networkId) => ({
|
|
44
87
|
[liquityV2_1.LiquityV2Versions.LiquityV2Eth]: (0, exports.LIQUITY_V2_ETH_MARKET)(networkId),
|
|
45
88
|
[liquityV2_1.LiquityV2Versions.LiquityV2WstEth]: (0, exports.LIQUITY_V2_WSTETH_MARKET)(networkId),
|
|
46
89
|
[liquityV2_1.LiquityV2Versions.LiquityV2REth]: (0, exports.LIQUITY_V2_RETH_MARKET)(networkId),
|
|
90
|
+
// Legacy
|
|
91
|
+
[liquityV2_1.LiquityV2Versions.LiquityV2EthLegacy]: (0, exports.LIQUITY_V2_ETH_LEGACY_MARKET)(networkId),
|
|
92
|
+
[liquityV2_1.LiquityV2Versions.LiquityV2WstEthLegacy]: (0, exports.LIQUITY_V2_WSTETH_LEGACY_MARKET)(networkId),
|
|
93
|
+
[liquityV2_1.LiquityV2Versions.LiquityV2REthLegacy]: (0, exports.LIQUITY_V2_RETH_LEGACY_MARKET)(networkId),
|
|
47
94
|
});
|
|
48
95
|
exports.LiquityV2Markets = LiquityV2Markets;
|
|
49
96
|
const findLiquityV2MarketByAddress = (marketAddress) => {
|