Building a Polymarket trading bot
232 segments
So, the kind of newest trend I suppose
or maybe it's not a trend right now, but
something that's been going on for a
while is uh doing the poly market
trading bots and um well, I've been kind
of looking into it and you can see the
leaderboards on Poly Market, let's just
say
uh monthly, you can see, you know, some
of the the traders their profit like
some people are making more than a
million per month. Like if we scroll
down here, this is top 20. Let's just do
page two.
We have a monthly top 36 sensei.
Um he might have been quite lucky here.
You know, some of these traders, they
are um they are not bots, but they are
just traders.
See this one here? This one looks like
like just a regular trader maybe. And
then we have someone like this.
One month they have a profit of
$500,000. This is an account I saw
shared on uh on Twitter. You can also
see how many views it has here. And this
for sure is is is a trading bot.
And uh it trades the um you know only
crypto 15 minutes minute market. So, we
have these uh Bitcoin up and down
15minut market and uh let me just
refresh the page here
and this one there's like 1 minute left
and then it goes to the next one and you
basically just try to predict will
Bitcoin go up or down within the next 15
minutes and uh there's a few bots here
now that trades this and I know now that
the poly market they added a fee so it
makes the bots less viable but there's
still a lot of different markets on on
Poly market and I have been working a
little bit on a on a bot now that it's
far from finished but I'll just
demonstrate how it works. I can do the
market uh sl which is this part up here
in the URL and put it into my tool and
um let me just refresh it for a moment
here.
Then I can start monitoring and now it's
just going to stream in the the data
here when the when the market starts. So
now this market here will start in it
actually started
you can see here now that it we get data
in here on the on the console and then
what I've done in this this bot is that
I have I I have a method to record the
data. So this is all data that we are
streaming in from Poly Market. They have
a they have an open websocket that you
can connect to and get the data and then
I I store the data to a CSV file here.
You can see here that if I just go down
that it's going to stream the data. So
that means that I can in the future just
basically re um rerun a market again and
again if I want to try out different
strategies for a certain market. Yeah,
you can make a strategy fit exactly that
market and then maybe the next market is
not going to work. Um, and that's fine,
but but this allows me to get down a lot
of data and and write different uh
strategies.
And there's several different strategies
that you can uh you can run on on Poly
Market that I have been looking into.
So, the two strategies that I'm looking
into right now, basically just trying to
copy this guy here. So what he does is
on poly market you have a uh price you
know up and down
and uh now the market is very efficient.
So this will happen in a very rare case
where the the total price of a pair is
below one US dollar. So in a in a
completely efficient market, the the
price of of the prediction if it's going
to go up or down should always be $1.
But sometimes it's not. Sometimes the
price will actually be 99 cents or 98
cents for the for for something that's
actually worth $1 because let's say you
buy both sides of the trade um and you
just hold both of the tokens to the to
the when the market resolves then well
then you get $1. But think about if you
can actually buy both sides and it only
cost you 99 cents then actually you make
1% on that trade. But the caveat here is
that now they introduced uh fees
specifically on the 15minute
uh markets here. So so it's probably not
viable exactly. But I thought to myself,
let's just try this out um to simply
just copy this guy here and uh let's see
one day. I mean he's still making look
at this. He's made $83,000
the past 24 hours.
83,000
and I mean it's it's just mindboggling.
So you can see here how he he takes both
positions, right? So here he has the
Solan up and down January 8 245 to 3:00
a.m. This is uh he have about a,000
shares at up and then he have uh about
more than a,000 shares down.
He pays 66
cents
for up and then 44 cents for down which
is actually $1. We want to see both
sides. This is so see how many he does
does all the time. So he did 83,000 for
one day but if you look at his activity
each of the trades is like $1 like
170.44
like one and a half share and it's on
the same market. it just keeps adding to
his uh positions depending on some kind
of of criterias that he have is in uh is
in his um strategy. Right.
So let's take a look at some of these uh
bitcoin up and down gener 83 to 315.
So that's $100
down 70
and um
and then up here is
29.
So I know that these don't add up, but
it might
well I guess it actually does, right? So
he did um
he he bought
these tokens
150 uh 130 130
157 shares at 70 cents each one minute
ago and then since then he has added to
a position
right 10 shares 29 so that's that's
basically 1% gain 1% gain here and this
this is uh 28.
So that's actually a 2% gain, right?
Because what what is he paying here in
total? So that's 70 plus uh 28 and it's
only five shares and then 28 29 29 29 29
29. So he basically just he puts a
position
and then
he adds shares.
He's basically just scalping like 1%.
Um,
so how that's kind of tied in with the
fees, I'm not sure about. I'm not
exactly sure how much the fees is
because the fees fee structure also
depends on the price of the um of the
token. So if you if you buy a token
where the price is like 50 cents, it's
more compared to like the edges of the
market. like if you have 90 cents and 10
cents then the fees will be less. So
here he buys kind of at the edges of the
market. I don't know if that's something
he does consistently. If you just only
look at these two trades, you have no
risk, right? Because if he buy both and
hold to expiration, he will get $1
worth,
right? For sure like per per um per of
the shares. But he only paid 49 plus 31.
So that's uh five, six, seven, eight. So
that's 80 cents. So actually just of
these two trades, it's like 20%. That's
the 20% um return just there.
It just seems like he adds small amounts
to the position
whenever his algorithm
determines that it is a good trade in
one way or the other. But basically he
does a almost zerorisk strategy
somehow by trying to to to buy both
sides of the trade. So he's like risk
neutral but try to get a discount on it.
So if you buy both sides the value
should be $1,
but he tries to get it to a discount in
in his trading strategy. So, um, so
basically this is what I'm trying to to
uh to make. And and look at this. Like
his position value right now is only
31,000
and his whole profit loss is more than
600,000. Like he's just printing. This
is basically just printing money.
That's crazy. Yeah. Anyway, so this is
basically what I'm working on. And uh
right now I have uh what I showed you uh
the ability to record
these trades and then I have um
different strategies.
So I have my default strategies which is
basically uh what we're looking for when
we have a pair price that's less than a
certain amount then we want to put a
trade. Um but but but now when I've been
testing the few like hours and days, um
it's very rare that the price of a pair
at the same time
is is is lower than one $1. And if it
is, it's only like very milliseconds.
And and from what I can see how he does
it, it's not exactly where he finds a
specific time where both pairs line up
exactly where it's it's a good price,
but he kind of adds on to it. So he kind
of balances his accounts uh somehow all
the time, right? So I think that's what
I'm going to try to mimic. Um and then
um uh yeah, try to keep you posted like
um and and see how it goes. So that's uh
all for today. Have a good one.
Ask follow-up questions or revisit key timestamps.
The video introduces the growing trend of Poly Market trading bots, highlighting that some top traders are achieving profits exceeding $1 million monthly. The speaker is actively developing their own trading bot, demonstrating its capability to stream real-time market data from Poly Market's open websocket and record it into CSV files for strategy development and testing. The primary strategy being explored is inspired by a successful bot that exploits market inefficiencies: it identifies and capitalizes on situations where buying both the "up" and "down" predictions for a market costs less than one dollar in total, thereby securing a risk-free profit through arbitrage. This successful bot, through numerous small, scalping trades, has generated hundreds of thousands in profit. However, the speaker notes challenges such as newly implemented fees and the extreme rarity and fleeting nature of these arbitrage opportunities, leading them to consider adapting their strategy to mimic the successful bot's method of continuously balancing and adding to positions over time.
Videos recently processed by our community