🥔 🥔 🥔
Potato Trader is a trading library written in Haskell created for the purpose of bot trading shit coins.
Exchanges and tokens are encoded at the type level to help enforce sensible trading compile time.
For example a token on an exchange is defined by
class (Token t, Exchange e) => ExchangeToken t e
a trading pair is thus
class (ExchangeToken t1 e, ExchangeToken t2 e) => ExchangePair t1 t2 e
and given 2 trading pairs, we can arbitrage
arbitrage :: (ExchangePair t1 t2 e1, ExchangePair t1 t2 e2) => ...
Potato Trader currently supports the following trading algorithms:
- market maker (needs testing)
And supports the following exchanges:
- Uniswap (on any Web3 compatible blockchain)
Once an exchange is implemented, supported tokens and trading pairs must be (easily) added in code to support trading with type safety.
Some planned features that aren't implemented yet:
- accounts are currently read unencrypted from a file directly inside the library. This is solved with
ExchangeAccounttype family but it hasn't been fully integrated yet
- better test cases for effectful code using test-fixture
- note that the current tests require a key file and communicate with live exchanges D: