Merge pull request #354 from blockworks-foundation/lou/activity-settle-funds
Add settle funds fees to activity feed
This commit is contained in:
commit
34b875d702
|
@ -73,6 +73,10 @@ export const getFee = (activity: any, mangoAccountAddress: string) => {
|
|||
const { borrow_fee, symbol } = activity.activity_details
|
||||
fee = { value: formatFee(borrow_fee), symbol }
|
||||
}
|
||||
if (activity_type == 'settle_funds') {
|
||||
const { fee: settleFee, symbol } = activity.activity_details
|
||||
fee = { value: formatFee(settleFee), symbol }
|
||||
}
|
||||
if (activity_type === 'liquidate_token_with_token') {
|
||||
const { side, liab_amount, liab_price, asset_amount, asset_price } =
|
||||
activity.activity_details
|
||||
|
@ -274,7 +278,11 @@ export const getValue = (activity: any, mangoAccountAddress: string) => {
|
|||
const { price, size } = activity.activity_details
|
||||
value = price * size
|
||||
}
|
||||
return value
|
||||
if (activity_type === 'settle_funds') {
|
||||
const { price, fee } = activity.activity_details
|
||||
value = price * fee
|
||||
}
|
||||
return -value
|
||||
}
|
||||
|
||||
const ActivityFeedTable = () => {
|
||||
|
|
|
@ -46,6 +46,7 @@ const DEFAULT_PARAMS = [
|
|||
'openbook_trade',
|
||||
'swap',
|
||||
'withdraw',
|
||||
'settle_funds',
|
||||
]
|
||||
|
||||
const ActivityFilters = () => {
|
||||
|
|
|
@ -33,6 +33,7 @@
|
|||
"perp_trade": "Perp Trade",
|
||||
"reset-filters": "Reset Filters",
|
||||
"select-tokens": "Select Tokens",
|
||||
"settle_funds": "Settle Funds",
|
||||
"spot-trade": "Spot Trade",
|
||||
"swap": "Swap",
|
||||
"swaps": "Swaps",
|
||||
|
|
|
@ -32,6 +32,7 @@
|
|||
"perps": "Perps",
|
||||
"perp_trade": "Perp Trade",
|
||||
"reset-filters": "Reset Filters",
|
||||
"settle_funds": "Settle Funds",
|
||||
"select-tokens": "Select Tokens",
|
||||
"spot-trade": "Spot Trade",
|
||||
"swap": "Swap",
|
||||
|
|
|
@ -33,6 +33,7 @@
|
|||
"perp_trade": "Perp Trade",
|
||||
"reset-filters": "Reset Filters",
|
||||
"select-tokens": "Select Tokens",
|
||||
"settle_funds": "Settle Funds",
|
||||
"spot-trade": "Spot Trade",
|
||||
"swap": "Swap",
|
||||
"swaps": "Swaps",
|
||||
|
|
|
@ -33,6 +33,7 @@
|
|||
"perps": "永续合约",
|
||||
"reset-filters": "重置筛选",
|
||||
"select-tokens": "选择币种",
|
||||
"settle_funds": "Settle Funds",
|
||||
"spot-trade": "现货交易",
|
||||
"swap": "换币",
|
||||
"swaps": "换币",
|
||||
|
|
|
@ -32,6 +32,7 @@
|
|||
"perp_trade": "合約交易",
|
||||
"perps": "永續合約",
|
||||
"reset-filters": "重置篩選",
|
||||
"settle_funds": "Settle Funds",
|
||||
"select-tokens": "選擇幣種",
|
||||
"spot-trade": "現貨交易",
|
||||
"swap": "換幣",
|
||||
|
|
|
@ -308,6 +308,21 @@ export interface SwapActivity {
|
|||
activity_type: string
|
||||
}
|
||||
|
||||
export interface SettleFundsActivity {
|
||||
activity_details: SettleFundsItem
|
||||
block_datetime: string
|
||||
activity_type: string
|
||||
}
|
||||
|
||||
export interface SettleFundsItem {
|
||||
block_datetime: string
|
||||
mango_account: string
|
||||
signature: string
|
||||
symbol: string
|
||||
price: number
|
||||
fee: number
|
||||
}
|
||||
|
||||
interface DepositWithdrawActivity {
|
||||
activity_details: DepositWithdrawFeedItem
|
||||
block_datetime: string
|
||||
|
@ -412,6 +427,7 @@ export type ActivityFeed = {
|
|||
| SpotLiquidationFeedItem
|
||||
| PerpLiquidationFeedItem
|
||||
| SwapHistoryItem
|
||||
| SettleFundsItem
|
||||
| PerpTradeActivityFeedItem
|
||||
| SpotTradeHistory
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue