Skip to content

Commit 3334f65

Browse files
committed
fix: fix config and tokenlist
1 parent 395fae2 commit 3334f65

File tree

6 files changed

+236
-11
lines changed

6 files changed

+236
-11
lines changed

src/api/routes/swap/swapRouter.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ async function findSwap(
6969

7070
return ServiceResponse.success<SwapResponse>(data)
7171
} catch (error) {
72+
console.log("error: ", error)
7273
if (error instanceof ApiError) {
7374
return ServiceResponse.failure(
7475
error.message,

src/common/utils/tokenList.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ const cache: Record<number, TokenListItem[]> = {}
1818

1919
export default function getTokenList(chainId: number): TokenListItem[] {
2020
if (!cache[chainId]) {
21-
cache[chainId] = require(`./tokenList_${chainId}.json`)
21+
cache[chainId] = require(`../../tokenLists/tokenList_${chainId}.json`)
2222
}
2323

2424
return cache[chainId]

src/index.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
import { app, logger } from "@/server"
2-
import dotenv from "dotenv"
3-
4-
dotenv.config()
52

63
const server = app.listen(process.env.PORT, () => {
74
const { NODE_ENV, PORT } = process.env

src/server.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ import { swapRouter } from "@/api/routes/swap/swapRouter"
99
import errorHandler from "@/common/middleware/errorHandler"
1010
import rateLimiter from "@/common/middleware/rateLimiter"
1111
import requestLogger from "@/common/middleware/requestLogger"
12+
import dotenv from "dotenv"
13+
14+
dotenv.config()
1215

1316
const logger = pino({ name: "server start" })
1417
const app: Express = express()

src/swapService/runner.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ export async function runPipeline(
4242
if (result.response) break
4343
}
4444

45-
console.log(allResults)
45+
// console.log(allResults)
4646

4747
const finalResult = allResults.pop()
4848
if (!finalResult)
@@ -62,9 +62,9 @@ export async function runPipeline(
6262
}
6363

6464
// TODO tokenlist, interfaces
65+
// TODO price impact
6566
// TODO error handling
6667
// TODO npm interfaces, supported chains
6768
// TODO cache pipeline
68-
// TODO env validation
6969
// TODO logging
7070
// TODO pendle rollover

src/common/utils/tokenLIst_1.json renamed to src/tokenLists/tokenLIst_1.json

Lines changed: 229 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,8 @@
307307
"name": "Ethena Staked USDe",
308308
"symbol": "SUSDE",
309309
"decimals": 18,
310-
"logoURI": "https://coin-images.coingecko.com/coins/images/33669/large/sUSDe-Symbol-Color.png?1716307680"
310+
"logoURI": "https://coin-images.coingecko.com/coins/images/33669/large/sUSDe-Symbol-Color.png?1716307680",
311+
"meta": {}
311312
},
312313
{
313314
"addressInfo": "0x6b3595068778dd592e39a122f4f5a5cf09c90fe2",
@@ -878,11 +879,13 @@
878879
{
879880
"addressInfo": "0x35d8949372d46b7a3d5a56006ae77b215fc69bc0",
880881
"chainId": 1,
881-
"name": "USD0 Liquid Bond",
882+
"name": "Staked USD0",
882883
"symbol": "USD0++",
883884
"decimals": 18,
884885
"logoURI": "https://coin-images.coingecko.com/coins/images/39169/large/0x35d8949372d46b7a3d5a56006ae77b215fc69bc0.png?1720798057",
885-
"meta": {}
886+
"meta": {
887+
"poolId": "55b0893b-1dbb-47fd-9912-5e439cd3d511"
888+
}
886889
},
887890
{
888891
"addressInfo": "0x9c7beba8f6ef6643abd725e45a4e8387ef260649",
@@ -911,6 +914,42 @@
911914
"logoURI": "https://coin-images.coingecko.com/coins/images/26433/large/starknet.png?1696525507",
912915
"meta": {}
913916
},
917+
{
918+
"addressInfo": "0xf469fbd2abcd6b9de8e169d128226c0fc90a012e",
919+
"chainId": 1,
920+
"name": "pumpBTC",
921+
"symbol": "PUMPBTC",
922+
"decimals": 8,
923+
"logoURI": "https://coin-images.coingecko.com/coins/images/39232/large/200pxPumpBTCLogo.png?1721227861",
924+
"meta": {}
925+
},
926+
{
927+
"addressInfo": "0xbdc7c08592ee4aa51d06c27ee23d5087d65adbcd",
928+
"chainId": 1,
929+
"name": "Lift Dollar",
930+
"symbol": "USDL",
931+
"decimals": 18,
932+
"logoURI": "https://coin-images.coingecko.com/coins/images/38484/large/USDL-Token-200px.png?1725022887",
933+
"meta": {}
934+
},
935+
{
936+
"addressInfo": "0x007115416ab6c266329a03b09a8aa39ac2ef7d9d",
937+
"chainId": 1,
938+
"name": "Midas BTC Yield Token",
939+
"symbol": "MBTC",
940+
"decimals": 18,
941+
"logoURI": "https://coin-images.coingecko.com/coins/images/51055/large/mbtc.png?1729875716",
942+
"meta": {}
943+
},
944+
{
945+
"addressInfo": "0x66a1e37c9b0eaddca17d3662d6c05f4decf3e110",
946+
"chainId": 1,
947+
"name": "Resolv USR",
948+
"symbol": "USR",
949+
"decimals": 18,
950+
"logoURI": "https://coin-images.coingecko.com/coins/images/40008/large/USR_LOGO.png?1725222638",
951+
"meta": {}
952+
},
914953
{
915954
"addressInfo": "0x62d0a8458ed7719fdaf978fe5929c6d342b0bfce",
916955
"chainId": 1,
@@ -920,6 +959,17 @@
920959
"logoURI": "https://coin-images.coingecko.com/coins/images/32417/large/chain-logo.png?1698114384",
921960
"meta": {}
922961
},
962+
{
963+
"addressInfo": "0x1202f5c7b4b9e47a1a484e8b270be34dbbc75055",
964+
"chainId": 1,
965+
"name": "Resolv wstUSR",
966+
"symbol": "WSTUSR",
967+
"decimals": 18,
968+
"logoURI": "https://coin-images.coingecko.com/coins/images/51880/large/USR_LOGO.png?1732098841",
969+
"meta": {
970+
"poolId": "0aedb3f6-9298-49de-8bb0-2f611a4df784"
971+
}
972+
},
923973
{
924974
"addressInfo": "0x4342B77fE3417Bcb09d0A4383301b0DC733C755B",
925975
"chainId": 1,
@@ -938,6 +988,24 @@
938988
"logoURI": "/tokens/1/swaap.jpg",
939989
"meta": {}
940990
},
991+
{
992+
"addressInfo": "0xf5Ca5a74c6F9fc23880865D8702EaEda6e1f38b1",
993+
"chainId": 1,
994+
"name": "Swaap wstETH-WETH Safeguard",
995+
"symbol": "s-wstETH-WETH-Sa",
996+
"decimals": 18,
997+
"logoURI": "/tokens/1/swaap.jpg",
998+
"meta": {}
999+
},
1000+
{
1001+
"addressInfo": "0xaC4E8D8B3a48C3451d4d0E4a84e6E5Ac52579D05",
1002+
"chainId": 1,
1003+
"name": "Swaap USDC-USDT Safeguard",
1004+
"symbol": "s-USDC-USDT-Sa",
1005+
"decimals": 18,
1006+
"logoURI": "/tokens/1/swaap.jpg",
1007+
"meta": {}
1008+
},
9411009
{
9421010
"addressInfo": "0xf3e621395fc714b90da337aa9108771597b4e696",
9431011
"chainId": 1,
@@ -1009,6 +1077,32 @@
10091077
"poolId": "6b28892f-0909-418d-b4bb-3106fff72449"
10101078
}
10111079
},
1080+
{
1081+
"addressInfo": "0xEe9085fC268F6727d5D4293dBABccF901ffDCC29",
1082+
"chainId": 1,
1083+
"name": "PT Ethena sUSDE 26DEC2024",
1084+
"symbol": "PT-sUSDE-26DEC2024",
1085+
"decimals": 18,
1086+
"logoURI": "https://assets.coingecko.com/coins/images/33669/large/sUSDe-Symbol-Color.png?1716307680",
1087+
"meta": {
1088+
"isPendlePT": true,
1089+
"pendleMarket": "0xa0ab94debb3cc9a7ea77f3205ba4ab23276fed08",
1090+
"poolId": "9be76d1d-734c-435d-bcbf-f0d2704e84d0"
1091+
}
1092+
},
1093+
{
1094+
"addressInfo": "0xAE5099C39f023C91d3dd55244CAFB36225B0850E",
1095+
"chainId": 1,
1096+
"name": "PT Ethena sUSDE 24OCT2024",
1097+
"symbol": "PT-sUSDE-24OCT2024",
1098+
"decimals": 18,
1099+
"logoURI": "https://assets.coingecko.com/coins/images/33669/large/sUSDe-Symbol-Color.png?1716307680",
1100+
"meta": {
1101+
"isPendlePT": true,
1102+
"pendleMarket": "0xbbf399db59a845066aafce9ae55e68c505fa97b7",
1103+
"poolId": "d4dfc52a-fcfb-46e0-856a-3c7006ee8821"
1104+
}
1105+
},
10121106
{
10131107
"addressInfo": "0xec5a52c685cc3ad79a6a347abace330d69e0b1ed",
10141108
"chainId": 1,
@@ -1023,16 +1117,146 @@
10231117
}
10241118
},
10251119
{
1026-
"addressInfo": "0xb997b3418935a1df0f914ee901ec83927c1509a0",
1120+
"addressInfo": "0xB997B3418935A1Df0F914Ee901ec83927c1509A0",
10271121
"chainId": 1,
10281122
"name": "PT ether.fi eBTC 26DEC2024",
10291123
"symbol": "PT-EBTC-26DEC2024",
10301124
"decimals": 8,
1031-
"logoURI": "https://coin-images.coingecko.com/coins/images/50411/large/eBTC.png?1727664788",
1125+
"logoURI": "/tokens/1/0xB997B3418935A1Df0F914Ee901ec83927c1509A0.svg",
10321126
"meta": {
10331127
"isPendlePT": true,
10341128
"pendleMarket": "0x36d3ca43ae7939645c306e26603ce16e39a89192",
10351129
"poolId": "e093fa52-1f6a-4256-9e3e-a58490468c0e"
10361130
}
1131+
},
1132+
{
1133+
"addressInfo": "0x332A8ee60EdFf0a11CF3994b1b846BBC27d3DcD6",
1134+
"chainId": 1,
1135+
"name": "PT Corn Lombard LBTC 26DEC2024",
1136+
"symbol": "PT-cornLBTC-26DEC2024",
1137+
"decimals": 8,
1138+
"logoURI": "/tokens/1/0x332A8ee60EdFf0a11CF3994b1b846BBC27d3DcD6.svg",
1139+
"meta": {
1140+
"isPendlePT": true,
1141+
"pendleMarket": "0xCaE62858DB831272A03768f5844cbe1B40bB381f",
1142+
"poolId": "f7826423-8043-4799-b12a-83a68adc992d"
1143+
}
1144+
},
1145+
{
1146+
"addressInfo": "0x44A7876cA99460ef3218bf08b5f52E2dbE199566",
1147+
"chainId": 1,
1148+
"name": "PT Corn ether.fi eBTC 27MAR2025",
1149+
"symbol": "PT-corn-eBTC-27MAR2025",
1150+
"decimals": 8,
1151+
"logoURI": "/tokens/1/0x44A7876cA99460ef3218bf08b5f52E2dbE199566.svg",
1152+
"meta": {
1153+
"isPendlePT": true,
1154+
"pendleMarket": "0x2C71Ead7ac9AE53D05F8664e77031d4F9ebA064B",
1155+
"poolId": "eb7de368-b460-4638-bde1-50a129109b7b"
1156+
}
1157+
},
1158+
{
1159+
"addressInfo": "0x997Ec6Bf18a30Ef01ed8D9c90718C7726a213527",
1160+
"chainId": 1,
1161+
"name": "PT pumpBTC 27MAR2025",
1162+
"symbol": "PT-pumpBTC-27MAR2025",
1163+
"decimals": 8,
1164+
"logoURI": "/tokens/1/0x997Ec6Bf18a30Ef01ed8D9c90718C7726a213527.svg",
1165+
"meta": {
1166+
"isPendlePT": true,
1167+
"pendleMarket": "0xf8208fb52ba80075af09840a683143c22dc5b4dd",
1168+
"poolId": "100c958b-ff1e-4218-a820-45333746a7e0"
1169+
}
1170+
},
1171+
{
1172+
"addressInfo": "0xa76f0C6e5f286bFF151b891d2A0245077F1Ad74c",
1173+
"chainId": 1,
1174+
"name": "PT Corn pumpBTC 26DEC2024",
1175+
"symbol": "PT-corn-pumpBTC-26DEC2024",
1176+
"decimals": 8,
1177+
"logoURI": "/tokens/1/0xa76f0C6e5f286bFF151b891d2A0245077F1Ad74c.svg",
1178+
"meta": {
1179+
"isPendlePT": true,
1180+
"pendleMarket": "0xf8208fb52ba80075af09840a683143c22dc5b4dd",
1181+
"poolId": "a23e2b97-ff92-4ebf-8c7d-171cad8431ad"
1182+
}
1183+
},
1184+
{
1185+
"addressInfo": "0x23e479ddcda990E8523494895759bD98cD2fDBF6",
1186+
"chainId": 1,
1187+
"name": "PT Corn SolvBTC Babylon 26DEC2024",
1188+
"symbol": "PT-corn-SolvBTC.BBN-26DEC2024",
1189+
"decimals": 8,
1190+
"logoURI": "/tokens/1/0x23e479ddcda990E8523494895759bD98cD2fDBF6.svg",
1191+
"meta": {
1192+
"isPendlePT": true,
1193+
"pendleMarket": "0xeb4d3057738b9ed930f451be473c1ccc42988384",
1194+
"poolId": "cd887bf9-7fc3-49e8-9cf7-6fc1098ed311"
1195+
}
1196+
},
1197+
{
1198+
"addressInfo": "0x61439b9575278054D69c9176d88FaFaf8319E4b7",
1199+
"chainId": 1,
1200+
"name": "PT USD0++ 30JAN2025",
1201+
"symbol": "PT-USD0++-30JAN2025",
1202+
"decimals": 18,
1203+
"logoURI": "/tokens/1/0x61439b9575278054D69c9176d88FaFaf8319E4b7.svg",
1204+
"meta": {
1205+
"isPendlePT": true,
1206+
"pendleMarket": "0x64506968e80c9ed07bff60c8d9d57474effff2c9",
1207+
"poolId": "b7d643b7-285d-4a76-9cbb-c51c5d9b6664"
1208+
}
1209+
},
1210+
{
1211+
"addressInfo": "0x5BaE9a5D67d1CA5b09B14c91935f635CFBF3b685",
1212+
"chainId": 1,
1213+
"name": "PT USD0++ 27MAR2025",
1214+
"symbol": "PT-USD0++-27MAR2025",
1215+
"decimals": 18,
1216+
"logoURI": "/tokens/1/0x5BaE9a5D67d1CA5b09B14c91935f635CFBF3b685.svg",
1217+
"meta": {
1218+
"isPendlePT": true,
1219+
"pendleMarket": "0xafdc922d0059147486cc1f0f32e3a2354b0d35cc",
1220+
"poolId": "74f696d4-1a0e-4a1a-8392-14b714ec3ce6"
1221+
}
1222+
},
1223+
{
1224+
"addressInfo": "0xf696FE29Ef85E892b5926313897D178288faA07e",
1225+
"chainId": 1,
1226+
"name": "PT USD0++ 26JUN2025",
1227+
"symbol": "PT-USD0++-26JUN2025",
1228+
"decimals": 18,
1229+
"logoURI": "/tokens/1/0xf696FE29Ef85E892b5926313897D178288faA07e.svg",
1230+
"meta": {
1231+
"isPendlePT": true,
1232+
"pendleMarket": "0x048680f64d6dff1748ba6d9a01f578433787e24b",
1233+
"poolId": "6c33c8f1-3c7f-4d1a-b554-76b4b575ae31"
1234+
}
1235+
},
1236+
{
1237+
"addressInfo": "0x7aa68E84bCD8d1B4C9e10B1e565DB993f68a3E09",
1238+
"chainId": 1,
1239+
"name": "PT Kelp Gain 26DEC2024",
1240+
"symbol": "PT-agETH-26DEC2024",
1241+
"decimals": 18,
1242+
"logoURI": "https://coin-images.coingecko.com/coins/images/39677/large/Icon___Dark.png?1723610897",
1243+
"meta": {
1244+
"isPendlePT": true,
1245+
"pendleMarket": "0x6010676bc2534652ad1ef5fa8073dcf9ad7ebfbe",
1246+
"poolId": ""
1247+
}
1248+
},
1249+
{
1250+
"addressInfo": "0xB07b9fDd62DC478E521E8bDe3630a777725B0eB4",
1251+
"chainId": 1,
1252+
"name": "PT Kelp rsETH 26DEC2024",
1253+
"symbol": "PT-rsETH-26DEC2024",
1254+
"decimals": 18,
1255+
"logoURI": "https://coin-images.coingecko.com/coins/images/33800/large/Icon___Dark.png?1702991855",
1256+
"meta": {
1257+
"isPendlePT": true,
1258+
"pendleMarket": "0x84a50177a84dad50fdbf665dfbfb39914b52dff2",
1259+
"poolId": ""
1260+
}
10371261
}
10381262
]

0 commit comments

Comments
 (0)