Skip to content

Commit

Permalink
✨ Add router support and new pools to creator
Browse files Browse the repository at this point in the history
  • Loading branch information
NotJeremyLiu committed Jan 29, 2023
1 parent d31aac5 commit e8cf1b4
Showing 1 changed file with 11 additions and 13 deletions.
24 changes: 11 additions & 13 deletions src/creator/creator.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,7 @@
import src.contract.factory.factories as factories

from src.contract.router.router import Router
from src.contract.router.routers import (
TerraswapRouter,
AstroportRouter,
PhoenixRouter,
WhiteWhaleRouter
)
from src.contract.router.routers import TerraswapRouter

class Creator:

Expand Down Expand Up @@ -86,7 +81,8 @@ def create_pool(contract_address: str, pool: str) -> Pool:
"loop": pools.Loop,
"phoenix": pools.Phoenix,
"white_whale": pools.Whitewhale,
"hopers": pools.Hopers
"hopers": pools.Hopers,
"wyndex": pools.Wyndex,
}
return protocols[pool](contract_address, pool)

Expand All @@ -99,19 +95,21 @@ def create_factory(contract_address: str, protocol: str) -> Factory:
"terraswap": factories.Terraswap,
"astroport": factories.Terraswap,
"phoenix": factories.Terraswap,
"white_whale": factories.Terraswap
"white_whale": factories.Terraswap,
"wyndex": factories.Terraswap
}
return protocols[protocol](contract_address, protocol)

@staticmethod
def create_router(contract_address: str, router: str) -> Router:
def create_router(contract_address: str, router: str, contracts: dict) -> Router:
""" Factory function to create router contracts.
@DEV TODO: Add more router contracts here.
"""
routers = {
"terraswap": TerraswapRouter,
"astroport": AstroportRouter,
"phoenix": PhoenixRouter,
"white_whale": WhiteWhaleRouter
"astroport": TerraswapRouter,
"phoenix": TerraswapRouter,
"white_whale": TerraswapRouter,
"wyndex": TerraswapRouter
}
return routers[router](contract_address, router)
return routers[router](contract_address, router, contracts)

0 comments on commit e8cf1b4

Please sign in to comment.