@defisaver/positions-sdk 0.0.16 → 0.0.17

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.
Files changed (83) hide show
  1. package/cjs/compoundV3/index.d.ts +1 -1
  2. package/cjs/compoundV3/index.js +3 -2
  3. package/cjs/config/contracts.d.ts +72 -184
  4. package/cjs/config/contracts.js +0 -16
  5. package/cjs/helpers/compoundHelpers/index.js +2 -2
  6. package/cjs/markets/curveUsd/index.d.ts +0 -2
  7. package/cjs/markets/curveUsd/index.js +1 -14
  8. package/cjs/types/compound.d.ts +1 -0
  9. package/cjs/types/contracts/generated/index.d.ts +0 -2
  10. package/cjs/types/curveUsd.d.ts +1 -2
  11. package/cjs/types/curveUsd.js +0 -1
  12. package/esm/compoundV3/index.d.ts +1 -1
  13. package/esm/compoundV3/index.js +3 -2
  14. package/esm/config/contracts.d.ts +72 -184
  15. package/esm/config/contracts.js +0 -16
  16. package/esm/helpers/compoundHelpers/index.js +2 -2
  17. package/esm/markets/curveUsd/index.d.ts +0 -2
  18. package/esm/markets/curveUsd/index.js +0 -12
  19. package/esm/types/compound.d.ts +1 -0
  20. package/esm/types/contracts/generated/index.d.ts +0 -2
  21. package/esm/types/curveUsd.d.ts +1 -2
  22. package/esm/types/curveUsd.js +0 -1
  23. package/package.json +40 -40
  24. package/src/aaveV2/index.ts +220 -220
  25. package/src/aaveV3/index.ts +556 -556
  26. package/src/assets/index.ts +60 -60
  27. package/src/chickenBonds/index.ts +123 -123
  28. package/src/compoundV2/index.ts +206 -206
  29. package/src/compoundV3/index.ts +273 -269
  30. package/src/config/contracts.js +651 -651
  31. package/src/constants/index.ts +3 -3
  32. package/src/contracts.ts +100 -100
  33. package/src/curveUsd/index.ts +228 -228
  34. package/src/exchange/index.ts +17 -17
  35. package/src/helpers/aaveHelpers/index.ts +134 -134
  36. package/src/helpers/chickenBondsHelpers/index.ts +23 -23
  37. package/src/helpers/compoundHelpers/index.ts +181 -181
  38. package/src/helpers/curveUsdHelpers/index.ts +32 -32
  39. package/src/helpers/index.ts +5 -5
  40. package/src/helpers/makerHelpers/index.ts +94 -94
  41. package/src/helpers/sparkHelpers/index.ts +106 -106
  42. package/src/index.ts +40 -40
  43. package/src/liquity/index.ts +103 -103
  44. package/src/maker/index.ts +101 -101
  45. package/src/markets/aave/index.ts +80 -80
  46. package/src/markets/aave/marketAssets.ts +32 -32
  47. package/src/markets/compound/index.ts +85 -85
  48. package/src/markets/compound/marketsAssets.ts +35 -35
  49. package/src/markets/curveUsd/index.ts +69 -69
  50. package/src/markets/index.ts +3 -3
  51. package/src/markets/spark/index.ts +29 -29
  52. package/src/markets/spark/marketAssets.ts +9 -9
  53. package/src/moneymarket/moneymarketCommonService.ts +75 -75
  54. package/src/morpho/markets.ts +39 -39
  55. package/src/morphoAaveV2/index.ts +254 -254
  56. package/src/morphoAaveV3/index.ts +617 -617
  57. package/src/multicall/index.ts +22 -22
  58. package/src/services/dsrService.ts +15 -15
  59. package/src/services/priceService.ts +21 -21
  60. package/src/services/utils.ts +34 -34
  61. package/src/spark/index.ts +413 -413
  62. package/src/staking/staking.ts +167 -167
  63. package/src/types/aave.ts +256 -256
  64. package/src/types/chickenBonds.ts +45 -45
  65. package/src/types/common.ts +83 -83
  66. package/src/types/compound.ts +122 -121
  67. package/src/types/contracts/generated/index.ts +0 -2
  68. package/src/types/curveUsd.ts +112 -112
  69. package/src/types/index.ts +6 -6
  70. package/src/types/liquity.ts +29 -29
  71. package/src/types/maker.ts +50 -50
  72. package/src/types/spark.ts +106 -106
  73. package/cjs/types/contracts/generated/CrvUSDsfrxETHAmm.d.ts +0 -139
  74. package/cjs/types/contracts/generated/CrvUSDsfrxETHAmm.js +0 -5
  75. package/cjs/types/contracts/generated/CrvUSDsfrxETHController.d.ts +0 -205
  76. package/cjs/types/contracts/generated/CrvUSDsfrxETHController.js +0 -5
  77. package/esm/types/contracts/generated/CrvUSDsfrxETHAmm.d.ts +0 -139
  78. package/esm/types/contracts/generated/CrvUSDsfrxETHAmm.js +0 -4
  79. package/esm/types/contracts/generated/CrvUSDsfrxETHController.d.ts +0 -205
  80. package/esm/types/contracts/generated/CrvUSDsfrxETHController.js +0 -4
  81. package/src/types/contracts/generated/CrvUSDsfrxETHAmm.ts +0 -286
  82. package/src/types/contracts/generated/CrvUSDsfrxETHController.ts +0 -403
  83. package/yarn-error.log +0 -64
@@ -456,14 +456,6 @@ module.exports = {
456
456
  }
457
457
  }
458
458
  },
459
- "crvUSDsfrxETHController": {
460
- "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": "payable", "type": "fallback" }, { "stateMutability": "view", "type": "function", "name": "factory", "inputs": [], "outputs": [{ "name": "", "type": "address" }] }, { "stateMutability": "view", "type": "function", "name": "amm", "inputs": [], "outputs": [{ "name": "", "type": "address" }] }, { "stateMutability": "view", "type": "function", "name": "collateral_token", "inputs": [], "outputs": [{ "name": "", "type": "address" }] }, { "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": "payable", "type": "function", "name": "create_loan", "inputs": [{ "name": "collateral", "type": "uint256" }, { "name": "debt", "type": "uint256" }, { "name": "N", "type": "uint256" }], "outputs": [] }, { "stateMutability": "payable", "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": "payable", "type": "function", "name": "add_collateral", "inputs": [{ "name": "collateral", "type": "uint256" }], "outputs": [] }, { "stateMutability": "payable", "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": "payable", "type": "function", "name": "borrow_more", "inputs": [{ "name": "collateral", "type": "uint256" }, { "name": "debt", "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": "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" }] }],
461
- "networks": {
462
- "1": {
463
- "address": "0xEC0820EfafC41D8943EE8dE495fC9Ba8495B15cf"
464
- }
465
- }
466
- },
467
459
  "crvUSDwstETHAmm": {
468
460
  "abi": [{ "name": "TokenExchange", "inputs": [{ "name": "buyer", "type": "address", "indexed": true }, { "name": "sold_id", "type": "uint256", "indexed": false }, { "name": "tokens_sold", "type": "uint256", "indexed": false }, { "name": "bought_id", "type": "uint256", "indexed": false }, { "name": "tokens_bought", "type": "uint256", "indexed": false }], "anonymous": false, "type": "event" }, { "name": "Deposit", "inputs": [{ "name": "provider", "type": "address", "indexed": true }, { "name": "amount", "type": "uint256", "indexed": false }, { "name": "n1", "type": "int256", "indexed": false }, { "name": "n2", "type": "int256", "indexed": false }], "anonymous": false, "type": "event" }, { "name": "Withdraw", "inputs": [{ "name": "provider", "type": "address", "indexed": true }, { "name": "amount_borrowed", "type": "uint256", "indexed": false }, { "name": "amount_collateral", "type": "uint256", "indexed": false }], "anonymous": false, "type": "event" }, { "name": "SetRate", "inputs": [{ "name": "rate", "type": "uint256", "indexed": false }, { "name": "rate_mul", "type": "uint256", "indexed": false }, { "name": "time", "type": "uint256", "indexed": false }], "anonymous": false, "type": "event" }, { "name": "SetFee", "inputs": [{ "name": "fee", "type": "uint256", "indexed": false }], "anonymous": false, "type": "event" }, { "name": "SetAdminFee", "inputs": [{ "name": "fee", "type": "uint256", "indexed": false }], "anonymous": false, "type": "event" }, { "stateMutability": "nonpayable", "type": "constructor", "inputs": [{ "name": "_borrowed_token", "type": "address" }, { "name": "_borrowed_precision", "type": "uint256" }, { "name": "_collateral_token", "type": "address" }, { "name": "_collateral_precision", "type": "uint256" }, { "name": "_A", "type": "uint256" }, { "name": "_sqrt_band_ratio", "type": "uint256" }, { "name": "_log_A_ratio", "type": "int256" }, { "name": "_base_price", "type": "uint256" }, { "name": "fee", "type": "uint256" }, { "name": "admin_fee", "type": "uint256" }, { "name": "_price_oracle_contract", "type": "address" }], "outputs": [] }, { "stateMutability": "nonpayable", "type": "function", "name": "set_admin", "inputs": [{ "name": "_admin", "type": "address" }], "outputs": [] }, { "stateMutability": "pure", "type": "function", "name": "coins", "inputs": [{ "name": "i", "type": "uint256" }], "outputs": [{ "name": "", "type": "address" }] }, { "stateMutability": "view", "type": "function", "name": "price_oracle", "inputs": [], "outputs": [{ "name": "", "type": "uint256" }] }, { "stateMutability": "view", "type": "function", "name": "dynamic_fee", "inputs": [], "outputs": [{ "name": "", "type": "uint256" }] }, { "stateMutability": "view", "type": "function", "name": "get_rate_mul", "inputs": [], "outputs": [{ "name": "", "type": "uint256" }] }, { "stateMutability": "view", "type": "function", "name": "get_base_price", "inputs": [], "outputs": [{ "name": "", "type": "uint256" }] }, { "stateMutability": "view", "type": "function", "name": "p_current_up", "inputs": [{ "name": "n", "type": "int256" }], "outputs": [{ "name": "", "type": "uint256" }] }, { "stateMutability": "view", "type": "function", "name": "p_current_down", "inputs": [{ "name": "n", "type": "int256" }], "outputs": [{ "name": "", "type": "uint256" }] }, { "stateMutability": "view", "type": "function", "name": "p_oracle_up", "inputs": [{ "name": "n", "type": "int256" }], "outputs": [{ "name": "", "type": "uint256" }] }, { "stateMutability": "view", "type": "function", "name": "p_oracle_down", "inputs": [{ "name": "n", "type": "int256" }], "outputs": [{ "name": "", "type": "uint256" }] }, { "stateMutability": "view", "type": "function", "name": "get_p", "inputs": [], "outputs": [{ "name": "", "type": "uint256" }] }, { "stateMutability": "view", "type": "function", "name": "read_user_tick_numbers", "inputs": [{ "name": "user", "type": "address" }], "outputs": [{ "name": "", "type": "int256[2]" }] }, { "stateMutability": "view", "type": "function", "name": "can_skip_bands", "inputs": [{ "name": "n_end", "type": "int256" }], "outputs": [{ "name": "", "type": "bool" }] }, { "stateMutability": "view", "type": "function", "name": "active_band_with_skip", "inputs": [], "outputs": [{ "name": "", "type": "int256" }] }, { "stateMutability": "view", "type": "function", "name": "has_liquidity", "inputs": [{ "name": "user", "type": "address" }], "outputs": [{ "name": "", "type": "bool" }] }, { "stateMutability": "nonpayable", "type": "function", "name": "deposit_range", "inputs": [{ "name": "user", "type": "address" }, { "name": "amount", "type": "uint256" }, { "name": "n1", "type": "int256" }, { "name": "n2", "type": "int256" }], "outputs": [] }, { "stateMutability": "nonpayable", "type": "function", "name": "withdraw", "inputs": [{ "name": "user", "type": "address" }, { "name": "frac", "type": "uint256" }], "outputs": [{ "name": "", "type": "uint256[2]" }] }, { "stateMutability": "view", "type": "function", "name": "get_dy", "inputs": [{ "name": "i", "type": "uint256" }, { "name": "j", "type": "uint256" }, { "name": "in_amount", "type": "uint256" }], "outputs": [{ "name": "", "type": "uint256" }] }, { "stateMutability": "view", "type": "function", "name": "get_dxdy", "inputs": [{ "name": "i", "type": "uint256" }, { "name": "j", "type": "uint256" }, { "name": "in_amount", "type": "uint256" }], "outputs": [{ "name": "", "type": "uint256" }, { "name": "", "type": "uint256" }] }, { "stateMutability": "view", "type": "function", "name": "get_dx", "inputs": [{ "name": "i", "type": "uint256" }, { "name": "j", "type": "uint256" }, { "name": "out_amount", "type": "uint256" }], "outputs": [{ "name": "", "type": "uint256" }] }, { "stateMutability": "view", "type": "function", "name": "get_dydx", "inputs": [{ "name": "i", "type": "uint256" }, { "name": "j", "type": "uint256" }, { "name": "out_amount", "type": "uint256" }], "outputs": [{ "name": "", "type": "uint256" }, { "name": "", "type": "uint256" }] }, { "stateMutability": "nonpayable", "type": "function", "name": "exchange", "inputs": [{ "name": "i", "type": "uint256" }, { "name": "j", "type": "uint256" }, { "name": "in_amount", "type": "uint256" }, { "name": "min_amount", "type": "uint256" }], "outputs": [{ "name": "", "type": "uint256[2]" }] }, { "stateMutability": "nonpayable", "type": "function", "name": "exchange", "inputs": [{ "name": "i", "type": "uint256" }, { "name": "j", "type": "uint256" }, { "name": "in_amount", "type": "uint256" }, { "name": "min_amount", "type": "uint256" }, { "name": "_for", "type": "address" }], "outputs": [{ "name": "", "type": "uint256[2]" }] }, { "stateMutability": "nonpayable", "type": "function", "name": "exchange_dy", "inputs": [{ "name": "i", "type": "uint256" }, { "name": "j", "type": "uint256" }, { "name": "out_amount", "type": "uint256" }, { "name": "max_amount", "type": "uint256" }], "outputs": [{ "name": "", "type": "uint256[2]" }] }, { "stateMutability": "nonpayable", "type": "function", "name": "exchange_dy", "inputs": [{ "name": "i", "type": "uint256" }, { "name": "j", "type": "uint256" }, { "name": "out_amount", "type": "uint256" }, { "name": "max_amount", "type": "uint256" }, { "name": "_for", "type": "address" }], "outputs": [{ "name": "", "type": "uint256[2]" }] }, { "stateMutability": "view", "type": "function", "name": "get_y_up", "inputs": [{ "name": "user", "type": "address" }], "outputs": [{ "name": "", "type": "uint256" }] }, { "stateMutability": "view", "type": "function", "name": "get_x_down", "inputs": [{ "name": "user", "type": "address" }], "outputs": [{ "name": "", "type": "uint256" }] }, { "stateMutability": "view", "type": "function", "name": "get_sum_xy", "inputs": [{ "name": "user", "type": "address" }], "outputs": [{ "name": "", "type": "uint256[2]" }] }, { "stateMutability": "view", "type": "function", "name": "get_xy", "inputs": [{ "name": "user", "type": "address" }], "outputs": [{ "name": "", "type": "uint256[][2]" }] }, { "stateMutability": "view", "type": "function", "name": "get_amount_for_price", "inputs": [{ "name": "p", "type": "uint256" }], "outputs": [{ "name": "", "type": "uint256" }, { "name": "", "type": "bool" }] }, { "stateMutability": "nonpayable", "type": "function", "name": "set_rate", "inputs": [{ "name": "rate", "type": "uint256" }], "outputs": [{ "name": "", "type": "uint256" }] }, { "stateMutability": "nonpayable", "type": "function", "name": "set_fee", "inputs": [{ "name": "fee", "type": "uint256" }], "outputs": [] }, { "stateMutability": "nonpayable", "type": "function", "name": "set_admin_fee", "inputs": [{ "name": "fee", "type": "uint256" }], "outputs": [] }, { "stateMutability": "nonpayable", "type": "function", "name": "reset_admin_fees", "inputs": [], "outputs": [] }, { "stateMutability": "nonpayable", "type": "function", "name": "set_callback", "inputs": [{ "name": "liquidity_mining_callback", "type": "address" }], "outputs": [] }, { "stateMutability": "view", "type": "function", "name": "admin", "inputs": [], "outputs": [{ "name": "", "type": "address" }] }, { "stateMutability": "view", "type": "function", "name": "A", "inputs": [], "outputs": [{ "name": "", "type": "uint256" }] }, { "stateMutability": "view", "type": "function", "name": "fee", "inputs": [], "outputs": [{ "name": "", "type": "uint256" }] }, { "stateMutability": "view", "type": "function", "name": "admin_fee", "inputs": [], "outputs": [{ "name": "", "type": "uint256" }] }, { "stateMutability": "view", "type": "function", "name": "rate", "inputs": [], "outputs": [{ "name": "", "type": "uint256" }] }, { "stateMutability": "view", "type": "function", "name": "active_band", "inputs": [], "outputs": [{ "name": "", "type": "int256" }] }, { "stateMutability": "view", "type": "function", "name": "min_band", "inputs": [], "outputs": [{ "name": "", "type": "int256" }] }, { "stateMutability": "view", "type": "function", "name": "max_band", "inputs": [], "outputs": [{ "name": "", "type": "int256" }] }, { "stateMutability": "view", "type": "function", "name": "admin_fees_x", "inputs": [], "outputs": [{ "name": "", "type": "uint256" }] }, { "stateMutability": "view", "type": "function", "name": "admin_fees_y", "inputs": [], "outputs": [{ "name": "", "type": "uint256" }] }, { "stateMutability": "view", "type": "function", "name": "price_oracle_contract", "inputs": [], "outputs": [{ "name": "", "type": "address" }] }, { "stateMutability": "view", "type": "function", "name": "bands_x", "inputs": [{ "name": "arg0", "type": "int256" }], "outputs": [{ "name": "", "type": "uint256" }] }, { "stateMutability": "view", "type": "function", "name": "bands_y", "inputs": [{ "name": "arg0", "type": "int256" }], "outputs": [{ "name": "", "type": "uint256" }] }, { "stateMutability": "view", "type": "function", "name": "liquidity_mining_callback", "inputs": [], "outputs": [{ "name": "", "type": "address" }] }],
469
461
  "networks": {
@@ -496,14 +488,6 @@ module.exports = {
496
488
  }
497
489
  }
498
490
  },
