Skip to content

Updating main branch#1

Open
Tbelleng wants to merge 175 commits intoTbelleng:mainfrom
keep-starknet-strange:main
Open

Updating main branch#1
Tbelleng wants to merge 175 commits intoTbelleng:mainfrom
keep-starknet-strange:main

Conversation

@Tbelleng
Copy link
Owner

No description provided.

delaaxe and others added 7 commits September 25, 2023 19:02
* Add swap pricing utils wip

* Add pricing utils

* use i128

* Fix i128

* Use i128

* Fix swap fees

* Remove duplicated functions

* Add tests

* Fixes

* Cleanup

* Update market_utils.cairo

* Review comments

* Rename i128 functions

* Rename I128Store

* Add test

* Format
* implemented first function

* added _get_price_impact_usd function

* corrected build fails

* fixed coding style

* added third function

* implemented all functions

* fix use i128

* fix tests

* remove previous test folder

* add tests

* implemented all tests skeleton

* corrected coding style

* fix internal function name

* uncomment referral storage tests

* fix requests

* fixed merge bugs
completed role_store + tests

Co-authored-by: zarboq <37303126+zarboq@users.noreply.github.com>
* feat: add increase_order_utils

* chore: add todo for proces_order tests

* chore: formatting

* dev: resolve comments

* dev: use data_store

* chore: remove position_store_utils

* dev: remove PositionTrait

* test: add another validate_oracle_block_numbers

---------

Co-authored-by: Michel <105498726+Sk8erboi84@users.noreply.github.com>
Co-authored-by: zarboq <37303126+zarboq@users.noreply.github.com>
* refact: add Copy derive on struct

* feat: add errors needed for decrease_position()

* feat: add missing functions mock

* refact: replace u128 by i128 in DecreasePositionCache

* feat: implement decrease_position()

* fix: i128 import

* refact: use u128_to_i128

* test: add skeletons

* feat: add test skeleton

* fix: duplicated functions and import

* fix: merge issue
swapped unwrap() for expect + div by 0 checks + semgrep rules

changed unwraps to expect

added div by zero checks

add semgrep cairo rules
@Tbelleng
Copy link
Owner Author

updating main branch

@Tbelleng Tbelleng closed this Sep 27, 2023
@Tbelleng Tbelleng reopened this Sep 27, 2023
sparqet and others added 20 commits September 28, 2023 16:39
* implemented external functions

* fix coding style

* begin tests

* added tests

* added globalreetrency abd only checks

* changed TODO message

* removed onlySelf

---------

Co-authored-by: zarboq <37303126+zarboq@users.noreply.github.com>
added new deployment scritps
* implemented claim_fees and claim_ui_fees functions

* implemented claim_fees and claim_ui_fees functions

