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

Leverage tiers types #22465

Merged
merged 14 commits into from
May 24, 2024
Merged

Leverage tiers types #22465

merged 14 commits into from
May 24, 2024

Conversation

samgermain
Copy link
Member

No description provided.

@carlosmiei carlosmiei self-assigned this May 17, 2024
@samgermain
Copy link
Member Author

Getting these errors, because it looks like the transpiler is adding 2 any imports

ccxt\async_support\okx.py:12:20: F811 Redefinition of unused `Any` from line 10
ccxt\okx.py:11:20: F811 Redefinition of unused `Any` from line 9

@carlosmiei
Copy link
Collaborator

Getting these errors, because it looks like the transpiler is adding 2 any imports

ccxt\async_support\okx.py:12:20: F811 Redefinition of unused `Any` from line 10
ccxt\okx.py:11:20: F811 Redefinition of unused `Any` from line 9

@samgermain will check it

@carlosmiei
Copy link
Collaborator

let's remove the any from now

@carlosmiei carlosmiei marked this pull request as ready for review May 24, 2024 11:13
@carlosmiei
Copy link
Collaborator

DEMO


> ccxt@4.3.30 cli.cs
> dotnet run --project "./cs/cli/cli.csproj" binanceusdm FetchLeverageTiers --sandbox

[]
{
  "tiers": {
    "ICX/USDT:USDT": [
      {
        "tier": 1,
        "currency": "USDT",
        "minNotional": 0.0,
        "maxNotional": 5000.0,
        "maintenanceMarginRate": 0.01,
        "maxLeverage": 50.0,
        "info": {
          "bracket": 1,
          "initialLeverage": 50,
          "notionalCap": 5000,
          "notionalFloor": 0,
          "maintMarginRatio": 0.01,
          "cum": 0.0
        }
      },
      {
        "tier": 2,
        "currency": "USDT",
        "minNotional": 5000.0,
        "maxNotional": 25000.0,
        "maintenanceMarginRate": 0.025,
        "maxLeverage": 20.0,
        "info": {
          "bracket": 2,
          "initialLeverage": 20,
          "notionalCap": 25000,
          "notionalFloor": 5000,
          "maintMarginRatio": 0.025,
          "cum": 75.0
        }
      },

@carlosmiei
Copy link
Collaborator

Python v3.11.7
CCXT v4.3.30
binanceusdm.fetchLeverageTiers()
{'1000BONK/USDC:USDC': [{'currency': 'USDC',
                         'info': {'bracket': '1',
                                  'cum': '0.0',
                                  'initialLeverage': '50',
                                  'maintMarginRatio': '0.01',
                                  'notionalCap': '5000',
                                  'notionalFloor': '0'},
                         'maintenanceMarginRate': 0.01,
                         'maxLeverage': 50.0,
                         'maxNotional': 5000.0,
                         'minNotional': 0.0,
                         'tier': 1.0},
                        {'currency': 'USDC',
                         'info': {'bracket': '2',
                                  'cum': '50.0',
                                  'initialLeverage': '25',
                                  'maintMarginRatio': '0.02',
                                  'notionalCap': '50000',
                                  'notionalFloor': '5000'},
                         'maintenanceMarginRate': 0.02,
                         'maxLeverage': 25.0,
                         'maxNotional': 50000.0,
                         'minNotional': 5000.0,

@carlosmiei carlosmiei merged commit cb501c3 into ccxt:master May 24, 2024
0 of 2 checks passed
kroitor pushed a commit that referenced this pull request May 24, 2024
* parseLiquidations types

* chore: parseLeverageTiers - types

* feat: new type - LeverageTiersDict

* fetchLeverageTiers tpes

* chore: fetchMarketLeverageTiers - types

* chore: parseLeverageTiers - types

* complete c# type

* LeverageTiersDict -> LeverageTiers

* htx.fetchMarketLeverageTiers minor fix

* coinex parseLeverageTier header fix

* remove :any typing

* update types

---------

Co-authored-by: carlosmiei <43336371+carlosmiei@users.noreply.github.com>

[ci skip]
@samgermain samgermain deleted the leverage-tiers-types branch May 24, 2024 18:56
@samgermain
Copy link
Member Author

let's remove the any from now

the info parameter type for parseMarketLeverageTiers should probably be Dict actually

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants