diff --git a/app/views/metapurses/show.html.haml b/app/views/metapurses/show.html.haml index 0739e918..802f51b5 100644 --- a/app/views/metapurses/show.html.haml +++ b/app/views/metapurses/show.html.haml @@ -31,7 +31,7 @@ $#{number_with_delimiter(value_amount)} USD - total_value += value_amount rescue 0 - else - - value = icpswap_pool_data_raw.split("record {").select{|pool| !pool.scan(canister_id).empty? && !pool.scan(icp_canister_id).empty? }[0].scan(/token0Price = [+-]?([1-9]\d*|0)(\.\d+)?/).join.to_f rescue nil + - value = icpswap_pool_data_raw.split("record {").select{|pool| !pool.scan(canister_id).empty? && !pool.scan(icp_canister_id).empty? }[-1].scan(/token0Price = [+-]?([1-9]\d*|0)(\.\d+)?/).join.to_f rescue nil * = "$#{value.round(2)}" = icpswap_pool_data_raw.split("record {").select{|pool| !pool.scan(canister_id).empty? && !pool.scan(icp_canister_id).empty? }[0].scan(/token0Symbol = \"(.*)\"; /)[0][0] rescue nil