barter-rs / barter-rs Goto Github PK
View Code? Open in Web Editor NEWOpen-source Rust framework for building event-driven live-trading & backtesting systems
Home Page: https://github.com/orgs/barter-rs/repositories
License: MIT License
Open-source Rust framework for building event-driven live-trading & backtesting systems
Home Page: https://github.com/orgs/barter-rs/repositories
License: MIT License
Barter Project
GitHub ProjectThis issue / proposal addresses the organisation of workflow in Barter Project
GitHub Project. It mainly focuses on proper organisation of views (Boards & Tables), Status field etc.
Here are some of the things which come to my mind:
This issue / proposal addresses various miscellaneous tasks related to GitHub repo which need to be performed.
These are some of the tasks which need to be performed (on all 4 repos):
PULL_REQUEST_TEMPLATE
fileISSUE_TEMPLATE
fileI'm very interested in using barter for my project and I'm wondering if there are funds and solid plans / roadmap to maintain and further develop this library in the long term.
I also wanted to point out that the discord link in the "Getting Help" section is invalid
This issue / proposal aims to address the complete rewriting of the whole project git history.
Hello folks!
@just-a-stream entrusted me a role of barter-rs GitHub organisation owner (along with him, of course),
mainly in order to assist him with structuring the GitHub organisation, teams, project, repositories etc.
One of the first items on my repo "housekeeping agenda" is addressing some problems with the project git history.
Afterwards, I will continue to make other advancements to the repository organisation, backlog, docs, CI etc.
Yes, I actually took my time and reviewed over 400 existing commits in this repo
in order to get a better understanding of the project structure & history (roughly 10 hours of work overall).
Hey, at least I learned the project structure and how the things evolved over time.
This proposal (along with its associated upcoming PR) aims to completely rewrite the whole project git history,
in order to fix few major otherwise unresolvable issues which are currently present.
However, performing such an unprecedented change is a very brave & dangerous task with a lot of risks associated.
That is why this proposal is designed in such a way to honour the above-limitations, reduce the risks to zero,
and remove any and all dangers associated with it.
This whole open-source project was started as a @just-a-stream's personal hobby project.
It is completely understandable that starting a small project from scratch does not assume doing "boilerplatey" tasks,
such as properly organising git branches or formatting git commit messages.
Once the project starts growing, the organic need for a stricter project organisation comes by.
Overall, the author did an amazing job of designing and open-sourcing such an ambitious project.
Nonetheless, it does not change the fact that some things should've / can still be organised better, as mentioned below.
This is a list of issues with a varying degrees of severity / significance:
develop
branch was merged into main
branch without a fast-forward merge
feature/*
branches must be merged without FF mergefeat/*
branches weren't rebased when going out-of-date from develop
, develop
was merged into them
feat/*
is when the feature/*
is going to squash its changesmain
branch was entirely ignored
release/*
branches was almost entirely ignored
main
main
branch
hotfix/*
branch utilisationtopic:
prefixes
feat:
prefixAgain, all the mentioned issues are completely normal and to-be-expected from an emerging open-source project.
When starting out, a dev works fast and breaks things.
Nobody has the time for such an overhead of a task such as properly organising git branches, commits or commit messages.
However, that is why it is important to perform some "git housekeeping" tasks before taking the project public,
e.g. making a "public appearance".
Now is better than never. The project is still very young and in its early stage.
The transfer to GitHub is also very recent, so it would be a good idea to do it as soon as possible,
before there is a swarm of forks, pull requests, stars & open issues.
All the forks are from the devs who are in communication with each other in the community (at the time of writing),
so nobody will be surprised by the change, without being informed in advance and offered additional migration help.
There are multiple constraints due to the fragility & delicacy of such a task.
In other words, nobody recommends to rewrite git history, devs are afraid of merge hells & force git pushes,
git rebase is not well-understood or liked etc.
This set of changes is designed with a strict respect to the constraints in mind:
Proposed solution to this problem is to carefully rebase the project's git history.
During the implementation of this solution, additional steps were taken to respect the above-mentioned constraints:
The result is a develop-new
branch which is 1-to-1 compatible with the current develop
branch
throughout all the versions of releases.
There are multiple benefits of this newly-rewritten project git history:
topic:
prefix keywords are properly utilised*
at the end of the commit message title / subject lineFooBar
;
.
git blame
& similar tools(expand)
Nah, just kidding. You can really verify it yourself.
By performing the steps specified below,
you can easily check that all the changes are indeed compatible with the existing develop
branch releases.
You can run this shell script, which is hopefully written concise enough and well-documented with expressive comments.
Yes, I had to write it from scratch, what a waste of time.
#!/usr/bin/env bash
ORIG_DIR="$PWD/barter-rs-orig"
REBASED_DIR="$PWD/barter-rs-rebased"
# this array contains hard-coded original branch "version" commits a.k.a. release commits
# how to easily acquire these commit hashes yourself?
# - run this shell command inside repo dir:
# `git checkout develop; git log --format=oneline Cargo.toml`
# - optionally, filter by commits containing "incr" (which is not 100% reliable due to unstructured message format):
# `git log --format=oneline --grep=incr Cargo.toml`
ORIG_VER_COMMITS=(
0d1467cc5a1b8318a3d2b4d941b1b8a38bd233a7 # v0.1.0
5dba365d1fd53630c7aa82943d3faa12aa27f835 # v0.2.0
1ff46f09f4db8003c816432c16e718e59e00fdd7 # v0.2.1
68d96309bff2a7fc367dd51b0d5120dc09fc46c6 # v0.2.2
fd85e3d47348e6c772116e368eca253075ea6c00 # v0.2.3
ef717c03418840dedfdfc2d95edf950f67ec9e6a # v0.2.4
57ec50a8551455c5102b2082a56f89676ffd9be6 # v0.2.5
64de2b24a7c11391683c6265ffcb1e00e9a88aec # v0.2.6
830c6c17e611107b53e49cdac44da99bade4687f # v0.2.7
430a33b9df0052b24bd170a0f291847035ddbd1c # v0.2.8
204b8f5ca50c260c41a1c1f7f6cdedfcd7f64dfd # v0.2.9
22e0d1d765c64c172377b340716910fda1c4aa37 # v0.2.10
78ab53fa5a042eb56ece795fb0a6a5b0aceca7a8 # v0.2.11
25013f809da85bc5c20995397d20d170626bdcc9 # v0.3.0
557b926e3c202616734dc4a9605253c72416231e # v0.3.1
5221bf49ce227268b2e6868c6055f200c6321d4b # v0.4.0
56e5668ad8ccdf4df4c3a7183d045772aef8f151 # v0.4.1
6d27e30d0603683f2927c106646a3690a4939626 # v0.5.0
6e659b7601cf107f6716315f52be03827e910599 # v0.5.1
05830063457ae54db000a3158000a8dec3239fe6 # v0.5.2
5bae25abc4ed878269bc8df9b679ccf42e235fd3 # v0.5.3
e9021da46717379615be01eadfc4ccae97422441 # v0.5.4
953a54cff61ab2dfc560f7adcf304a249aede437 # v0.5.5
3571f630d2913c76a5eb05e0891b5a3c18c9ad25 # v0.5.6
d322f9ac6d41fd39f738025cc8f789e28db04e26 # v0.5.7
f1543e8da74309619da6d71b220528e14ff54671 # v0.5.8
eaa19c6ed47930f6297692c6d0333d9442b9d336 # v0.5.9
89fd2602199ad99aec2216611d476b34667cf3d3 # v0.5.10
945cf1693de2bbaff6c3aa17775d4e67d5454239 # v0.6.0
f16e763abe006002f7ebf0c295f6bb13a9923a18 # v0.6.1
2022a73303f6ba467c68d8b2660e64b21912a8cb # v0.6.2
c86cebcb47b8d3ff1d82dc179215f1d812893ed4 # v0.6.3
d634cd5e5a3740eb838fefdc63fa8d0320c62419 # v0.6.4
ca2b714b409686fedf01426533395408a3f48d39 # v0.6.5
36e98f7ee9c0ad96fd45d3289a1d2b931f0ae122 # v0.7.0
3d9d4203485ff4e41b0d82527ba14d4a009d39a8 # v0.7.1
495a8727a796871038c1adad5ffa9cab49f791a7 # v0.7.2
f855592f8f073d749ad62301724b9b4ac22d2aa8 # v0.8.0
e10b4533175aadcc5898afed0a623105a2605435 # v0.8.1
9d9fa2f6a35aace70c2b1e2f4d59adac72f94463 # v0.8.2
2c5d2994118ac803a87b44f0bd5ce21c5086f50e # v0.8.3
ba2af7d4639f8977b10dfde927bf4beaf727f9d4 # v0.8.4
)
# this array contains rebased branch "version" commits a.k.a. release commits
# these can be easily acquired, since commit messages are well-formatted
REBASED_VER_COMMITS=(
`git log --format="%H" --grep="build: increment" Cargo.toml | tac`
)
# if arrays are unexpectedly of different length, the script has to terminate - it makes no sense to continue
if [ "${#ORIG_VER_COMMITS[@]}" -ne "${#REBASED_VER_COMMITS[@]}" ]; then
echo "${#ORIG_VER_COMMITS[@]}"
echo "${#REBASED_VER_COMMITS[@]}"
echo "Error: different number of release commits between original & rebased branches" >&2
exit 1
fi
# initial cleanup
rm -rf "$ORIG_DIR"
rm -rf "$REBASED_DIR"
rm -rf "diffs"
# clone repo & duplicate the dir (one for original branch releases & other for rebased branch releases)
git clone "https://www.github.com/barter-rs/barter-rs" "$ORIG_DIR"
cp -r "$ORIG_DIR" "$REBASED_DIR"
# iterate over commit arrays, checkout given commits & compare the differences between git trees at that point in time
# - this is a reliable method, since it takes into account all the changes that might have accumulated over time
# (up until the release commit)
for i in $(seq 1 "${#ORIG_VER_COMMITS[@]}"); do
echo "Info: Comparing versions ($i / ${#ORIG_VER_COMMITS[@]})"
cd "$ORIG_DIR"
git checkout -q "${ORIG_VER_COMMITS[$(($i-1))]}" # add -q flag to hide verbose git commit info
orig_ver="$(grep -Eo '^version\s*=\s*"\d\.\d\.\d+"' Cargo.toml | tr -d ' "' | cut -d = -f2)"
echo "Info: Checked out v$orig_ver (original branch - ${ORIG_VER_COMMITS[$(($i-1))]})"
cd ..
cd "$REBASED_DIR"
git checkout -q "${REBASED_VER_COMMITS[$(($i-1))]}" # add -q flag to hide verbose git commit info
rebased_ver="$(grep -Eo '^version\s*=\s*"\d\.\d\.\d+"' Cargo.toml | tr -d ' "' | cut -d = -f2)"
echo "Info: Checked out v$rebased_ver (rebased branch - ${REBASED_VER_COMMITS[$(($i-1))]})"
cd ..
# check if captured version variables contain exactly 1 line and are not empty
if [ -z "$orig_ver" ] && [ "$(echo $orig_ver | wc -l)" -ne 1 ]; then
err="original repo contains an invalid Cargo.toml file - most likely due to a git conflict"
break
fi
if [ -z "$orig_ver" ] && [ "$(echo $rebased_ver | wc -l)" -ne 1 ]; then
err="rebased repo contains an invalid Cargo.toml file - most likely due to a git conflict"
break
fi
if [ "$orig_ver" != "$rebased_ver" ]; then
err="version mismatch occurred on original version $orig_ver / rebased version $rebased_ver"
break
fi
# compare different branch git trees (a.k.a. directories) for differences
# (`-r` is recursive, `-q` is quiet / brief - e.g. only show which files differ)
diff_output_quiet="$(diff -qr -x ".git" -x ".idea" -x "target" -x "Cargo.lock" "$ORIG_DIR" "$REBASED_DIR")"
if [ ! -z "$diff_output_quiet" ]; then
# if differences exist (they are not an empty string), re-run a full diff to capture content differences as well
diff_output="$(diff -r -x ".git" -x ".idea" -x "target" -x "Cargo.lock" "$ORIG_DIR" "$REBASED_DIR")"
echo "Warning: branches differ on v$orig_ver" >&2
# create dir for saving `diff` outputs
mkdir -p diffs
# save content differences to a file named by a version
echo "$diff_output" > "diffs/v$orig_ver.diff"
else
echo "Info: branch releases are identical for v$orig_ver"
fi
done
# exit cleanup - remove cloned repos
rm -rf "$ORIG_DIR"
rm -rf "$REBASED_DIR"
if [ ! -z "$err" ]; then
echo "Error: $err" >&2
exit 1
fi
Info: Comparing versions (1 / 42)
Info: Checked out v0.1.0 (original branch - 0d1467cc5a1b8318a3d2b4d941b1b8a38bd233a7)
Info: Checked out v0.1.0 (rebased branch - <some SHA-1 hash>)
Info: branch releases are identical for v0.1.0
Info: Comparing versions (2 / 42)
Info: Checked out v0.2.0 (original branch - 5dba365d1fd53630c7aa82943d3faa12aa27f835)
Info: Checked out v0.2.0 (rebased branch - <some SHA-1 hash>)
Info: branch releases are identical for v0.2.0
Info: Comparing versions (3 / 42)
Info: Checked out v0.2.1 (original branch - 1ff46f09f4db8003c816432c16e718e59e00fdd7)
Info: Checked out v0.2.1 (rebased branch - <some SHA-1 hash>)
Info: branch releases are identical for v0.2.1
Info: Comparing versions (4 / 42)
Info: Checked out v0.2.2 (original branch - 68d96309bff2a7fc367dd51b0d5120dc09fc46c6)
Info: Checked out v0.2.2 (rebased branch - <some SHA-1 hash>)
Info: branch releases are identical for v0.2.2
Info: Comparing versions (5 / 42)
Info: Checked out v0.2.3 (original branch - fd85e3d47348e6c772116e368eca253075ea6c00)
Info: Checked out v0.2.3 (rebased branch - <some SHA-1 hash>)
Info: branch releases are identical for v0.2.3
Info: Comparing versions (6 / 42)
Info: Checked out v0.2.4 (original branch - ef717c03418840dedfdfc2d95edf950f67ec9e6a)
Info: Checked out v0.2.4 (rebased branch - <some SHA-1 hash>)
Info: branch releases are identical for v0.2.4
Info: Comparing versions (7 / 42)
Info: Checked out v0.2.5 (original branch - 57ec50a8551455c5102b2082a56f89676ffd9be6)
Info: Checked out v0.2.5 (rebased branch - <some SHA-1 hash>)
Info: branch releases are identical for v0.2.5
Info: Comparing versions (8 / 42)
Info: Checked out v0.2.6 (original branch - 64de2b24a7c11391683c6265ffcb1e00e9a88aec)
Info: Checked out v0.2.6 (rebased branch - <some SHA-1 hash>)
Info: branch releases are identical for v0.2.6
Info: Comparing versions (9 / 42)
Info: Checked out v0.2.7 (original branch - 830c6c17e611107b53e49cdac44da99bade4687f)
Info: Checked out v0.2.7 (rebased branch - <some SHA-1 hash>)
Info: branch releases are identical for v0.2.7
Info: Comparing versions (10 / 42)
Info: Checked out v0.2.8 (original branch - 430a33b9df0052b24bd170a0f291847035ddbd1c)
Info: Checked out v0.2.8 (rebased branch - <some SHA-1 hash>)
Info: branch releases are identical for v0.2.8
Info: Comparing versions (11 / 42)
Info: Checked out v0.2.9 (original branch - 204b8f5ca50c260c41a1c1f7f6cdedfcd7f64dfd)
Info: Checked out v0.2.9 (rebased branch - <some SHA-1 hash>)
Info: branch releases are identical for v0.2.9
Info: Comparing versions (12 / 42)
Info: Checked out v0.2.10 (original branch - 22e0d1d765c64c172377b340716910fda1c4aa37)
Info: Checked out v0.2.10 (rebased branch - <some SHA-1 hash>)
Info: branch releases are identical for v0.2.10
Info: Comparing versions (13 / 42)
Info: Checked out v0.2.11 (original branch - 78ab53fa5a042eb56ece795fb0a6a5b0aceca7a8)
Info: Checked out v0.2.11 (rebased branch - <some SHA-1 hash>)
Info: branch releases are identical for v0.2.11
Info: Comparing versions (14 / 42)
Info: Checked out v0.3.0 (original branch - 25013f809da85bc5c20995397d20d170626bdcc9)
Info: Checked out v0.3.0 (rebased branch - <some SHA-1 hash>)
Info: branch releases are identical for v0.3.0
Info: Comparing versions (15 / 42)
Info: Checked out v0.3.1 (original branch - 557b926e3c202616734dc4a9605253c72416231e)
Info: Checked out v0.3.1 (rebased branch - <some SHA-1 hash>)
Info: branch releases are identical for v0.3.1
Info: Comparing versions (16 / 42)
Info: Checked out v0.4.0 (original branch - 5221bf49ce227268b2e6868c6055f200c6321d4b)
Info: Checked out v0.4.0 (rebased branch - <some SHA-1 hash>)
Info: branch releases are identical for v0.4.0
Info: Comparing versions (17 / 42)
Info: Checked out v0.4.1 (original branch - 56e5668ad8ccdf4df4c3a7183d045772aef8f151)
Info: Checked out v0.4.1 (rebased branch - <some SHA-1 hash>)
Info: branch releases are identical for v0.4.1
Info: Comparing versions (18 / 42)
Info: Checked out v0.5.0 (original branch - 6d27e30d0603683f2927c106646a3690a4939626)
Info: Checked out v0.5.0 (rebased branch - <some SHA-1 hash>)
Info: branch releases are identical for v0.5.0
Info: Comparing versions (19 / 42)
Info: Checked out v0.5.1 (original branch - 6e659b7601cf107f6716315f52be03827e910599)
Info: Checked out v0.5.1 (rebased branch - <some SHA-1 hash>)
Info: branch releases are identical for v0.5.1
Info: Comparing versions (20 / 42)
Info: Checked out v0.5.2 (original branch - 05830063457ae54db000a3158000a8dec3239fe6)
Info: Checked out v0.5.2 (rebased branch - <some SHA-1 hash>)
Info: branch releases are identical for v0.5.2
Info: Comparing versions (21 / 42)
Info: Checked out v0.5.3 (original branch - 5bae25abc4ed878269bc8df9b679ccf42e235fd3)
Info: Checked out v0.5.3 (rebased branch - <some SHA-1 hash>)
Info: branch releases are identical for v0.5.3
Info: Comparing versions (22 / 42)
Info: Checked out v0.5.4 (original branch - e9021da46717379615be01eadfc4ccae97422441)
Info: Checked out v0.5.4 (rebased branch - <some SHA-1 hash>)
Info: branch releases are identical for v0.5.4
Info: Comparing versions (23 / 42)
Info: Checked out v0.5.5 (original branch - 953a54cff61ab2dfc560f7adcf304a249aede437)
Info: Checked out v0.5.5 (rebased branch - <some SHA-1 hash>)
Info: branch releases are identical for v0.5.5
Info: Comparing versions (24 / 42)
Info: Checked out v0.5.6 (original branch - 3571f630d2913c76a5eb05e0891b5a3c18c9ad25)
Info: Checked out v0.5.6 (rebased branch - <some SHA-1 hash>)
Info: branch releases are identical for v0.5.6
Info: Comparing versions (25 / 42)
Info: Checked out v0.5.7 (original branch - d322f9ac6d41fd39f738025cc8f789e28db04e26)
Info: Checked out v0.5.7 (rebased branch - <some SHA-1 hash>)
Info: branch releases are identical for v0.5.7
Info: Comparing versions (26 / 42)
Info: Checked out v0.5.8 (original branch - f1543e8da74309619da6d71b220528e14ff54671)
Info: Checked out v0.5.8 (rebased branch - <some SHA-1 hash>)
Info: branch releases are identical for v0.5.8
Info: Comparing versions (27 / 42)
Info: Checked out v0.5.9 (original branch - eaa19c6ed47930f6297692c6d0333d9442b9d336)
Info: Checked out v0.5.9 (rebased branch - <some SHA-1 hash>)
Info: branch releases are identical for v0.5.9
Info: Comparing versions (28 / 42)
Info: Checked out v0.5.10 (original branch - 89fd2602199ad99aec2216611d476b34667cf3d3)
Info: Checked out v0.5.10 (rebased branch - <some SHA-1 hash>)
Info: branch releases are identical for v0.5.10
Info: Comparing versions (29 / 42)
Info: Checked out v0.6.0 (original branch - 945cf1693de2bbaff6c3aa17775d4e67d5454239)
Info: Checked out v0.6.0 (rebased branch - <some SHA-1 hash>)
Info: branch releases are identical for v0.6.0
Info: Comparing versions (30 / 42)
Info: Checked out v0.6.1 (original branch - f16e763abe006002f7ebf0c295f6bb13a9923a18)
Info: Checked out v0.6.1 (rebased branch - <some SHA-1 hash>)
Info: branch releases are identical for v0.6.1
Info: Comparing versions (31 / 42)
Info: Checked out v0.6.2 (original branch - 2022a73303f6ba467c68d8b2660e64b21912a8cb)
Info: Checked out v0.6.2 (rebased branch - <some SHA-1 hash>)
Info: branch releases are identical for v0.6.2
Info: Comparing versions (32 / 42)
Info: Checked out v0.6.3 (original branch - c86cebcb47b8d3ff1d82dc179215f1d812893ed4)
Info: Checked out v0.6.3 (rebased branch - <some SHA-1 hash>)
Info: branch releases are identical for v0.6.3
Info: Comparing versions (33 / 42)
Info: Checked out v0.6.4 (original branch - d634cd5e5a3740eb838fefdc63fa8d0320c62419)
Info: Checked out v0.6.4 (rebased branch - <some SHA-1 hash>)
Info: branch releases are identical for v0.6.4
Info: Comparing versions (34 / 42)
Info: Checked out v0.6.5 (original branch - ca2b714b409686fedf01426533395408a3f48d39)
Info: Checked out v0.6.5 (rebased branch - <some SHA-1 hash>)
Info: branch releases are identical for v0.6.5
Info: Comparing versions (35 / 42)
Info: Checked out v0.7.0 (original branch - 36e98f7ee9c0ad96fd45d3289a1d2b931f0ae122)
Info: Checked out v0.7.0 (rebased branch - <some SHA-1 hash>)
Info: branch releases are identical for v0.7.0
Info: Comparing versions (36 / 42)
Info: Checked out v0.7.1 (original branch - 3d9d4203485ff4e41b0d82527ba14d4a009d39a8)
Info: Checked out v0.7.1 (rebased branch - <some SHA-1 hash>)
Info: branch releases are identical for v0.7.1
Info: Comparing versions (37 / 42)
Info: Checked out v0.7.2 (original branch - 495a8727a796871038c1adad5ffa9cab49f791a7)
Info: Checked out v0.7.2 (rebased branch - <some SHA-1 hash>)
Info: branch releases are identical for v0.7.2
Info: Comparing versions (38 / 42)
Info: Checked out v0.8.0 (original branch - f855592f8f073d749ad62301724b9b4ac22d2aa8)
Info: Checked out v0.8.0 (rebased branch - <some SHA-1 hash>)
Info: branch releases are identical for v0.8.0
Info: Comparing versions (39 / 42)
Info: Checked out v0.8.1 (original branch - e10b4533175aadcc5898afed0a623105a2605435)
Info: Checked out v0.8.1 (rebased branch - <some SHA-1 hash>)
Info: branch releases are identical for v0.8.1
Info: Comparing versions (40 / 42)
Info: Checked out v0.8.2 (original branch - 9d9fa2f6a35aace70c2b1e2f4d59adac72f94463)
Info: Checked out v0.8.2 (rebased branch - <some SHA-1 hash>)
Info: branch releases are identical for v0.8.2
Info: Comparing versions (41 / 42)
Info: Checked out v0.8.3 (original branch - 2c5d2994118ac803a87b44f0bd5ce21c5086f50e)
Info: Checked out v0.8.3 (rebased branch - <some SHA-1 hash>)
Info: branch releases are identical for v0.8.3
Info: Comparing versions (42 / 42)
Info: Checked out v0.8.4 (original branch - ba2af7d4639f8977b10dfde927bf4beaf727f9d4)
Info: Checked out v0.8.4 (rebased branch - <some SHA-1 hash>)
Info: branch releases are identical for v0.8.4
If you run into issues while attempting to merge your forked branch back into this rebased develop-new
branch,
here are the steps you need to take to solve the issues:
git checkout <mybranch>; git checkout -b <mybranch-backup>; git checkout <mybranch>
develop-old
branch (either via rebase or merge)develop-new
branch
git rebase --onto develop-new develop-old
git cherry-pick
all of your commits (which haven't yet been merged into develop-old
branch) into a new branchdevelop-new
git format-patch
and apply them to your newly createdgit am
(essentially the same as cherry-picking)This section is meant for individual(s) who might oppose to the idea of this proposal,
and offers an alternative view in form of common answers for common questions you (or they) might ask.
Why rebasing?? My boss / co-worker / friend / cousin / joe / medium.com article told me that rebasing is bad?? We should never rebase, it is forbidden!
Well, such a generalised statement assumes some level of ignorance from your end.
Sure, if you are a dev who is just starting out and have an intern-level skills & experience, or are afraid of git,
then yes, treating the git
tool as a black box, and avoiding common sources of problems & complications,
such as rebasing, might be a smart approach.
But if you take your time to actually dive deeper into how git works,
then there is no reason to be afraid of some more aggressive git tasks,
as long as nothing breaks & all the existing constraints are satisfied.
Who cares?? Who cares about the git history, commit messages and branches organisation...
Well, who cares about the version control at all? Why not just pack your code changes into a ZIP file,
upload it to Google Drive and share the link to other devs who want to collaborate?
Or even better, why not print out the new code which you wrote, pack it into an envelope / letter,
and ship it via postal service or use a homing pigeon who will deliver it to other devs?
We can go on and on like this... Same mentality, same level of ignorance, same answer.
Projects which have ambitions for growing and want to onboard a lot of new contributors (which we hope for here)
need a modern collaboration tools & approaches. Stricter order means less chaos, and more progress & advancement.
Changes are bad... I am afraid of changes, it will break my current and future commits!
Is this really a question?
Anyhow, if you have read this verbose & overly-explained proposal writeup up to this point,
then you would've understood that nothing will actually break, and you won't have any problems merging your changes,
or submitting new PRs in future.
There are some minor additional items which should be considered in future.
For one, all the future contributions should continue to respect the conventions discussed in this proposal,
and improve the overall quality of project code & structure.
Another thing, there is some concrete room for a future improvement:
topic:
type:
feat
fix
test
refactor
perf
style
docs
build
chore
ci
revert
docs/CONTRIBUTING.md
filePls just approve this proposal (and its associated PR) and let me take care of this stuff, I can handle it. Thx!
If any other contributor experiences issues with merging their work back to the repo (which is highly unlikely),
I am always available for one-on-one consultations, to help them resolve the issues without any trouble or pain.
But most likely, the problems won't even occur, or will be solved by running a single git rebase
command
(git rebase --onto develop-new develop-old
if you will) in the worst-case scenario. But I repeat, unlikely.
Thanks for taking your time to read this!
This is a list of items which need to be performed:
barter-rs
project git repo historybarter-data-rs
project git repo historybarter-integration-rs
project git repo historybarter-execution-rs
project git repo historyUnsoundness is found using the nightly toolchain with prettytable-rs
version 0.8.0. Details are found in issue
Could you please upgrade prettytable-rs
to 0.10.0 which uses safe rust to convert Table
to TableSlice
.
I would love to contribute, but I failed to find the branch where 0.8.6
locates.
Hello! is it possible to use your library to trade on DEX?
I got bad formatted output, when I ran the example with BTCUSDTPERP data (about 1000 ticks).
It seems that printing the performance analysis and system event logs is executed asynchronously.
# snipped...
PositionUpdate { position_id: "255385be-bc70-4f3d-bdb6-186049dd7900_binance_(btc_usdt, spot)_position", update_time: 2022-11-14T21:14:59.999Z, current_symbol_price: 16306.0, current_value_gross: 97.836, unrealised_profit_loss: -30.915479999999995 }
PositionUpdate { position_id: "255385be-bc70-4f3d-bdb6-186049dd7900_binance_(btc_usdt, spot)_position", update_time: 2022-11-14T21:29:59.999Z, current_symbol_price: 16338.0, current_value_gross: 98.028, unrealised_profit_loss: -30.723479999999988 }
PositionUpdate { position_id: "255385be-bc70-4f3d-bdb6-186049dd7900_binance_(btc_usdt, spot)_position", update_time: 2022-11-14T21:44:59.999Z, current_symbol_price: 16374.4, current_value_gross: 98.2464, unrealised_profit_loss: -30.50508 }
PositionUpdate { position_id: "255385be-bc70-4f3d-bdb6-186049dd7900_binance_(btc_usdt, spot)_position", update_time: 2022-11-14T21:59:59.999Z, current_symbol_price: 16396.6, current_value_gross: 98.3796, unrealised_profit_loss: -30.371879999999997 }
| PositionUpdate { position_id: "255385be-bc70-4f3d-bdb6-186049dd7900_binance_(btc_usdt, spot)_position", update_time: 2022-11-14T22:14:59.999Z, current_symbol_price: 16404.2, current_value_gross: 98.4252, unrealised_profit_loss: -30.32627999999999 }
0.000 PositionUpdate { position_id: "255385be-bc70-4f3d-bdb6-186049dd7900_binance_(btc_usdt, spot)_position", update_time: 2022-11-14T22:29:59.999Z, current_symbol_price: 16393.4, current_value_gross: 98.36040000000001, unrealised_profit_loss: -30.39107999999998 }
| PositionUpdate { position_id: "255385be-bc70-4f3d-bdb6-186049dd7900_binance_(btc_usdt, spot)_position", update_time: 2022-11-14T22:44:59.999Z, current_symbol_price: 16356.0, current_value_gross: 98.136, unrealised_profit_loss: -30.615479999999998 }
0 PositionUpdate { position_id: "255385be-bc70-4f3d-bdb6-186049dd7900_binance_(btc_usdt, spot)_position", update_time: 2022-11-14T22:59:59.999Z, current_symbol_price: 16398.0, current_value_gross: 98.388, unrealised_profit_loss: -30.36347999999999 }
Signal { time: 2023-01-01T14:32:05.173112179Z, exchange: binance, instrument: Instrument { base: btc, quote: usdt, kind: Spot }, signals: {CloseLong: SignalStrength(1.0), Short: SignalStrength(1.0)}, market_meta: MarketMeta { close: 16549.2, time: 2022-11-14T23:14:59.999Z } }
PositionUpdate { position_id: "255385be-bc70-4f3d-bdb6-186049dd7900_binance_(btc_usdt, spot)_position", update_time: 2022-11-14T23:14:59.999Z, current_symbol_price: 16549.2, current_value_gross: 99.29520000000001, unrealised_profit_loss: -29.456279999999985 }
OrderEvent { time: 2023-01-01T14:32:05.173124573Z, exchange: binance, instrument: Instrument { base: btc, quote: usdt, kind: Spot }, market_meta: MarketMeta { close: 16549.2, time: 2022-11-14T23:14:59.999Z }, decision: CloseLong, quantity: -0.006, order_type: Market }
FillEvent { time: 2023-01-01T14:32:05.173127616Z, exchange: binance, instrument: Instrument { base: btc, quote: usdt, kind: Spot }, market_meta: MarketMeta { close: 16549.2, time: 2022-11-14T23:14:59.999Z }, decision: CloseLong, quantity: -0.006, fill_value_gross: 99.29520000000001, fees: Fees { exchange: 9.929520000000002, slippage: 4.964760000000001, network: 0.0 } }
PositionExit { position_id: "255385be-bc70-4f3d-bdb6-186049dd7900_binance_(btc_usdt, spot)_position", exit_time: 2023-01-01T14:32:05.173127616Z, exit_balance: Balance { time: 2023-01-01T14:32:05.173127616Z, total: 8754.7218585, available: 8670.3209385 }, exit_fees: Fees { exchange: 9.929520000000002, slippage: 4.964760000000001, network: 0.0 }, exit_fees_total: 14.894280000000002, exit_avg_price_gross: 16549.2, exit_value_gross: 99.29520000000001, realised_profit_loss: -29.494619999999987 }
Balance { time: 2023-01-01T14:32:05.173127616Z, total: 8754.7218585, available: 8754.7218585 }
Signal { time: 2023-01-01T14:32:05.173154442Z, exchange: binance, instrument: Instrument { base: btc, quote: usdt, kind: Spot }, signals: {Short: SignalStrength(1.0), CloseLong: SignalStrength(1.0)}, market_meta: MarketMeta { close: 16634.6, time: 2022-11-14T23:29:59.999Z } }
OrderEvent { time: 2023-01-01T14:32:05.173164310Z, exchange: binance, instrument: Instrument { base: btc, quote: usdt, kind: Spot }, market_meta: MarketMeta { close: 16634.6, time: 2022-11-14T23:29:59.999Z }, decision: Short, quantity: -0.006, order_type: Market }
FillEvent { time: 2023-01-01T14:32:05.173167174Z, exchange: binance, instrument: Instrument { base: btc, quote: usdt, kind: Spot }, market_meta: MarketMeta { close: 16634.6, time: 2022-11-14T23:29:59.999Z }, decision: Short, quantity: -0.006, fill_value_gross: 99.8076, fees: Fees { exchange: 9.98076, slippage: 4.99038, network: 0.0 } }
Position { position_id: "255385be-bc70-4f3d-bdb6-186049dd7900_binance_(btc_usdt, spot)_position", meta: PositionMeta { enter_time: 2022-11-14T23:29:59.999Z, update_time: 2023-01-01T14:32:05.173167174Z, exit_balance: None }, exchange: binance, instrument: Instrument { base: btc, quote: usdt, kind: Spot }, side: Sell, quantity: -0.006, enter_fees: Fees { exchange: 9.98076, slippage: 4.99038, network: 0.0 }, enter_fees_total: 14.97114, enter_avg_price_gross: 16634.6, enter_value_gross: 99.8076, exit_fees: Fees { exchange: 0.0, slippage: 0.0, network: 0.0 }, exit_fees_total: 0.0, exit_avg_price_gross: 0.0, exit_value_gross: 0.0, current_symbol_price: 16634.6, current_value_gross: 99.8076, unrealised_profit_loss: -29.94228, realised_profit_loss: 0.0 }
Balance { time: 2023-01-01T14:32:05.173167174Z, total: 8754.7218585, available: 8639.9431185 }
Signal { time: 2023-01-01T14:32:05.173184671Z, exchange: binance, instrument: Instrument { base: btc, quote: usdt, kind: Spot }, signals: {CloseLong: SignalStrength(1.0), Short: SignalStrength(1.0)}, market_meta: MarketMeta { close: 16692.1, time: 2022-11-14T23:44:59.999Z } }
PositionUpdate { position_id: "255385be-bc70-4f3d-bdb6-186049dd7900_binance_(btc_usdt, spot)_position", update_time: 2022-11-14T23:44:59.999Z, current_symbol_price: 16692.1, current_value_gross: 100.15259999999999, unrealised_profit_loss: -30.28728 }
Signal { time: 2023-01-01T14:32:05.173202045Z, exchange: binance, instrument: Instrument { base: btc, quote: usdt, kind: Spot }, signals: {CloseLong: SignalStrength(1.0), Short: SignalStrength(1.0)}, market_meta: MarketMeta { close: 16605.2, time: 2022-11-14T23:59:59.999Z } }
PositionUpdate { position_id: "255385be-bc70-4f3d-bdb6-186049dd7900_binance_(btc_usdt, spot)_position", update_time: 2022-11-14T23:59:59.999Z, current_symbol_price: 16605.2, current_value_gross: 99.6312, unrealised_profit_loss: -29.765880000000013 }
|
+-----------------------+--------+------+--------+--------------+----------------+-------------+------------------+------------------+-------------+--------------+--------------+---------------+--------------+--------------+-------------------+---------------+--------------------+
It seems that I am unable to align the timelines of independently running traders: I initially intended to monitor a futures contract trader, and when certain conditions are met, send trading commands to the corresponding options contract trader (in another independent thread). However, since the engine is event-driven, traders trade based on their independently held timelines of data and derived market events under the control of their respective strategies. Any insights in terms of timeline alignment between traders?
I read the source code of the example, and it seems that a trader is bound to a strategy, and a strategy can only receive one data source. So is barter unable to implement strategies like triple screen?
https://www.quantifiedstrategies.com/alexander-elder-triple-screen-strategy/
Tried run examples with the following command
cd barter-rs # Same level as barter-rs/Cargo.toml
cargo run --example engine_with_historic_candles
rust complains the data file candles_1h.json
can not be found
Running
target/debug/examples/engine_with_historic_candles
thread 'main' panicked at 'failed to read file: Os { code: 2, kind: NotFound, message: "No such file or directory" }', examples/engine_with_historic_candles.rs:116:71
I guess this is because the path of the data file lives in barter-rs/examples/data/candles_1h.json
, while the current working directory is barter-rs
. The line causing trouble is in engine_with_historic_candles.rs
line 116: let candles = fs::read_to_string("barter-rs/examples/data/candles_1h.json").expect("failed to read file");
When I changed the path to fs::read_to_string("examples/data/candles_1h.json")
, The error can be fixed.
I am not sure if this is a bug, or I am in the wrong directory? What is the expected working directory for a new user to run the example with cargo run --example engine_with_historic_candles
?
The example requires the example has a field close_time
:
candles
.into_iter()
.map(|candle| MarketEvent {
exchange_time: candle.close_time,
received_time: Utc::now(),
exchange: Exchange::from("binance"),
......
But the example data in candles_1h.json
only has start_time
and end_time
, but no close_time
:
{
"start_time": "2022-04-05 20:00:00.000000000 UTC",
"end_time": "2022-04-05 21:00:00.000000000 UTC",
"open": 1000.0,
"high": 1100.0,
"low": 900.0,
"close": 1050.0,
"volume": 1000000000.0,
"trade_count": 100
},
resulting in this error:
Running
target/debug/examples/engine_with_historic_candles
thread 'main' panicked at 'failed to parse candles String: Error("missing fieldclose_time
", line: 11, column: 3)', examples/engine_with_historic_candles.rs:119:55
This can also be fixed by replacing all the end_time
fields with close_time
in candles_1h.json
. But I am not sure whether the start_time
and end_time
fileds are still valid fields to keep.
This issue / proposal attempts to address the project's need for a proper documentation update.
Type of docs which need to be updated / added (including but not limited to):
README.md
ARCHITECTURE.md
CONTRIBUTING.md
MAINTAINING.md
CODE_OF_CONDUCT.md
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.