Getting started

yarn install # untested yarn.lock is generated by bun install

# disabling debug will show closer to real world performance
yarn start --no-dev --minify

Future Work

many room for improvements and optimizations, esp. in keeping orderbook up to date turns out it is more cpu demanding than i imagined, some ideas to improve:

  • backend websocket subscription should accept an interval params, so that we can control the frequency of data coming in, this is the biggest bottleneck right now as low end device wouldn't keep up
  • move some Orderbook features (websocket, reconciling data, rendering) to run in separate thread (less effort) or to run in native (more effort)
  • usually orderbooks shows green/red bars to indicate buy/sell size, once it gets to that point, we definitely needs to use reanimated or skia
  • reuse single websocket connection for multiple data streams

Known Issues

'FlatList' cannot be used as a JSX component.
  Its instance type 'FlatList<unknown>' is not a valid JSX element.
    The types returned by 'render()' are incompatible between these types.
      Type 'React.ReactNode' is not assignable to type 'import("/Users/ger/src/justomat/expo-chart-orderbook/node_modules/@types/hoist-non-react-statics/node_modules/@types/react/ts5.0/index").ReactNode'.
        Type 'ReactElement<any, string | JSXElementConstructor<any>>' is not assignable to type 'ReactNode'.
          Property 'children' is missing in type 'ReactElement<any, string | JSXElementConstructor<any>>' but required in type 'ReactPortal'.ts(2786)

Some error on vscode due to @types/hoist-non-react-statics using different typescript version, but it doesn't affect the build

License

MIT