Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimal fee structure estimate based on trading pair and securities class #736

Open
wants to merge 26 commits into
base: main
Choose a base branch
from

Conversation

timsnyder-sorella
Copy link
Contributor

This PR replaces the fee table with a more sophisticated estimate of fees for each exchange. It considers the exchange pair and the securities class (spot vs. derivatives).

Limitations:
Not all token symbols were found in the database, so not all could be recognized. This will default them to a lower rate usually.
There were tons of tokens that didn't have a defined constant for them, and I didn't try to find one for all of them (this affected Kucoin). Let me know if I should try and resolve these.

@0xvanbeethoven 0xvanbeethoven deleted the feat/fees branch August 8, 2024 06:42
@0xvanbeethoven 0xvanbeethoven restored the feat/fees branch August 8, 2024 06:42
@0xvanbeethoven 0xvanbeethoven reopened this Aug 8, 2024
jnoorchashm37 and others added 21 commits August 12, 2024 10:21
* yer

* wip

* wip

* proper endpoint

* snapshot-downloader

* don't delete if full db

* better comment

* yer

* yer

* cleanup

* cleanup

* proper week chunks

* change name to avoid conflict
* just experimenting

Former-commit-id: b852f8d

added curve test

Former-commit-id: 64915dd

fixed curve test

Former-commit-id: 07913c7

add logging

Former-commit-id: 389626c

add uniswap test

Former-commit-id: cb1e279

add uniswap test

Former-commit-id: cc34d65

add uniswap test

Former-commit-id: cd65440

add uniswap test

Former-commit-id: 1b73d11

add uniswap test

Former-commit-id: 70c7e68

add uniswap test

Former-commit-id: 4c3f566

add uniswap test

Former-commit-id: 771190d

add uniswap test

Former-commit-id: d2479ab

add sushiswap test

Former-commit-id: ef2d32d

add sushiswap test

Former-commit-id: 8ad47f1

add sushiswap test

Former-commit-id: c1ed1fd

add curve test

Former-commit-id: 28d60a7

add curve test

Former-commit-id: befb981

add curve test

Former-commit-id: babe96c

add curve test

Former-commit-id: 45271a9

add curve test

Former-commit-id: 32e41d6

updated commented out tests

Former-commit-id: 68a09c8

add curve test

Former-commit-id: 3d72db2

add curve test

Former-commit-id: fd80790

add curve test

Former-commit-id: 32dbdea

add curve test

Former-commit-id: 4047e69

add curve test

Former-commit-id: 62407b5

add curve test

Former-commit-id: 31dfcde

add curve test

Former-commit-id: 508420b

add curve test

Former-commit-id: 5dcd45d

add curve test

Former-commit-id: 79e7ce6

add curve test

Former-commit-id: c1c96a0

clean up PR

Former-commit-id: a4f7359

fix curve test

Former-commit-id: 25fba7d

address clippy

Former-commit-id: 4ebcc98

address clippy

Former-commit-id: dab0010

update deps

Former-commit-id: 86d4d7e

check-build.sh

Former-commit-id: 630d414

check-build.sh

Former-commit-id: 526ce1e

add windows

Former-commit-id: f22d6a2

add metapoolv2 plainpool1 test

Former-commit-id: 00f9c0f

add metapoolv2 plainpool1 test

Former-commit-id: 7f14006

add metapoolv2 plainpool1 test

Former-commit-id: 54bdfb4

add metapoolv2 tests

Former-commit-id: d32be19

add metapoolv2 tests

Former-commit-id: c3b2c36

add metapoolv2 tests

Former-commit-id: 4c8a2db

add metapoolv2 tests

Former-commit-id: 44ca6b2

add metapoolv2 tests

Former-commit-id: a959690

add metapoolv2 tests

Former-commit-id: 6f684a6

add metapoolv2 tests

Former-commit-id: 0ce393b

add metapoolv2 tests

Former-commit-id: 2f99d8d

add metapoolv2 tests

Former-commit-id: 583a86b

add metapoolv2 tests

Former-commit-id: e7ad6f8

add metapoolv2 tests

Former-commit-id: 82fbade

fix query_base_pool to try both methods

Former-commit-id: 80cbe30

add curve crvUSD tests

Former-commit-id: e5054ed

add curve crvUSD tests

Former-commit-id: da98d60

clean up curve tests

Former-commit-id: 572b8a0

clean up curve tests

Former-commit-id: 397da7b

check-build.sh

Former-commit-id: 4634ebf

check-build.sh

Former-commit-id: 7a84ae0

check-build.sh

Former-commit-id: bfc3c9f

ready for review

Former-commit-id: 3988345

* cleaned up

* remove old fields

* fix up tests

* fix up tests

* fix up tests

* fix up tests

* fix up tests

* fix up tests

* fix up tests
* benchmarking quote downloader

* better benchmarks

* test

* test

* test

* test

* benchmarking with par iter for conversion

* separated

* find matching blocks optimisation

* fix index out of bounds

* lol forgot

* further optimized

* test size delta origin

* test perf improvements

* par is better

* test

* bench

* test

* Better cex quotes downloader, can still make faster but cba rn

* done
* benchmarking quote downloader

* better benchmarks

* test

* test

* test

* test

* benchmarking with par iter for conversion

* separated

* find matching blocks optimisation

* fix index out of bounds

* lol forgot

* further optimized

* test size delta origin

* test perf improvements

* par is better

* test

* bench

* test

* Better cex quotes downloader, can still make faster but cba rn

* done

* cleanup to latest rust nightly
* fixo

* fixo
* test

* test, without order by

* test

* Made clippy happy, cleaned up spammy logs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants