yral-dapp / hot-or-not-backend-canister

Other
9 stars 6 forks source link

Swap: Get Prices for Third Party SNS tokens #449

Open joel-medicala-yral opened 1 week ago

joel-medicala-yral commented 1 week ago

Flow

flowchart TD
    Caller[Caller args:token_ledger] --> get_token_price[Get Token Price] --> |Checks token value from third-party sources tbd icpswap as placeholder| ThirdPartySources{Third Party Sources}

    ThirdPartySources --> |Price Available| Available[Available] --> return[Return Token Price]
    ThirdPartySources --> |Price Unavailable| Unavailable[Unavailable] --> |Fallback| get_ledger_controllers[Get Ledger Controllers] --> filter_canister_ids[Filter Canister IDs]

    filter_canister_ids --> |Verifies token ownership by calling deployed CDAO for each ID| IsTokenOwner{Is Token Owner?}

    IsTokenOwner --> |Not Owner| NotOwner[Error: Not Owner] --> error[Error]
    IsTokenOwner --> |Owner Verified| Owner[Owner] --> check_price_field[Check Price Field] --> return[Return Token Price]