Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: update callback addresses for production use #29

Merged
merged 3 commits into from
Nov 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/hot-pillows-crash.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@protocolink/logics': patch
---

feat: update callback addresses for production use
7 changes: 7 additions & 0 deletions .changeset/nine-spies-bake.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
'@protocolink/logics': patch
---

Updated dependencies
- @protocolink/common@0.3.4
- @protocolink/core@0.4.3
5 changes: 5 additions & 0 deletions .changeset/twelve-cobras-remember.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@protocolink/logics': patch
---

fix: remove AAVE V2 stable rate tests
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@
},
"dependencies": {
"@paraswap/sdk": "^6.2.2",
"@protocolink/common": "^0.3.3",
"@protocolink/core": "^0.4.2",
"@protocolink/common": "^0.3.4",
"@protocolink/core": "^0.4.3",
"@types/lodash": "^4.14.195",
"@uniswap/sdk-core": "^3.2.6",
"@uniswap/token-lists": "^1.0.0-beta.31",
Expand Down
6 changes: 3 additions & 3 deletions src/logics/aave-v2/configs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,21 @@ export const configs: Config[] = [
chainId: common.ChainId.mainnet,
contract: {
ProtocolDataProvider: '0x057835Ad21a177dbdd3090bB1CAE03EaCF78Fc6d',
AaveV2FlashLoanCallback: '0x27BfAC5fb25C3853C2F48cF0e5B2F89Ea03C0104',
AaveV2FlashLoanCallback: '0x727c55092C7196d65594A8e4F39ae8dC0cB39173',
},
},
{
chainId: common.ChainId.polygon,
contract: {
ProtocolDataProvider: '0x7551b5D2763519d4e37e8B81929D336De671d46d',
AaveV2FlashLoanCallback: '0x27BfAC5fb25C3853C2F48cF0e5B2F89Ea03C0104',
AaveV2FlashLoanCallback: '0x727c55092C7196d65594A8e4F39ae8dC0cB39173',
},
},
{
chainId: common.ChainId.avalanche,
contract: {
ProtocolDataProvider: '0x65285E9dfab318f57051ab2b139ccCf232945451',
AaveV2FlashLoanCallback: '0x27BfAC5fb25C3853C2F48cF0e5B2F89Ea03C0104',
AaveV2FlashLoanCallback: '0x727c55092C7196d65594A8e4F39ae8dC0cB39173',
},
},
];
Expand Down
14 changes: 7 additions & 7 deletions src/logics/aave-v3/configs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,49 +12,49 @@ export const configs: Config[] = [
chainId: common.ChainId.mainnet,
contract: {
PoolDataProvider: '0x7B4EB56E7CD4b454BA8ff71E4518426369a138a3',
AaveV3FlashLoanCallback: '0x6ea614B4C520c8abC9B0F50803Bef964D4DA81EB',
AaveV3FlashLoanCallback: '0x6f81cf774052D03873b32944a036BF0647bFB5bF',
},
},
{
chainId: common.ChainId.optimism,
contract: {
PoolDataProvider: '0xd9Ca4878dd38B021583c1B669905592EAe76E044',
AaveV3FlashLoanCallback: '0x6ea614B4C520c8abC9B0F50803Bef964D4DA81EB',
AaveV3FlashLoanCallback: '0x6f81cf774052D03873b32944a036BF0647bFB5bF',
},
},
{
chainId: common.ChainId.polygon,
contract: {
PoolDataProvider: '0x9441B65EE553F70df9C77d45d3283B6BC24F222d',
AaveV3FlashLoanCallback: '0x6ea614B4C520c8abC9B0F50803Bef964D4DA81EB',
AaveV3FlashLoanCallback: '0x6f81cf774052D03873b32944a036BF0647bFB5bF',
},
},
{
chainId: common.ChainId.metis,
contract: {
PoolDataProvider: '0x99411FC17Ad1B56f49719E3850B2CDcc0f9bBFd8',
AaveV3FlashLoanCallback: '0x6ea614B4C520c8abC9B0F50803Bef964D4DA81EB',
AaveV3FlashLoanCallback: '0x6f81cf774052D03873b32944a036BF0647bFB5bF',
},
},
{
chainId: common.ChainId.base,
contract: {
PoolDataProvider: '0x2d8A3C5677189723C4cB8873CfC9C8976FDF38Ac',
AaveV3FlashLoanCallback: '0x6ea614B4C520c8abC9B0F50803Bef964D4DA81EB',
AaveV3FlashLoanCallback: '0x6f81cf774052D03873b32944a036BF0647bFB5bF',
},
},
{
chainId: common.ChainId.arbitrum,
contract: {
PoolDataProvider: '0x6b4E260b765B3cA1514e618C0215A6B7839fF93e',
AaveV3FlashLoanCallback: '0x6ea614B4C520c8abC9B0F50803Bef964D4DA81EB',
AaveV3FlashLoanCallback: '0x6f81cf774052D03873b32944a036BF0647bFB5bF',
},
},
{
chainId: common.ChainId.avalanche,
contract: {
PoolDataProvider: '0x50ddd0Cd4266299527d25De9CBb55fE0EB8dAc30',
AaveV3FlashLoanCallback: '0x6ea614B4C520c8abC9B0F50803Bef964D4DA81EB',
AaveV3FlashLoanCallback: '0x6f81cf774052D03873b32944a036BF0647bFB5bF',
},
},
];
Expand Down
12 changes: 6 additions & 6 deletions src/logics/balancer-v2/configs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,47 +12,47 @@ export const configs: Config[] = [
chainId: common.ChainId.mainnet,
contract: {
Vault: '0xBA12222222228d8Ba445958a75a0704d566BF2C8',
BalancerV2FlashLoanCallback: '0x08b3d2c773C08CF21746Cf16268d2E092881c208',
BalancerV2FlashLoanCallback: '0xA15B9C132F29e91D99b51E3080020eF7c7F5E350',
ProtocolFeesCollector: '0xce88686553686DA562CE7Cea497CE749DA109f9F',
},
},
{
chainId: common.ChainId.optimism,
contract: {
Vault: '0xBA12222222228d8Ba445958a75a0704d566BF2C8',
BalancerV2FlashLoanCallback: '0x08b3d2c773C08CF21746Cf16268d2E092881c208',
BalancerV2FlashLoanCallback: '0xA15B9C132F29e91D99b51E3080020eF7c7F5E350',
ProtocolFeesCollector: '0xce88686553686DA562CE7Cea497CE749DA109f9F',
},
},
{
chainId: common.ChainId.polygon,
contract: {
Vault: '0xBA12222222228d8Ba445958a75a0704d566BF2C8',
BalancerV2FlashLoanCallback: '0x08b3d2c773C08CF21746Cf16268d2E092881c208',
BalancerV2FlashLoanCallback: '0xA15B9C132F29e91D99b51E3080020eF7c7F5E350',
ProtocolFeesCollector: '0xce88686553686DA562CE7Cea497CE749DA109f9F',
},
},
{
chainId: common.ChainId.base,
contract: {
Vault: '0xBA12222222228d8Ba445958a75a0704d566BF2C8',
BalancerV2FlashLoanCallback: '0x08b3d2c773C08CF21746Cf16268d2E092881c208',
BalancerV2FlashLoanCallback: '0xA15B9C132F29e91D99b51E3080020eF7c7F5E350',
ProtocolFeesCollector: '0xce88686553686DA562CE7Cea497CE749DA109f9F',
},
},
{
chainId: common.ChainId.arbitrum,
contract: {
Vault: '0xBA12222222228d8Ba445958a75a0704d566BF2C8',
BalancerV2FlashLoanCallback: '0x08b3d2c773C08CF21746Cf16268d2E092881c208',
BalancerV2FlashLoanCallback: '0xA15B9C132F29e91D99b51E3080020eF7c7F5E350',
ProtocolFeesCollector: '0xce88686553686DA562CE7Cea497CE749DA109f9F',
},
},
{
chainId: common.ChainId.avalanche,
contract: {
Vault: '0xBA12222222228d8Ba445958a75a0704d566BF2C8',
BalancerV2FlashLoanCallback: '0x08b3d2c773C08CF21746Cf16268d2E092881c208',
BalancerV2FlashLoanCallback: '0xA15B9C132F29e91D99b51E3080020eF7c7F5E350',
ProtocolFeesCollector: '0xce88686553686DA562CE7Cea497CE749DA109f9F',
},
},
Expand Down
2 changes: 1 addition & 1 deletion src/logics/radiant-v2/configs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export const configs: Config[] = [
chainId: common.ChainId.arbitrum,
contract: {
ProtocolDataProvider: '0x596B0cc4c5094507C50b579a662FE7e7b094A2cC',
RadiantV2FlashLoanCallback: '0x8629F6769f072FDFCDF0c1c040708b6FfAa58E5c',
RadiantV2FlashLoanCallback: '0x6bfCE075A1c4F0fD4067A401dA8f159354e1a916',
},
},
];
Expand Down
18 changes: 0 additions & 18 deletions test/logics/aave-v2/borrow.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,30 +34,12 @@ describe('mainnet: Test AaveV2 Borrow Logic', function () {
output: new common.TokenAmount(aavev2.mainnetTokens.ETH, '1'),
interestRateMode: aavev2.InterestRateMode.variable,
},
{
userIndex: 0,
deposit: new common.TokenAmount(aavev2.mainnetTokens.USDC, '5000'),
output: new common.TokenAmount(aavev2.mainnetTokens.WETH, '1'),
interestRateMode: aavev2.InterestRateMode.stable,
},
{
userIndex: 0,
deposit: new common.TokenAmount(aavev2.mainnetTokens.USDC, '5000'),
output: new common.TokenAmount(aavev2.mainnetTokens.ETH, '1'),
interestRateMode: aavev2.InterestRateMode.stable,
},
{
userIndex: 1,
deposit: new common.TokenAmount(aavev2.mainnetTokens.WETH, '1'),
output: new common.TokenAmount(aavev2.mainnetTokens.USDC, '1'),
interestRateMode: aavev2.InterestRateMode.variable,
},
{
userIndex: 1,
deposit: new common.TokenAmount(aavev2.mainnetTokens.WETH, '1'),
output: new common.TokenAmount(aavev2.mainnetTokens.USDC, '1'),
interestRateMode: aavev2.InterestRateMode.stable,
},
];