499
- "crvUSDsfrxETHAmm": {
500
- "abi": [{ "name": "TokenExchange", "inputs": [{ "name": "buyer", "type": "address", "indexed": true }, { "name": "sold_id", "type": "uint256", "indexed": false }, { "name": "tokens_sold", "type": "uint256", "indexed": false }, { "name": "bought_id", "type": "uint256", "indexed": false }, { "name": "tokens_bought", "type": "uint256", "indexed": false }], "anonymous": false, "type": "event" }, { "name": "Deposit", "inputs": [{ "name": "provider", "type": "address", "indexed": true }, { "name": "amount", "type": "uint256", "indexed": false }, { "name": "n1", "type": "int256", "indexed": false }, { "name": "n2", "type": "int256", "indexed": false }], "anonymous": false, "type": "event" }, { "name": "Withdraw", "inputs": [{ "name": "provider", "type": "address", "indexed": true }, { "name": "amount_borrowed", "type": "uint256", "indexed": false }, { "name": "amount_collateral", "type": "uint256", "indexed": false }], "anonymous": false, "type": "event" }, { "name": "SetRate", "inputs": [{ "name": "rate", "type": "uint256", "indexed": false }, { "name": "rate_mul", "type": "uint256", "indexed": false }, { "name": "time", "type": "uint256", "indexed": false }], "anonymous": false, "type": "event" }, { "name": "SetFee", "inputs": [{ "name": "fee", "type": "uint256", "indexed": false }], "anonymous": false, "type": "event" }, { "name": "SetAdminFee", "inputs": [{ "name": "fee", "type": "uint256", "indexed": false }], "anonymous": false, "type": "event" }, { "stateMutability": "nonpayable", "type": "constructor", "inputs": [{ "name": "_borrowed_token", "type": "address" }, { "name": "_borrowed_precision", "type": "uint256" }, { "name": "_collateral_token", "type": "address" }, { "name": "_collateral_precision", "type": "uint256" }, { "name": "_A", "type": "uint256" }, { "name": "_sqrt_band_ratio", "type": "uint256" }, { "name": "_log_A_ratio", "type": "int256" }, { "name": "_base_price", "type": "uint256" }, { "name": "fee", "type": "uint256" }, { "name": "admin_fee", "type": "uint256" }, { "name": "_price_oracle_contract", "type": "address" }], "outputs": [] }, { "stateMutability": "nonpayable", "type": "function", "name": "set_admin", "inputs": [{ "name": "_admin", "type": "address" }], "outputs": [] }, { "stateMutability": "pure", "type": "function", "name": "coins", "inputs": [{ "name": "i", "type": "uint256" }], "outputs": [{ "name": "", "type": "address" }] }, { "stateMutability": "view", "type": "function", "name": "price_oracle", "inputs": [], "outputs": [{ "name": "", "type": "uint256" }] }, { "stateMutability": "view", "type": "function", "name": "dynamic_fee", "inputs": [], "outputs": [{ "name": "", "type": "uint256" }] }, { "stateMutability": "view", "type": "function", "name": "get_rate_mul", "inputs": [], "outputs": [{ "name": "", "type": "uint256" }] }, { "stateMutability": "view", "type": "function", "name": "get_base_price", "inputs": [], "outputs": [{ "name": "", "type": "uint256" }] }, { "stateMutability": "view", "type": "function", "name": "p_current_up", "inputs": [{ "name": "n", "type": "int256" }], "outputs": [{ "name": "", "type": "uint256" }] }, { "stateMutability": "view", "type": "function", "name": "p_current_down", "inputs": [{ "name": "n", "type": "int256" }], "outputs": [{ "name": "", "type": "uint256" }] }, { "stateMutability": "view", "type": "function", "name": "p_oracle_up", "inputs": [{ "name": "n", "type": "int256" }], "outputs": [{ "name": "", "type": "uint256" }] }, { "stateMutability": "view", "type": "function", "name": "p_oracle_down", "inputs": [{ "name": "n", "type": "int256" }], "outputs": [{ "name": "", "type": "uint256" }] }, { "stateMutability": "view", "type": "function", "name": "get_p", "inputs": [], "outputs": [{ "name": "", "type": "uint256" }] }, { "stateMutability": "view", "type": "function", "name": "read_user_tick_numbers", "inputs": [{ "name": "user", "type": "address" }], "outputs": [{ "name": "", "type": "int256[2]" }] }, { "stateMutability": "view", "type": "function", "name": "can_skip_bands", "inputs": [{ "name": "n_end", "type": "int256" }], "outputs": [{ "name": "", "type": "bool" }] }, { "stateMutability": "view", "type": "function", "name": "active_band_with_skip", "inputs": [], "outputs": [{ "name": "", "type": "int256" }] }, { "stateMutability": "view", "type": "function", "name": "has_liquidity", "inputs": [{ "name": "user", "type": "address" }], "outputs": [{ "name": "", "type": "bool" }] }, { "stateMutability": "nonpayable", "type": "function", "name": "deposit_range", "inputs": [{ "name": "user", "type": "address" }, { "name": "amount", "type": "uint256" }, { "name": "n1", "type": "int256" }, { "name": "n2", "type": "int256" }], "outputs": [] }, { "stateMutability": "nonpayable", "type": "function", "name": "withdraw", "inputs": [{ "name": "user", "type": "address" }, { "name": "frac", "type": "uint256" }], "outputs": [{ "name": "", "type": "uint256[2]" }] }, { "stateMutability": "view", "type": "function", "name": "get_dy", "inputs": [{ "name": "i", "type": "uint256" }, { "name": "j", "type": "uint256" }, { "name": "in_amount", "type": "uint256" }], "outputs": [{ "name": "", "type": "uint256" }] }, { "stateMutability": "view", "type": "function", "name": "get_dxdy", "inputs": [{ "name": "i", "type": "uint256" }, { "name": "j", "type": "uint256" }, { "name": "in_amount", "type": "uint256" }], "outputs": [{ "name": "", "type": "uint256" }, { "name": "", "type": "uint256" }] }, { "stateMutability": "view", "type": "function", "name": "get_dx", "inputs": [{ "name": "i", "type": "uint256" }, { "name": "j", "type": "uint256" }, { "name": "out_amount", "type": "uint256" }], "outputs": [{ "name": "", "type": "uint256" }] }, { "stateMutability": "view", "type": "function", "name": "get_dydx", "inputs": [{ "name": "i", "type": "uint256" }, { "name": "j", "type": "uint256" }, { "name": "out_amount", "type": "uint256" }], "outputs": [{ "name": "", "type": "uint256" }, { "name": "", "type": "uint256" }] }, { "stateMutability": "nonpayable", "type": "function", "name": "exchange", "inputs": [{ "name": "i", "type": "uint256" }, { "name": "j", "type": "uint256" }, { "name": "in_amount", "type": "uint256" }, { "name": "min_amount", "type": "uint256" }], "outputs": [{ "name": "", "type": "uint256[2]" }] }, { "stateMutability": "nonpayable", "type": "function", "name": "exchange", "inputs": [{ "name": "i", "type": "uint256" }, { "name": "j", "type": "uint256" }, { "name": "in_amount", "type": "uint256" }, { "name": "min_amount", "type": "uint256" }, { "name": "_for", "type": "address" }], "outputs": [{ "name": "", "type": "uint256[2]" }] }, { "stateMutability": "nonpayable", "type": "function", "name": "exchange_dy", "inputs": [{ "name": "i", "type": "uint256" }, { "name": "j", "type": "uint256" }, { "name": "out_amount", "type": "uint256" }, { "name": "max_amount", "type": "uint256" }], "outputs": [{ "name": "", "type": "uint256[2]" }] }, { "stateMutability": "nonpayable", "type": "function", "name": "exchange_dy", "inputs": [{ "name": "i", "type": "uint256" }, { "name": "j", "type": "uint256" }, { "name": "out_amount", "type": "uint256" }, { "name": "max_amount", "type": "uint256" }, { "name": "_for", "type": "address" }], "outputs": [{ "name": "", "type": "uint256[2]" }] }, { "stateMutability": "view", "type": "function", "name": "get_y_up", "inputs": [{ "name": "user", "type": "address" }], "outputs": [{ "name": "", "type": "uint256" }] }, { "stateMutability": "view", "type": "function", "name": "get_x_down", "inputs": [{ "name": "user", "type": "address" }], "outputs": [{ "name": "", "type": "uint256" }] }, { "stateMutability": "view", "type": "function", "name": "get_sum_xy", "inputs": [{ "name": "user", "type": "address" }], "outputs": [{ "name": "", "type": "uint256[2]" }] }, { "stateMutability": "view", "type": "function", "name": "get_xy", "inputs": [{ "name": "user", "type": "address" }], "outputs": [{ "name": "", "type": "uint256[][2]" }] }, { "stateMutability": "view", "type": "function", "name": "get_amount_for_price", "inputs": [{ "name": "p", "type": "uint256" }], "outputs": [{ "name": "", "type": "uint256" }, { "name": "", "type": "bool" }] }, { "stateMutability": "nonpayable", "type": "function", "name": "set_rate", "inputs": [{ "name": "rate", "type": "uint256" }], "outputs": [{ "name": "", "type": "uint256" }] }, { "stateMutability": "nonpayable", "type": "function", "name": "set_fee", "inputs": [{ "name": "fee", "type": "uint256" }], "outputs": [] }, { "stateMutability": "nonpayable", "type": "function", "name": "set_admin_fee", "inputs": [{ "name": "fee", "type": "uint256" }], "outputs": [] }, { "stateMutability": "nonpayable", "type": "function", "name": "reset_admin_fees", "inputs": [], "outputs": [] }, { "stateMutability": "nonpayable", "type": "function", "name": "set_callback", "inputs": [{ "name": "liquidity_mining_callback", "type": "address" }], "outputs": [] }, { "stateMutability": "view", "type": "function", "name": "admin", "inputs": [], "outputs": [{ "name": "", "type": "address" }] }, { "stateMutability": "view", "type": "function", "name": "A", "inputs": [], "outputs": [{ "name": "", "type": "uint256" }] }, { "stateMutability": "view", "type": "function", "name": "fee", "inputs": [], "outputs": [{ "name": "", "type": "uint256" }] }, { "stateMutability": "view", "type": "function", "name": "admin_fee", "inputs": [], "outputs": [{ "name": "", "type": "uint256" }] }, { "stateMutability": "view", "type": "function", "name": "rate", "inputs": [], "outputs": [{ "name": "", "type": "uint256" }] }, { "stateMutability": "view", "type": "function", "name": "active_band", "inputs": [], "outputs": [{ "name": "", "type": "int256" }] }, { "stateMutability": "view", "type": "function", "name": "min_band", "inputs": [], "outputs": [{ "name": "", "type": "int256" }] }, { "stateMutability": "view", "type": "function", "name": "max_band", "inputs": [], "outputs": [{ "name": "", "type": "int256" }] }, { "stateMutability": "view", "type": "function", "name": "admin_fees_x", "inputs": [], "outputs": [{ "name": "", "type": "uint256" }] }, { "stateMutability": "view", "type": "function", "name": "admin_fees_y", "inputs": [], "outputs": [{ "name": "", "type": "uint256" }] }, { "stateMutability": "view", "type": "function", "name": "price_oracle_contract", "inputs": [], "outputs": [{ "name": "", "type": "address" }] }, { "stateMutability": "view", "type": "function", "name": "bands_x", "inputs": [{ "name": "arg0", "type": "int256" }], "outputs": [{ "name": "", "type": "uint256" }] }, { "stateMutability": "view", "type": "function", "name": "bands_y", "inputs": [{ "name": "arg0", "type": "int256" }], "outputs": [{ "name": "", "type": "uint256" }] }, { "stateMutability": "view", "type": "function", "name": "liquidity_mining_callback", "inputs": [], "outputs": [{ "name": "", "type": "address" }] }],
501
- "networks": {
502
- "1": {
503
- "address": "0xfA96ad0a9E64261dB86950e2dA362f5572c5c6fd"
504
- }
505
- }
506
- },
507
491
  "crvUSDView": {
508
492
  "abi": [{ "inputs": [{ "internalType": "address", "name": "market", "type": "address" }, { "internalType": "uint256", "name": "collateral", "type": "uint256" }, { "internalType": "uint256", "name": "debt", "type": "uint256" }, { "internalType": "uint256", "name": "N", "type": "uint256" }], "name": "createLoanData", "outputs": [{ "components": [{ "internalType": "int256", "name": "health", "type": "int256" }, { "internalType": "uint256", "name": "minColl", "type": "uint256" }, { "internalType": "uint256", "name": "maxBorrow", "type": "uint256" }, { "components": [{ "internalType": "int256", "name": "id", "type": "int256" }, { "internalType": "uint256", "name": "lowPrice", "type": "uint256" }, { "internalType": "uint256", "name": "highPrice", "type": "uint256" }, { "internalType": "uint256", "name": "collAmount", "type": "uint256" }, { "internalType": "uint256", "name": "debtAmount", "type": "uint256" }], "internalType": "struct CurveUsdView.Band[]", "name": "bands", "type": "tuple[]" }], "internalType": "struct CurveUsdView.CreateLoanData", "name": "", "type": "tuple" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "market", "type": "address" }, { "internalType": "int256", "name": "n", "type": "int256" }], "name": "getBandData", "outputs": [{ "components": [{ "internalType": "int256", "name": "id", "type": "int256" }, { "internalType": "uint256", "name": "lowPrice", "type": "uint256" }, { "internalType": "uint256", "name": "highPrice", "type": "uint256" }, { "internalType": "uint256", "name": "collAmount", "type": "uint256" }, { "internalType": "uint256", "name": "debtAmount", "type": "uint256" }], "internalType": "struct CurveUsdView.Band", "name": "", "type": "tuple" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "market", "type": "address" }, { "internalType": "uint256", "name": "collateral", "type": "uint256" }, { "internalType": "uint256", "name": "debt", "type": "uint256" }, { "internalType": "uint256", "name": "N", "type": "uint256" }], "name": "getBandsData", "outputs": [{ "components": [{ "internalType": "int256", "name": "id", "type": "int256" }, { "internalType": "uint256", "name": "lowPrice", "type": "uint256" }, { "internalType": "uint256", "name": "highPrice", "type": "uint256" }, { "internalType": "uint256", "name": "collAmount", "type": "uint256" }, { "internalType": "uint256", "name": "debtAmount", "type": "uint256" }], "internalType": "struct CurveUsdView.Band[]", "name": "bands", "type": "tuple[]" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "market", "type": "address" }, { "internalType": "int256", "name": "from", "type": "int256" }, { "internalType": "int256", "name": "to", "type": "int256" }], "name": "getBandsData", "outputs": [{ "components": [{ "internalType": "int256", "name": "id", "type": "int256" }, { "internalType": "uint256", "name": "lowPrice", "type": "uint256" }, { "internalType": "uint256", "name": "highPrice", "type": "uint256" }, { "internalType": "uint256", "name": "collAmount", "type": "uint256" }, { "internalType": "uint256", "name": "debtAmount", "type": "uint256" }], "internalType": "struct CurveUsdView.Band[]", "name": "", "type": "tuple[]" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "market", "type": "address" }], "name": "globalData", "outputs": [{ "components": [{ "internalType": "address", "name": "collateral", "type": "address" }, { "internalType": "uint256", "name": "decimals", "type": "uint256" }, { "internalType": "int256", "name": "activeBand", "type": "int256" }, { "internalType": "uint256", "name": "A", "type": "uint256" }, { "internalType": "uint256", "name": "totalDebt", "type": "uint256" }, { "internalType": "uint256", "name": "ammPrice", "type": "uint256" }, { "internalType": "uint256", "name": "basePrice", "type": "uint256" }, { "internalType": "uint256", "name": "oraclePrice", "type": "uint256" }, { "internalType": "uint256", "name": "minted", "type": "uint256" }, { "internalType": "uint256", "name": "redeemed", "type": "uint256" }, { "internalType": "uint256", "name": "monetaryPolicyRate", "type": "uint256" }, { "internalType": "uint256", "name": "ammRate", "type": "uint256" }, { "internalType": "int256", "name": "minBand", "type": "int256" }, { "internalType": "int256", "name": "maxBand", "type": "int256" }], "internalType": "struct CurveUsdView.GlobalData", "name": "", "type": "tuple" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "market", "type": "address" }, { "internalType": "address", "name": "user", "type": "address" }, { "internalType": "int256", "name": "collChange", "type": "int256" }, { "internalType": "int256", "name": "debtChange", "type": "int256" }, { "internalType": "bool", "name": "isFull", "type": "bool" }, { "internalType": "uint256", "name": "numBands", "type": "uint256" }], "name": "healthCalculator", "outputs": [{ "internalType": "int256", "name": "", "type": "int256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "market", "type": "address" }, { "internalType": "uint256", "name": "collateral", "type": "uint256" }, { "internalType": "uint256", "name": "N", "type": "uint256" }], "name": "maxBorrow", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "market", "type": "address" }, { "internalType": "uint256", "name": "debt", "type": "uint256" }, { "internalType": "uint256", "name": "N", "type": "uint256" }], "name": "minCollateral", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "market", "type": "address" }, { "internalType": "address", "name": "user", "type": "address" }], "name": "userData", "outputs": [{ "components": [{ "internalType": "bool", "name": "loanExists", "type": "bool" }, { "internalType": "uint256", "name": "collateralPrice", "type": "uint256" }, { "internalType": "uint256", "name": "marketCollateralAmount", "type": "uint256" }, { "internalType": "uint256", "name": "curveUsdCollateralAmount", "type": "uint256" }, { "internalType": "uint256", "name": "debtAmount", "type": "uint256" }, { "internalType": "uint256", "name": "N", "type": "uint256" }, { "internalType": "uint256", "name": "priceLow", "type": "uint256" }, { "internalType": "uint256", "name": "priceHigh", "type": "uint256" }, { "internalType": "uint256", "name": "liquidationDiscount", "type": "uint256" }, { "internalType": "int256", "name": "health", "type": "int256" }, { "internalType": "int256[2]", "name": "bandRange", "type": "int256[2]" }, { "internalType": "uint256[][2]", "name": "usersBands", "type": "uint256[][2]" }], "internalType": "struct CurveUsdView.UserData", "name": "", "type": "tuple" }], "stateMutability": "view", "type": "function" }],
509
493
  "networks": {
@@ -34,8 +34,8 @@ export const formatBaseData = (data, network, baseAssetPrice) => {
34
34
  totalBorrow, marketLiquidity: new Dec(totalSupply).minus(totalBorrow).toString(), symbol: wethToEth(assetInfo.symbol), priceInBaseAsset: getEthAmountForDecimals(data.price, 8), price: baseAssetPrice, collateralFactor: '0', liquidationRatio: '0', canBeBorrowed: true, canBeSupplied: true, supplyCap: '0', rewardSupplySpeed: getEthAmountForDecimals(data.baseTrackingSupplyRewardsSpeed, 15), rewardBorrowSpeed: getEthAmountForDecimals(data.baseTrackingBorrowRewardsSpeed, 15), minDebt: getEthAmountForDecimals(data.baseBorrowMin, assetInfo.decimals), isBase: true }));
35
35
  };
36
36
  export const getIncentiveApys = (baseData, compPrice) => {
37
- const incentiveSupplyApy = aprToApy((100 * SECONDS_PER_YEAR * +baseData.rewardSupplySpeed * +compPrice) / +baseData.price / +baseData.totalSupply).toString();
38
- const incentiveBorrowApy = aprToApy((100 * SECONDS_PER_YEAR * +baseData.rewardBorrowSpeed * +compPrice) / +baseData.price / +baseData.totalBorrow).toString();
37
+ const incentiveSupplyApy = aprToApy((100 * SECONDS_PER_YEAR * +baseData.rewardSupplySpeed * +compPrice) / +baseData.priceInBaseAsset / +baseData.totalSupply).toString();
38
+ const incentiveBorrowApy = aprToApy((100 * SECONDS_PER_YEAR * +baseData.rewardBorrowSpeed * +compPrice) / +baseData.priceInBaseAsset / +baseData.totalBorrow).toString();
39
39
  return {
40
40
  incentiveSupplyApy,
41
41
  incentiveBorrowApy,
@@ -4,11 +4,9 @@ export declare const CRVUSD_WSTETH_MARKET: (networkId: NetworkNumber) => CrvUSDM
4
4
  export declare const CRVUSD_ETH_MARKET: (networkId: NetworkNumber) => CrvUSDMarketData;
5
5
  export declare const CRVUSD_WBTC_MARKET: (networkId: NetworkNumber) => CrvUSDMarketData;
6
6
  export declare const CRVUSD_TBTC_MARKET: (networkId: NetworkNumber) => CrvUSDMarketData;
7
- export declare const CRVUSD_SFRXETH_MARKET: (networkId: NetworkNumber) => CrvUSDMarketData;
8
7
  export declare const CrvUsdMarkets: (networkId: NetworkNumber) => {
9
8
  readonly wstETH: CrvUSDMarketData;
10
9
  readonly ETH: CrvUSDMarketData;
11
10
  readonly WBTC: CrvUSDMarketData;
12
11
  readonly tBTC: CrvUSDMarketData;
13
- readonly sfrxETH: CrvUSDMarketData;
14
12
  };
@@ -44,21 +44,9 @@ export const CRVUSD_TBTC_MARKET = (networkId) => ({
44
44
  ammAddress: getConfigContractAddress('crvUSDtBTCAmm', networkId),
45
45
  createCollAssets: ['tBTC'],
46
46
  });
47
- export const CRVUSD_SFRXETH_MARKET = (networkId) => ({
48
- chainIds: [1],
49
- label: 'sfrxETH',
50
- shortLabel: 'sfrxETH',
51
- value: CrvUSDVersions.sfrxETH,
52
- collAsset: 'sfrxETH',
53
- baseAsset: 'crvUSD',
54
- controllerAddress: getConfigContractAddress('crvUSDsfrxETHController', networkId),
55
- ammAddress: getConfigContractAddress('crvUSDsfrxETHAmm', networkId),
56
- createCollAssets: ['sfrxETH'],
57
- });
58
47
  export const CrvUsdMarkets = (networkId) => ({
59
48
  [CrvUSDVersions.wstETH]: CRVUSD_WSTETH_MARKET(networkId),
60
49
  [CrvUSDVersions.ETH]: CRVUSD_ETH_MARKET(networkId),
61
50
  [CrvUSDVersions.WBTC]: CRVUSD_WBTC_MARKET(networkId),
62
51
  [CrvUSDVersions.tBTC]: CRVUSD_TBTC_MARKET(networkId),
63
- [CrvUSDVersions.sfrxETH]: CRVUSD_SFRXETH_MARKET(networkId),
64
52
  });
@@ -49,6 +49,7 @@ export interface CompoundV3AssetData extends CompoundAssetData {
49
49
  minDebt: string;
50
50
  liquidationRatio: string;
51
51
  supplyCap: string;
52
+ priceInBaseAsset: string;
52
53
  }
53
54
  export interface CompoundAssetsData<T> {
54
55
  [token: string]: T;
@@ -56,8 +56,6 @@ export type { CrvUSDFactory } from "./CrvUSDFactory";
56
56
  export type { CrvUSDView } from "./CrvUSDView";
57
57
  export type { CrvUSDWBTCAmm } from "./CrvUSDWBTCAmm";
58
58
  export type { CrvUSDWBTCController } from "./CrvUSDWBTCController";
59
- export type { CrvUSDsfrxETHAmm } from "./CrvUSDsfrxETHAmm";
60
- export type { CrvUSDsfrxETHController } from "./CrvUSDsfrxETHController";
61
59
  export type { CrvUSDtBTCAmm } from "./CrvUSDtBTCAmm";
62
60
  export type { CrvUSDtBTCController } from "./CrvUSDtBTCController";
63
61
  export type { CrvUSDwstETHAmm } from "./CrvUSDwstETHAmm";
@@ -3,8 +3,7 @@ export declare enum CrvUSDVersions {
3
3
  'wstETH' = "wstETH",
4
4
  'WBTC' = "WBTC",
5
5
  'ETH' = "ETH",
6
- 'tBTC' = "tBTC",
7
- 'sfrxETH' = "sfrxETH"
6
+ 'tBTC' = "tBTC"
8
7
  }
9
8
  export declare enum CrvUSDStatus {
10
9
  Nonexistant = "Nonexistant",
@@ -4,7 +4,6 @@ export var CrvUSDVersions;
4
4
  CrvUSDVersions["WBTC"] = "WBTC";
5
5
  CrvUSDVersions["ETH"] = "ETH";
6
6
  CrvUSDVersions["tBTC"] = "tBTC";
7
- CrvUSDVersions["sfrxETH"] = "sfrxETH";
8
7
  })(CrvUSDVersions || (CrvUSDVersions = {}));
9
8
  export var CrvUSDStatus;
10
9
  (function (CrvUSDStatus) {
package/package.json CHANGED
@@ -1,40 +1,40 @@
1
- {
2
- "name": "@defisaver/positions-sdk",
3
- "version": "0.0.16",
4
- "description": "",
5
- "main": "./cjs/index.js",
6
- "module": "./esm/index.js",
7
- "types": "./esm/index.d.ts",
8
- "scripts": {
9
- "build:esm": "rm -rf esm && tsc -p tsconfig.json",
10
- "build:cjs": "rm -rf cjs && tsc -p tsconfig.cjs.json",
11
- "build": "npm run generate-contracts && npm run build:cjs && npm run build:esm",
12
- "dev": "npm run generate-contracts && tsc -p tsconfig.cjs.json --watch",
13
- "lint": "eslint src/ --fix",
14
- "generate-contracts": "node scripts/generateContracts.js",
15
- "test": "mocha tests/*",
16
- "build-test": "npm run build && mocha tests/*"
17
- },
18
- "keywords": [],
19
- "author": "",
20
- "license": "ISC",
21
- "dependencies": {
22
- "@defisaver/tokens": "^1.5.3",
23
- "decimal.js": "^10.4.3",
24
- "@morpho-org/morpho-aave-v3-sdk": "^1.5.3",
25
- "@ethersproject/bignumber": "^5.7.0"
26
- },
27
- "devDependencies": {
28
- "@defisaver/eslint-config": "^1.0.1",
29
- "chai": "^4.3.8",
30
- "dotenv": "^16.3.1",
31
- "eslint": "^8.49.0",
32
- "mocha": "^10.2.0",
33
- "typechain": "^8.3.1",
34
- "typechain-target-web3-v1-3mihai3": "^6.0.2",
35
- "typescript": "^5.2.2"
36
- },
37
- "peerDependencies": {
38
- "web3": "^1.10.2"
39
- }
40
- }
1
+ {
2
+ "name": "@defisaver/positions-sdk",
3
+ "version": "0.0.17",
4
+ "description": "",
5
+ "main": "./cjs/index.js",
6
+ "module": "./esm/index.js",
7
+ "types": "./esm/index.d.ts",
8
+ "scripts": {
9
+ "build:esm": "rm -rf esm && tsc -p tsconfig.json",
10
+ "build:cjs": "rm -rf cjs && tsc -p tsconfig.cjs.json",
11
+ "build": "npm run generate-contracts && npm run build:cjs && npm run build:esm",
12
+ "dev": "npm run generate-contracts && tsc -p tsconfig.cjs.json --watch",
13
+ "lint": "eslint src/ --fix",
14
+ "generate-contracts": "node scripts/generateContracts.js",
15
+ "test": "mocha tests/*",
16
+ "build-test": "npm run build && mocha tests/*"
17
+ },
18
+ "keywords": [],
19
+ "author": "",
20
+ "license": "ISC",
21
+ "dependencies": {
22
+ "@defisaver/tokens": "^1.5.3",
23
+ "decimal.js": "^10.4.3",
24
+ "@morpho-org/morpho-aave-v3-sdk": "^1.5.3",
25
+ "@ethersproject/bignumber": "^5.7.0"
26
+ },
27
+ "devDependencies": {
28
+ "@defisaver/eslint-config": "^1.0.1",
29
+ "chai": "^4.3.8",
30
+ "dotenv": "^16.3.1",
31
+ "eslint": "^8.49.0",
32
+ "mocha": "^10.2.0",
33
+ "typechain": "^8.3.1",
34
+ "typechain-target-web3-v1-3mihai3": "^6.0.2",
35
+ "typescript": "^5.2.2"
36
+ },
37
+ "peerDependencies": {
38
+ "web3": "^1.10.2"
39
+ }
40
+ }