Skip to content

Commit

Permalink
Fixing tests. Fixing Aave maxSize
Browse files Browse the repository at this point in the history
  • Loading branch information
pgbrandao committed Nov 2, 2023
1 parent 01ac32d commit 42ab46f
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 15 deletions.
7 changes: 6 additions & 1 deletion core/src/simulation/find-slots.ts
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,12 @@ export async function findSlots({
METHODS[1]
);

const maxSize = Math.min(allowSize, balanceSize);
let maxSize;
if (asset.type === "aaveV3Deposit") {
maxSize = 40;
} else {
maxSize = Math.min(allowSize, balanceSize);
}

return { allowSlot, balanceSlot, maxSize };
}
6 changes: 3 additions & 3 deletions core/tests/protocols/aave.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@ import { test } from "vitest";
import { simulateSingleAssetToSingleAsset } from "./utils";

test("generateTransaction: USDC to aPolUSDC (aaveV3Deposit)", async () => {
simulateSingleAssetToSingleAsset({
await simulateSingleAssetToSingleAsset({
chainId: 137,
inputAssetId: "e251ecf6-48c2-4538-afcd-fbb92424054d",
outputAssetId: "371b83f1-3301-4c69-b3ad-8d199c6d1774",
amountIn: "1000000000",
});
});

test.skip("generateTransaction: aPolUSDC (aaveV3Deposit) to USDC", async () => {
simulateSingleAssetToSingleAsset({
test("generateTransaction: aPolUSDC (aaveV3Deposit) to USDC", async () => {
await simulateSingleAssetToSingleAsset({
chainId: 137,
inputAssetId: "371b83f1-3301-4c69-b3ad-8d199c6d1774",
outputAssetId: "e251ecf6-48c2-4538-afcd-fbb92424054d",
Expand Down
4 changes: 2 additions & 2 deletions core/tests/protocols/beefy.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { test } from "vitest";
import { simulateSingleAssetToSingleAsset } from "./utils";

test("generateTransaction: USDC to QUICK (beefyDeposit)", async () => {
simulateSingleAssetToSingleAsset({
await simulateSingleAssetToSingleAsset({
chainId: 137,
inputAssetId: "e251ecf6-48c2-4538-afcd-fbb92424054d",
outputAssetId: "37819023-9c6a-4848-8cf5-24a95350f001",
Expand All @@ -11,7 +11,7 @@ test("generateTransaction: USDC to QUICK (beefyDeposit)", async () => {
});

test.skip("generateTransaction: beefy.finance (beefyDeposit) to USDC", async () => {
simulateSingleAssetToSingleAsset({
await simulateSingleAssetToSingleAsset({
chainId: 137,
inputAssetId: "fecfd33d-e6a7-476b-89cb-910a0058fa48",
outputAssetId: "e251ecf6-48c2-4538-afcd-fbb92424054d",
Expand Down
14 changes: 7 additions & 7 deletions core/tests/protocols/gamma.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { test } from "vitest";
import { simulateSingleAssetToSingleAsset } from "./utils";

test("generateTransaction: USDC to USDC/WETH (gammaDeposit)", async () => {
simulateSingleAssetToSingleAsset({
await simulateSingleAssetToSingleAsset({
chainId: 137,
inputAssetId: "e251ecf6-48c2-4538-afcd-fbb92424054d",
outputAssetId: "8da84d12-9e9d-4c04-831d-7b93f1cd822f",
Expand All @@ -11,7 +11,7 @@ test("generateTransaction: USDC to USDC/WETH (gammaDeposit)", async () => {
});

test("generateTransaction: USDC to WMATIC/WETH (gammaDeposit)", async () => {
simulateSingleAssetToSingleAsset({
await simulateSingleAssetToSingleAsset({
chainId: 137,
inputAssetId: "e251ecf6-48c2-4538-afcd-fbb92424054d",
outputAssetId: "3c42b7d3-555b-41a4-96b6-ce4fadd62f83",
Expand All @@ -20,7 +20,7 @@ test("generateTransaction: USDC to WMATIC/WETH (gammaDeposit)", async () => {
});

test("generateTransaction: USDC to WMATIC/MaticX (gammaDeposit)", async () => {
simulateSingleAssetToSingleAsset({
await simulateSingleAssetToSingleAsset({
chainId: 137,
inputAssetId: "e251ecf6-48c2-4538-afcd-fbb92424054d",
outputAssetId: "5a5cd640-b972-43b6-9bb2-24e6711ab1db",
Expand All @@ -29,7 +29,7 @@ test("generateTransaction: USDC to WMATIC/MaticX (gammaDeposit)", async () => {
});

test("generateTransaction: WMATIC/MaticX (gammaDeposit) to USDC", async () => {
simulateSingleAssetToSingleAsset({
await simulateSingleAssetToSingleAsset({
chainId: 137,
inputAssetId: "5a5cd640-b972-43b6-9bb2-24e6711ab1db",
outputAssetId: "e251ecf6-48c2-4538-afcd-fbb92424054d",
Expand All @@ -38,7 +38,7 @@ test("generateTransaction: WMATIC/MaticX (gammaDeposit) to USDC", async () => {
});

test("generateTransaction: WMATIC/WETH (gammaDeposit) to USDC", async () => {
simulateSingleAssetToSingleAsset({
await simulateSingleAssetToSingleAsset({
chainId: 137,
inputAssetId: "3c42b7d3-555b-41a4-96b6-ce4fadd62f83",
outputAssetId: "e251ecf6-48c2-4538-afcd-fbb92424054d",
Expand All @@ -47,7 +47,7 @@ test("generateTransaction: WMATIC/WETH (gammaDeposit) to USDC", async () => {
});

test("generateTransaction: USDC/WETH (gammaDeposit) to USDC", async () => {
simulateSingleAssetToSingleAsset({
await simulateSingleAssetToSingleAsset({
chainId: 137,
inputAssetId: "8da84d12-9e9d-4c04-831d-7b93f1cd822f",
outputAssetId: "e251ecf6-48c2-4538-afcd-fbb92424054d",
Expand All @@ -56,7 +56,7 @@ test("generateTransaction: USDC/WETH (gammaDeposit) to USDC", async () => {
});

test("generateTransaction: USDC/WETH (gammaDeposit) to WMATIC/MaticX (gammaDeposit)", async () => {
simulateSingleAssetToSingleAsset({
await simulateSingleAssetToSingleAsset({
chainId: 137,
inputAssetId: "8da84d12-9e9d-4c04-831d-7b93f1cd822f",
outputAssetId: "5a5cd640-b972-43b6-9bb2-24e6711ab1db",
Expand Down
4 changes: 2 additions & 2 deletions data/assets.json
Original file line number Diff line number Diff line change
Expand Up @@ -1468,7 +1468,7 @@
"category": ["Lending", "Yield", "Blue chip"],
"allowSlot": 53,
"balanceSlot": 52,
"maxSize": 64
"maxSize": 40
},
{
"id": "371b83f1-3301-4c69-b3ad-8d199c6d1774",
Expand All @@ -1489,7 +1489,7 @@
"visible": true,
"allowSlot": 53,
"balanceSlot": 52,
"maxSize": 64
"maxSize": 40
},
{
"id": "fecfd33d-e6a7-476b-89cb-910a0058fa48",
Expand Down

0 comments on commit 42ab46f

Please sign in to comment.