testCases.forEach(({ userIndex, deposit, output, interestRateMode }, i) => {
Expand Down
39 changes: 0 additions & 39 deletions test/logics/aave-v2/repay.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,78 +31,39 @@ describe('mainnet: Test AaveV2 Repay Logic', function () {
borrow: new common.TokenAmount(aavev2.mainnetTokens.ETH, '1'),
interestRateMode: aavev2.InterestRateMode.variable,
},
{
userIndex: 0,
deposit: new common.TokenAmount(aavev2.mainnetTokens.USDC, '5000'),
borrow: new common.TokenAmount(aavev2.mainnetTokens.ETH, '1'),
interestRateMode: aavev2.InterestRateMode.stable,
},
{
userIndex: 0,
deposit: new common.TokenAmount(aavev2.mainnetTokens.USDC, '5000'),
borrow: new common.TokenAmount(aavev2.mainnetTokens.WETH, '1'),
interestRateMode: aavev2.InterestRateMode.variable,
},
{
userIndex: 0,
deposit: new common.TokenAmount(aavev2.mainnetTokens.USDC, '5000'),
borrow: new common.TokenAmount(aavev2.mainnetTokens.WETH, '1'),
interestRateMode: aavev2.InterestRateMode.stable,
},
{
userIndex: 1,
deposit: new common.TokenAmount(aavev2.mainnetTokens.WETH, '1'),
borrow: new common.TokenAmount(aavev2.mainnetTokens.USDC, '1'),
interestRateMode: aavev2.InterestRateMode.variable,
},
{
userIndex: 1,
deposit: new common.TokenAmount(aavev2.mainnetTokens.WETH, '1'),
borrow: new common.TokenAmount(aavev2.mainnetTokens.USDC, '1'),
interestRateMode: aavev2.InterestRateMode.stable,
},
{
userIndex: 0,
deposit: new common.TokenAmount(aavev2.mainnetTokens.USDC, '5000'),
borrow: new common.TokenAmount(aavev2.mainnetTokens.ETH, '1'),
interestRateMode: aavev2.InterestRateMode.variable,
balanceBps: 5000,
},
{
userIndex: 0,
deposit: new common.TokenAmount(aavev2.mainnetTokens.USDC, '5000'),
borrow: new common.TokenAmount(aavev2.mainnetTokens.ETH, '1'),
interestRateMode: aavev2.InterestRateMode.stable,
balanceBps: 5000,
},
{
userIndex: 0,
deposit: new common.TokenAmount(aavev2.mainnetTokens.USDC, '5000'),
borrow: new common.TokenAmount(aavev2.mainnetTokens.WETH, '1'),
interestRateMode: aavev2.InterestRateMode.variable,
balanceBps: 5000,
},
{
userIndex: 0,
deposit: new common.TokenAmount(aavev2.mainnetTokens.USDC, '5000'),
borrow: new common.TokenAmount(aavev2.mainnetTokens.WETH, '1'),
interestRateMode: aavev2.InterestRateMode.stable,
balanceBps: 5000,
},
{
userIndex: 1,
deposit: new common.TokenAmount(aavev2.mainnetTokens.WETH, '1'),
borrow: new common.TokenAmount(aavev2.mainnetTokens.USDC, '1'),
interestRateMode: aavev2.InterestRateMode.variable,
balanceBps: 5000,
},
{
userIndex: 1,
deposit: new common.TokenAmount(aavev2.mainnetTokens.WETH, '1'),
borrow: new common.TokenAmount(aavev2.mainnetTokens.USDC, '1'),
interestRateMode: aavev2.InterestRateMode.stable,
balanceBps: 5000,
},
];

testCases.forEach(({ userIndex, deposit, borrow, interestRateMode, balanceBps }, i) => {
Expand Down
18 changes: 9 additions & 9 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1020,10 +1020,10 @@
bignumber.js "^9.0.2"
ts-essentials "^9.1.2"

"@protocolink/common@^0.3.0", "@protocolink/common@^0.3.1", "@protocolink/common@^0.3.3":
version "0.3.3"
resolved "https://registry.yarnpkg.com/@protocolink/common/-/common-0.3.3.tgz#63c3e34c9fbf25918847d8402aae5346924da2d4"
integrity sha512-izfqCopiNYDs0lafqplNRLIPXu/fbeaX9f2pwANw6LwhshOHBXi603fxmoPXTPYLvEDe6WdUDioclw/YHDKGeg==
"@protocolink/common@^0.3.0", "@protocolink/common@^0.3.4":
version "0.3.4"
resolved "https://registry.yarnpkg.com/@protocolink/common/-/common-0.3.4.tgz#cc7faeb6025c2da0231499a318e13a91093cfc0c"
integrity sha512-TnMn9ngY3w4RdKXuzIIazuBtEGpH+v2jHmpPDiBBmhAn4xIndQ5iFHggUfl7BpAkrw5ZIpwPJn5Gg542UNIk6g==
dependencies:
"@types/lodash" "^4.14.195"
bignumber.js "^9.1.1"
Expand All @@ -1033,12 +1033,12 @@
type-fest "^3.12.0"
zksync-web3 "^0.14.3"

"@protocolink/core@^0.4.2":
version "0.4.2"
resolved "https://registry.yarnpkg.com/@protocolink/core/-/core-0.4.2.tgz#19d07613ce355497eb13db82b3d68a44c3f4691e"
integrity sha512-WtapXfFgkb8jjNOYru+i00gCU23x0BR4i/2mGokQsKAGkeyuMymHIUTtsxN+5fL009t1NgrGhZe7Xt62wbX8Ug==
"@protocolink/core@^0.4.3":
version "0.4.3"
resolved "https://registry.yarnpkg.com/@protocolink/core/-/core-0.4.3.tgz#4c2533acf62092d1e76b3e7ac7c2f9c69ae3e355"
integrity sha512-7AyR5Mu/aAfP9rDXkpc70gK29JtMDXDdzRfTXWKf7OisXXqPUuOuC6D0s2zbZr5DCd/IzMURZOSQ4VjfGsspfQ==
dependencies:
"@protocolink/common" "^0.3.1"
"@protocolink/common" "^0.3.4"
"@uniswap/permit2-sdk" "^1.2.0"
ethers "^5.7.2"
tiny-invariant "^1.3.1"
Expand Down
Loading