mirror of
https://github.com/RoboSats/robosats.git
synced 2025-01-18 12:11:35 +00:00
Add maker_fee_split. Show maker/taker fee split in app
This commit is contained in:
parent
c9cdc2743d
commit
c4cf995dbf
@ -49,10 +49,15 @@ NETWORK = 'testnet'
|
||||
NODE_ALIAS = '🤖RoboSats⚡(RoboDevs)'
|
||||
NODE_ID = '033b58d7......'
|
||||
|
||||
# Trade fee in percentage %
|
||||
# Total trade fee as fraction
|
||||
FEE = 0.002
|
||||
# Bond size in percentage %
|
||||
# Maker/taker fee split. As seen in https://bisq.wiki/Trading_fees . It is implicit that TAKER_FEE_SPLIT = (1 - MAKER_FEE_SPLIT)
|
||||
# Shall incentivize order making
|
||||
MAKER_FEE_SPLIT=0.125
|
||||
|
||||
# Default bond size as fraction
|
||||
BOND_SIZE = 0.01
|
||||
|
||||
# Time out penalty for canceling takers in SECONDS
|
||||
PENALTY_TIMEOUT = 60
|
||||
# Time between routing attempts of buyer invoice in MINUTES
|
||||
|
@ -28,7 +28,6 @@ from django.conf import settings
|
||||
from decouple import config
|
||||
|
||||
EXP_MAKER_BOND_INVOICE = int(config("EXP_MAKER_BOND_INVOICE"))
|
||||
FEE = float(config("FEE"))
|
||||
RETRY_TIME = int(config("RETRY_TIME"))
|
||||
|
||||
avatar_path = Path(settings.AVATAR_ROOT)
|
||||
@ -335,7 +334,7 @@ class OrderView(viewsets.ViewSet):
|
||||
if order.payout.status == LNPayment.Status.EXPIRE:
|
||||
data["invoice_expired"] = True
|
||||
# Add invoice amount once again if invoice was expired.
|
||||
data["invoice_amount"] = int(order.last_satoshis * (1 - FEE))
|
||||
data["invoice_amount"] = int(order.last_satoshis * (1 - float(config('FEE'))))
|
||||
|
||||
return Response(data, status.HTTP_200_OK)
|
||||
|
||||
@ -676,7 +675,8 @@ class InfoView(ListAPIView):
|
||||
context["node_alias"] = config("NODE_ALIAS")
|
||||
context["node_id"] = config("NODE_ID")
|
||||
context["network"] = config("NETWORK")
|
||||
context["fee"] = FEE
|
||||
context["maker_fee"] = float(config("FEE"))*float(config("MAKER_FEE_SPLIT"))
|
||||
context["taker_fee"] = float(config("FEE"))*(1 - float(config("MAKER_FEE_SPLIT")))
|
||||
context["bond_size"] = float(config("BOND_SIZE"))
|
||||
if request.user.is_authenticated:
|
||||
context["nickname"] = request.user.username
|
||||
|
@ -39,7 +39,8 @@ export default class BottomBar extends Component {
|
||||
num_public_buy_orders: 0,
|
||||
num_public_sell_orders: 0,
|
||||
active_robots_today: 0,
|
||||
fee: 0,
|
||||
maker_fee: 0,
|
||||
taker_fee: 0,
|
||||
today_avg_nonkyc_btc_premium: 0,
|
||||
today_volume: 0,
|
||||
lifetime_volume: 0,
|
||||
@ -378,7 +379,7 @@ bottomBarDesktop =()=>{
|
||||
<ListItemText
|
||||
primaryTypographyProps={{fontSize: '14px'}}
|
||||
secondaryTypographyProps={{fontSize: '12px'}}
|
||||
primary={this.state.fee*100+"% (buyer)"}
|
||||
primary={(this.state.maker_fee + this.state.taker_fee)*100}
|
||||
secondary="Trade Fee" />
|
||||
</ListItem>
|
||||
</Grid>
|
||||
@ -495,7 +496,7 @@ bottomBarDesktop =()=>{
|
||||
primaryTypographyProps={{fontSize: '14px'}}
|
||||
secondaryTypographyProps={{fontSize: '12px'}}
|
||||
secondary="Trading fees">
|
||||
{this.state.fee*100}% <small>(buyer)</small> | 0.0% <small>(seller)</small>
|
||||
{(this.state.maker_fee*100).toFixed(3)}% <small>(maker)</small> | {(this.state.taker_fee*100).toFixed(3)}% <small>(taker)</small>
|
||||
</ListItemText>
|
||||
</ListItem>
|
||||
</List>
|
||||
|
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user