* fix coding style
add all deployment scripts for contracts
…ure (#466)

* contrib: moved betacod to eytanlvy

* readme update

* readme update name

* corrected i128_values typing

---------

Co-authored-by: zarboq <37303126+zarboq@users.noreply.github.com>
…mary (#468)

* add details in ADL doc

* fix link to adl file

* change DOGE for STRK ;)

* creat + add content of bank module doc

* clean

* add details to callback doc + add link to bank file in bank doc

* adjust name of a link

* reduce size of func name

* add chain doc

* add config-module doc

* for test

* reset to base version

* add infos to data doc -> can be completed with more details

* add content in Deposit doc

* change a litle form + content

* add content + warning

* add content to fee module doc

* add content to gas doc file

* add content to liquidation doc file

* creat + add content into market doc file

* add content to mock doc file

* non doc + delete conclusion in some files

* add content to order doc file

* create and price doc add content

* small modif in Read doc

* add content to referral doc

* add content to role doc file

* update of utils doc file

* add content to swap doc file

* add content to withdrawal doc

* add new doc in summary

* Add Module to name when it's missing in SUMMARY.md

* Upgrading, synthesizing and cleaning

* clean

---------

Co-authored-by: zarboq <37303126+zarboq@users.noreply.github.com>
* wip

* Update market_utils.cairo

* Add `get_pool_value_info`

* Reorder functions

* Add functions

* Update data_store.cairo

* Use i128

* Add remaining functions

* Cleanup

* Cleanup

* Update market_utils.cairo

* Fix event

* Update test_market_events_emitted.cairo

* Remove `market_event_utils`

* Fix error argument
* feat: implement create_liquidation_order function

* fix: use max instead of hardcoded value

* fix old test and add new test

* fix: make changes required by upstream change

* update test to use event emitter from setup

* start_roll before calling create_liquidation_order

* comment out test due to upstream issue

* update test name

---------

Co-authored-by: Michel <105498726+Sk8erboi84@users.noreply.github.com>
Co-authored-by: sparqet <37338401+sparqet@users.noreply.github.com>
* implememted reader_utils functions

* fixed change request

* fixed coding style

* fixed Default impl to derive

---------

Co-authored-by: zarboq <37303126+zarboq@users.noreply.github.com>
* implemented the log data and removed th event log data

* removed event log data from test

* switch import to log data

* switched the names of variable

* switched the names of variable
* fixed size

* fixed

* fixed

* fixed

* removed oak
* contrib: moved betacod to eytanlvy

* readme update

* readme update name

* compiling skeleton

* getamountpersizedelta

* debugging

* get_pnl_to_pool_factor not working

* get_borrowing_fees checkpoint

* getnextborrowingfees done

* debugging u/i128

* debugging pt 7

* building but one test failing because of overflow

* used get_block_timestamp() correctly

* all tests are working

* changes requested made

* fmt

* fixed until apply_delta_to_virtual_inventory_for_swaps()

* did everything except params error

* panicked with rs, have to fix later

* sync fork but not compiling because thread panicked

* fmt

* ready for review

* deleted unnecessary file

* removed unecessary returns

* removed unecessary imports

* apply_delta_to_open_interest

* error with params

---------

Co-authored-by: Michel <105498726+Sk8erboi84@users.noreply.github.com>
* feat: implement order_vault & placeholder for test

* fix coding style
* Adding Role admin check to the role-admin branch

* Precise panic error and code refactor
* feat: implement decrease_position_collateral_utils

* fixes: changes after review

---------

Co-authored-by: Michel <105498726+Sk8erboi84@users.noreply.github.com>
* 10 functions done

* almost finished, debug next

* debug time

* debuging

* pushing recent changes/ still bug because missing functions

* debuging finished

* adding comments on functions

* almost clean

* Emit bug

* programm compile 🎉

* resolving last test

* All test passed

* resolve request

* 1 test failed because of max swap path lenght exceed test

* resolving failed test

* resolve

* solving

* compilation resolved

---------

Co-authored-by: Michel <105498726+Sk8erboi84@users.noreply.github.com>
* test(deposit_vault_contract): Can start doing some unit tests from that

* test(deposit_vault_contract): Better format

* test(deposit_vault_contract): All test passes! 🥳

* test(deposit_vault_contract): Added unit test for transfer_out not enough balance

---------

Co-authored-by: akhercha <akherchache@pm.me>
Co-authored-by: sparqet <37338401+sparqet@users.noreply.github.com>
sparqet and others added 30 commits June 17, 2024 18:21
* refactor integration tests

* trigger Limit Decrease tested

* uncomment tests

* fix coding style
* refactor integration tests

* liquidation test passed

* fix coding style
* refactor integration tests

* liquidation fails
* refactor integration tests

* remove tests commented lines
* refactor integration tests

* added pragma lib
Co-authored-by: sparqet <37338401+sparqet@users.noreply.github.com>
* refactor integration tests

* implemented oracle functions
* refactor integration tests

* oracle good for testing features

* fix coding style
* refactor integration tests

* open long and increase correctly

* fix coding style
* refactor integration tests

* open increase decrease and close long
* refactor integration tests

* use set_prices_params

* remove comments on set_primary_price

* fix coding style
* fix: pool value in deposit error

* fix: replace cancel deposit reason by empty string
feat: fix key field in Order and Withdrawal

Co-authored-by: sparqet <37338401+sparqet@users.noreply.github.com>
* refactor integration tests

* change handle contract by exchange router
* refactor integration tests

* trigger increase & decrease long
* refactor integration tests

* check failing tests for decrese increase and close trigger
* refactor integration tests

* swap test passed 1 ETH to 5000 USDC
* refactor integration tests

* use send_tokens instead of transfer

* fix test bug
* refactor integration tests

* use send_tokens instead of transfer

* refactor deploy setup / long / swap
* refactor integration tests

* use send_tokens instead of transfer

* short opened closed

* short position open close

* refacto short test
* refactor integration tests

* use send_tokens instead of transfer

* short opened closed

* short position open close

* refacto short test

* change transfer out call

* fix coding style
* refactor integration tests

* rename assert failing tests
* refactor integration tests

* liquidation test passed
* refactor integration tests

* leverage long PnL positif & leveraged x10 liquidated
* refactor integration tests

* set u256 constants on testnet

* set u256 constants on testnet
* refactor integration tests

* add is_position_liquidable in reader

* fix coding style
* refactor integration tests

* add is_position_liquidable in reader

* fix coding style

* refactor deposit setup tests
* refactor integration tests

* add is_position_liquidable in reader

* fix coding style

* refactor deposit setup tests

* refactor execute function test

* fix test and coding style
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.

Comments