diff --git a/core/src/abis/Maker/SavingsDai.json b/core/src/abis/Maker/SavingsDai.json new file mode 100644 index 0000000..32355f9 --- /dev/null +++ b/core/src/abis/Maker/SavingsDai.json @@ -0,0 +1,477 @@ +[ + { + "inputs": [ + { "internalType": "address", "name": "_daiJoin", "type": "address" }, + { "internalType": "address", "name": "_pot", "type": "address" } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Approval", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "assets", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "shares", + "type": "uint256" + } + ], + "name": "Deposit", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Transfer", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "assets", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "shares", + "type": "uint256" + } + ], + "name": "Withdraw", + "type": "event" + }, + { + "inputs": [], + "name": "DOMAIN_SEPARATOR", + "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "PERMIT_TYPEHASH", + "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "", "type": "address" }, + { "internalType": "address", "name": "", "type": "address" } + ], + "name": "allowance", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "spender", "type": "address" }, + { "internalType": "uint256", "name": "value", "type": "uint256" } + ], + "name": "approve", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "asset", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "", "type": "address" }], + "name": "balanceOf", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "uint256", "name": "shares", "type": "uint256" } + ], + "name": "convertToAssets", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "uint256", "name": "assets", "type": "uint256" } + ], + "name": "convertToShares", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "dai", + "outputs": [ + { "internalType": "contract DaiLike", "name": "", "type": "address" } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "daiJoin", + "outputs": [ + { "internalType": "contract DaiJoinLike", "name": "", "type": "address" } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "decimals", + "outputs": [{ "internalType": "uint8", "name": "", "type": "uint8" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "spender", "type": "address" }, + { + "internalType": "uint256", + "name": "subtractedValue", + "type": "uint256" + } + ], + "name": "decreaseAllowance", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "deploymentChainId", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "uint256", "name": "assets", "type": "uint256" }, + { "internalType": "address", "name": "receiver", "type": "address" } + ], + "name": "deposit", + "outputs": [ + { "internalType": "uint256", "name": "shares", "type": "uint256" } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "spender", "type": "address" }, + { "internalType": "uint256", "name": "addedValue", "type": "uint256" } + ], + "name": "increaseAllowance", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "", "type": "address" }], + "name": "maxDeposit", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "", "type": "address" }], + "name": "maxMint", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "owner", "type": "address" } + ], + "name": "maxRedeem", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "owner", "type": "address" } + ], + "name": "maxWithdraw", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "uint256", "name": "shares", "type": "uint256" }, + { "internalType": "address", "name": "receiver", "type": "address" } + ], + "name": "mint", + "outputs": [ + { "internalType": "uint256", "name": "assets", "type": "uint256" } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "name", + "outputs": [{ "internalType": "string", "name": "", "type": "string" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "", "type": "address" }], + "name": "nonces", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "owner", "type": "address" }, + { "internalType": "address", "name": "spender", "type": "address" }, + { "internalType": "uint256", "name": "value", "type": "uint256" }, + { "internalType": "uint256", "name": "deadline", "type": "uint256" }, + { "internalType": "bytes", "name": "signature", "type": "bytes" } + ], + "name": "permit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "owner", "type": "address" }, + { "internalType": "address", "name": "spender", "type": "address" }, + { "internalType": "uint256", "name": "value", "type": "uint256" }, + { "internalType": "uint256", "name": "deadline", "type": "uint256" }, + { "internalType": "uint8", "name": "v", "type": "uint8" }, + { "internalType": "bytes32", "name": "r", "type": "bytes32" }, + { "internalType": "bytes32", "name": "s", "type": "bytes32" } + ], + "name": "permit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "pot", + "outputs": [ + { "internalType": "contract PotLike", "name": "", "type": "address" } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "uint256", "name": "assets", "type": "uint256" } + ], + "name": "previewDeposit", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "uint256", "name": "shares", "type": "uint256" } + ], + "name": "previewMint", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "uint256", "name": "shares", "type": "uint256" } + ], + "name": "previewRedeem", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "uint256", "name": "assets", "type": "uint256" } + ], + "name": "previewWithdraw", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "uint256", "name": "shares", "type": "uint256" }, + { "internalType": "address", "name": "receiver", "type": "address" }, + { "internalType": "address", "name": "owner", "type": "address" } + ], + "name": "redeem", + "outputs": [ + { "internalType": "uint256", "name": "assets", "type": "uint256" } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "symbol", + "outputs": [{ "internalType": "string", "name": "", "type": "string" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalAssets", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalSupply", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "to", "type": "address" }, + { "internalType": "uint256", "name": "value", "type": "uint256" } + ], + "name": "transfer", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "from", "type": "address" }, + { "internalType": "address", "name": "to", "type": "address" }, + { "internalType": "uint256", "name": "value", "type": "uint256" } + ], + "name": "transferFrom", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "vat", + "outputs": [ + { "internalType": "contract VatLike", "name": "", "type": "address" } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "version", + "outputs": [{ "internalType": "string", "name": "", "type": "string" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "uint256", "name": "assets", "type": "uint256" }, + { "internalType": "address", "name": "receiver", "type": "address" }, + { "internalType": "address", "name": "owner", "type": "address" } + ], + "name": "withdraw", + "outputs": [ + { "internalType": "uint256", "name": "shares", "type": "uint256" } + ], + "stateMutability": "nonpayable", + "type": "function" + } +] diff --git a/core/src/abis/index.ts b/core/src/abis/index.ts index 915b3e0..17ede06 100644 --- a/core/src/abis/index.ts +++ b/core/src/abis/index.ts @@ -15,6 +15,7 @@ import UniswapV2FactoryABI from "./UniswapV2/UniswapV2Factory.json"; import UniswapV2PairABI from "./UniswapV2/UniswapV2Pair.json"; import UniswapV2Router02ABI from "./UniswapV2/UniswapV2Router02.json"; import ZeroXERC20ABI from "./ZeroX/ZeroXERC20.json"; +import SavingsDaiABI from "./Maker/SavingsDai.json"; import RouterABI from "./Router.json"; import RouterSimulatorABI from "./RouterSimulator.json"; @@ -37,5 +38,6 @@ export const UniswapV2Factory = new Interface(UniswapV2FactoryABI); export const UniswapV2Pair = new Interface(UniswapV2PairABI); export const UniswapV2Router02 = new Interface(UniswapV2Router02ABI); export const ZeroXERC20 = new Interface(ZeroXERC20ABI.abi); +export const SavingsDai = new Interface(SavingsDaiABI); export const Router = new Interface(RouterABI.abi); export const RouterSimulator = new Interface(RouterSimulatorABI.abi); diff --git a/core/src/asset-strategies/SavingsDaiDepositStrategy.ts b/core/src/asset-strategies/SavingsDaiDepositStrategy.ts new file mode 100644 index 0000000..d87c97d --- /dev/null +++ b/core/src/asset-strategies/SavingsDaiDepositStrategy.ts @@ -0,0 +1,202 @@ +import { RequestTree } from "../transaction/get-prices-and-linked-assets"; +import { StoreOpType } from "../transaction/types"; +import { + fetchPriceData, + getPrice, +} from "../transaction/asset-type-strategies-helpers"; +import { getMagicOffsets } from "core/src/utils/get-magic-offset"; +import { IERC20, SavingsDai } from "core/src/abis"; +import { + FRACTION_MULTIPLIER, + MAGIC_REPLACERS, +} from "core/src/utils/get-magic-offset"; +import { + FetchPriceDataParams, + GetPriceParams, + GenerateStepParams, +} from "./InterfaceStrategy"; +import { InterfaceStrategy } from "./InterfaceStrategy"; + +export class SavingsDaiDepositStrategy extends InterfaceStrategy { + fetchPriceData({ provider, assetStore, asset }: FetchPriceDataParams) { + const linkedAsset = assetStore.getAssetById(asset.linkedAssets[0].assetId); + + let requestTree: RequestTree = {}; + + requestTree[asset.address] = {}; + + const fetchedData = fetchPriceData({ + provider, + assetStore, + asset: linkedAsset, + }); + requestTree = { + ...requestTree, + ...fetchedData, + }; + return requestTree; + } + + getPrice({ assetStore, asset, requestTree }: GetPriceParams) { + const linkedAsset = assetStore.getAssetById(asset.linkedAssets[0].assetId); + + return getPrice({ assetStore, asset: linkedAsset, requestTree }); + } + + async generateStep({ + assetAllocation, + assetStore, + walletAddress, + chainId, + value, + currentAllocation, + routerOperation, + }: GenerateStepParams) { + const asset = assetStore.getAssetById(assetAllocation.assetId); + if (asset.linkedAssets.length != 1) { + throw new Error( + `SavingsDaiDepositStrategy: asset ${asset.id} should have exactly one linked asset` + ); + } + const linkedAsset = assetStore.getAssetById(asset.linkedAssets[0].assetId); + + const storeNumberSDai = routerOperation.stores.findOrInitializeStoreIdx({ + assetId: asset.id, + }); + const storeNumberDai = routerOperation.stores.findOrInitializeStoreIdx({ + assetId: linkedAsset.id, + }); + + if (assetAllocation.fraction > 0) { + const currentFraction = currentAllocation.getAssetById({ + assetId: linkedAsset.id, + }).fraction; + const newFraction = asset.linkedAssets[0].fraction / currentFraction; + const variation = currentFraction * newFraction; + + currentAllocation.updateFraction({ + assetId: linkedAsset.id, + delta: -variation, + }); + currentAllocation.updateFraction({ + assetId: asset.id, + delta: variation, + }); + + const { data: approveEncodedCall, offsets: approveFromOffsets } = + getMagicOffsets({ + data: IERC20.encodeFunctionData("approve", [ + asset.address, + MAGIC_REPLACERS[0], + ]), + magicReplacers: [MAGIC_REPLACERS[0]], + }); + + routerOperation.steps.push({ + stepAddress: linkedAsset.address, + stepEncodedCall: approveEncodedCall, + storeOperations: [ + { + storeOpType: StoreOpType.RetrieveStoreAssignCall, + storeNumber: storeNumberDai, + secondaryStoreNumber: 0, + offset: approveFromOffsets[0], + fraction: Math.round(FRACTION_MULTIPLIER * newFraction), + }, + ], + }); + + const { data: depositEncodedCall, offsets: depositFromOffsets } = + getMagicOffsets({ + data: SavingsDai.encodeFunctionData("deposit", [ + MAGIC_REPLACERS[0], // assets + walletAddress, // receiver + ]), + magicReplacers: [MAGIC_REPLACERS[0]], + }); + + const { offsets: depositToOffsets } = getMagicOffsets({ + data: SavingsDai.encodeFunctionResult("deposit", [ + MAGIC_REPLACERS[0], // shares + ]), + magicReplacers: [MAGIC_REPLACERS[0]], + }); + + routerOperation.steps.push({ + stepAddress: asset.address, + stepEncodedCall: depositEncodedCall, + storeOperations: [ + { + storeOpType: StoreOpType.RetrieveStoreAssignCallSubtract, + storeNumber: storeNumberDai, + secondaryStoreNumber: 0, + offset: depositFromOffsets[0], + fraction: Math.round(newFraction * FRACTION_MULTIPLIER), + }, + { + storeOpType: StoreOpType.RetrieveResultAddStore, + storeNumber: storeNumberSDai, + secondaryStoreNumber: 0, + offset: depositToOffsets[0], + fraction: FRACTION_MULTIPLIER, + }, + ], + }); + } else if (assetAllocation.fraction < 0) { + const currentFraction = currentAllocation.getAssetById({ + assetId: asset.id, + }).fraction; + const newFraction = -assetAllocation.fraction / currentFraction; + const variation = newFraction * currentFraction; + + asset.linkedAssets.map((la, i) => { + currentAllocation.updateFraction({ + assetId: la.assetId, + delta: variation * la.fraction, + }); + currentAllocation.updateFraction({ + assetId: asset.id, + delta: -variation * la.fraction, + }); + }); + + const { data: redeemEncodedCall, offsets: redeemFromOffsets } = + getMagicOffsets({ + data: SavingsDai.encodeFunctionData("redeem", [ + MAGIC_REPLACERS[0], // shares + walletAddress, // receiver + walletAddress, // owner + ]), + magicReplacers: [MAGIC_REPLACERS[0]], + }); + + const { offsets: redeemToOffsets } = getMagicOffsets({ + data: SavingsDai.encodeFunctionResult("redeem", [MAGIC_REPLACERS[0]]), + magicReplacers: [MAGIC_REPLACERS[0]], + }); + + routerOperation.steps.push({ + stepAddress: asset.address, + stepEncodedCall: redeemEncodedCall, + storeOperations: [ + { + storeOpType: StoreOpType.RetrieveStoreAssignCallSubtract, + storeNumber: storeNumberSDai, + secondaryStoreNumber: 0, + offset: redeemFromOffsets[0], + fraction: Math.round(newFraction * FRACTION_MULTIPLIER), + }, + { + storeOpType: StoreOpType.RetrieveResultAddStore, + storeNumber: storeNumberDai, + secondaryStoreNumber: 0, + offset: redeemToOffsets[0], + fraction: FRACTION_MULTIPLIER, + }, + ], + }); + } + + return routerOperation; + } +} diff --git a/core/src/asset-strategies/asset-type-strategies.ts b/core/src/asset-strategies/asset-type-strategies.ts index 02357f4..347f3d2 100644 --- a/core/src/asset-strategies/asset-type-strategies.ts +++ b/core/src/asset-strategies/asset-type-strategies.ts @@ -8,6 +8,7 @@ import { AaveV2DepositStrategy } from "./AaveV2DepositStrategy"; import { AaveV3DepositStrategy } from "./AaveV3DepositStrategy"; import { InterfaceStrategy } from "./InterfaceStrategy"; import { BalancerDepositStrategy } from "./BalancerDepositStrategy"; +import { SavingsDaiDepositStrategy } from "./SavingsDaiDepositStrategy"; export const assetTypeStrategies: { [chainId: number]: { @@ -23,5 +24,6 @@ export const assetTypeStrategies: { gammaDeposit: new GammaDepositStrategy(), aaveV2Deposit: new AaveV2DepositStrategy(), aaveV3Deposit: new AaveV3DepositStrategy(), + savingsDaiDeposit: new SavingsDaiDepositStrategy(), }, }; diff --git a/core/src/transaction/types.ts b/core/src/transaction/types.ts index a607995..eb9d391 100644 --- a/core/src/transaction/types.ts +++ b/core/src/transaction/types.ts @@ -291,6 +291,7 @@ export type AssetType = | "beefyDeposit" | "aaveV2Deposit" | "aaveV3Deposit" + | "savingsDaiDeposit" | "balancerDeposit" | "uniswapV2Liquidity"; diff --git a/core/tests/protocols/savingsDai.spec.ts b/core/tests/protocols/savingsDai.spec.ts new file mode 100644 index 0000000..41a871d --- /dev/null +++ b/core/tests/protocols/savingsDai.spec.ts @@ -0,0 +1,32 @@ +import { test } from "vitest"; +import { simulateRouterOperationHelper } from "./utils"; + +test.skip("generateTransaction: USDC to SDAI (savingsDai)", async () => { + await simulateRouterOperationHelper({ + chainId: 1, + inputAllocation: [ + { + assetId: "ed46f991-d225-491d-b2b2-91f89da016d2", + amountStr: "1000000000", + }, + ], + outputAllocation: [ + { assetId: "8bd1bd78-4938-4204-a945-fa63f57c642b", fraction: 1.0 }, + ], + }); +}); + +test.skip("generateTransaction: SDAI (savingsDai) to USDC", async () => { + await simulateRouterOperationHelper({ + chainId: 1, + inputAllocation: [ + { + assetId: "8bd1bd78-4938-4204-a945-fa63f57c642b", + amountStr: "1000000000000000000000", + }, + ], + outputAllocation: [ + { assetId: "ed46f991-d225-491d-b2b2-91f89da016d2", fraction: 1.0 }, + ], + }); +}); diff --git a/data/assets/1/networkToken.json b/data/assets/1/networkToken.json new file mode 100644 index 0000000..96239d1 --- /dev/null +++ b/data/assets/1/networkToken.json @@ -0,0 +1,14 @@ +[ + { + "id": "98887ce0-466f-481d-a0a0-3d5bf5ea6d83", + "name": "Ether", + "chainId": 1, + "active": true, + "address": "0x0000000000000000000000000000000000001010", + "color": "#818181", + "decimals": 18, + "symbol": "ETH", + "type": "networkToken", + "visible": true + } +] diff --git a/data/assets/1/savingsDaiDeposit.json b/data/assets/1/savingsDaiDeposit.json new file mode 100644 index 0000000..e272980 --- /dev/null +++ b/data/assets/1/savingsDaiDeposit.json @@ -0,0 +1,23 @@ +[ + { + "id": "8bd1bd78-4938-4204-a945-fa63f57c642b", + "name": "Savings Dai", + "chainId": 1, + "active": true, + "address": "0x83F20F44975D03b1b09e64809B757c47f942BEeA", + "color": "#79A63A", + "decimals": 18, + "symbol": "sDAI", + "type": "savingsDaiDeposit", + "visible": true, + "maxSize": 64, + "allowSlot": 2, + "balanceSlot": 1, + "linkedAssets": [ + { + "assetId": "389d84c3-9095-4b00-b01a-18948b9ada39", + "fraction": 1 + } + ] + } +] diff --git a/data/assets/1/token.json b/data/assets/1/token.json new file mode 100644 index 0000000..c18b2fe --- /dev/null +++ b/data/assets/1/token.json @@ -0,0 +1,31 @@ +[ + { + "id": "ed46f991-d225-491d-b2b2-91f89da016d2", + "active": true, + "address": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48", + "color": "#2775ca", + "decimals": 6, + "name": "USD Coin", + "chainId": 1, + "symbol": "USDC", + "type": "token", + "visible": true, + "allowSlot": 10, + "balanceSlot": 9 + }, + { + "id": "a80c67f9-5ba9-4c05-b5b1-511836b38454", + "name": "DAI", + "chainId": 1, + "active": true, + "address": "0x6B175474E89094C44Da98b954EedeAC495271d0F", + "color": "#fcb934", + "decimals": 18, + "symbol": "DAI", + "type": "token", + "visible": true, + "allowSlot": 3, + "balanceSlot": 2, + "maxSize": 64 + } +] diff --git a/data/assets/137/balancerDeposit.json b/data/assets/137/balancerDeposit.json index 06bd8a9..f038146 100644 --- a/data/assets/137/balancerDeposit.json +++ b/data/assets/137/balancerDeposit.json @@ -39,11 +39,11 @@ "linkedAssets": [ { "assetId": "8634b650-20fe-4f9e-8310-6672b38ea0ce", - "fraction": 0 + "fraction": 0.7951 }, { "assetId": "d604439e-d464-4df5-bed1-66815b348cab", - "fraction": 1 + "fraction": 0.2049 } ], "name": "maticX/WMATIC", diff --git a/data/assets/137/networkToken.json b/data/assets/137/networkToken.json new file mode 100644 index 0000000..cd5787d --- /dev/null +++ b/data/assets/137/networkToken.json @@ -0,0 +1,14 @@ +[ + { + "id": "48f0325c-e5cc-4dac-9873-793f6c12fe08", + "name": "Matic", + "chainId": 137, + "active": true, + "address": "0x0000000000000000000000000000000000001010", + "color": "#468af0", + "decimals": 18, + "symbol": "MATIC", + "type": "networkToken", + "visible": true + } +]