require Ecto.Query

[
  %History.Tokens.Token{name: "0x", symbol: "zrx"},
  %History.Tokens.Token{name: "1inch", symbol: "1inch"},
  %History.Tokens.Token{name: "Aave", symbol: "aave"},
  %History.Tokens.Token{name: "Ada", symbol: "ada"},
  %History.Tokens.Token{name: "Alchemix", symbol: "alcx"},
  %History.Tokens.Token{name: "Algorand", symbol: "algo"},
  %History.Tokens.Token{name: "Alpha Finance", symbol: "alpha"},
  %History.Tokens.Token{name: "Ampleforth", symbol: "ampl"},
  %History.Tokens.Token{name: "AscendEx", symbol: "asd"},
  %History.Tokens.Token{name: "Audius", symbol: "audio"},
  %History.Tokens.Token{name: "Avalanche", symbol: "avax"},
  %History.Tokens.Token{name: "Axie Infinity", symbol: "axs"},
  %History.Tokens.Token{name: "Badger DAO", symbol: "badger"},
  %History.Tokens.Token{name: "BakerySwap", symbol: "bake"},
  %History.Tokens.Token{name: "Balancer", symbol: "bal"},
  %History.Tokens.Token{name: "Bancor", symbol: "bnt"},
  %History.Tokens.Token{name: "Band Protocol", symbol: "band"},
  %History.Tokens.Token{name: "Bao", symbol: "bao"},
  %History.Tokens.Token{name: "Binance Coin", symbol: "bnb"},
  %History.Tokens.Token{name: "Binance USD", symbol: "busd"},
  %History.Tokens.Token{name: "Bitcoin Cash", symbol: "bch"},
  %History.Tokens.Token{name: "Bitcoin", symbol: "btc"},
  %History.Tokens.Token{name: "Bonfida", symbol: "fida"},
  %History.Tokens.Token{name: "BurgerSwap", symbol: "burger"},
  %History.Tokens.Token{name: "C.R.E.A.M", symbol: "cream"},
  %History.Tokens.Token{name: "Celo", symbol: "celo"},
  %History.Tokens.Token{name: "Celsius Token", symbol: "cel"},
  %History.Tokens.Token{name: "Chainlink", symbol: "link"},
  %History.Tokens.Token{name: "Chiliz", symbol: "comp"},
  %History.Tokens.Token{name: "Compound USDT", symbol: "cusdt"},
  %History.Tokens.Token{name: "Compound", symbol: "chz"},
  %History.Tokens.Token{name: "Convergence", symbol: "conv"},
  %History.Tokens.Token{name: "Cosmos", symbol: "atom"},
  %History.Tokens.Token{name: "Crypto.com", symbol: "cro"},
  %History.Tokens.Token{name: "Curve DAO Token", symbol: "crv"},
  %History.Tokens.Token{name: "DODO", symbol: "dodo"},
  %History.Tokens.Token{name: "Dai", symbol: "dai"},
  %History.Tokens.Token{name: "Dent", symbol: "dent"},
  %History.Tokens.Token{name: "Dogecoin", symbol: "doge"},
  %History.Tokens.Token{name: "EOS", symbol: "eos"},
  %History.Tokens.Token{name: "Enjin Coin", symbol: "enj"},
  %History.Tokens.Token{name: "Ethereum", symbol: "eth"},
  %History.Tokens.Token{name: "FTX Token", symbol: "ftt"},
  %History.Tokens.Token{name: "Fantom", symbol: "ftm"},
  %History.Tokens.Token{name: "HXRO", symbol: "hxro"},
  %History.Tokens.Token{name: "Holy Trinity Pool", symbol: "holy"},
  %History.Tokens.Token{name: "Huobi Token", symbol: "ht"},
  %History.Tokens.Token{name: "KeeperDAO", symbol: "rook"},
  %History.Tokens.Token{name: "Kin", symbol: "kin"},
  %History.Tokens.Token{name: "Kyber Network", symbol: "knc"},
  %History.Tokens.Token{name: "LEO", symbol: "leo"},
  %History.Tokens.Token{name: "Litecoin", symbol: "ltc"},
  %History.Tokens.Token{name: "Loopring", symbol: "lrc"},
  %History.Tokens.Token{name: "Maker", symbol: "mkr"},
  %History.Tokens.Token{name: "Matic", symbol: "matic"},
  %History.Tokens.Token{name: "OKB", symbol: "okb"},
  %History.Tokens.Token{name: "OMG Network", symbol: "omg"},
  %History.Tokens.Token{name: "Oxygen", symbol: "oxy"},
  %History.Tokens.Token{name: "PAX Gold", symbol: "paxg"},
  %History.Tokens.Token{name: "PancakeSwap", symbol: "cake"},
  %History.Tokens.Token{name: "Paxos Standard", symbol: "pax"},
  %History.Tokens.Token{name: "Polkadot", symbol: "dot"},
  %History.Tokens.Token{name: "Polygon", symbol: "matic"},
  %History.Tokens.Token{name: "Pundi X", symbol: "pundix"},
  %History.Tokens.Token{name: "REN", symbol: "ren"},
  %History.Tokens.Token{name: "Raydium", symbol: "ray"},
  %History.Tokens.Token{name: "Reef Finance", symbol: "reef"},
  %History.Tokens.Token{name: "SKALE", symbol: "skl"},
  %History.Tokens.Token{name: "Serum Ecosystem Token", symbol: "seco"},
  %History.Tokens.Token{name: "Serum", symbol: "srm"},
  %History.Tokens.Token{name: "Shiba Inu", symbol: "shib"},
  %History.Tokens.Token{name: "Solana", symbol: "sol"},
  %History.Tokens.Token{name: "Storj", symbol: "storj"},
  %History.Tokens.Token{name: "Sushi", symbol: "sushi"},
  %History.Tokens.Token{name: "Swipe", symbol: "sxp"},
  %History.Tokens.Token{name: "Synthetix", symbol: "snx"},
  %History.Tokens.Token{name: "Tether Gold", symbol: "xaut"},
  %History.Tokens.Token{name: "Tether", symbol: "usdt"},
  %History.Tokens.Token{name: "The Graph", symbol: "grt"},
  %History.Tokens.Token{name: "Thorchain", symbol: "rune"},
  %History.Tokens.Token{name: "TomoChain", symbol: "tomo"},
  %History.Tokens.Token{name: "Travala", symbol: "ava"},
  %History.Tokens.Token{name: "Tron", symbol: "trx"},
  %History.Tokens.Token{name: "TrueUSD", symbol: "tusd"},
  %History.Tokens.Token{name: "USD Coin", symbol: "usdc"},
  %History.Tokens.Token{name: "USD", symbol: "usd"},
  %History.Tokens.Token{name: "Uniswap", symbol: "uni"},
  %History.Tokens.Token{name: "Waves", symbol: "waves"},
  %History.Tokens.Token{name: "Wrapped BTC", symbol: "wbtc"},
  %History.Tokens.Token{name: "XRP", symbol: "xrp"},
  %History.Tokens.Token{name: "Yearn.Finance", symbol: "yfi"},
]
|> Enum.map(fn s ->
  case History.Repo.one(
         Ecto.Query.from(t in History.Tokens.Token, where: t.name == ^s.name and t.symbol == ^s.symbol)
       ) do
    nil -> s
    token -> token
  end
end)
|> Enum.map(&History.Tokens.Token.changeset(&1, %{}))
|> Enum.each(&History.Repo.insert_or_update!/1)
