From 642dd7e035597193dcaac0ab2867b801c893a09f Mon Sep 17 00:00:00 2001 From: Phu Ngo <12547020+NgoKimPhu@users.noreply.github.com> Date: Tue, 10 Dec 2024 18:11:47 +0700 Subject: [PATCH] ft/zkswap stable and v3 (#642) * ft: add zkswap-stable * ft: add zkswap-v3 --- pkg/source/curve/embed.go | 6 +++++ .../curve/pools/zkswap-stable/zksync.json | 26 +++++++++++++++++++ pkg/valueobject/exchange.go | 4 +++ 3 files changed, 36 insertions(+) create mode 100644 pkg/source/curve/pools/zkswap-stable/zksync.json diff --git a/pkg/source/curve/embed.go b/pkg/source/curve/embed.go index 3d476f443..92f6983e8 100644 --- a/pkg/source/curve/embed.go +++ b/pkg/source/curve/embed.go @@ -78,6 +78,11 @@ var arbitrumPancakeStablePoolsBytes []byte //go:embed pools/pancake-stable/bsc.json var bscPancakeStablePoolsBytes []byte +// ZkSwap-stable pool bytes + +//go:embed pools/zkswap-stable/zksync.json +var zksyncPoolsBytes []byte + var bytesByPath = map[string][]byte{ "pools/arbitrum.json": arbitrumPoolsBytes, "pools/avalanche.json": avalanchePoolsBytes, @@ -90,4 +95,5 @@ var bytesByPath = map[string][]byte{ "pools/ellipsis/bsc.json": ellipsisBscPoolsBytes, "pools/pancake-stable/arbitrum.json": arbitrumPancakeStablePoolsBytes, "pools/pancake-stable/bsc.json": bscPancakeStablePoolsBytes, + "pools/zkswap-stable/zksync.json": zksyncPoolsBytes, } diff --git a/pkg/source/curve/pools/zkswap-stable/zksync.json b/pkg/source/curve/pools/zkswap-stable/zksync.json new file mode 100644 index 000000000..6820b5ca3 --- /dev/null +++ b/pkg/source/curve/pools/zkswap-stable/zksync.json @@ -0,0 +1,26 @@ +[ + { + "id": "0x15309aaf4fedf346e5204331027b4ef7b75b1dd7", + "name": "USDC/USDC/USDT", + "type": "curve-base", + "lpToken": "0x31c330f2febda65693ec8801b77a93c6d1f479e4", + "aPrecision": "2000", + "tokens": [ + { + "address": "0x1d17cbcf0d6d143135ae902365d2e5e2a16538d4", + "precision": "1", + "rate": "1000000000000000000" + }, + { + "address": "0x3355df6d4c9c3035724fd0e3914de96a5a83aaf4", + "precision": "1", + "rate": "1000000000000000000" + }, + { + "address": "0x493257fd37edb34451f62edf8d2a0c418852ba4c", + "precision": "1", + "rate": "1000000000000000000" + } + ] + } +] diff --git a/pkg/valueobject/exchange.go b/pkg/valueobject/exchange.go index 909bead02..fc9a92c81 100644 --- a/pkg/valueobject/exchange.go +++ b/pkg/valueobject/exchange.go @@ -70,6 +70,7 @@ var ( ExchangeCurve Exchange = "curve" ExchangeEllipsis Exchange = "ellipsis" ExchangePancakeStable Exchange = "pancake-stable" + ExchangeZkSwapStable Exchange = "zkswap-stable" ExchangeCurveStablePlain Exchange = "curve-stable-plain" ExchangeCurveStableNg Exchange = "curve-stable-ng" @@ -157,6 +158,7 @@ var ( ExchangeRamsesV2 Exchange = "ramses-v2" ExchangePharaohV2 Exchange = "pharaoh-v2" ExchangeDackieV3 Exchange = "dackie-v3" + ExchangeZkSwapV3 Exchange = "zkswap-v3" ExchangeHoriza Exchange = "horiza" ExchangeBaseSwapV3 Exchange = "baseswap-v3" ExchangeArbiDexV3 Exchange = "arbidex-v3" @@ -446,6 +448,7 @@ var AMMSourceSet = map[Exchange]struct{}{ ExchangeCurveTwoCryptoNg: {}, ExchangeEllipsis: {}, ExchangePancakeStable: {}, + ExchangeZkSwapStable: {}, ExchangeUniSwapV3: {}, ExchangeKyberswapElastic: {}, ExchangeBalancer: {}, @@ -509,6 +512,7 @@ var AMMSourceSet = map[Exchange]struct{}{ ExchangeSushiSwapV3: {}, ExchangeRamsesV2: {}, ExchangeDackieV3: {}, + ExchangeZkSwapV3: {}, ExchangeHoriza: {}, ExchangeBaseSwapV3: {}, ExchangeArbiDexV3: {},