Giter Site home page Giter Site logo

backend's People

Contributors

0xproteus avatar evmcheb avatar iofq avatar reduce avatar taureau75 avatar troopercrypto avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

backend's Issues

fix/lastprice reporting 24h change as 100%

As you can see below, the last price msg has a lot of these changes at 100% even though there is volume reported:

  • additional: set change to 0 if no yesterday price is available.

grafik

A little proposal - use Promise.allSettled for improve a bit getERC20Info performance.

Link to place of the code -

tokenInfos.decimals = await contract.decimals()

Explanation: currently you getting tokenInfos step by step (decimals, name, symbol), and you won't get tokenInfos.name while you didnt get contract.decimals. I think it will be a much better use Promise.allSettled here with passing all needed promises to it. The profit is that you'll launch getting three promises in parallel, not step by step as in the current case.

How you can make it (pseudo-code):
const [decimalsRes, nameRes, symbolRes] = await Promise.allSettled([ contract.decimals(), contract.name(), contract.symbol() ]);

Also, i have some syntax proposals for you (like contain some magic values to constants or enums or stuff like that). If you're interested, i can contact with you for help.

Use time independent from user when creating an order

When creating an order, a time is pulled from the user. This time is also used to set the market order and limit order expiry. Users can run into issues when their pc clock isn't synced or when they're using VPN.

Solution: stop pulling a time from the users, but use an independent/general source, independent from the user, unrelated to the user, to create the orders.

How to get assets decimals on REST APIs?

I am trying to use the API in the REST way due to how my code is set up. I am referring to the code at

https://github.com/ZigZagExchange/frontend/blob/master/src/lib/api/providers/APIZKProvider.js#L127

to submit an order. However, the doc says

The current list of operations available over HTTP POST are: submitorder2, requestquote, orderreceiptreq, refreshliquidity, dailyvolumereq

So it seems there is no way I can get the market info, from which I can retrieve baseAssetDecimals and quoteAssetDecimals to create arguments for the syncWallet.getOrder() call.

I think the problem is we are not exposing subscribemarket to the HTTP POST APIs.

A temporary solution is for me to hardcode the decimals but that feels a bit hacky. Is there a better solution?

cc @taureau75

WebSocket is not open

got error below when trying to swap. does anyone know how to fix this?
throw new Error('WebSocket is not open: readyState 0 (CONNECTING)');

Pay orders fees with tokens

I would need to know if there is a way to submitorder3 ( or submitorder2) paying the fee in tokens instead of using ETH, thanks.

submitorder2 stopped working

Hi, was using the operation "submitorder2" using
wss://secret-thicket-93345.herokuapp.com/

but as of yesterday it stopped working, it doesn't send error message but it doesn't swap anymore.

Bridge issue when using "max" button

Seems like a rounding up problem or zkSyncs contract can't handle too precise amounts?

Person uses our bridge UI that taps into zkSync's smart contract. Person uses "max" button. Amount gets rounded up and user tries to bridge more than what they actually have. Resulting in failed transaction.

https://etherscan.io/tx/0x785b92239ddd77deb8193e188e0eced833a94547eb8ab5fb01cb2e5b742eb032

Screenshot 2022-03-03 at 14 05 47

https://discord.com/channels/907722916697878559/919189316205428776/919535257907265536

"Tried to send Max amount with dust, and it gave me that error."
"if we allow to deposit only x.xxx we should be good regardless"
"It's Max amount."

"Changed the uint amount a little and 2nd one went through.
1: 2205985190uint
2: 2205985100uint
should have tested if it worked with 2205985189 ( changing uint amount 1 lower)
So when they press Max on our bridge, we should only insert everything before the ''-'' and assume the rest as ''00'' 22059851-00. So basically not add all the ''dust'' of their tokens into the amount. If you get what I mean
I explained it bad but I think you get what i meant lmao. Anyway I g2g for few hours.
or you can test if it works when we leave 1 digit from their dust when they click ''MAX''
I think it might work then too, since I was able to send his amount ( cause I still had balance left of that token in my L1 wallet.)"

"So aslong as you block the person from briding all of their tokens, they will not get this bug.
So when they press ''MAX'' in the bridge interface, just make it so we input all but 1 millionth of the token for them or something."

feat: Backend API scaling & CMC integration

Description

We want to list market pairs on CoinMarketCap and need a few REST endpoints to do this. This may require some refactoring of the API so things don't get messy like separating endpoints into microservices. While doing this, let's scale the socket and REST API by rebroadcasting socket events via redis client pub/sub so we can run multiple instances in parallel as well as setup heroku autoscaling (dynos) so we're not phased by further DDOS attacking haters. Continuous integration should be a couple switches in the heroku dashboard so let's throw that in there and setup production (prod) and staging (master) branches.

Goals

  • Rebase from feat/improve-market-maker-interaction
  • Refactor backend architecture to allow for REST and socket endpoints to run as isolated microservices
  • Scale the backend API socket server so that we can run multiple instances in parallel
  • #53
  • Continuous integration for prod/staging
  • Setup autoscaling
  • Add typescript

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.