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

WIP: Ocean archive and Ocean API #2724

Draft
wants to merge 108 commits into
base: master
Choose a base branch
from
Draft

WIP: Ocean archive and Ocean API #2724

wants to merge 108 commits into from

Conversation

Jouzo
Copy link
Collaborator

@Jouzo Jouzo commented Nov 27, 2023

Summary

@Jouzo Jouzo marked this pull request as draft November 27, 2023 19:36
@Jouzo Jouzo force-pushed the feature/ocean-archive branch 3 times, most recently from f12bdf8 to 96ff191 Compare November 27, 2023 20:19
@Jouzo
Copy link
Collaborator Author

Jouzo commented Dec 19, 2023

List of RPC queries done by Ocean that should be exposed directly by FFI:

account.getAccount
account.getAccountHistory
account.getBurnInfo
account.listAccountHistory
blockchain.getBlockchainInfo
loan.getLoanInfo
loan.getLoanScheme
masternode.getGov
net.getNetworkInfo
poolpair.getPoolPair
poolpair.listPoolPairs
token.getToken
token.listTokens

@Jouzo Jouzo mentioned this pull request Dec 27, 2023
21 tasks
Jouzo and others added 23 commits February 7, 2024 22:13
* add ApiPageResponse + impl json on list_blocks

* refine

* body -> query
* Added `rockdb` to ocean api.
* Implementation of ocean-api database method  all  module.
* Added data_access layer
* Added test case for module.
* wip

* fail-fast false
* pagination query

* poolpair path api path

* mild refactor on error.rs and block.rs

* masternode typing

* rm debug_handler

* extra line

* default masternodestate

* fix return type

* typo

* pub enum state

* missing import

* clone

* simplified mn
* added block indexing

* added block indexing and query method

* added query methods and extra table

* added query methods to modules

* added oracle price active and prive feed module

* added oracle price active and prive feed module

* rebased indexing ocean-archive

* rebased indexing ocean-archive and updated query methods all modules

* rebased indexing ocean-archive and updated query methods all modules

* fixed white space

* fixed white space

* fixed query method for masternode and masterstats
* OceanStore building

* With RepositoryOps trait

* Cleanup columns

* Implement put/get/list masternode

* Fix MasternodeByHeight get_key

* Cleanup MasternodeData

* Invalidate masternode

* Remove comments

* cfg(test_off)

---------

Co-authored-by: canonbrother <w.canonbrother@gmail.com>
* target branch feature/ocean-archive

* docker-build

* on pr master + note
@Jouzo Jouzo mentioned this pull request Mar 10, 2024
Jouzo and others added 20 commits March 10, 2024 16:01
* added network type to ocean

* added network type to ocean

* Impl ToString for Network

---------

Co-authored-by: jouzo <jdesclercs@gmail.com>
* Implementation of oracle repo and storage for oracle api

* Implementation for indexing oracle

* formatting issue in vscode

* fixed process_inner_values

* added oracle get method API

* fixed error handling

* updated oracles history details

* updated price oracles

* oracles fmt

* implemented price api methods and fixed price_ticker

* fixed pagination for oracles and price and removal price_ticker_key

* fixed invalidate and appointoracle pricefeed and currecny

* fixed update and remove oracle

* remove bigUint crate and fixed index_interval_mapper

* rebase ocean archive

* added price ticker

* added price ticker

* fixed error handling for oracle and invalidate method

* format issue in vs_code

* fixed oracle and added testcase appoint

* implemented of setoracleInterval

* added indexing setoraclinterval

* added indexing setoraclinterval

* added setinterval model

* updated oracles  remove oracle and invalidate method

* fixed update and invalidate oracle

* fixed update and invalidate oracle

* fixed oracles api and price feeds for setoracles

* removed num-bigint

* removed num-bigint

* removed num-bigint and fixed price api

* merge setoracledatainterval into setoracledata

* updated invalidate interval and index mapper

* Restore opcode import

* Remove num-traits

* Clippy

* fixed price_feed api and removed num-traits

* fixed space

* Revert src fmt changes

---------

Co-authored-by: jouzo <jdesclercs@gmail.com>
* fixed clippy warning for oracle

* format space

* Revert "format space"

This reverts commit 36c8e21.

* fixed OraclePriceAggregatedIntervalKey

* fixed index_interval_mapper

* removed unwanted println

* Fix clippy

---------

Co-authored-by: jouzo <jdesclercs@gmail.com>
* comment unuse poolpairs api

* enable api poolpairs list

* rename struct prefix PoolPair and replace data by response

* fix types

* StringOrF64

* fmt

* char

* rm println

* custom_rewards: Vec<String>

* fix PoolPairsResult de

* filter BURN- and ordering

* creation_height i64

* rm filter since using BTreeMap

* apr and vol -> f64

* getpoolpair

* token typings

* pp list filter_map

* StringOrFloat

* rm StringOrFloat

* wip listpoolswaps

