ragetrade / utilities Goto Github PK
View Code? Open in Web Editor NEWArbitrage bot for FTX and RageTrade
Arbitrage bot for FTX and RageTrade
Both try to ensure that post trade margin is not breached
https://github.com/RageTrade/arbitrage-bot/blob/6f7e0c61b02e51509c47706055e8f991d21af1d6/arbitrage-bot/execute.ts#L127
Here since numerator is same but denominator is different position size on the two platforms would not be same.
Is this intentional?
https://github.com/RageTrade/arbitrage-bot/blob/6f7e0c61b02e51509c47706055e8f991d21af1d6/arbitrage-bot/rage-trade/index.ts#L231
Correct logic:
if (currentPosition.gt(0)) {
maxLong = marketValueNotional/0.5 - currentPositionNotional
maxShort = marketValueNotional/0.5 + currentPositionNotional
}
else if (currentPosition.lt(0)) {
maxLong = marketValueNotional/0.5 + currentPositionNotional
maxShort = marketValueNotional/0.5 - currentPositionNotional
}
else (currentPosition.eq(0)) {
maxLong = marketValueNotional/0.5
maxShort = marketValueNotional/0.5
}
Can we make a single call for twapPrice and pass it everywhere?
https://github.com/RageTrade/arbitrage-bot/blob/cb9dc696b06a609800a58b72ecfed43082484c7d/arbitrage-bot/rage-trade/index.ts#L242
This check should be basis the position that you are trying to take and not you current position
https://github.com/RageTrade/arbitrage-bot/blob/02354cd0602c55140326c31cf141cad49bd7f416/keeper-liquidation/index.ts#L37
"tokenPositions[0].netTraderPosition.gt(0)" -> this should be !=0
"tokenPositions[0].balance.isZero()" -> should be removed
Is this profit calculation correct?
ftxEthPrice should be ftxMargin
getAccountInfo is used just to getNetPosition at multiple places.
use getNetPosition instead of getAccountInfo wherever possible since it would be cheaper and faster
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.