Skip to content

Commit

Permalink
add mode
Browse files Browse the repository at this point in the history
  • Loading branch information
hskang9 committed Aug 13, 2024
1 parent 778d7fb commit ffe9655
Show file tree
Hide file tree
Showing 4 changed files with 262 additions and 10 deletions.
25 changes: 23 additions & 2 deletions src/buildList.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,13 @@ const kroma = require("./tokens/kroma.json");
const morphHolesky = require("./tokens/morph_holesky.json");
const metal = require("./tokens/metal.json");
const fraxtal = require("./tokens/fraxtal.json");
const mode = require("./tokens/mode.json");

// pairs
const basePairs = require("./pairs/base.json");
const kromaPairs = require("./pairs/kroma.json");
const morphHoleskyPairs = require("./pairs/morph_holesky.json");
const modePairs = require("./pairs/mode.json");
const metalPairs = require("./pairs/metal.json");
const fraxtalPairs = require("./pairs/fraxtal.json");

Expand Down Expand Up @@ -57,13 +59,22 @@ module.exports = function buildList() {
"https://coin-images.coingecko.com/coins/images/279/large/ethereum.png?1696501628",
},
"Morph Holesky": {
name: "Ethereum Token",
name: "Ether",
symbol: "ETH",
decimals: 18,
address: "0x5300000000000000000000000000000000000011",
logoURI:
"https://raw.githubusercontent.com/morph-l2/morph-list/main/tokenIcons/ETH.svg",
},
Mode: {
chainId: 8453,
name: "Ether",
symbol: "ETH",
decimals: 18,
address: "0x4200000000000000000000000000000000000006",
logoURI:
"https://assets.coingecko.com/coins/images/279/large/ethereum.png?1696501628",
},
Fraxtal: {
chainId: 252,
address: "0x4200000000000000000000000000000000000006",
Expand Down Expand Up @@ -187,6 +198,7 @@ module.exports = function buildList() {
Base: "https://basescan.org",
Kroma: "https://kromascan.com",
"Morph Holesky": "https://explorer-holesky.morphl2.io/",
Mode: "https://modescan.io/",
Fraxtal: "https://fraxscan.com/",
Metal: "https://metalscan.io/",
},
Expand All @@ -203,6 +215,10 @@ module.exports = function buildList() {
address: "0x2D25464C8C044b9Ab122076BE55E353fA1F9bd29",
startBlock: 6038844,
},
Mode: {
address: "0xd7ABA1cbAd246249be6a0de9a449FB5EDEFf1E47",
startBlock: 11698902,
},
Fraxtal: {
address: "0xd7ABA1cbAd246249be6a0de9a449FB5EDEFf1E47",
startBlock: 8354873,
Expand All @@ -225,6 +241,10 @@ module.exports = function buildList() {
address: "0xEA98008F20e06636470b6a3C7ddA9caE63B668EC",
startBlock: 5389919,
},
Mode: {
address: "0xEA98008F20e06636470b6a3C7ddA9caE63B668EC",
startBlock: 5389919,
},
Fraxtal: {
address: "0xEA98008F20e06636470b6a3C7ddA9caE63B668EC",
startBlock: 5389919,
Expand All @@ -241,10 +261,11 @@ module.exports = function buildList() {
...basePairs,
...kromaPairs,
...morphHoleskyPairs,
...modePairs,
...fraxtalPairs,
...metalPairs,
],
tokens: [...base, ...kroma, ...morphHolesky, ...fraxtal, ...metal]
tokens: [...base, ...kroma, ...morphHolesky, ...mode, ...fraxtal, ...metal]
// sort them by symbol for easy readability
.sort((t1, t2) => {
if (t1.chainId === t2.chainId) {
Expand Down
169 changes: 169 additions & 0 deletions src/pairs/mode.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,169 @@
[
{
"base": {
"chainId": 34443,
"address": "0xcDd475325D6F564d27247D1DddBb0DAc6fA0a5CF",
"symbol": "WBTC",
"name": "Wrapped BTC",
"decimals": 8,
"logoURI": "https://ethereum-optimism.github.io/data/WBTC/logo.png"
},
"quote": {
"chainId": 34443,
"address": "0x4200000000000000000000000000000000000006",
"name": "Ether",
"symbol": "ETH",
"decimals": 18,
"logoURI": "https://ethereum-optimism.github.io/data/ETH/logo.png"
},
"listing_price": 22.394724
},
{
"base": {
"chainId": 34443,
"address": "0xcDd475325D6F564d27247D1DddBb0DAc6fA0a5CF",
"symbol": "WBTC",
"name": "Wrapped BTC",
"decimals": 8,
"logoURI": "https://ethereum-optimism.github.io/data/WBTC/logo.png"
},
"quote": {
"chainId": 34443,
"address": "0xd988097fb8612cc24eeC14542bC03424c656005f",
"name": "USD Coin",
"symbol": "USDC",
"decimals": 6,
"logoURI": "https://ethereum-optimism.github.io/data/USDC/logo.png"
},
"listing_price": 59822.28
},
{
"base": {
"chainId": 34443,
"address": "0xcDd475325D6F564d27247D1DddBb0DAc6fA0a5CF",
"symbol": "WBTC",
"name": "Wrapped BTC",
"decimals": 8,
"logoURI": "https://ethereum-optimism.github.io/data/WBTC/logo.png"
},
"quote": {
"chainId": 34443,
"address": "0xf0F161fDA2712DB8b566946122a5af183995e2eD",
"name": "Tether",
"symbol": "USDT",
"decimals": 6,
"logoURI": "https://ethereum-optimism.github.io/data/USDT/logo.png"
},
"listing_price": 59822.28
},
{
"base": {
"chainId": 34443,
"address": "0x80137510979822322193FC997d400D5A6C747bf7",
"symbol": "STONE",
"name": "StakeStone Ether",
"decimals": 18
},
"quote": {
"chainId": 34443,
"address": "0x4200000000000000000000000000000000000006",
"name": "Ether",
"symbol": "ETH",
"decimals": 18,
"logoURI": "https://ethereum-optimism.github.io/data/ETH/logo.png"
},
"listing_price": 1,
"buy_tick": 10,
"sell_tick": 10
},
{
"base": {
"chainId": 34443,
"address": "0x80137510979822322193FC997d400D5A6C747bf7",
"symbol": "STONE",
"name": "StakeStone Ether",
"decimals": 18
},
"quote": {
"chainId": 34443,
"address": "0xd988097fb8612cc24eeC14542bC03424c656005f",
"name": "USD Coin",
"symbol": "USDC",
"decimals": 6,
"logoURI": "https://ethereum-optimism.github.io/data/USDC/logo.png"
},
"listing_price": 2735.44
},
{
"base": {
"chainId": 34443,
"address": "0x80137510979822322193FC997d400D5A6C747bf7",
"symbol": "STONE",
"name": "StakeStone Ether",
"decimals": 18
},
"quote": {
"chainId": 34443,
"address": "0xf0F161fDA2712DB8b566946122a5af183995e2eD",
"name": "Tether",
"symbol": "USDT",
"decimals": 6,
"logoURI": "https://ethereum-optimism.github.io/data/USDT/logo.png"
},
"listing_price": 2735.44
},
{
"base": {
"chainId": 34443,
"address": "0xDfc7C877a950e49D2610114102175A06C2e3167a",
"symbol": "MODE",
"name": "Mode",
"decimals": 18
},
"quote": {
"chainId": 34443,
"address": "0x4200000000000000000000000000000000000006",
"name": "Ether",
"symbol": "ETH",
"decimals": 18,
"logoURI": "https://ethereum-optimism.github.io/data/ETH/logo.png"
},
"listing_price": 0.0000044
},
{
"base": {
"chainId": 34443,
"address": "0xDfc7C877a950e49D2610114102175A06C2e3167a",
"symbol": "MODE",
"name": "Mode",
"decimals": 18
},
"quote": {
"chainId": 34443,
"address": "0xd988097fb8612cc24eeC14542bC03424c656005f",
"name": "USD Coin",
"symbol": "USDC",
"decimals": 6,
"logoURI": "https://ethereum-optimism.github.io/data/USDC/logo.png"
},
"listing_price": 0.01177
},
{
"base": {
"chainId": 34443,
"address": "0xDfc7C877a950e49D2610114102175A06C2e3167a",
"symbol": "MODE",
"name": "Mode",
"decimals": 18
},
"quote": {
"chainId": 34443,
"address": "0xf0F161fDA2712DB8b566946122a5af183995e2eD",
"name": "Tether",
"symbol": "USDT",
"decimals": 6,
"logoURI": "https://ethereum-optimism.github.io/data/USDT/logo.png"
},
"listing_price": 0.01177
}
]
30 changes: 22 additions & 8 deletions src/scripts/generateDefaultPairs.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
// replace path with path to desired network tokenlist
const tokenlist = require("../tokens/fraxtal.json")
const tokenlist = require("../tokens/mode.json")



function addETHUSDTPairs() {
function adddefaultPairs() {

const stablecoin2 = tokenlist.find((token) => token.symbol === "USDT");
const stablecoin = tokenlist.find((token) => token.symbol === "USDC");
const eth = tokenlist.find((token) => token.symbol === "ETH");

const remainingTokens = tokenlist.filter((token) => token.address !== stablecoin.address && token.address !== eth.address);
const remainingTokens = tokenlist.filter((token) => token.address !== stablecoin.address && token.address !== eth.address && token.address !== stablecoin2.address);


const ETHUSDTPairs = [];
const defaultPairs = [];

for (const token of remainingTokens) {
ETHUSDTPairs.push({
defaultPairs.push({
"base": {
"chainId": token.chainId,
"address": token.address,
Expand All @@ -25,7 +27,7 @@ function addETHUSDTPairs() {
"quote": eth,
"listing_price": 0.
})
ETHUSDTPairs.push({
defaultPairs.push({
"base": {
"chainId": token.chainId,
"address": token.address,
Expand All @@ -37,9 +39,21 @@ function addETHUSDTPairs() {
"quote": stablecoin,
"listing_price": 0.
})
defaultPairs.push({
"base": {
"chainId": token.chainId,
"address": token.address,
"symbol": token.symbol,
"name": token.name,
"decimals": token.decimals,
"logoURI": token.logoURI
},
"quote": stablecoin2,
"listing_price": 0.
})
}

console.log(JSON.stringify(ETHUSDTPairs, null, 2));
console.log(JSON.stringify(defaultPairs, null, 2));
}

addETHUSDTPairs()
adddefaultPairs()
48 changes: 48 additions & 0 deletions src/tokens/mode.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
[
{
"chainId": 34443,
"address": "0x4200000000000000000000000000000000000006",
"name": "Ether",
"symbol": "ETH",
"decimals": 18,
"logoURI": "https://ethereum-optimism.github.io/data/ETH/logo.png"
},
{
"chainId": 34443,
"address": "0xd988097fb8612cc24eeC14542bC03424c656005f",
"name": "USD Coin",
"symbol": "USDC",
"decimals": 6,
"logoURI": "https://ethereum-optimism.github.io/data/USDC/logo.png"
},
{
"chainId": 34443,
"address": "0xf0F161fDA2712DB8b566946122a5af183995e2eD",
"name": "Tether",
"symbol": "USDT",
"decimals": 6,
"logoURI": "https://ethereum-optimism.github.io/data/USDT/logo.png"
},
{
"chainId": 34443,
"address": "0xcDd475325D6F564d27247D1DddBb0DAc6fA0a5CF",
"name": "Wrapped BTC",
"symbol": "WBTC",
"decimals": 8,
"logoURI": "https://ethereum-optimism.github.io/data/WBTC/logo.png"
},
{
"chainId": 34443,
"address": "0x80137510979822322193FC997d400D5A6C747bf7",
"name": "StakeStone Ether",
"symbol": "STONE",
"decimals": 18
},
{
"chainId": 34443,
"address": "0xDfc7C877a950e49D2610114102175A06C2e3167a",
"name": "Mode",
"symbol": "MODE",
"decimals": 18
}
]

0 comments on commit ffe9655

Please sign in to comment.