* Implement InitialKeyProvider for PoolSwapRepository

* enable listpoolswapsverbose

* Ocean: poolpair graph (#2855)

* sync_token_graph on initialize

* poolpairs_path

* get_pool_pair_info_cached

* compute_paths_between_tokens + all_simple_paths

* get_pool_pair_info_cached

* add list_paths api

* fix list_paths api

* fix all_simple_paths

* missing Response list_paths api

* temp disable list_pool_pairs_cached + fix get_pool_pair_info_cached

* camelCase TokenIdentifier + Arc for token_graph & tokens_to_swappable_tokens data model

* fix SwapPathPoolPair rename id to pool_pair_id, enable price_ratio

* fix PriceRatio typing

* sync_token_graph: execute first then wait in loop

* estimated_dex_fees_in_pct

* grab fab7f5f defichain-rpc

* rm extra api

* get_best_path

* use rust_decimal

* rm unuse import

* fix estimated_dex_fees_in_pct

* default 1

* mmv list_paths above of get_best_path

* ceil

* format num

* fix typo

* ceil

* id default String

* proper err for`from_token_id != to_token_id`

* fix EstimatedDexFeesInPct typing

* rm unuse comment

* rm tokens_to_swappable_tokens & wip get_swappable_tokens api

* fix get_swappable_tokens

* get_swappable_tokens done

* br

* use format_err.into()

* fix unwrap

* rm println

* sync_token_graph_if_empty

* repl if let else by unwrap_or_default

* rm ceil.. its bug

* rm clone

* refine recur

* partialeq Network

* pool.name

* rm unuse pool dep

* clippy

* poolpair -> pool_pair

* rename get_pool_pair_info_cached -> get_pool_pair_cached

* refactor: mv pool_pair api to a new dir

* fmt_rs

* rm pp dir s

* totalliquidityinusd + refactor + fix gettokencached and getpoolpaircached

* swap DecimalError and SecondaryIndex

* rename DecimalError to DecimalConversionError

* add rust_decimal::Error as DecimalError, OverflowError and UnderflowError

* get_gov_cached

* wip apr

* fmt_rs

* fix token split value type str -> f64, get_blockchain_info eunos.height handling

* total_liquidity usd typing decimal to string

* sync_token_graph in tokio

* fmt_rs

* lint

* undo defichain-rpc dep version

* push latest cargo.lock updue to update of rust-defichain-rpc

* fix list_pool_pairs_cached

* disable cached on list pool pairs temp

* lint

* fmt_cpp

* axum 0.7.5

* refine ocean ci

* fix ocean ci

* fix req: unwrap -> ok_or

* fmt_rs

* use expect on  vec -> arr

* use expect in fold

---------

Co-authored-by: jouzo <jdesclercs@gmail.com>
* Remove unwraps

* Use slice
Jouzo and others added 5 commits May 22, 2024 16:01
* wip

* fmt

* rm log

* cleanup

* [index_block_start] sort pool creation_height desc

* faster get_pool_pair

* paginate

* enable pool swap indexer

* default 0 if empty accounts

* [index_block_start] wrap oneday interval

* missing store onehour aggregate

* fix wrong amount token id

* [fix] DeserializeAnyNotSupported decimal, change aggregate token amount type from decimal to string

* fmt

* index_block_start poolswap grab the latest only

* decimal places 8 + convert base unit to logical unit

* fix interval hour

* fmt_rs

* cleanup

* async function is not directly supported yet

* fmt

* impl correct index approach

* cleanup

* missing PoolSwapAggregated and PoolSwapAggregatedKey columns

* fix getting splited arr wrong index

* rm oneday and onehour columns

* rm PoolSwapAggregatedInterval from

* add bucket into key

* refine

* stuck

* Impl Column trait

* revert hiding code

* rm pool_test.rs

* fmt_rs

* clear debug log

* add invalidate poolswapagg

---------

Co-authored-by: jouzo <jdesclercs@gmail.com>
* fix unwrap

* wip

* fix query

* filter untradable token

* fmt_rs
* indexing active price

* index implemetation for active_price SetLoanToken

* updated price ticker storage

* updated active price

* updated SetLoanToken from active_price

* handling empty loan_value

* updated pirces api and oracles

* fixed comments

* fixed comments

* updated api method name get_feed and response

* fixed duplicated insertion of oracle

* fixed duplicated insertion

* fixed oracle map_price_feeds

* testing for oralces

* fixed oracles repeating data

* added testcase for oracle_price_feed

* updated api query for oracle get feed and test cases

* updated price api

* price changes made in map_aggregated

* fixed the api amount decimal point

* fix list_prices order

* updated index interval for oracle

* fixed conflicts

* remove of script.sh

* Clippy fix

* Clippy tests

---------

Co-authored-by: canonbrother <w.canonbrother@gmail.com>
Co-authored-by: jouzo <jdesclercs@gmail.com>
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.

None yet

4 participants